首页 > 解决方案 > GMSMapView - 为什么我的折线被画在街道下面?

问题描述

我正在使用 GoogleMaps iOS SDK,并按照说明将折线添加到地图:

private func addRoute(to mapView: GMSMapView, history: ShipmentHistory) {

    let path = GMSMutablePath()
    path.add(history.currentState.location)
    for alert in history.alerts {
        path.add(alert.location)
    }
    let polyline = GMSPolyline(path: path)
    polyline.strokeWidth = 5
    polyline.strokeColor = UIColor(asset: Asset.ColorAssets.appTint)
    polyline.zIndex = polylineBaseZIndex // value is 20
    polyline.map = mapView

}

现在我想知道为什么它在街道线下面画这条线,如图所示:

在此处输入图像描述

标签: iosswiftgoogle-maps-sdk-iosgmsmapview

解决方案


推荐阅读