I'm trying to resize markers based on zoom开发者_运维知识库 level in Google Maps API 2.
I tried with this code and it's not working:
tinyIcon.iconSize = new GSize(30, 30);
GEvent.addListener(map, "zoomend", function() {
var zoom = map.getZoom();
if (zoom > 10) {
tinyIcon.iconSize = new GSize(50, 50);
} else {
tinyIcon.iconSize = new GSize(30, 30);
}
});
Anyone have any other idea?
精彩评论