Ios 如何使用google direction API在swift中绘制苹果地图上的路线?

Ios 如何使用google direction API在swift中绘制苹果地图上的路线?,ios,swift,google-api,apple-maps,Ios,Swift,Google Api,Apple Maps,下面是我从google direction api得到的回复。现在我需要在苹果地图上一步一步地画出路线 let directionURL=”https://maps.googleapis.com/maps/api/directions/json?key=\(samplekey)s&origin=valsad&destination=rajkot“ let参数=[String:String]() SCMServiceManager().createSmartServiceWith(参数:参数,ur

下面是我从google direction api得到的回复。现在我需要在苹果地图上一步一步地画出路线

let directionURL=”https://maps.googleapis.com/maps/api/directions/json?key=\(samplekey)s&origin=valsad&destination=rajkot“
let参数=[String:String]()
SCMServiceManager().createSmartServiceWith(参数:参数,url:directionURL,httpMethod:kHTTPMethodGET){(url,结果,错误)在
guard let responseDict=结果为?[String:Any]else{return}
让status=responseDict[“status”]作为!字符串
var routesArray:字符串!
如果状态==“正常”{
RouteArray=(((responseDict[“routes”]!as![Any])[0]as![String:Any])[“overview_polyline”]as![String:Any])[“points”]as?String
打印(“routesArray:\(字符串(描述:routesArray)))
}

如果需要,我也可以发布一些json响应。谢谢。我正在我的应用程序中使用apple map。

我建议您使用此库绘制路线。

apple map和Google map都不同。因此,我认为direction api提供的数据在apple map上无法准确工作。我认为这对我来说是个坏消息。