简体   繁体   English

如何更改MapKit Swift的颜色

[英]How to change the colors of MapKit Swift

In my app i used mapKit, the problem is the map should be in specific color like this : 在我的应用程序中,我使用了mapKit,问题是地图应该是这样的特定颜色: mapKit i try to change the type of map, but nothing match with this picture, so i thought if i can change the color of the mapKit. 我尝试更改地图的类型,但与此图片不符,所以我想是否可以更改mapKit的颜色。 anyone faced like this problem ? 有人遇到这样的问题吗? any help please ? 请帮忙吗? thanks 谢谢

Try using the Mapbox API. 尝试使用Mapbox API。 I currently have the same problem and this library has come in-handy. 我目前有同样的问题,这个库已经派上用场了。

You can apply a mask by adding an Overlay betwen the map and Label/Road: 您可以通过在地图和标签/道路之间添加一个叠加层来应用蒙版:

let path = NSBundle.mainBundle().pathForResource("overlay", ofType: "png")
let fileURL = NSURL(fileURLWithPath: path!)
self.overlay = MKTileOverlay(URLTemplate: fileURL.absoluteString)
self.overlay!.canReplaceMapContent = false
self.mapView.addOverlay(self.overlay!, level: MKOverlayLevel.AboveRoads)

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

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