add zone, add popup address, add popup zone, add remove marker, add close popup

This commit is contained in:
David Nguyen 2025-10-07 16:25:36 -04:00
parent 849a6f07a0
commit e823f060c8
Signed by: david.nguyen
GPG Key ID: D5FB5A5715829326

View File

@ -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 ? `<p>Delivery time estimate ${address.deliverySchedule}</p>` : ''}
</div>`,
{
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(`
<div class="delivery-zone">
.bindPopup(`
<div >
${zone.name ? `<p><strong>${zone.name}</strong></p>` : ''}
${zone.shippingFee ? `<p>Shipping: ${zone.shippingFee}</p>` : ''}
${zone.deliverySchedule ? `<p>Delivery: ${zone.deliverySchedule}</p>` : ''}
</div>`,
{
permanent: true,
offset: [0, 0]
})
.openTooltip();
</div>`)
.openPopup();
}
closePopup()
{