2011-10-14 49 views
0

我啓動googlemap使用意向給經緯度。 它顯示具有指定位置周圍區域的地圖。Android:啓動谷歌地圖意圖如何標記一個特定的位置

如何在啓動地圖時在此特定位置顯示標記?

這裏是我開始的活動代碼:

Intent i = new Intent(android.content.Intent.ACTION_VIEW, 
         Uri.parse("geo:" + lat+ "," + long+ "?z=10" )) 
startActivity(intent); 
+0

@preeta你需要使用intent或無意圖來放置標記嗎? – Venky

+0

按照此... http://stackoverflow.com/questions/5840943/how-to-mark-two-locations-in-map-of-an-android-app – Noby

+0

我想這樣做woth意圖。它與mapactivity和webview一起工作,但這裏的要求是特定於意圖和啓動一個活動 – png

回答

3

放置標記只使用下面的例子:

// change name - to any text you want to display 
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("geo:55.74274,37.56577?q=55.74274,37.56577 (name)")); 
// the following line should be used if you want use only Google maps 
intent.setComponent(new ComponentName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity")); 
startActivity(intent); 
相關問題