accomadesc 0.4.22 → 0.4.23

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.
@@ -1,8 +1,13 @@
1
1
  <script lang="ts">
2
2
  import type { MapOptions, Map } from 'leaflet';
3
3
  import 'leaflet/dist/leaflet.css';
4
- import 'leaflet/dist/images/marker-shadow.png';
5
- import 'leaflet/dist/images/marker-icon.png';
4
+
5
+ // Bundlers break leaflet's automatic marker-image path detection (it scans
6
+ // for a leaflet script/link tag), so markers 404 as relative
7
+ // `marker-icon.png` (P23 on the published site). Pin the bundled URLs.
8
+ import markerIconUrl from 'leaflet/dist/images/marker-icon.png';
9
+ import markerIconRetinaUrl from 'leaflet/dist/images/marker-icon-2x.png';
10
+ import markerShadowUrl from 'leaflet/dist/images/marker-shadow.png';
6
11
 
7
12
  import { onMount, onDestroy } from 'svelte';
8
13
  import type { LeafletMapContent } from './types.js';
@@ -24,6 +29,11 @@
24
29
  };
25
30
  const leafletModule = await import('leaflet');
26
31
  const L = leafletModule.default;
32
+ L.Icon.Default.mergeOptions({
33
+ iconUrl: markerIconUrl,
34
+ iconRetinaUrl: markerIconRetinaUrl,
35
+ shadowUrl: markerShadowUrl,
36
+ });
27
37
 
28
38
  if (mapElement) {
29
39
  theMap = L.map(mapElement, options);
@@ -1,6 +1,4 @@
1
1
  import 'leaflet/dist/leaflet.css';
2
- import 'leaflet/dist/images/marker-shadow.png';
3
- import 'leaflet/dist/images/marker-icon.png';
4
2
  import type { LeafletMapContent } from './types.js';
5
3
  declare const LeafletMap: import("svelte").Component<LeafletMapContent, {}, "">;
6
4
  type LeafletMap = ReturnType<typeof LeafletMap>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "accomadesc",
3
- "version": "0.4.22",
3
+ "version": "0.4.23",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "dist",