Google Maps API v2 を使用して運転ルートを取得する
2 つの場所間の運転ルートを取得することは、多くの地図アプリケーションの共通の要件です。ただし、指定したコードは、ターンバイターンの道順を提供するのではなく、ポイント間に直線を描画するだけです。
Android GoogleDirection ライブラリを使用したソリューション
運転ルートを取得するには、akexorcist によって最近リリースされたライブラリである Android GoogleDirectionLibrary を利用できます。このライブラリを使用した変更されたコード スニペットは次のとおりです。
import com.akexorcist.googledirection.DirectionCallback; import com.akexorcist.googledirection.GoogleDirection; import com.akexorcist.googledirection.model.Direction; import com.akexorcist.googledirection.model.Leg; import com.akexorcist.googledirection.model.Route; import com.akexorcist.googledirection.util.DirectionConverter; ... // Replace with your API key String apiKey = "YOUR_API_KEY"; GoogleDirection.withServerKey(apiKey) .from(new LatLng(12.917745600000000000,77.623788300000000000)) .to(new LatLng(12.842056800000000000,7.663096499999940000)) .execute(new DirectionCallback() { @Override public void onDirectionSuccess(Direction direction, String rawBody) { if (direction.isOK()) { Route route = direction.getRouteList().get(0); Leg leg = route.getLegList().get(0); // Draw the path (Polylines) List<latlng> directionPositionList = DirectionConverter.decodePoly(leg.getPolylinePoint()); Polyline line = mMap.addPolyline(new PolylineOptions() .addAll(directionPositionList) .width(5) .color(Color.RED)); // Display turn-by-turn instructions String[] instructions = DirectionConverter.provideInstructionList(leg); for (String instruction : instructions) { Log.d("Direction", instruction); } } else { // Handle error } } @Override public void onDirectionFailure(Throwable t) { // Handle error } });</latlng>
この変更されたコードを使用すると、ターンバイターンの指示を含む、2 つの場所間の運転ルートを取得できるようになります。
以上がGoogle Maps API v2 を使用してターンバイターン方式のルート案内を取得するにはどうすればよいですか?の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

jvm'sperformanceiscompetitivewitherruntimes、sped、safety、andproductivityの提供

javaachievesplatformedentenceTheThejavavirtualMachine(JVM)、avainwithcodetorunonanyplatformwithajvm.1)codescompiledintobytecode、notmachine-specificcode.2)

thejvmisanabstractcomputingMachineCrucialForrunningJavaProgramsDuetoitsPlatForm-IndopentInterChitecture.Itincludes:1)ClassLoaderForloadingClasses、2)Runtimedataareaforforforatastorage、3)executionEngineWithinterter、Jitcompiler、およびGarbagecolfecolfecolfececolfecolfer

jvmhasacloserelationshiptheosasittrantesjavabytecodecodecodecodecodecodecodecodecodecodecodecodecodetructions、manageSmemory、およびhandlesgarbagecollection.thisrelationshipallowsjavatorunonvariousosenvirnments、Butalsedentsはspeedifediferentjvmbeviorhiorsandosendisfredediferentjvmbehbehioorysando

Javaの実装「Write and、Run Everywherewhere」はBytecodeにコンパイルされ、Java仮想マシン(JVM)で実行されます。 1)Javaコードを書き、それをByteCodeにコンパイルします。 2)JVMがインストールされたプラットフォームでByteCodeが実行されます。 3)Javaネイティブインターフェイス(JNI)を使用して、プラットフォーム固有の機能を処理します。 JVMの一貫性やプラットフォーム固有のライブラリの使用などの課題にもかかわらず、Woraは開発効率と展開の柔軟性を大幅に向上させます。

javaachievesplatformentenceTheTheTheJavavirtualMachine(JVM)、CodetorunondifferentoperatingSystemswithOutModification.thejvmcompilesjavacodeplatform-IndopentedbyTecodeを承認することを許可します

javaispowerfulfulduetoitsplatformindepentence、object-orientednature、richstandardlibrary、performancecapability、andstrongsecurityfeatures.1)platformendependenceallowseplicationStorunonaydevicesupportingjava.2)オブジェクト指向のプログラマン型

上位のJava関数には、次のものが含まれます。1)オブジェクト指向プログラミング、サポートポリ型、コードの柔軟性と保守性の向上。 2)例外処理メカニズム、トライキャッチ式ブロックによるコードの堅牢性の向上。 3)ゴミ収集、メモリ管理の簡素化。 4)ジェネリック、タイプの安全性の向上。 5)コードをより簡潔で表現力豊かにするためのAMBDAの表現と機能的なプログラミング。 6)最適化されたデータ構造とアルゴリズムを提供するリッチ標準ライブラリ。


ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

SecLists
SecLists は、セキュリティ テスターの究極の相棒です。これは、セキュリティ評価中に頻繁に使用されるさまざまな種類のリストを 1 か所にまとめたものです。 SecLists は、セキュリティ テスターが必要とする可能性のあるすべてのリストを便利に提供することで、セキュリティ テストをより効率的かつ生産的にするのに役立ちます。リストの種類には、ユーザー名、パスワード、URL、ファジング ペイロード、機密データ パターン、Web シェルなどが含まれます。テスターはこのリポジトリを新しいテスト マシンにプルするだけで、必要なあらゆる種類のリストにアクセスできるようになります。

SublimeText3 英語版
推奨: Win バージョン、コードプロンプトをサポート!

SublimeText3 Linux 新バージョン
SublimeText3 Linux 最新バージョン

VSCode Windows 64 ビットのダウンロード
Microsoft によって発売された無料で強力な IDE エディター

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)
