KmlLayer

constructor(map: GoogleMap, resourceId: Int, 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

Throws

if file cannot be parsed

if I/O error


constructor(map: GoogleMap, stream: InputStream, 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

Throws

if file cannot be parsed

if I/O error


constructor(map: GoogleMap, @RawRes resourceId: Int, context: Context, markerManager: MarkerManager, polygonManager: PolygonManager, polylineManager: PolylineManager, groundOverlayManager: GroundOverlayManager, cache: Renderer.ImagesCache)

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 with their 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

Throws

if file cannot be parsed

if I/O error


constructor(map: GoogleMap, stream: InputStream, context: Context, markerManager: MarkerManager, polygonManager: PolygonManager, polylineManager: PolylineManager, groundOverlayManager: GroundOverlayManager, cache: Renderer.ImagesCache)

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 with their 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

Throws

if file cannot be parsed

if I/O error