前提・実現したいこと
AndroidアプリにGoogleMapルート経路を表示するアプリを作成しています。
解決したいこと
AndroidアプリにGoogleMapルート経路を表示する為、Direction-APIのJson取得までできたのですが、"routes"配下に複数のタグがあり、PolylineOptionsへの設定方法をご教授い頂けると助かります。
該当のソースコード
"routes" : [
{
"bounds" : {
"northeast" : {
"lat" : 35.71190929999999,
"lng" : 139.810053
},
"southwest" : {
"lat" : 35.6750675,
"lng" : 139.7660903
}
},
"copyrights" : "Map data ©2020 Google",
"legs" : [
{
"distance" : {
"text" : "7.8 km",
"value" : 7828
},
"duration" : {
"text" : "17 mins",
"value" : 1019
},
"end_address" : "1-chōme-1-2 Oshiage, Sumida City, Tōkyō-to 131-8634, Japan",
"end_location" : {
"lat" : 35.7096948,
"lng" : 139.8100385
},
"start_address" : "Tokyo Station, 1-chōme-9 Marunouchi, Chiyoda City, Tōkyō-to 100-0005, Japan",
"start_location" : {
"lat" : 35.6774979,
"lng" : 139.7660903
},
"steps" : [
{
"distance" : {
"text" : "82 m",
"value" : 82
},
"duration" : {
"text" : "1 min",
"value" : 20
},
"end_location" : {
"lat" : 35.6773192,
"lng" : 139.766967
},
"html_instructions" : "Head \u003cb\u003eeast\u003c/b\u003e on \u003cb\u003e馬場先通り\u003c/b\u003e/\u003cwbr/\u003e\u003cb\u003e都道406号\u003c/b\u003e toward \u003cb\u003e外堀通り\u003c/b\u003e/\u003cwbr/\u003e\u003cb\u003e都道405号\u003c/b\u003e",
"polyline" : {
"points" : "kgwxEaaatY?AHi@Hk@Fi@@IDc@"
},
"start_location" : {
"lat" : 35.6774979,
"lng" : 139.7660903
},
"travel_mode" : "DRIVING"
},
{
"distance" : {
"text" : "0.6 km",
"value" : 562
},
"duration" : {
"text" : "2 mins",
"value" : 111
},
"end_location" : {
"lat" : 35.6750675,
"lng" : 139.7725042
},
"html_instructions" : "At \u003cb\u003e鍛冶橋(交差点)\u003c/b\u003e, continue onto \u003cb\u003e鍛冶橋通り\u003c/b\u003e (signs for \u003cb\u003eEitai Bridge\u003c/b\u003e)",
"polyline" : {
"points" : "gfwxEqfatYFg@B[`@_B@?Lc@l@oBp@}BX{@X_A\eAPk@ZeAf@}ADMBGFQBKLa@L]Rg@LIf@cB"
},
あなたの回答
tips
プレビュー