Geoportal Extension for OpenLayers
API Reference

Class: KMLExtended

ol.format.KMLExtended

Extended Styles KML format to export (internal use only !)

INFO
only ol.Control is a user-extendable class.
Everything else requires integration with the original openlayers source and a new ol.js
to be built with your new classes incorporated.

SPEC
cf. https://developers.google.com/kml/forum/advanced

ISSUES
cf. https://github.com/openlayers/openlayers/issues/4829
cf. https://github.com/openlayers/openlayers/issues/4460
cf. https://github.com/openlayers/openlayers/pull/5590
cf. https://github.com/openlayers/openlayers/issues/5229
cf. https://github.com/openlayers/openlayers/issues/3371

new KMLExtended(options)

Formats/KML.js, line 47
Name Type Description
options Object

Options

Name Type Description
extensions Object optional

Add properties to file root

Extends

  • ol.format.KML

Methods

_processKml(kmlNode, features, process)

Formats/KML.js, line 142

Fonction de lecture du KML avec fonction de traitement en fonction du type
PlaceMark (Label ou Marker).
Les traitements sont de 2 types :

  • creation de styles étendus ou correctifs sur le KML
  • ajout de styles étendus sur les features
Name Type Description
kmlNode DOMElement

kml nodes

features Array.<Object>

features

process Object

process

Example
// ajoute des fonctionnalités dans le KML
_processKml(kmlDoc, {
  labelStyle : createStyleLabel,
  iconStyle  : createStyleIcon
});

// lit des fonctionnalités du KML non impl. par OpenLayers
_processKml(kmlNode, {
  labelStyle : getStyleToFeatureLabel,
  iconStyle  : getStyleToFeatureIcon,
  extendedData : getExtendedData
});

_writeRootExtensions(kmlNode, extensions)

Formats/KML.js, line 751

...

Name Type Description
kmlNode *

...

extensions *

...

readFeatures(source, options){Array.<ol.Feature>}

Formats/KML.js, line 778

Read Extend for Features.
This function overloads ol.format.KML.readFeatures ...

Name Type Description
source Document | Node

Source.

options olx.format.ReadOptions optional

options.

See:
  • ol.format.KML.prototype.readFeatures

readRootExtensions(key){Object}

Formats/KML.js, line 1282

...

Name Type Description
key *

...

writeFeatures(features, options){String}

Formats/KML.js, line 353

Write Extend for Features.
This function overloads ol.format.KML.writeFeatures ...

Name Type Description
features Array.<Object>

Features.

options Object

Options.

See:
  • ol.format.KML.prototype.writeFeatures
Returns:
string formatted