export default class LeafletLine extends HTMLElement { static get observedAttributes() { return ['lat', 'lng']; } get latlng(): [number, number] { return [+(this.getAttribute('lat') ?? 0), +(this.getAttribute('lng') ?? 0)]; } attributeChangedCallback() { this.dispatchEvent(new CustomEvent('line-updated', { bubbles: true })); } } customElements.define('leaflet-line', LeafletLine);