Two interchangeable base maps, two overlays you can toggle independently, a scale bar, and a custom control of your own — all over Curitiba.
LayersControl takes two objects: base layers first, overlays second.
Base layers are radio buttons; overlays are checkboxes.
LayerGroup bundles many layers behind a single entry, so the three
depot markers toggle together.
onAdd returning an element. Implement
onRemove as well whenever you attached listeners, or they leak.
baselayerchange, overlayadd and overlayremove
fire on the map, carrying the layer's label in e.name.
position:
'topleft', 'topright', 'bottomleft' or
'bottomright'. Several controls in the same corner stack in the order
they were added.
import {CargoMap, TileLayer, LayersControl, ScaleControl, Control, LayerGroup, Marker, Circle, DomUtil} from 'cargocanvas';