title: Android Google Map, Polylines and zoom
body: <p>I am drawing a list of polylines on a Google Map. I am looking for a solution to fit the zoom of the map depending of the drawed polylines. I've calculated the center point of all my polyline so I know on which point to center the map. But I don't find any solution to get the zoom level.</p>
  
  <p>Here the code I use:</p>
  
  <pre><code>    mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(getZoomPoint(), 15));
  
  private LatLng getZoomPoint() {
      Double minLatitude = null;
      Double minLongitude = null;
      Double maxLatitude = null;
      Double maxLongitude = null;
  
      for (Feature feature : features) {
          List&lt;Coordinates&gt; coordinates = ((LineString) feature.getGeometry()).getCoordinates();
          for (Coordinates coordinate : coordinates) {
              // --------------------------------------------------------- INITIALISATION
              if (minLatitude == null) { // No matter on wich var we check
                  minLatitude = coordinate.getLatitude();
                  minLongitude = coordinate.getLongitude();
                  maxLatitude = coordinate.getLatitude();
                  maxLongitude = coordinate.getLongitude();
              } else {
                  if (coordinate.getLatitude() &lt; minLatitude) {
                      minLatitude = coordinate.getLatitude();
                  }
                  if (coordinate.getLatitude() &gt; maxLatitude) {
                      maxLatitude = coordinate.getLatitude();
                  }
                  if (coordinate.getLongitude() &lt; minLongitude) {
                      minLongitude = coordinate.getLongitude();
                  }
                  if (coordinate.getLongitude() &gt; maxLongitude) {
                      maxLongitude = coordinate.getLongitude();
                  }
              }
          }
      }
      double meanLatitude = (minLatitude + maxLatitude) / 2;
      double meanLongitude = (minLongitude + maxLongitude) / 2;
      return new LatLng(meanLatitude, meanLongitude);
  }
  </code></pre>
  
  <p>My first question is: is there a way to compute the zoom level value ? (here is '15' hard-coded).</p>
  
  <p>My second question is: how can I fit the polylines width depending on the camera zoom level ? I've added a listener:</p>
  
  <pre><code>mMap.setOnCameraChangeListener(new GoogleMap.OnCameraChangeListener() {
              @Override
              public void onCameraChange(CameraPosition cameraPosition) {
                  Log.d("ZOOM = ", "" +mMap.getCameraPosition().zoom);
  
          });
  </code></pre>
  
  <p>And I can change the polylines width using the <code>setWidth(...)</code> method but I don't find a "formula" to compute the width value. Now, the polylines which is fix and don't depends on the zoom level.</p>
  
  <p>Any suggestions ?</p>