@edugis-org/webmapx 0.1.5 → 0.1.7

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.
@@ -3,7 +3,7 @@ import { t } from "./webmapx-base-tool-Dm9NAWLD.js";
3
3
  import { i as n, n as r, o as i } from "./decorators-B35AgiCU.js";
4
4
  import { css as a, html as o, nothing as s } from "lit";
5
5
  //#region src/utils/epsg-lookup-manager.ts
6
- var c = "https://cdn.jsdelivr.net/npm/@edugis-org/webmapx@0.1.5/public", l = 6e4, u = new class {
6
+ var c = "https://cdn.jsdelivr.net/npm/@edugis-org/webmapx@0.1.7/public", l = 6e4, u = new class {
7
7
  constructor() {
8
8
  this.worker = null, this.isReady = !1, this.isInitializing = !1, this.initPromise = null, this.pendingRequests = /* @__PURE__ */ new Map(), this.requestCounter = 0, this.idleTimeout = null, this.idleTimeoutMs = l;
9
9
  }
@@ -26,7 +26,7 @@ var i = {
26
26
  "3d": () => import("./webmapx-3d-tool-D4CTD2gB.js"),
27
27
  truearea: () => import("./webmapx-truearea-tool-CMB4Orm-.js"),
28
28
  "view-mode": () => import("./webmapx-view-mode-tool-CUpLNjOj.js"),
29
- coordinates: () => import("./webmapx-coordinates-tool-Ca5-r3im.js"),
29
+ coordinates: () => import("./webmapx-coordinates-tool-GMfztOzE.js"),
30
30
  settings: () => import("./webmapx-settings-DDEJ8aoV.js"),
31
31
  "config-edit": () => import("./webmapx-config-edit-tool-BgcSkmmg.js")
32
32
  };
@@ -1298,7 +1298,7 @@ function ve(e, t) {
1298
1298
  }
1299
1299
  //#endregion
1300
1300
  //#region src/bootstrap/locale-loader.ts
1301
- var ye = "https://cdn.jsdelivr.net/npm/@edugis-org/webmapx@0.1.5/src/locales";
1301
+ var ye = "https://cdn.jsdelivr.net/npm/@edugis-org/webmapx@0.1.7/src/locales";
1302
1302
  async function W(e) {
1303
1303
  if (H.hasResourceBundle(e, "webmapx")) {
1304
1304
  await H.changeLanguage(e);
@@ -2536,53 +2536,63 @@ var Ke = {
2536
2536
  version: 8,
2537
2537
  sources: {},
2538
2538
  layers: []
2539
- }, qe = class {
2539
+ };
2540
+ function qe(e) {
2541
+ return { mainToolbar: {
2542
+ type: "toolbar",
2543
+ enabled: !0,
2544
+ position: "top-left",
2545
+ items: e.map((e) => ({ tool: e }))
2546
+ } };
2547
+ }
2548
+ var Je = class {
2540
2549
  static async mount(e, t) {
2541
2550
  let n = typeof t.config == "string" ? await fetch(t.config).then((e) => {
2542
2551
  if (!e.ok) throw Error(`[webmapx] Failed to load config: ${t.config}`);
2543
2552
  return e.json();
2544
2553
  }) : t.config;
2545
2554
  await _e();
2546
- let i = n.engine ?? "maplibre";
2555
+ let i = n.engine ?? "maplibre", o = Array.isArray(n.tools) ? n.tools : [];
2547
2556
  await Promise.all([
2548
2557
  r(i),
2549
- a(n.tools ?? []),
2558
+ a(o),
2550
2559
  n.plugins?.length ? s(n.plugins) : Promise.resolve()
2551
2560
  ]), n.locale && n.locale !== "en" && await W(n.locale);
2552
- let o = document.querySelector(e);
2553
- if (!o) throw Error(`[webmapx] Mount target not found: "${e}"`);
2554
- o.innerHTML = `<webmapx-map adapter="${i}"><webmapx-layout></webmapx-layout></webmapx-map>`;
2555
- let c = o.querySelector("webmapx-map"), l = n.map, u = Ge({
2556
- ...n,
2561
+ let c = document.querySelector(e);
2562
+ if (!c) throw Error(`[webmapx] Mount target not found: "${e}"`);
2563
+ c.innerHTML = `<webmapx-map adapter="${i}"><webmapx-layout></webmapx-layout></webmapx-map>`;
2564
+ let l = c.querySelector("webmapx-map"), u = n.map, { engine: d, tools: f, locale: p, plugins: m, ...h } = n, g = o.length > 0 ? qe(o) : typeof f == "object" && !Array.isArray(f) ? f : void 0, _ = Ge({
2565
+ ...h,
2557
2566
  map: {
2558
2567
  type: i,
2559
2568
  center: [0, 0],
2560
2569
  zoom: 2,
2561
- ...l
2562
- }
2570
+ ...u
2571
+ },
2572
+ ...g ? { tools: g } : {}
2563
2573
  }, "WebMapX.mount");
2564
- c.setConfig(u);
2565
- let d = c.querySelector("webmapx-layout");
2566
- if (d && d.childElementCount === 0 && n.tools) {
2574
+ l.setConfig(_);
2575
+ let v = l.querySelector("webmapx-layout");
2576
+ if (v && v.childElementCount === 0) {
2567
2577
  let { buildLayoutFromConfig: e } = await import("./dynamic-layout-DmLc5_yX.js");
2568
- e(d, n.tools);
2578
+ e(v, g ?? _.tools);
2569
2579
  }
2570
- let f = await c.getAdapterAsync?.();
2571
- if (!f) {
2580
+ let y = await l.getAdapterAsync?.();
2581
+ if (!y) {
2572
2582
  console.error("[webmapx] Adapter not available — check engine config.");
2573
2583
  return;
2574
2584
  }
2575
- let p = l?.style ?? Ke, m = {
2576
- center: l?.center ?? [0, 0],
2577
- zoom: l?.zoom ?? 2,
2578
- ...l?.bearing == null ? {} : { bearing: l.bearing },
2579
- ...l?.pitch == null ? {} : { pitch: l.pitch },
2580
- ...l?.minZoom == null ? {} : { minZoom: l.minZoom },
2581
- ...l?.maxZoom == null ? {} : { maxZoom: l.maxZoom },
2582
- ...typeof p == "string" ? { styleUrl: p } : { style: p }
2585
+ let b = u?.style ?? Ke, x = {
2586
+ center: u?.center ?? [0, 0],
2587
+ zoom: u?.zoom ?? 2,
2588
+ ...u?.bearing == null ? {} : { bearing: u.bearing },
2589
+ ...u?.pitch == null ? {} : { pitch: u.pitch },
2590
+ ...u?.minZoom == null ? {} : { minZoom: u.minZoom },
2591
+ ...u?.maxZoom == null ? {} : { maxZoom: u.maxZoom },
2592
+ ...typeof b == "string" ? { styleUrl: b } : { style: b }
2583
2593
  };
2584
- f.initialize(e.replace(/^#/, ""), m);
2594
+ y.initialize(e.replace(/^#/, ""), x);
2585
2595
  }
2586
2596
  };
2587
2597
  //#endregion
2588
- export { qe as WebMapX, e as WebmapxBaseTool, t as WebmapxPluginTool, W as changeLocale, H as i18n, ve as t };
2598
+ export { Je as WebMapX, e as WebmapxBaseTool, t as WebmapxPluginTool, W as changeLocale, H as i18n, ve as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edugis-org/webmapx",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "A modular web map UI with built-in adapters for MapLibre, OpenLayers, Leaflet, and Cesium.",
5
5
  "license": "ISC",
6
6
  "author": "Anne Blankert",