MapLayer.clearLayers

Syntax

clearLayers();

Description

The clearLayers method clears child layers of a map.

Example

To execute the example the HTML page must contain the MapChart component named map (see Example of Creating the MapChart Component). A map with the Google topobase must also be loaded (see  page with description of the MapChart.afterGoogleLoad property).

Clear layer with areas of a map based on Google topobase:

// Get map layer of the map
var mainLayer = map.getLayer("MainLayer");
// Clear the layer with map areas
mainLayer.clearLayers();

After executing the example the layer containing map areas is cleared:

See also:

MapLayer