如何在iOS地图中突出显示国家 [英] how to highlight countries in ios maps
问题描述
我正在构建一个应用程序,必须在其中动态突出显示世界地图中的某些国家/地区.
I am building an app in which I have to highlight some countries dynamically in the world map.
简而言之,我想自定义ios地图的整个视图,如图像中所示. 可以使用MapKit完成此操作,还是有其他方法?预先感谢
In short I want to customize the whole view of ios maps as shown in the images. can this be done using MapKit or is there any other method. Thanks in advance
推荐答案
您要查看 Mapbox iOS SDK ,它将使您可以使用类似MapKit的API来执行此操作以及执行更多操作.特别是,您将希望使用提供的世界国家/地区边界的自然地球"数据集,通过 TileMill 快速制作自定义地图,启用UTFGrid交互性,以便可以识别出被点击的区域,并在地图视图上的RMAnnotation
上使用RMShape
类,以根据需要添加/着色国家/地区多边形.听起来有些复杂,但是这些工具已经存在,完全是免费的和开放源代码的,在这个过程中我可以为您提供帮助.
You want to look into the Mapbox iOS SDK which will allow you to do this and more with a MapKit-like API. In particular, you will want to quickly make a custom map with TileMill using the provided Natural Earth data set for world country borders, enable UTFGrid interactivity so that the tapped regions can be identified, and use the RMShape
class on an RMAnnotation
onto the map view to add/color country polygons as needed. This sounds a little complex but the tools exist, are entirely free and open source, and I can help you with this process.
这篇关于如何在iOS地图中突出显示国家的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!