From e823f060c887e5e31eeb117aa4991bd1d2b00b74 Mon Sep 17 00:00:00 2001 From: David Nguyen Date: Tue, 7 Oct 2025 16:25:36 -0400 Subject: [PATCH] add zone, add popup address, add popup zone, add remove marker, add close popup --- fesm2022/svrnty-ngx-open-map-wrapper.mjs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/fesm2022/svrnty-ngx-open-map-wrapper.mjs b/fesm2022/svrnty-ngx-open-map-wrapper.mjs index 8cf7110..78aa17f 100644 --- a/fesm2022/svrnty-ngx-open-map-wrapper.mjs +++ b/fesm2022/svrnty-ngx-open-map-wrapper.mjs @@ -1,5 +1,5 @@ import {Map, NavigationControl, Marker, Popup} from 'maplibre-gl'; -import { Map as Map$1, TileLayer, Marker as Marker$1 } from 'leaflet'; +import { Map as Map$1, TileLayer, Marker as Marker$1, polygon } from 'leaflet'; import * as i0 from '@angular/core'; import { inject, PLATFORM_ID, output, Directive, Injector, input, runInInjectionContext, effect, ViewChild, Component } from '@angular/core'; import { isPlatformBrowser } from '@angular/common'; @@ -263,7 +263,7 @@ class LeafletAdapter { if (zone.opacity) opacity = zone.opacity; - const polygon = L.polygon(latlngs, { color, fillOpacity: opacity }) + polygon(latlngs, { color, fillOpacity: opacity }) .addTo(this.map); } } @@ -290,11 +290,10 @@ class LeafletAdapter { ${address.deliverySchedule ? `

Delivery time estimate ${address.deliverySchedule}

` : ''} `, { - permanent: true, - offset: [-38, 135] + permanent: true, + offset: [-38, 135] }) .openTooltip(); - this.map.on('move', () => { if (this.popup) { const newBounds = this.map.getBounds(); @@ -323,17 +322,13 @@ class LeafletAdapter { opacity: 0 }) .addTo(this.map) - .bindTooltip(` -
+ .bindPopup(` +
${zone.name ? `

${zone.name}

` : ''} ${zone.shippingFee ? `

Shipping: ${zone.shippingFee}

` : ''} ${zone.deliverySchedule ? `

Delivery: ${zone.deliverySchedule}

` : ''} -
`, - { - permanent: true, - offset: [0, 0] - }) - .openTooltip(); +
`) + .openPopup(); } closePopup() {