@madebylars.com/mbl-fleetmap 1.0.0 → 1.0.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.
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mbl-fleetmap",
3
3
  "configKey": "mblFleetMap",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
@@ -1,4 +1,8 @@
1
- const busRegistry = /* @__PURE__ */ new Map();
1
+ const g = globalThis;
2
+ if (!g.__mblFleetBusRegistry) {
3
+ g.__mblFleetBusRegistry = /* @__PURE__ */ new Map();
4
+ }
5
+ const busRegistry = g.__mblFleetBusRegistry;
2
6
  function getBus(mapId) {
3
7
  if (!busRegistry.has(mapId)) {
4
8
  busRegistry.set(mapId, {
@@ -1,5 +1,5 @@
1
1
  import type L from 'leaflet';
2
- export declare const registerMap: (id: string, map: L.Map) => import("vue").ShallowReactive<Map<string, L.Map>>;
2
+ export declare const registerMap: (id: string, map: L.Map) => Map<string, L.Map>;
3
3
  export declare const getMap: (id: string) => L.Map | null;
4
4
  export declare const removeMap: (id: string) => boolean;
5
5
  export declare const setLeaflet: (L: unknown) => void;
@@ -1,10 +1,13 @@
1
1
  import { shallowReactive } from "vue";
2
- const mapRegistry = shallowReactive(/* @__PURE__ */ new Map());
2
+ const g = globalThis;
3
+ if (!g.__mblFleetMapRegistry) {
4
+ g.__mblFleetMapRegistry = shallowReactive(/* @__PURE__ */ new Map());
5
+ }
6
+ const mapRegistry = g.__mblFleetMapRegistry;
3
7
  export const registerMap = (id, map) => mapRegistry.set(id, map);
4
8
  export const getMap = (id) => mapRegistry.get(id) ?? null;
5
9
  export const removeMap = (id) => mapRegistry.delete(id);
6
- let _leaflet = null;
7
10
  export const setLeaflet = (L) => {
8
- _leaflet = L;
11
+ g.__mblFleetLeaflet = L;
9
12
  };
10
- export const getLeaflet = () => _leaflet;
13
+ export const getLeaflet = () => g.__mblFleetLeaflet ?? null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madebylars.com/mbl-fleetmap",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Nuxt 4 module — Leaflet-powered transport map with driver markers and route API",
5
5
  "repository": "madebylars/mbl-fleetmap",
6
6
  "license": "MIT",