0

My project is to make a map app of the Siquijor island from the Philippines for tourists, and I want the app to only show the island. The only coordinates I could find are 9.1999° N, 123.5952° E. I dont know how to implement these coordinates to

private GoogleMap mMap;
// Create a LatLngBounds that includes the city of Adelaide in Australia.
private LatLngBounds ADELAIDE = new LatLngBounds(
  new LatLng(-35.0, 138.58), new LatLng(-34.9, 138.61));
// Constrain the camera target to the Adelaide bounds.
mMap.setLatLngBoundsForCameraTarget(ADELAIDE);
Exc3m1206
  • 19
  • 4
  • 1
    Will zoom (in from constraint) need to be supported? –  Apr 05 '18 at 11:34
  • Possible duplicate of [limit scrolling and zooming Google Maps Android API v2](https://stackoverflow.com/questions/14977078/limit-scrolling-and-zooming-google-maps-android-api-v2) – Andrii Omelchenko Apr 05 '18 at 12:10

1 Answers1

0

LatLngBounds class reference

Relevant information:

LatLngBounds(LatLng southwest, LatLng northeast)
Creates a new bounds based on a southwest and a northeast corner.

So, the first parameter is the southwest corner of the bound and the second parameter is the northeast corner of the bound.

So you can go to Google Maps and find the southwest and northeast coordinates of the area you want the map to be bounded by. Click on the map to see the coordinates of the point you just clicked.

Additionally, look at Google Maps Gestures and how to enable/disable them for additional control over how others navigate your map.

For example to disable some of the gestures:

 public void onMapReady(GoogleMap map) {
    UiSettings uiSettings = map.getUiSettings();
    uiSettings.setZoomGesturesEnabled(false); //disable zoom gestures
    uiSettings.setScrollGesturesEnabled(false); //disable scroll(pan) gestures
    uiSettings.setTiltGesturesEnabled(false); //disable tilt gestures
    uiSettings.setRotateGesturesEnabled(false); //disable rotation gestures

}
Droid
  • 528
  • 1
  • 5
  • 12
  • Thanks, @AsifAli72090. I have updated my answer to add relevant information from the links referenced. – Droid Apr 05 '18 at 04:59