import { CircleMarker, type CircleMarkerOptions } from 'leaflet'; import { num, type PropDef } from '../core/props.ts'; import { latLngProps, pathProps } from '../core/shared-props.ts'; import { WithProps, type LeafletAddEventListener, type LeafletElementConstructor, type LeafletRemoveEventListener, } from '../core/with-props.ts'; import type { PathEvents } from '../core/event-types.ts'; const PROPS: typeof latLngProps & typeof pathProps & { radius: PropDef; } = { ...latLngProps, radius: num(10, { get: (obj) => obj.getRadius() }), ...pathProps, }; const Base: LeafletElementConstructor = WithProps(PROPS); /** `` — a Leaflet `CircleMarker` (radius in pixels, fixed screen size). */ export default class LeafletCircleMarkerElement extends Base { declare readonly leafletObject?: CircleMarker; declare addEventListener: LeafletAddEventListener; declare removeEventListener: LeafletRemoveEventListener; createLeafletObject(options: CircleMarkerOptions): CircleMarker { return new CircleMarker([this.lat, this.lng], options); } }