I have a page that displays several "smart markers" with a bit of info about each site available if you click the marker. The markers are created by doing:
var myImage = new YImage();
/* the real app does some stuff to pick the icon and size */
myImage.src = 'img/MapIcons/point_1.png';
myImage.size = new YSize(sz,sz);
myImage.offsetSmartWindow = new YCoordPoint(sz/4,5);
var newMarker= new YMarker(new YGeoPoint(someLat, someLng),
newMarker.addAutoExpand( aHtmlString );
var markerMarkup = anotherHtmlString;
I tried "map.removeMarkersAll();" but it does not seem to remove the points. Is there a way to remove all the marker layers without recreating the whole map. I want to keep the current map, position and zoom in order to make it a little nicer for the user.
What is the best way to do this?
My current guess is to implement an array of layers with some sort of unique ID to keep track of them and then change each marker, but I am not quite sure how or if this is really the best way to do it.