将图像添加到 Android MapView
如果我在墨卡托地图投影中有一个图像,具有特定的左上角纬度/经度和右下纬度经度,我如何将其添加到 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用mapView.getLatitudeSpan() 和mapView.getLongitudeSpan() 来确定是否应显示地理定位图像。
you could use mapView.getLatitudeSpan() and mapView.getLongitudeSpan() to determine if the geo-located image should be displayed or not.
嗯,投影确实无关紧要。我可以在任何地图投影中绘制它,只是我相信谷歌地图也使用墨卡托。我的另一个问题是,是否有一种简单的方法来获取显示的地图范围,以便我可以确定覆盖层是否应该绘制该图像?这是从地图视图中包含的投影中获得的吗?
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?