-
- 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 StringsetProperty(String property, String propertyValue)Store a new property key and value StringremoveProperty(String property)Removes a given property GeoJsonPointStylegetPointStyle()Returns the style used to render GeoJsonPoints voidsetPointStyle(GeoJsonPointStyle pointStyle)Sets the style used to render GeoJsonPoints GeoJsonLineStringStylegetLineStringStyle()Returns the style used to render GeoJsonLineStrings voidsetLineStringStyle(GeoJsonLineStringStyle lineStringStyle)Sets the style used to render GeoJsonLineStrings GeoJsonPolygonStylegetPolygonStyle()Returns the style used to render GeoJsonPolygons voidsetPolygonStyle(GeoJsonPolygonStyle polygonStyle)Sets the style used to render GeoJsonPolygons PolygonOptionsgetPolygonOptions()Gets a PolygonOptions object from mPolygonStyle containing styles for the GeoJsonPolygon MarkerOptionsgetMarkerOptions()Gets a MarkerOptions object from mPointStyle containing styles for the GeoJsonPoint PolylineOptionsgetPolylineOptions()Gets a Polyline object from mLineStringStyle containing styles for the GeoJsonLineString voidsetGeometry(Geometry geometry)Sets the stored Geometry and redraws it on the layer if it has already been added LatLngBoundsgetBoundingBox()Gets the array containing the coordinates of the bounding box for the feature. StringtoString()voidupdate(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 featureid- common identifier of the featureproperties- hashmap of containing properties related to the featureboundingBox- 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 storepropertyValue- value of the property to store
-
removeProperty
String removeProperty(String property)
Removes a given property
- Parameters:
property- key of the property to remove
-
getPointStyle
GeoJsonPointStyle getPointStyle()
Returns the style used to render GeoJsonPoints
-
setPointStyle
void setPointStyle(GeoJsonPointStyle pointStyle)
Sets the style used to render GeoJsonPoints
- Parameters:
pointStyle- style used to render GeoJsonPoints
-
getLineStringStyle
GeoJsonLineStringStyle getLineStringStyle()
Returns the style used to render GeoJsonLineStrings
-
setLineStringStyle
void setLineStringStyle(GeoJsonLineStringStyle lineStringStyle)
Sets the style used to render GeoJsonLineStrings
- Parameters:
lineStringStyle- style used to render GeoJsonLineStrings
-
getPolygonStyle
GeoJsonPolygonStyle getPolygonStyle()
Returns the style used to render GeoJsonPolygons
-
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 objectdata- null, no extra argument is passed through the notifyObservers method
-
-
-
-