MapKit隐藏POI(公园名称,建筑物名称等)不起作用

时间:2018-02-01 01:24:00

标签: ios swift mapkit

我已将.showsPointsOfInterest设置为false viewDidLoad,我尝试将.showsBuildings设置为false,但是当我启动地图时,它仍会显示所有内容地图上的POI名称......有谁知道为什么还会发生这种情况?

enter image description here

我的mapView设置代码:

mapView = MKMapView()

let leftMargin:CGFloat = 0
let topMargin:CGFloat = 0
let mapWidth:CGFloat = view.frame.size.width
let mapHeight:CGFloat = view.frame.size.height

mapView?.frame = CGRect(x: leftMargin, y: topMargin, width: mapWidth, height: mapHeight)

mapView?.mapType = MKMapType.standard
mapView?.isZoomEnabled = true
mapView?.isScrollEnabled = true
mapView?.showsPointsOfInterest = false
mapView?.showsBuildings = false

mapView?.delegate = self
mapView?.showsScale = true
let scale = MKScaleView(mapView: mapView)
scale.scaleVisibility = .visible
scale.legendAlignment = .leading
mapView?.addSubview(scale)
mapView?.showsCompass = true
self.view.addSubview(mapView!)

1 个答案:

答案 0 :(得分:1)

这似乎是来自iOS 10的错误。

https://openradar.appspot.com/28980142