开发者

icon according the zoom factor

With the API v开发者_StackOverflow中文版ersion 3, How to change the size of an icon (created with MarkerImage) according to the zoom factor of the map ? I suppose I must use scaledSize and map.getZoom() ?


This is code cut and free hand written from the api documentation but it might give you an idea where to start

 google.maps.event.addListener(map, 'zoom_changed', function() {
   yourMarker.setIcon("path to your icon here");
});

If you need to change all the icons on the map I would suggest putting them in an array and loop over them doing setIcon()

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜