LayersControl constructor

LayersControl([
  1. dynamic baselayers,
  2. dynamic overlays,
  3. LayersControlOptions? options
])

Creates a layers control with the given layers.

The baseLayers and overlays parameters are object literals with layer names as keys and Layer objects as values. Note: Since dart2js interop doesn't transpile dart maps to native js map directly, you will have to create anonymous anotated classes for each different baselayers and overlays object (or just use the addBaseLayer and addOverlay instance methods).

Base layers will be switched with radio buttons, while overlays will be switched with checkboxes. Note that all base layers should be passed in the base layers object, but only one should be added to the map during map instantiation.

Implementation

external LayersControl([
  dynamic baselayers,
  dynamic overlays,
  LayersControlOptions? options,
]);