简体   繁体   English

具有自定义地图的MapKit

[英]MapKit with custom Maps

For my next project I have an image of a small village and I have to turn this into a map. 对于我的下一个项目,我有一个小村庄的图像,必须将其转换为地图。 In this map I have to be able to add MKAnnotationView like the "normal" MapKit Map. 在此地图中,我必须能够像“普通” MapKit地图一样添加MKAnnotationView The user can also zoom the map. 用户还可以缩放地图。 I'm just trying to figure out how to implement this custom map: The only possible way is to create a UIImageView as subviews to which I add the "reproductions" of MKAnnotationView ? 我只是想弄清楚如何实现此自定义映射:唯一可能的方法是创建一个UIImageView作为子视图,并向其中添加MKAnnotationView的“复制品”?

Any suggestions on how I can create this type of map? 关于如何创建此类地图的任何建议?

Also have a look at MapBox. 还可以看看MapBox。 There are two options: 有两种选择:

  1. MapBox iOS SDK - works like MapKit, but is an open source alternative that lets you do completely custom maps (iOS 5+). MapBox iOS SDK-类似于MapKit,但它是开放源代码的替代方案,可让您制作完全自定义的地图(iOS 5+)。

  2. MBXMapKit - built on MapKit, but allows custom map tiles (iOS 7+). MBXMapKit-建立在MapKit上,但允许自定义地图图块(iOS 7+)。

I don't think using a UIImageView will work particularly well. 我认为使用UIImageView效果不是特别好。 If the suggested source code doesn't work for you, look at the documentation and sample code for CATiledLayer . 如果建议的源代码不适合您,请查看CATiledLayer的文档和示例代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM