davej Posted December 31, 2012 Share Posted December 31, 2012 I'm looking at Google Maps and wondering how added icons are erased from a map? What if you want to display your current location with a marker. When you get a location update how do you erase the old marker and then add the new marker? http://www.w3schools.com/googleAPI/google_maps_overlays.asp Thanks Link to comment Share on other sites More sharing options...
justsomeguy Posted January 7, 2013 Share Posted January 7, 2013 You can use setPosition to move an existing marker: https://developers.google.com/maps/documentation/javascript/reference#Marker To remove a marker, you can use the setMap method on the marker to set the map reference to null, and then delete the marker variable. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now