-
- All Implemented Interfaces:
-
java.util.Observer
public class GeoJsonRenderer extends Renderer implements Observer
Renders GeoJsonFeature objects onto the GoogleMap as Marker, Polyline and Polygon objects. Also removes GeoJsonFeature objects and redraws features when updated.
-
-
Method Summary
Modifier and Type Method Description voidsetMap(GoogleMap map)Changes the map that GeoJsonFeature objects are being drawn onto. voidaddLayerToMap()Adds all of the stored features in the layer onto the map if the layer isnot already on the map. voidaddFeature(@NonNull() GeoJsonFeature feature)Adds a new GeoJsonFeature to the map if its geometry property is not null. voidremoveLayerFromMap()Removes all GeoJsonFeature objects stored in the mFeatures hashmap from the map voidremoveFeature(GeoJsonFeature feature)Removes a GeoJsonFeature from the map if its geometry property is not null voidupdate(Observable observable, 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 -
Methods inherited from class java.util.Observer
update -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Method Detail
-
setMap
void setMap(GoogleMap map)
Changes the map that GeoJsonFeature objects are being drawn onto. Existing objects areremoved from the previous map and drawn onto the new map.
- Parameters:
map- GoogleMap to place GeoJsonFeature objects on
-
addLayerToMap
void addLayerToMap()
Adds all of the stored features in the layer onto the map if the layer isnot already on the map.
-
addFeature
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
void removeLayerFromMap()
Removes all GeoJsonFeature objects stored in the mFeatures hashmap from the map
-
removeFeature
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
void update(Observable observable, Object data)
Update is called if the developer sets a style or geometry in a GeoJsonFeature object
- Parameters:
observable- GeoJsonFeature objectdata- null, no extra argument is passed through the notifyObservers method
-
-
-
-