@symfony/ux-leaflet-map 2.25.2 → 2.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@ type MapOptions = Pick<LeafletMapOptions, 'center' | 'zoom'> & {
8
8
  url: string;
9
9
  attribution: string;
10
10
  options: Record<string, unknown>;
11
- };
11
+ } | false;
12
12
  };
13
13
  export default class extends AbstractMapController<MapOptions, L.Map, MarkerOptions, L.Marker, PopupOptions, L.Popup, PolygonOptions, L.Polygon, PolylineOptions, L.Polyline> {
14
14
  map: L.Map;
@@ -45,7 +45,7 @@ class default_1 extends Controller {
45
45
  createInfoWindow({ definition, element, }) {
46
46
  this.dispatchEvent('info-window:before-create', { definition, element });
47
47
  const infoWindow = this.doCreateInfoWindow({ definition, element });
48
- this.dispatchEvent('info-window:after-create', { infoWindow, element });
48
+ this.dispatchEvent('info-window:after-create', { infoWindow, definition, element });
49
49
  this.infoWindows.push(infoWindow);
50
50
  return infoWindow;
51
51
  }
@@ -76,7 +76,7 @@ class default_1 extends Controller {
76
76
  return ({ definition }) => {
77
77
  this.dispatchEvent(eventBefore, { definition });
78
78
  const drawing = factory({ definition });
79
- this.dispatchEvent(eventAfter, { [type]: drawing });
79
+ this.dispatchEvent(eventAfter, { [type]: drawing, definition });
80
80
  draws.set(definition['@id'], drawing);
81
81
  return drawing;
82
82
  };
@@ -145,10 +145,12 @@ class map_controller extends default_1 {
145
145
  center: center === null ? undefined : center,
146
146
  zoom: zoom === null ? undefined : zoom,
147
147
  });
148
- L.tileLayer(options.tileLayer.url, {
149
- attribution: options.tileLayer.attribution,
150
- ...options.tileLayer.options,
151
- }).addTo(map);
148
+ if (options.tileLayer) {
149
+ L.tileLayer(options.tileLayer.url, {
150
+ attribution: options.tileLayer.attribution,
151
+ ...options.tileLayer.options,
152
+ }).addTo(map);
153
+ }
152
154
  return map;
153
155
  }
154
156
  doCreateMarker({ definition }) {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@symfony/ux-leaflet-map",
3
3
  "description": "Leaflet bridge for Symfony UX Map, integrate interactive maps in your Symfony applications",
4
4
  "license": "MIT",
5
- "version": "2.25.2",
5
+ "version": "2.26.1",
6
6
  "keywords": [
7
7
  "symfony-ux",
8
8
  "leaflet",
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "devDependencies": {
51
51
  "@hotwired/stimulus": "^3.0.0",
52
- "@symfony/ux-map": "2.25.2",
52
+ "@symfony/ux-map": "2.26.1",
53
53
  "@types/leaflet": "^1.9.12",
54
54
  "leaflet": "^1.9.4"
55
55
  }