gpt4 book ai didi

ios - 还有其他选项可以在 mapbox 中绘制多条路线吗?

转载 作者:行者123 更新时间:2023-11-28 15:10:42 25 4
gpt4 key购买 nike

我正在使用 MGLPolyline 绘制多条路线。但它没有给我路线选择(点击)选项。

我的代码:

 // Convert the route’s coordinates into a polyline.
var routeCoordinates = route.coordinates!
let routeLine = MGLPolyline(coordinates: &routeCoordinates, count: route.coordinateCount)

// Add the polyline to the map and fit the viewport to the polyline.
homeMapView.addAnnotation(routeLine)
homeMapView.setVisibleCoordinates(&routeCoordinates, count: route.coordinateCount, edgePadding: .zero, animated: true)

最佳答案

如果您使用的是 MapboxDirections.swift,请设置 includesAlternativeRoutes为真。然后,路由请求应返回多个路由对象。

检索路线,然后使用它们绘制路线。

关于ios - 还有其他选项可以在 mapbox 中绘制多条路线吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47688743/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com