Some of your code looks foreign to me. Is that V2 code? I would loop through the array of markers and use the .setIcon method to assign new icon to each marker.
On Apr 28, 1:18 pm, ben <[email protected]> wrote: > What im trying to do is to have the Gmarker Icon size change base on > the zoom level. the more i zoom in the larger the icon gets. the more > i zoom out the smaller the icon get. I have about 8K listings with a > default icon size. > > GEvent.addListener(map, "zoomend", function() { > alert("You clicked the map. " + mgr.getMarkerCount(16) / > *map.getZoom()*/); > > for (var i = 0; i < mgr.getMarkerCount(16); ++i) { > mgr[i].icon.iconSize = new GSize(10, 10); > } > }); > } > > Please note: > 1) I am using google MarkerManager to load all markers(see below) > 2) var map = null; > var mgr = null; > are both global > 3) i'm using mgr.getMarkerCount(16) to find out how many markers are > on the map > but really wanted to use mgr.length or any other way....maybe better > to use Foreach(...?? > > 4) here some of the code: > function setupMarkers() { > mgr = new MarkerManager(map); > mgr.addMarkers(getMarkers(2000), 11); > mgr.addMarkers(getMarkers(2000), 12); > mgr.addMarkers(getMarkers(2000), 13); > mgr.addMarkers(getMarkers(2000), 14); > mgr.refresh(); > } > > If anyone can fix my code that would be super great! as i tired and > looked all over for an answer. > > Thanks for your help.... -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
