Class 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addFeature​(GeoJsonFeature feature)
      Adds a new GeoJsonFeature to the map if its geometry property is not null.
      void addLayerToMap()
      Adds all of the stored features in the layer onto the map if the layer is not already on the map.
      void removeFeature​(GeoJsonFeature feature)
      Removes a GeoJsonFeature from the map if its geometry property is not null
      void removeLayerFromMap()
      Removes all GeoJsonFeature objects stored in the mFeatures hashmap from the map
      void setMap​(com.google.android.gms.maps.GoogleMap map)
      Changes the map that GeoJsonFeature objects are being drawn onto.
      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
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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.
        Overrides:
        setMap in class Renderer
        Parameters:
        map - GoogleMap to place GeoJsonFeature objects on
      • 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:
        update in interface java.util.Observer
        Parameters:
        observable - GeoJsonFeature object
        data - null, no extra argument is passed through the notifyObservers method