Package 

Class GeoJsonFeature

  • All Implemented Interfaces:
    java.util.Observer

    
    public class GeoJsonFeature
    extends Feature implements Observer
                        

    A GeoJsonFeature has a geometry, bounding box, id and set of properties. Styles are also stored in this class.

    • Method Summary

      Modifier and Type Method Description
      String setProperty(String property, String propertyValue) Store a new property key and value
      String removeProperty(String property) Removes a given property
      GeoJsonPointStyle getPointStyle() Returns the style used to render GeoJsonPoints
      void setPointStyle(GeoJsonPointStyle pointStyle) Sets the style used to render GeoJsonPoints
      GeoJsonLineStringStyle getLineStringStyle() Returns the style used to render GeoJsonLineStrings
      void setLineStringStyle(GeoJsonLineStringStyle lineStringStyle) Sets the style used to render GeoJsonLineStrings
      GeoJsonPolygonStyle getPolygonStyle() Returns the style used to render GeoJsonPolygons
      void setPolygonStyle(GeoJsonPolygonStyle polygonStyle) Sets the style used to render GeoJsonPolygons
      PolygonOptions getPolygonOptions() Gets a PolygonOptions object from mPolygonStyle containing styles for the GeoJsonPolygon
      MarkerOptions getMarkerOptions() Gets a MarkerOptions object from mPointStyle containing styles for the GeoJsonPoint
      PolylineOptions getPolylineOptions() Gets a Polyline object from mLineStringStyle containing styles for the GeoJsonLineString
      void setGeometry(Geometry geometry) Sets the stored Geometry and redraws it on the layer if it has already been added
      LatLngBounds getBoundingBox() Gets the array containing the coordinates of the bounding box for the feature.
      String toString()
      void update(Observable observable, Object data) Update is called if the developer modifies a style that is stored in this feature
      • Methods inherited from class com.google.maps.android.data.Feature

        getGeometry, getId, getProperties, getProperty, getPropertyKeys, hasGeometry, hasProperties, hasProperty
      • Methods inherited from class java.util.Observable

        addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers
      • 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
    • Constructor Detail

      • GeoJsonFeature

        GeoJsonFeature(Geometry geometry, String id, HashMap<String, String> properties, LatLngBounds boundingBox)
        Creates a new GeoJsonFeature object
        Parameters:
        geometry - type of geometry to assign to the feature
        id - common identifier of the feature
        properties - hashmap of containing properties related to the feature
        boundingBox - bounding box of the feature
    • Method Detail

      • setProperty

         String setProperty(String property, String propertyValue)

        Store a new property key and value

        Parameters:
        property - key of the property to store
        propertyValue - value of the property to store
      • removeProperty

         String removeProperty(String property)

        Removes a given property

        Parameters:
        property - key of the property to remove
      • setPointStyle

         void setPointStyle(GeoJsonPointStyle pointStyle)

        Sets the style used to render GeoJsonPoints

        Parameters:
        pointStyle - style used to render GeoJsonPoints
      • setLineStringStyle

         void setLineStringStyle(GeoJsonLineStringStyle lineStringStyle)

        Sets the style used to render GeoJsonLineStrings

        Parameters:
        lineStringStyle - style used to render GeoJsonLineStrings
      • setPolygonStyle

         void setPolygonStyle(GeoJsonPolygonStyle polygonStyle)

        Sets the style used to render GeoJsonPolygons

        Parameters:
        polygonStyle - style used to render GeoJsonPolygons
      • getPolygonOptions

         PolygonOptions getPolygonOptions()

        Gets a PolygonOptions object from mPolygonStyle containing styles for the GeoJsonPolygon

      • getMarkerOptions

         MarkerOptions getMarkerOptions()

        Gets a MarkerOptions object from mPointStyle containing styles for the GeoJsonPoint

      • getPolylineOptions

         PolylineOptions getPolylineOptions()

        Gets a Polyline object from mLineStringStyle containing styles for the GeoJsonLineString

      • setGeometry

         void setGeometry(Geometry geometry)

        Sets the stored Geometry and redraws it on the layer if it has already been added

        Parameters:
        geometry - Geometry to set
      • getBoundingBox

         LatLngBounds getBoundingBox()

        Gets the array containing the coordinates of the bounding box for the feature. Ifthe feature did not have a bounding box then null will be returned.

      • update

         void update(Observable observable, Object data)

        Update is called if the developer modifies a style that is stored in this feature

        Parameters:
        observable - GeoJsonStyle object
        data - null, no extra argument is passed through the notifyObservers method