1
Google Direction APIから来たiOS上のGoogleマップで経路を描こうとしました。 私はその後、私はスタートラインは、その座標に開始、しかし最も近い方法でないように見えますGMSPolyline
出発地と目的地がGoogle Maps SDKに正確に配置されていない
GMSPath *path =[GMSPath pathFromEncodedPath:resultData[@"routes"][0][@"overview_polyline"][@"points"]];
if (routeToCustomer == nil)
routeToCustomer = [[GMSPolyline alloc] init];
routeToCustomer.path = path;
routeToCustomer.strokeWidth = 7;
routeToCustomer.strokeColor = [UIColor colorWithHexString:ACTIVE_COLOR];
routeToCustomer.map = _mapView;
で私が描くそのルートを持っ
NSString *urlString = [NSString stringWithFormat:@"https://maps.googleapis.com/maps/api/directions/json?origin=%@&destination=%@&mode=driving&key=%@", origin, destination, gDirectionKey];
をこのエンドポイントをヒット。下の画像を参照してください。
その「開始方向」へ座標から線を描画することが可能ですか?もしそうなら、どんな助けもありがとう。ありがとうございました。
開始線の座標と実際の開始点の間にポリラインを描くことができます。 –
"出発方向"とは何を意味しますか? –
開始方向はGoogleの方向からの開始点です。実際の出発点は、Googleの方向APIへのパラメータとして使用する私の最初のポイントです –