将图像添加到 Android MapView

发布于 2024-10-08 01:19:03 字数 222 浏览 0 评论 0原文

如果我在墨卡托地图投影中有一个图像,具有特定的左上角纬度/经度和右下纬度经度,我如何将其添加到 Android MapView 中?

我是否必须扩展覆盖类,找出当前的 MapView 范围,然后像 BufferedImage 一样使用 BufferedImage 来剪辑图像?或者我是否必须在 Google 地图使用的相同图块结构中设置图像,然后使用扩展的 Overlay 类将这些图块添加到 MapView 中?

If I have an image in a Mercator map projection with a particular upper left latitude/longitude and lower right latitude longitude, how would I add this to the Android MapView?

Do I have to extend the overlay class, figure out my current MapView extents and then clip the image using like a BufferedImage? Or do I have to have the image already set up in the same tile structure that Google Maps uses and then just add these tiles to the MapView using an extended Overlay class?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

月依秋水 2024-10-15 01:19:03

您可以使用mapView.getLatitudeSpan() 和mapView.getLongitudeSpan() 来确定是否应显示地理定位图像。

you could use mapView.getLatitudeSpan() and mapView.getLongitudeSpan() to determine if the geo-located image should be displayed or not.

梦在夏天 2024-10-15 01:19:03

嗯,投影确实无关紧要。我可以在任何地图投影中绘制它,只是我相信谷歌地图也使用墨卡托。我的另一个问题是,是否有一种简单的方法来获取显示的地图范围,以便我可以确定覆盖层是否应该绘制该图像?这是从地图视图中包含的投影中获得的吗?

Well the projection is really irrelevant. I could plot it in any map projection, its just that I believe that Google maps also uses Mercator. One other question that I have, is there an easy way to get the map extents of the display, so that I can figure out whether an Overlay layer should draw this image or not? Would that be gotten from the projection contained in the mapView?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文