How do I move marker along with moving of Google Map in iOS?

前端 未结 4 1891
一个人的身影
一个人的身影 2020-12-24 15:37

I am displaying a marker in a particular place, along with displaying the current address in the address label on Google Maps.

Now, I want to change the location by

4条回答
  •  误落风尘
    2020-12-24 15:59

    Based from Release Notes made in Maps SDK for IOS, changing a markers position will cause the marker to animate to the new location.

    To resolve this, you may use new features for GMSMarker as stated in Release Version 1.5 such as:

    • Markers can be made draggable using the draggable property, and new drag delegate methods have been added to GMSMapViewDelegate. (Issue 4975)
    • Added GMSMarkerLayer, a custom CALayer subclass for GMSMarker that supports animation of marker position and rotation. (Issue 4951, Issue 5743)

    In addition to that, this post in GitHub - GoogleMapsAnimationGlitch and this SO post - How to smoothly move GMSMarker along coordinates in Objective c might also help.

提交回复
热议问题