Class Layer

    • Constructor Detail

      • Layer

        public Layer()
    • Method Detail

      • addLayerToMap

        public abstract void addLayerToMap()
      • removeLayerFromMap

        public void removeLayerFromMap()
        Removes all the data from the map and clears all the stored placemarks
      • setOnFeatureClickListener

        public void setOnFeatureClickListener​(Layer.OnFeatureClickListener listener)
        Sets a single click listener for the entire GoogleMap object, that will be called with 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 must be handled differently.

        Parameters:
        listener - Listener providing the onFeatureClick method to call.
      • getFeatures

        public java.lang.Iterable<? extends Feature> getFeatures()
        Gets an iterable of all Feature elements that have been added to the layer
        Returns:
        iterable of Feature elements
      • getFeature

        public Feature getFeature​(java.lang.Object mapObject)
        Retrieves a corresponding Feature instance for the given Object Allows maps with multiple layers to determine which layer the Object belongs to.
        Parameters:
        mapObject - Object
        Returns:
        Feature for the given object
      • getContainerFeature

        public Feature getContainerFeature​(java.lang.Object mapObject)
      • getMap

        public com.google.android.gms.maps.GoogleMap getMap()
        Gets the map on which the layer is rendered
        Returns:
        map on which the layer is rendered
      • setMap

        public void setMap​(com.google.android.gms.maps.GoogleMap map)
        Renders the layer on the given map. The layer on the current map is removed and added to the given map.
        Parameters:
        map - to render the layer on, if null the layer is cleared from the current map
      • isLayerOnMap

        public boolean isLayerOnMap()
        Checks if the current layer has been added to the map
        Returns:
        true if the layer is on the map, false otherwise
      • getDefaultPointStyle

        public GeoJsonPointStyle getDefaultPointStyle()
        Gets the default style used to render GeoJsonPoints. Any changes to this style will be reflected in the features that use it.
        Returns:
        default style used to render GeoJsonPoints
      • getDefaultLineStringStyle

        public GeoJsonLineStringStyle getDefaultLineStringStyle()
        Gets the default style used to render GeoJsonLineStrings. Any changes to this style will be reflected in the features that use it.
        Returns:
        default style used to render GeoJsonLineStrings
      • getDefaultPolygonStyle

        public GeoJsonPolygonStyle getDefaultPolygonStyle()
        Gets the default style used to render GeoJsonPolygons. Any changes to this style will be reflected in the features that use it.
        Returns:
        default style used to render GeoJsonPolygons