Search in sources :

Example 1 with GeoJsonPolygonStyle

use of com.google.maps.android.geojson.GeoJsonPolygonStyle in project AirMapView by airbnb.

the class NativeGoogleMapFragment method setGeoJsonLayer.

@Override
public void setGeoJsonLayer(final AirMapGeoJsonLayer airMapGeoJsonLayer) throws JSONException {
    // clear any existing layers
    clearGeoJsonLayer();
    layerOnMap = new GeoJsonLayer(googleMap, new JSONObject(airMapGeoJsonLayer.geoJson));
    GeoJsonPolygonStyle style = layerOnMap.getDefaultPolygonStyle();
    style.setStrokeColor(airMapGeoJsonLayer.strokeColor);
    style.setStrokeWidth(airMapGeoJsonLayer.strokeWidth);
    style.setFillColor(airMapGeoJsonLayer.fillColor);
    layerOnMap.addLayerToMap();
}
Also used : GeoJsonLayer(com.google.maps.android.geojson.GeoJsonLayer) JSONObject(org.json.JSONObject) GeoJsonPolygonStyle(com.google.maps.android.geojson.GeoJsonPolygonStyle)

Aggregations

GeoJsonLayer (com.google.maps.android.geojson.GeoJsonLayer)1 GeoJsonPolygonStyle (com.google.maps.android.geojson.GeoJsonPolygonStyle)1 JSONObject (org.json.JSONObject)1