0

I have a boundary on map and i saved all those tapped co-ordinates of that boundary. I want to show that complete boundary when i opens the map. How can i achieve it? I tried it by changing the (zoom level) camera position but not getting.

Actually my intention is how to pass more than 5 co-ordinates to map so that it shows all those passed co-ordinates on screen (fix the passed co-ordinates in mobile screen and show it when open it).

Shailendra Madda
  • 20,649
  • 15
  • 100
  • 138

1 Answers1

0

I tried this but not working perfectly, i want to change the zoom level dynamically based on passed co-ordinates.

    private void showBoundary() {
   final LatLng hmt = new LatLng(17.42214430,78.5483395);
            final LatLng tharnaka = new LatLng(17.426542300,78.53627059999997);
            final LatLng habsiguda = new LatLng(17.40681270000,78.547629599999940);
            final LatLng uppal = new LatLng(17.401809200,78.56018919999997);
            LatLngBounds bounds = new LatLngBounds.Builder()
                    .include(hmt)
                     .include(tharnaka)
                     .include(habsiguda)
                     .include(uppal)
                     .build();
            googleMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds,50));
    }

Actually my intention is how to pass more than 5 co-ordinates to map so that it shows all those passed co-ordinates on screen (fix the passed co-ordinates in mobile screen and show it when open it).

Shailendra Madda
  • 20,649
  • 15
  • 100
  • 138