mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* adding leaflet-groupedlayercontrol types * Adding typescript version information to index.d.ts file. * Updating formatting in types * Adding dom to libs in tsconfig * Updating formatting issues in index.d.ts file
27 lines
600 B
TypeScript
27 lines
600 B
TypeScript
import * as L from 'leaflet';
|
|
import 'leaflet-groupedlayercontrol';
|
|
|
|
const map: L.Map = L.map('#map');
|
|
|
|
const baseLayers = {
|
|
street: L.tileLayer('...')
|
|
};
|
|
|
|
const groupedOverlays = {
|
|
overlayGroup1: {
|
|
overlay1: L.layerGroup(),
|
|
overlay2: L.layerGroup()
|
|
},
|
|
overlayGroup2: {
|
|
overlay3: L.layerGroup()
|
|
}
|
|
};
|
|
|
|
const groupedLayersOptions: L.GroupedLayersOptions = {
|
|
position: 'topleft',
|
|
exclusiveGroups: ['overlayGroup1', 'overlayGroup2'],
|
|
groupCheckboxes: false
|
|
};
|
|
|
|
L.control.groupedLayers(baseLayers, groupedOverlays, groupedLayersOptions).addTo(map);
|