Class: KML

cercalia.KML


new cercalia.KML(options)

src/cercalia/kml.js, line 21
Name Type Description
options

Hash table with extra options to configure the KML layer

Name Type Description
name string | undefined

Name

map cercalia.Map

Cercalia Map Required.

minResolution number | undefined

The minimum resolution (inclusive) at which this layer will be visible.

maxResolution number | undefined

MaxResolution The maximum resolution (exclusive) below which this layer will be visible.

opacity number | undefined

Opacity. 0-1. Default is 1

projection string | undefined

Projection. Default is EPSG:3857

draggable string | undefined

Draggable. Default is false

url string | undefined

Url of resource

onLoadUrl function | undefined

Callback function when URL and features are loaded.

visible string | undefined

Visible. Default is false

Extends

Methods

addFeature(feature)

src/cercalia/kml.js, line 359
Name Type Description
feature cercalia.Feature | cercalia.Marker | ol.Feature

feature.

addFeaturesFromKML(kml, proj)

src/cercalia/kml.js, line 378
Name Type Description
kml string

KML as string.

proj string

Data projection.

centerToFeatures()

src/cercalia/kml.js, line 476

Center to loaded features

clear()

src/cercalia/kml.js, line 458

Clear all features

getClass(){string} inherited

src/cercalia/object.js, line 41
Returns:
Get Class name of object

getFeatures(){Array}

src/cercalia/kml.js, line 342
Returns:
Array of KML features.

getId(){string} inherited

src/cercalia/object.js, line 33
Returns:
Unique Id.

getKML(){string}

src/cercalia/kml.js, line 421
Returns:
Kml of features in layer.

getLayer(){ol.layer.Vector}

src/cercalia/kml.js, line 299

Get Layer of KML features.

Returns:
Layer vector

getMap(){cercalia.Map|undefined}

src/cercalia/kml.js, line 211

return cercalia map

Returns:
map

getMaxResolution(){number|undefined}

src/cercalia/kml.js, line 246
Returns:
maxResolution

getMinResolution(){number|undefined}

src/cercalia/kml.js, line 228
Returns:
minResolution

getOpacity(){number}

src/cercalia/kml.js, line 263
Returns:
opacity

getProjection(){string}

src/cercalia/kml.js, line 307
Returns:
Projection.

getUrl(){string}

src/cercalia/kml.js, line 271
Returns:
url

getVisible(){boolean}

src/cercalia/kml.js, line 290

Get if map is visible

Returns:
trueif layer is visible.

isDraggable(){boolean}

src/cercalia/kml.js, line 334
Returns:
Returns if KML features are draggable.

removeFeature(feature)

src/cercalia/kml.js, line 408

Remove a single feature from the source. If you want to remove all features at once, use the clear() method instead

Name Type Description
feature cercalia.Feature | cercalia.Marker | ol.Feature

Feature to remove.

setDraggable(draggable)

src/cercalia/kml.js, line 316

Converts features to draggable.

Name Type Description
draggable boolean

Draggable true or false.

setMaxResolution(maxResolution)

src/cercalia/kml.js, line 237
Name Type Description
maxResolution number

Maximum resolution.

setMinResolution(minResolution)

src/cercalia/kml.js, line 219
Name Type Description
minResolution number

Minimum resolution

setOpacity(opacity)

src/cercalia/kml.js, line 254
Name Type Description
opacity number

Opacity. Decimal value in `0..1' .

setUrl(url)

src/cercalia/kml.js, line 467
Name Type Description
url string

Url

setVisible(visible)

src/cercalia/kml.js, line 280

Show KML in mapa.

Name Type Description
visible boolean

Set the visibility of the layer (true or false)