Just as the Title implies, I just added a "center_changed" listener to my map and the function is running more than once. I'm assuming it's because the center of the map is changing a bunch of times before the map comes to a rest, but I thought that that's what "drag" was for and that "center_changed only fires once after it comes to a rest??? The only reason I know its firing a bunch of times is because I have a drop shadow on the icon and it gets darker and darker over about two seconds before its completely black. If anyone needs my code, its below.
google.maps.event.addListener(map, 'center_changed', function() {
var zoomLevel = map.getZoom();
if (zoomLevel > 7) {
clearAll();
addmarker1();
addmarker2();
addmarker3();
addmarker4();
}
else {
clearAll();
}
});
Clear app data Google Maps stores data like shared locations, saved locations, and map tiles on your phone or tablet. Clearing this data will do the following things: Delete cache (including search suggestions, direction searches, map tiles, and activity page content stored on your device) Delete cookies.
To add an event, head to Google Maps on Android, tap on Contribute >Events > Add a public event. You can add an event name, tag the location, and add the time and date of the event as well. There's an option to add an image, write more event details, and add description as well.
The use of markers in the map is quite limited but you can put up to 50 markers on a map in 10 different colors and in 3 different sizes with an optional letter in it on the map.
These two functions fire only after your map comes to a rest
If you want your function to execute only when user drags(not programmatically) then use...
google.maps.event.addListener(map, 'dragend', function(){...}
But if you want your function to execute even when dragged, zoom changed programmatically(e.g. setZoom , fitBounds), then use...
google.maps.event.addListener(map, 'idle', function(){...}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With