import { Control, type ControlPosition } from 'leaflet'; import { bool, choice, num } from '../core/props.ts'; import { WithProps } from '../core/with-props.ts'; export default class LeafletControlScaleElement extends WithProps( { position: choice('bottomleft'), maxWidth: num(100), metric: bool(true), imperial: bool(true), updateWhenIdle: bool(), }, { attach: 'self' }, ) { declare readonly leafletObject?: Control.Scale; createLeafletObject(options: Control.ScaleOptions): Control.Scale { return new Control.Scale(options); } }