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