0

我正在将此 SDK 用于地图 https://github.com/2gis/iOS-SDKs-for-tiles 但我添加的路线不可见。rendererFor 调用,但线不可见。如果我删除 MKTileOverlay 一切正常。我该如何解决?

func mapView(_ mapView: MKMapView, rendererFor overlay: MKOverlay) -> MKOverlayRenderer {

        if (overlay is MKPolyline) {
            let pr = MKPolylineRenderer(overlay: overlay)
            pr.strokeColor = UIColor.blue.withAlphaComponent(1.0)
            pr.lineWidth = 5
            return pr
        } else {
            return MKTileOverlayRenderer(overlay: overlay)
        }

    }
4

0 回答 0