Show google map marker based on zoom level

I am wondering if it is possible to set markers for visibility at the selected zoom level for the
Google Map API v3.
I decided that this is possible in the v2 API using the "Marker Manager", but cannot find a way for the latest API.

Example:
Marker-1 → (max_zoom: 10, min_zoom: 5) // will be displayed within the zoom level 5-10
Marker-2 → (max_zoom: 15, min_zoom: 10) // will be displayed within the zoom level 10-15

As I develop a jQuery plugin, I want to use only the original API without add-ons.

Thanks in advance!

+3
source share
2

- , gmap, - :

var zoomLevel =  map.getZoom();
if (zoomLevel>=5 && zoomLevel<=10) { 
     // call the setMarker function for the marker1
} else if (zoomLevel>10 && zoomLevel<=15) {
     // call the setMarker function for the marker2
}

, , : http://code.google.com/apis/maps/documentation/javascript/events.html

+2
+1

All Articles