Skip to content

Latest commit

 

History

History
158 lines (80 loc) · 3.48 KB

KmlLayer.md

File metadata and controls

158 lines (80 loc) · 3.48 KB

See html formatted version

KmlLayer class

google.maps.KmlLayer class

A KmlLayer adds geographic markup to the map from a KML, KMZ or GeoRSS file that is hosted on a publicly accessible web server. A KmlFeatureData object is provided for each feature when clicked.

This class extends MVCObject.

Constructor

undefined

KmlLayer([opts])

Parameters: 

Creates a KmlLayer which renders the contents of the specified KML/KMZ file (https://developers.google.com/kml/documentation/kmlreference) or GeoRSS file (http://www.georss.org).

Methods

undefined

getDefaultViewport()

Parameters:  None

Return Value:  LatLngBounds

Get the default viewport for the layer being displayed.

undefined

getMap()

Parameters:  None

Return Value:  Map

Get the map on which the KML Layer is being rendered.

undefined

getMetadata()

Parameters:  None

Return Value:  KmlLayerMetadata

Get the metadata associated with this layer, as specified in the layer markup.

undefined

getStatus()

Parameters:  None

Return Value:  KmlLayerStatus

Get the status of the layer, set once the requested document has loaded.

undefined

getUrl()

Parameters:  None

Return Value:  string

Gets the URL of the KML file being displayed.

undefined

getZIndex()

Parameters:  None

Return Value:  number

Gets the z-index of the KML Layer.

undefined

setMap(map)

Parameters: 

Return Value:  None

Renders the KML Layer on the specified map. If map is set to null, the layer is removed.

undefined

setOptions(options)

Parameters: 

Return Value:  None

undefined

setUrl(url)

Parameters: 

  • url:  string

Return Value:  None

Sets the URL of the KML file to display.

undefined

setZIndex(zIndex)

Parameters: 

  • zIndex:  number

Return Value:  None

Sets the z-index of the KML Layer.

Events

undefined

function(kmlClickEvent)

Arguments: 

This event is fired when a feature in the layer is clicked.

undefined

function()

Arguments:  None

This event is fired when the KML layers default viewport has changed.

undefined

function()

Arguments:  None

This event is fired when the KML layer has finished loading. At this point it is safe to read the status property to determine if the layer loaded successfully.