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