You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
leaflet-components/src/elements/leaflet-layer-group.ts

27 lines
912 B
TypeScript

import { LayerGroup } from 'leaflet';
import {
WithProps,
type LeafletAddEventListener,
type LeafletElementConstructor,
type LeafletRemoveEventListener,
} from '../core/with-props.ts';
import type { GroupEvents } from '../core/event-types.ts';
const PROPS: Record<never, never> = {};
const Base: LeafletElementConstructor<LayerGroup, typeof PROPS> = WithProps(PROPS);
/**
* `<leaflet-layer-group>` — a Leaflet `LayerGroup`. A passthrough container
* with no options of its own; child layers add themselves through the standard
* registration bubble, and groups can nest.
*/
export default class LeafletLayerGroupElement extends Base {
declare readonly leafletObject?: LayerGroup;
declare addEventListener: LeafletAddEventListener<GroupEvents>;
declare removeEventListener: LeafletRemoveEventListener<GroupEvents>;
createLeafletObject(): LayerGroup {
return new LayerGroup([]);
}
}