当用户放大/缩小时缩放 Android MapView 标记
我看到了一些与此相关的问题,但没有可靠的答案。
我有一个 MapView,它可以根据用户放大或缩小的距离在地图上生成多达 1600 个位置。到目前为止,我只是将标记设置为应用程序中的可绘制对象。如何检测用户是否放大/缩小,然后相应地缩放标记。我不关心缩放部分,而是关心缩放聆听部分。有没有人为这个小问题开发出解决方案,或者可以为我指明创建自己的解决方案的正确方向?
另外,据我所知,Android 没有提供默认标记。我的说法正确吗?如果 Android 有一个内置标记可以根据缩放级别为您处理缩放,那就太好了。
I've seen a few questions about this but no solid answers.
I have a MapView that can generate up to 1600 locations on the map, based on how far the user zooms in or out. As of now, I have my marker simply set to a drawable within my application. How can I detect if a user has zoomed in/out, then scale the marker accordingly. I'm not concerned with the scaling part, but with the zoom listening part. Has anyone developed a solution to this little issue, or can point me in the correct direction to create my own?
Also, as far as I know, there is not a default marker that Android supplies. Am I correct about this? It would be nice if Android had a built in marker that handles the scaling based on zoom levels for you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
标记不会根据缩放而改变大小。如果您需要这种效果,请使用 GroundOverlays。 src
地面叠加层是固定在地图上的图像,随地图缩放而缩放。请参阅API 了解更多信息
请参阅相关帖子:通过 Zoom 缩放地图标记,Android
Markers do not change size based on zoom. Use GroundOverlays if you desire this effect. src
A ground overlay is an image that is fixed to a map and scales with the map zoom. Please see the API for more info
See related post: Scale Map Markers by Zoom, Android
我正在使用
google 地图文档 GroundOverlayOptions 中的文档
I'am use
The docs in google maps docs GroundOverlayOptions