قالب وردپرس درنا توس
Home / IOS Development / ios – Can I get UIScreen points from GMSMarker points?

ios – Can I get UIScreen points from GMSMarker points?



I've included google map view in my project and have shown the cursor on it. Google Map only provides pop animation by cursor. I want a drop animation for the cursors.

I have successfully implemented radius animation zoom in and zoom out, but need cursor drop animation.

So my idea is as if I get the exact point of the cursor in the UIScreen then I will drop pin from the top of my screen that will seem like drop animation.

Finally, I let go of animation from the subcode, but it's a problem that I did not get perfect points from mapview to show drop animation.

  // Drop tap
func setMarker (latitude: Double, longitude: Double, isForJobLocation: Bool = false) {

la punkt = mapView.projection.point (for: CLLocationCoordinate2D (latitude: latitude, longitude: latitude))
la viewPoints = UIApplication.shared.keyWindow! .convert (point, from: mapView)

print (views)

self.showAnimatation (xPosition: viewPoints.x, yPosition: viewPoints.y) {

let marker1
= GMSMarker (position: CLLocationCoordinate2D (latitude: latitude, longitude: latitude)) marker1.icon = UIImage (named: "mapLoadingPin") marker1.map = self.mapView } } funk showAnimation (xPosition: CGFOlate, yPosition: CGFOlate, Completion: @escaping (() -> ())) { la imageView = UIImageView (frame: CGRect (x: xPosition, y: yPosition - 100, width: 44, height: 44)) imageView.image = UIImage (named: "mapLoadingPin") self.view.addSubview (imageVis) UIView.animate (withDuration: 1.0, animations: { imageView.frame.origin.y = yPosition self.view.layoutIfNeeded () }) {(true) i imageView.removeFromSuperview () completion () } }

Please help me. Any help will be appreciated.


Source link