-
public abstract class LayerAn abstraction that shares the common properties of KmlLayer and GeoJsonLayer
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceLayer.OnFeatureClickListenerCallback interface for when a map object is clicked.
-
Method Summary
Modifier and Type Method Description abstract voidaddLayerToMap()voidremoveLayerFromMap()Removes all the data from the map and clears all the stored placemarks voidsetOnFeatureClickListener(Layer.OnFeatureClickListener listener)Sets a single click listener for the entire GoogleMap object, that will be calledwith the corresponding Feature object when an object on the map (Polygon,Marker, Polyline) is clicked. Iterable<out Feature>getFeatures()Gets an iterable of all Feature elements that have been added to the layer FeaturegetFeature(Object mapObject)Retrieves a corresponding Feature instance for the given ObjectAllows maps with multiple layers to determine which layer the Objectbelongs to. FeaturegetContainerFeature(Object mapObject)GoogleMapgetMap()Gets the map on which the layer is rendered voidsetMap(GoogleMap map)Renders the layer on the given map. booleanisLayerOnMap()Checks if the current layer has been added to the map GeoJsonPointStylegetDefaultPointStyle()Gets the default style used to render GeoJsonPoints. GeoJsonLineStringStylegetDefaultLineStringStyle()Gets the default style used to render GeoJsonLineStrings. GeoJsonPolygonStylegetDefaultPolygonStyle()Gets the default style used to render GeoJsonPolygons. -
-
Method Detail
-
addLayerToMap
abstract void addLayerToMap()
-
removeLayerFromMap
void removeLayerFromMap()
Removes all the data from the map and clears all the stored placemarks
-
setOnFeatureClickListener
void setOnFeatureClickListener(Layer.OnFeatureClickListener listener)
Sets a single click listener for the entire GoogleMap object, that will be calledwith the corresponding Feature object when an object on the map (Polygon,Marker, Polyline) is clicked.
If getFeature() returns null this means that either the object is inside a KMLContainer,or the object is a MultiPolygon, MultiLineString or MultiPoint and mustbe handled differently.
- Parameters:
listener- Listener providing the onFeatureClick method to call.
-
getFeatures
Iterable<out Feature> getFeatures()
Gets an iterable of all Feature elements that have been added to the layer
-
getFeature
Feature getFeature(Object mapObject)
Retrieves a corresponding Feature instance for the given ObjectAllows maps with multiple layers to determine which layer the Objectbelongs to.
- Parameters:
mapObject- Object
-
getContainerFeature
Feature getContainerFeature(Object mapObject)
-
getMap
GoogleMap getMap()
Gets the map on which the layer is rendered
-
setMap
void setMap(GoogleMap map)
Renders the layer on the given map. The layer on the current map is removed andadded to the given map.
- Parameters:
map- to render the layer on, if null the layer is cleared from the current map
-
isLayerOnMap
boolean isLayerOnMap()
Checks if the current layer has been added to the map
-
getDefaultPointStyle
GeoJsonPointStyle getDefaultPointStyle()
Gets the default style used to render GeoJsonPoints. Any changes to this style will bereflected in the features that use it.
-
getDefaultLineStringStyle
GeoJsonLineStringStyle getDefaultLineStringStyle()
Gets the default style used to render GeoJsonLineStrings. Any changes to this style will bereflected in the features that use it.
-
getDefaultPolygonStyle
GeoJsonPolygonStyle getDefaultPolygonStyle()
Gets the default style used to render GeoJsonPolygons. Any changes to this style will bereflected in the features that use it.
-
-
-
-