Reputation: 71
I am making location based reminder app using goole map api v2. So I want to know is which map view is best to set my location. Currently I'm using normal type. And it consist hybrid, satellite etc. Also can you help me on how to add zoom option?
mMap.setOnMapClickListener(new GoogleMap.OnMapClickListener() {
@Override
public void onMapClick(LatLng latLng) {
mMap.clear();
locationLat = latLng.latitude;
locationLong = latLng.longitude;
AddLocationActivity.this.addMarker(new LatLng(locationLat,locationLong), AddLocationActivity.locationName);
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(locationLat,locationLong), 10.9f));
AddLocationActivity.this.mainClass.locationName = address;
Log.i("AddLocationActivity",""+AddLocationActivity.this.mainClass.locationName);
}
});``
Upvotes: 0
Views: 664
Reputation: 7771
The Google Maps Android API offers four types of maps, as well as an option to have no map at all:
Normal
- Typical road map. Roads, some man-made features, and important natural features such as rivers are shown. Road and feature labels are also visible.
Hybrid
- Satellite photograph data with road maps added. Road and feature labels are also visible.
Satellite
- Satellite photograph data. Road and feature labels are not visible.
Terrain
- Topographic data. The map includes colors, contour lines and labels, and perspective shading. Some roads and labels are also visible.
None
- No tiles. The map will be rendered as an empty grid with no tiles loaded.
For the zoom option, try this code if it can work on your case.
LatLng coordinate = new LatLng(lat, lng);
CameraUpdate yourLocation = CameraUpdateFactory.newLatLngZoom(coordinate, 5);
map.moveCamera(yourLocation);
Check this page for more information about zoom.
Also try to check this related SO question.
Upvotes: 1