Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/186.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在谷歌地图v2中为android中的当前位置(pin)设置缩放级别?_Android_Google Maps - Fatal编程技术网

如何在谷歌地图v2中为android中的当前位置(pin)设置缩放级别?

如何在谷歌地图v2中为android中的当前位置(pin)设置缩放级别?,android,google-maps,Android,Google Maps,我完美地设置了google map v2,但我不知道如何设置当前位置(当前pin)的缩放级别。如果你有任何想法,请与我分享。谢谢。在我的例子中,我从阵列中获取地质点,您可以尝试类似的方法或修改代码,然后使用mapcontroller设置缩放级别 GoogleMap theMap; //in the below function pass your LatLang and the zoom level theMap.animateCamera(CameraUpdateFactory.newLa

我完美地设置了google map v2,但我不知道如何设置当前位置(当前pin)的缩放级别。如果你有任何想法,请与我分享。谢谢。

在我的例子中,我从阵列中获取地质点,您可以尝试类似的方法或修改代码,然后使用mapcontroller设置缩放级别

GoogleMap theMap;

//in the below function pass your LatLang and the zoom level 
theMap.animateCamera(CameraUpdateFactory.newLatLngZoom(Your Pin LatLangPoint, 14));
private MapController mapController;
GeoPoint[] mallCoords;

mallCoords = new GeoPoint[24];

mallCoords[0] = new GeoPoint(28701067, 77116834);//this is just an example

mapController.animateTo(mallCoords[0]);
mapController.setZoom(15);
Map.animateCamera(CameraUpdateFactory.zoomTo(50));