我正在使用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
}
现在我想知道为什么它在街道线下绘制这条线,如图所示: