DEMO: http://so.devilmaycode.it/refresh-reload-maps-google-maps-api-v2/
all you need is inside the source, look and let me know.
basically the demo uses markermanager.js lib, as it is now, it explains how to refer to newly added markers and how to insert and remove them without updating the current map / page;
the process behind is simple, every time a marker added to the map using addMarkers func, it creates marker.object , the property we are looking for, marker.no , which is in the form of marker# where # is an incremental number, so it can be any number.
now the real trick here is to create a global array where we save all the created tokens for easy access.
So, we can achieve and remove each individual marker using the removeMarker function, for example: removeMarker(global_marker_array[marker_id]); where marker_id is marker.no ;
I think this approach is really good, because you do not need to know the lat and take a long time to search for tags a second time.
source share