MapChart.clearLayer

Syntax

clearLayer(layerNode: HTMLElement);

Parameters

layerNode. The DOM item corresponding to the layer to be cleared.

Description

The clearLayer method clears a specified layer.

Example

To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). Clear all map layers:

// Get map layers
var layers = map.getLayers();
for (var i in layers) {
    // Get layer
    var layer = layers[i];
    // Delete this layer
    map.clearLayer(layer.getDomNode());
};

After executing the example all map layers are cleared:

See also:

MapChart