利用Intent 玩Google Map
Intents List: Invoking Google Applications on Android Devices有些更新!
Google Maps
URI :
geo:latitude,longitude
geo:latitude,longitude?z=zoom
geo:0,0?q=my+street+address
geo:0,0?q=business+near+city
Google Streetview
URI :
google.streetview:cbll=lat,lng&cbp=1,yaw,,pitch,zoom&mz=mapZoom
(The cbll field is required. The cbp and mz fields are optional.)
--
其他 :
顯示地圖
路徑規劃
// 把把起點終點以經緯度表示然後丟給google map 去做路徑規劃
Google Maps
URI :
geo:latitude,longitude
geo:latitude,longitude?z=zoom
geo:0,0?q=my+street+address
geo:0,0?q=business+near+city
Google Streetview
URI :
google.streetview:cbll=lat,lng&cbp=1,yaw,,pitch,zoom&mz=mapZoom
(The cbll field is required. The cbp and mz fields are optional.)
--
其他 :
顯示地圖
Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
路徑規劃
Uri uri = Uri.parse("http://maps.google.com/maps? f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
//where startLat, startLng, endLat, endLng are a long with 6 decimals
like: 50.123456
// 把把起點終點以經緯度表示然後丟給google map 去做路徑規劃
留言
張貼留言
歡迎留言一起討論