2013-01-01 17 views

回答

1

首先,我建議你停止閱讀該教程,因爲Google Maps API version it uses is deprecated.

也就是說,和特別是如果你是從頭開始,我就開始閱讀新Google Maps Android API V2文檔。

根據您發佈的網址,您想要去的位置是26.293723,50.186512,縮放級別爲17.不知道spn參數是什麼。

您可以通過設置GoogleMap對象上的攝像頭位置,使用newCameraPosition方法做到這一點:

GoogleMap map = // <Get it from your fragment> 
LatLng point = new LatLong(26.293723, 50.186512); 
map.newLatLngZoom(point, 17F); 

GoogleMap map = // <Get it from your fragment> 
LatLng point = new LatLong(26.293723, 50.186512); 
CameraPosition position = new CameraPosition(0, point, 0, 17F); 
map.newCameraPosition(position); 

您也可以用該方法newLatLngZoom一個漂亮的飛動漫做

1

從鏈接

感謝我注意到你所在位置的經緯度長值。將您的緯度和經度as extras傳遞到您顯示地圖的活動。使用這些值創建一個GeoPoint,您可以使用您的MapController將其傳遞給setCenter()和/或animateTo()

controller.setCenter(geoPoint); 
controller.animateTo(geoPoint); 

Here's more info關於如何使用這些方法。