控制 OverlayItem 大小
我正在构建一个在单个 ItemizedOverlay 中包含几十个 OverlayItems 的地图。我的地图设计为可以非常近距离地查看(大约缩放级别 18+),并且 OverlayItems 彼此非常接近。地图放大时看起来不错。但是,如果用户缩小,图标就会开始重叠,一切看起来都非常糟糕。
有没有办法控制 OverlayItem 图标大小,使其随地图缩放?如果没有,是否有办法在达到特定缩放级别后隐藏图标?关于如何解决这个问题还有其他建议吗?
I'm building a map with a few dozen OverlayItems in a single ItemizedOverlay. My map is made to be viewed very close up (about zoom level 18+), with the OverlayItems in very close proximity to one another. The map looks good when zoomed in. However, if the user zooms out the icons begin to overlap and everything looks incredibly junky.
Is there a way to control the OverlayItem icon size so that it scales with the map? If not, is there a way to hide the icons once a specific zoom level is reached? Any other suggestions on how to approach this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Joshc,fegruior,你们可能想看看 Geobeagle 是如何做到的。具体来说,此文件:http://code.google.com/p/geobeagle/source/browse/trunk/GeoBeagle/src/com/google/code/geobeagle/activity/map/OverlayManager.java
他们管理两个叠加层,一个用于缩小时,一个用于放大时。
理论上,您可以有 n 个(无论有多少缩放级别)叠加层,它们都具有不同大小的图标,并交换可见的叠加层当您放大和缩小时。这可能会使处理变得繁重,但您是否想要这样做是您需要做出的决定。
Joshc, fegruior, You folks may want to check out how Geobeagle does it. Specifically, this file: http://code.google.com/p/geobeagle/source/browse/trunk/GeoBeagle/src/com/google/code/geobeagle/activity/map/OverlayManager.java
They manage two overlays, one for when you're zoomed out, and one for when you're zoomed in.
Theoretically, you could have n (however many zoom levels there are) overlays that all have differently sized icons, and swap the visible one out as you zoom in and out. This could get heavy on the processing, but whether that's something you want to do is a decision you would need to make.