Class Veery

getBoundingBox(GeoJsonLayer layer)

getBoundingBox(GeoJsonLayer[] layers)

getBoundingBox(JSONObject geojson)

getBoundingBox(JSONObject[] geojsons)

static functions

Get the bounding box of the passed object. Useful for zooming a Map to the right zoom level.

Parameters

GeoJsonLayer or JSONObject

Returns

LatLngBounds

Usage / Example

final JSONObject[] geoJsonData = locations.toGeoJSONArray();
if (geoJsonData != null) {
    for (int i = 0; i<geoJsonData.length;i++) {
        JSONObject object = geoJsonData[i];
        GeoJsonLayer layer = new GeoJsonLayer(mMap, object);
        layer.addLayerToMap();

        // Zoom to the layer
        LatLngBounds latLngBounds = Veery.getBoundingBox(layer);
        if (latLngBounds != null)
                mMap.animateCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds,100));
    }
}

User interaction

none