use*_*397 10 android google-maps android-maps-v2
如何使用GMaps v2将地图中心设置为特定位置?这就是我使用GMaps v1的方式:
public void setCenter( LatLng point )
{
if( point.latitude*1000000 != 0 && point.longitude*1000000 != 0 )
{
if( mMapController != null )
{
mMapController.setCenter( point );
}
/*else if( mOpenStreetMapViewControllerSource != null )
{
mOpenStreetMapViewControllerSource.getController().setCenter( new org.osmdroid.util.GeoPoint( point.getLatitudeE6(), point.getLongitudeE6() ) );
mPostponedSetCenterPoint = point;
}*/
}
}
Run Code Online (Sandbox Code Playgroud)
我查看了GMaps v2的API,找不到和类似的功能.我该怎么做呢?
Brt*_*tle 29
你可以试试:
map.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(latitude, longitude), zoom));
Run Code Online (Sandbox Code Playgroud)
mapGoogleMap实例在哪里.
| 归档时间: |
|
| 查看次数: |
16074 次 |
| 最近记录: |