Class GeoJsonRenderer
- java.lang.Object
-
- com.google.maps.android.data.Renderer
-
- com.google.maps.android.data.geojson.GeoJsonRenderer
-
- All Implemented Interfaces:
java.util.Observer
public class GeoJsonRenderer extends Renderer implements java.util.Observer
Renders GeoJsonFeature objects onto the GoogleMap as Marker, Polyline and Polygon objects. Also removes GeoJsonFeature objects and redraws features when updated.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.maps.android.data.Renderer
Renderer.ImagesCache
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFeature(GeoJsonFeature feature)Adds a new GeoJsonFeature to the map if its geometry property is not null.voidaddLayerToMap()Adds all of the stored features in the layer onto the map if the layer is not already on the map.voidremoveFeature(GeoJsonFeature feature)Removes a GeoJsonFeature from the map if its geometry property is not nullvoidremoveLayerFromMap()Removes all GeoJsonFeature objects stored in the mFeatures hashmap from the mapvoidsetMap(com.google.android.gms.maps.GoogleMap map)Changes the map that GeoJsonFeature objects are being drawn onto.voidupdate(java.util.Observable observable, java.lang.Object data)Update is called if the developer sets a style or geometry in a GeoJsonFeature object-
Methods inherited from class com.google.maps.android.data.Renderer
assignStyleMap, getFeatures, getGroundOverlayMap, getMap, getValues, isLayerOnMap
-
-
-
-
Method Detail
-
setMap
public void setMap(com.google.android.gms.maps.GoogleMap map)
Changes the map that GeoJsonFeature objects are being drawn onto. Existing objects are removed from the previous map and drawn onto the new map.
-
addLayerToMap
public void addLayerToMap()
Adds all of the stored features in the layer onto the map if the layer is not already on the map.
-
addFeature
public void addFeature(@NonNull GeoJsonFeature feature)Adds a new GeoJsonFeature to the map if its geometry property is not null.- Parameters:
feature- feature to add to the map
-
removeLayerFromMap
public void removeLayerFromMap()
Removes all GeoJsonFeature objects stored in the mFeatures hashmap from the map
-
removeFeature
public void removeFeature(GeoJsonFeature feature)
Removes a GeoJsonFeature from the map if its geometry property is not null- Parameters:
feature- feature to remove from map
-
update
public void update(java.util.Observable observable, java.lang.Object data)Update is called if the developer sets a style or geometry in a GeoJsonFeature object- Specified by:
updatein interfacejava.util.Observer- Parameters:
observable- GeoJsonFeature objectdata- null, no extra argument is passed through the notifyObservers method
-
-