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-control-attribution.ts

24 lines
835 B
TypeScript

import { Control, type ControlPosition } from 'leaflet';
import { choice, str, type PropDef } from '../core/props.ts';
import { WithProps, type LeafletElementConstructor } from '../core/with-props.ts';
const PROPS: {
position: PropDef<ControlPosition>;
prefix: PropDef<string>;
} = {
position: choice<ControlPosition>('bottomright'),
prefix: str(),
};
const Base: LeafletElementConstructor<Control.Attribution, typeof PROPS> = WithProps(PROPS, {
attach: 'self',
});
/** `<leaflet-control-attribution>` — the map's attribution control (`Control.Attribution`). */
export default class LeafletControlAttributionElement extends Base {
declare readonly leafletObject?: Control.Attribution;
createLeafletObject(options: Control.AttributionOptions): Control.Attribution {
return new Control.Attribution(options);
}
}