I am somewhat stuck at trying to tell Javascript to do what I want it to do.
I have an example map http://calwestcultural.com/sgs/backup/example-map.html and I have cate
If you would like to keep markers in separate categories, create an array for each category of marker and use them to store each set of markers. Then do the following:
To hide markers on load, create the markers but leave the marker map property set to null
:
var myLatlng = new google.maps.LatLng(-25.363882,131.044922);
var myOptions = {
zoom: 4,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: null,
title:"Hello World!"
});
To show only the markers in a given category, listen for the event that should trigger display of the markers and then set the markers' map property:
for ( var i = 0; i < markerCategoryArray.length; i++ ) {
markerCategoryArray[i].setMap( map );
}