Last active
December 18, 2015 23:08
-
-
Save yushiro/5858910 to your computer and use it in GitHub Desktop.
Android google map API V2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Programmatically set google map fragment visibility (API2) | |
private GoogleMap mMap; | |
private SupportMapFragment mMapFragment; | |
mMapFragment = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.mapFragment)); | |
mMap = mMapFragment.getMap(); | |
mMapFragment.getView().setVisibility(View.INVISIBLE); | |
VisibleRegion vr = mMap.getProjection().getVisibleRegion(); | |
double left = vr.latLngBounds.southwest.longitude; | |
double top = vr.latLngBounds.northeast.latitude; | |
double right = vr.latLngBounds.northeast.longitude; | |
double bottom = vr.latLngBounds.southwest.latitude; | |
地图的隐藏和显示 | |
getSupportFragmentManager().beginTransaction().hide(myMapView).commit(); | |
getSupportFragmentManager().beginTransaction().show(myMapView).commit(); | |
地图的中心点 | |
mMap.getCameraPosition().target | |
移动地图到某个坐标 | |
mMap.moveCamera(CameraUpdateFactory.newCameraPosition(mMap.getCameraPosition())); | |
mMap.moveCamera(CameraUpdateFactory.newLatLng(goPoint)); | |
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(goPoint, zoomLevel)); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment