How do I set default location and Zoom level for google map api v2?

后端 未结 5 2005
予麋鹿
予麋鹿 2020-12-02 07:13

When my map shows, it always start at a fixed location (near Africa).

Then, I use the following code to center the map to the location I want.

mMap.a         


        
5条回答
  •  佛祖请我去吃肉
    2020-12-02 07:40

    you can use directy CameraUpdate using static latlong

     LatLong latlong = new LatLong(lat, long);
     CameraUpdate cameraPosition = CameraUpdateFactory.newLatLngZoom(latLong, 15);
                    mGoogleMap.moveCamera(cameraPosition);
                    mGoogleMap.animateCamera(cameraPosition);
    

提交回复
热议问题