removeLayer method

dynamic removeLayer(
  1. String id
)

Removes the layer with the given ID from the map's style.

If no such layer exists, an error event is fired.

@param {string} id id of the layer to remove @fires error

@example // If a layer with ID 'state-data' exists, remove it. if (map.getLayer('state-data')) map.removeLayer('state-data');

Implementation

removeLayer(String id) => jsObject.removeLayer(id);