0
GoogleのDirection APIを使用して、ソースとターゲットの間に運転経路を描いています。複数の代替ルートを表示したいので、パラメータ alternatives=true
をURL文字列に渡します。しかし、余分なパスは表示されず、1つだけ表示されます。 URLのための私のコード:GoogleディレクションAPIで「alternatives = true」が機能しない
Private String getDirectionsUrl(LatLng origin,LatLng dest)
{
// Origin of route
String str_origin = "origin="+origin.latitude+","+origin.longitude;
// Destination of route
String str_dest = "destination="+dest.latitude+","+dest.longitude;
// Sensor enabled
String sensor = "sensor=false";
//Adding Alternative parameter
String alternative = "alternatives=true";
// Building the parameters to the web service
String parameters = str_origin+"&"+str_dest+"&"+sensor+"&"+alternative;
// Output format
String output = "json";
// Building the url to the web service
String url = "https://maps.googleapis.com/maps/api/directions/"+output+"?"+parameters;
return url;
}
理由を詳しく教えてください。サーバからの応答が遅いという特定の分野に課されている制限のためですか? –
@RajaShahrozeAbbasなぜ彼らはいつも選択肢を送信するわけではないかもしれませんが、それは多くの理由が原因である可能性があります。代替手段がないか、無料使用パッケージに制限している可能性があります。 ](https://developers.google.com/maps/documentation/directions/usage-limits) –
助けを借りて大丈夫です:D –