根据缩放级别更改图标 [英] Changing icon based on zoom level
本文介绍了根据缩放级别更改图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我如何去改变图标高度&基于Google Maps缩放级别的宽度?
How do I go about changing an icon height & width based on the Google Maps zoom level?
我使用的是Google Maps api v3。
I'm using Google Maps api v3.
推荐答案
您应该可以根据 文档 。它不会传递任何东西,但你可以通过api获取属性。
You should be able to add a listener on the zoom change per the docs. It doesnt get passed anything, but you can get the property via the api.
google.maps.event.addListener(map, 'zoom_changed', function() {
zoomLevel = map.getZoom();
//this is where you will do your icon height and width change.
});
这篇关于根据缩放级别更改图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文