Saturday, 15 May 2010

javascript - Google Maps v3 Remove Infowindow from Certain Marker Types -



javascript - Google Maps v3 Remove Infowindow from Certain Marker Types -

i'm loading google map on page shows 3 types of marker. master, sub, , minor. want have infowindows available on master & sub types not on minor type should static marker.

is there way accomplish this?

i'm pretty much using this: https://developers.google.com/maps/articles/phpsqlajax_v3?hl=it verbatim, few changes info , icons loaded.

i can't seem find in maps api documentation mentions doing this.

think of not adding infowindow markers. modify marker creation not phone call bindinfowindow function types of markers.

from tutorial linked, modified not create infowindows markers type "minor":

(var = 0; < markers.length; i++) { var name = markers[i].getattribute("name"); var address = markers[i].getattribute("address"); var type = markers[i].getattribute("type"); var point = new google.maps.latlng( parsefloat(markers[i].getattribute("lat")), parsefloat(markers[i].getattribute("lng"))); var html = "<b>" + name + "</b> <br/>" + address; var icon = customicons[type] || {}; var marker = new google.maps.marker({ map: map, position: point, icon: icon.icon }); if (type != "minor") { bindinfowindow(marker, map, infowindow, html); } }

javascript google-maps google-maps-api-3

No comments:

Post a Comment