Package 

Class KmlLayer


  • 
    public class KmlLayer
    extends Layer
                        

    Document class allows for users to input their KML data and output it onto the map

    • Constructor Summary

      Constructors 
      Constructor Description
      KmlLayer(GoogleMap map, int resourceId, Context context) Creates a new KmlLayer object - addLayerToMap() must be called to trigger rendering onto a map.Constructor may be called on a background thread, as I/O and parsing may be long-running.
      KmlLayer(GoogleMap map, InputStream stream, Context context) Creates a new KmlLayer object - addLayerToMap() must be called to trigger rendering onto a map.Constructor may be called on a background thread, as I/O and parsing may be long-running.
      KmlLayer(GoogleMap map, int resourceId, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOverlayManager groundOverlayManager, Renderer.ImagesCache cache) Creates a new KmlLayer object - addLayerToMap() must be called to trigger rendering onto a map.Constructor may be called on a background thread, as I/O and parsing may be long-running.Use this constructor with shared object managers in order to handle multiple layers withtheir own event handlers on the map.
      KmlLayer(GoogleMap map, InputStream stream, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOverlayManager groundOverlayManager, Renderer.ImagesCache cache) Creates a new KmlLayer object - addLayerToMap() must be called to trigger rendering onto a map.Constructor may be called on a background thread, as I/O and parsing may be long-running.Use this constructor with shared object managers in order to handle multiple layers withtheir own event handlers on the map.
    • Method Summary

      Modifier and Type Method Description
      void addLayerToMap() Adds the KML data to the map - must be called on the main UI thread
      boolean hasPlacemarks() Checks if the layer contains placemarks
      Iterable<KmlPlacemark> getPlacemarks() Gets an iterable of KmlPlacemark objects
      boolean hasContainers() Checks if the layer contains any KmlContainers
      Iterable<KmlContainer> getContainers() Gets an iterable of KmlContainerInterface objects
      Iterable<KmlGroundOverlay> getGroundOverlays() Gets an iterable of KmlGroundOverlay objects
      • Methods inherited from class com.google.maps.android.data.Layer

        getContainerFeature, getDefaultLineStringStyle, getDefaultPointStyle, getDefaultPolygonStyle, getFeature, getFeatures, getMap, isLayerOnMap, removeLayerFromMap, setMap, setOnFeatureClickListener
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • KmlLayer

        KmlLayer(GoogleMap map, int resourceId, Context context)
        Creates a new KmlLayer object - addLayerToMap() must be called to trigger rendering onto a map.Constructor may be called on a background thread, as I/O and parsing may be long-running.
        Parameters:
        map - GoogleMap object
        resourceId - Raw resource KML or KMZ file
        context - The Context
      • KmlLayer

        KmlLayer(GoogleMap map, InputStream stream, Context context)
        Creates a new KmlLayer object - addLayerToMap() must be called to trigger rendering onto a map.Constructor may be called on a background thread, as I/O and parsing may be long-running.
        Parameters:
        map - GoogleMap object
        stream - InputStream containing KML or KMZ file
        context - The Context
      • KmlLayer

        KmlLayer(GoogleMap map, int resourceId, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOverlayManager groundOverlayManager, Renderer.ImagesCache cache)
        Creates a new KmlLayer object - addLayerToMap() must be called to trigger rendering onto a map.Constructor may be called on a background thread, as I/O and parsing may be long-running.Use this constructor with shared object managers in order to handle multiple layers withtheir own event handlers on the map.
        Parameters:
        map - GoogleMap object
        resourceId - Raw resource KML or KMZ file
        context - The Context
        markerManager - marker manager to create marker collection from
        polygonManager - polygon manager to create polygon collection from
        polylineManager - polyline manager to create polyline collection from
        groundOverlayManager - ground overlay manager to create ground overlay collection from
        cache - cache to be used for fetched images
      • KmlLayer

        KmlLayer(GoogleMap map, InputStream stream, Context context, MarkerManager markerManager, PolygonManager polygonManager, PolylineManager polylineManager, GroundOverlayManager groundOverlayManager, Renderer.ImagesCache cache)
        Creates a new KmlLayer object - addLayerToMap() must be called to trigger rendering onto a map.Constructor may be called on a background thread, as I/O and parsing may be long-running.Use this constructor with shared object managers in order to handle multiple layers withtheir own event handlers on the map.
        Parameters:
        map - GoogleMap object
        stream - InputStream containing KML or KMZ file
        context - The Context
        markerManager - marker manager to create marker collection from
        polygonManager - polygon manager to create polygon collection from
        polylineManager - polyline manager to create polyline collection from
        groundOverlayManager - ground overlay manager to create ground overlay collection from
        cache - cache to be used for fetched images