使用图像作为 MKOverlayView (iPhone MKMapKit)
我们想要使用 MapKit
/ MKOverlayView
创建一个看起来完全自定义的地图。我们将创建一个包含当地街道/兴趣点的 PNG
,并将其与 MapKit
地图相匹配。
我发现一些信息似乎推断这是可能的,但我找到的所有教程和示例都在处理绘制线条和多边形,这不是我们想要的。
我还考虑了创建 PNG
的可能性,抓取用户的位置并以数学方式计算他们在图像上的位置......但这似乎是比使用 MKOverlayView
更大的任务代码>
任何有关如何开始的想法将不胜感激。
We want to use MapKit
/ MKOverlayView
to create a map that looks totally customized. We would create a PNG
that has the local streets / points of interest, and match that up to MapKit
map.
I am finding some info that seems to infer that this is possible, but all the tutorials and examples I find are dealing with drawing lines and polygons, which is not what we want.
I have also considered the possibility of creating the PNG
, grabbing the user's location and mathematically calculating their position on the image... but that seems like a bigger task than potentially using a MKOverlayView
Any ideas about how to get started would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以首先查看 Open Maps 我相信您可以通过创建自己的 XML 文件(不同样式道路等..)然后您可以将地图图块下载为 PNG 或在您的应用程序中延迟加载它们。
另一方面,Google 地图不允许您在应用程序中修改或存储。
但是,如果您选择开放地图方法,则必须有效地推出自己的 MapKit。这很棘手,但可能性很大。首先观看关于平铺滚动视图的苹果开发者视频。
You could start by looking at Open Maps I believe you can customise their maps by creating your own XML file (different styles of roads etc..) You can then download the map tiles as PNGs or lazy load them in your app.
Google maps on the other hand you are not allowed to modify or store in you application.
However if you choose the open maps approach you have to effectively roll your own MapKit. This is tricky but very much possible. Start by looking at the apple developer videos on tiled scroll views.