I\'m trying to achieve the following thing: Have different types of markers on my map for example, schools, libraries, bus stops and I want to be able to show/hide each grou
You basically just need to store references to Marker objects in an array, set their type (school, bus stop, etc.) and then on some event loop through and hide/show as appropriate:
var markers = [];
// create Marker
marker.locType = 'school'; //as appropriate
function hideMarkersOfType(type) {
var i = markers.length;
while(i--) {
if (markers[i].locType == type) {
markers[i].setVisible(false);
}
}
}
// similar function showMarkersOfType() calling markers[i].setVisible(true);
That should be a good start anyway.