Google地图TileProvider使用单个SVG地图 [英] Googlemaps TileProvider using a single SVG Map
问题描述
在我的Android应用程序中,我想要显示带有滚动和缩放功能的简单地图。我不想依赖网络连接的地图,所以一切都必须随应用程序一起提供。
我有一个想要显示的国家/地区的单个SVG文件(只有地块和/或水对我来说很重要)。我认为显示地图的最佳方式是使用自定义 TileProvider
的Google Maps View,它可以从SVG文件动态地生成切片。
然而,似乎我需要做数学运算,以某种方式映射实际坐标( x
和 y
我将 TileProvider
)加入到SVG的scale中,这听起来像是一件不平凡的事情。
是否有其他选项我没有想到,这不涉及使用我的应用程序传送兆字节的磁贴?是否有可能为我提供这些东西的现有库?我应该使用一种完全不同的方法吗?
希望它不会太晚=)
其实我找到了2个解决方案: 你可以使用这个库: SVGMapView
In my Android application, I want to display a simple Map with scrolling and zooming capabilities. I don't want to rely on network connection for the map, so everything has to be shipped with the application.
I have a single SVG file of the country I want to show (only land mass and/or water is important for me). I figured that the best way to display the map would be a Google Maps View with a custom TileProvider
, that generates the tiles dynamically from the SVG file.
However, it seems as if I would need to do the math, that somehow maps real coordinates (the x
and y
I am getting in the TileProvider
) onto the SVG scale, myself, which sounds like a non-trivial thing to do.
Is there any other option I didn't think of that does not involve shipping megabytes of tiles with my app? Are there maybe existing libraries that do the stuff for me? Should I use a completely different approach?
Hope that it's not too late =)
Actually i found 2 solutions :
You can use this library : SVGMapView
The 2nd solution was developed by Google in the Application :
这篇关于Google地图TileProvider使用单个SVG地图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!