- 使用satellite,除了地形圖,沒有多餘的文字。
- 建一個MKTileOverlay,利用canReplaceMapContent隱藏地圖。
var mapView: MKMapView = {
let view = MKMapView()
view.mapType = .satellite
view.delegate = self
let overlay = MKTileOverlay()
overlay.canReplaceMapContent = true
view.addOverlay(overlay)
return view
}()
PS. 記得重畫MKTileOverlay
extension ContentViewController: MKMapViewDelegate {
func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {
return MKOverlayRenderer(overlay: overlay)
}
}
沒有留言:
張貼留言