开发者

Moving a tag using the Google Maps API on Android

开发者 https://www.devze.com 2023-02-28 18:41 出处:网络
I am using a HelloItemizedOverlay to plot a tag of my location on a Google map. Now, if the tag is moved, I want to remove it and plot a new one.开发者_Python百科

I am using a HelloItemizedOverlay to plot a tag of my location on a Google map.

Now, if the tag is moved, I want to remove it and plot a new one.开发者_Python百科

How do I remove this tag?


You can implement LocationListener in your activity to get users current latitude and longitude.

Create geopoint using this latitude and longitude(in onLocationChanged method) and make OverlayItem of this. and pass this overlayItem to your HelloItemizedOverlay.

 overlayItem = new OverlayItem(geoPoint, "Text","Snippet");
        helloItemizedOverlay.addOverlay(overlayItem);

this will pin on your current location and will create new pin again once your location is changed.

0

精彩评论

暂无评论...
验证码 换一张
取 消