@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.
package/dist-lib/{webmapx-coordinates-tool-Ca5-r3im.js → webmapx-coordinates-tool-GMfztOzE.js}
RENAMED
|
@@ -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.
|
|
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
|
}
|
package/dist-lib/webmapx.js
CHANGED
|
@@ -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-
|
|
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.
|
|
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
|
-
}
|
|
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(
|
|
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
|
|
2553
|
-
if (!
|
|
2554
|
-
|
|
2555
|
-
let
|
|
2556
|
-
...
|
|
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
|
-
...
|
|
2562
|
-
}
|
|
2570
|
+
...u
|
|
2571
|
+
},
|
|
2572
|
+
...g ? { tools: g } : {}
|
|
2563
2573
|
}, "WebMapX.mount");
|
|
2564
|
-
|
|
2565
|
-
let
|
|
2566
|
-
if (
|
|
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(
|
|
2578
|
+
e(v, g ?? _.tools);
|
|
2569
2579
|
}
|
|
2570
|
-
let
|
|
2571
|
-
if (!
|
|
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
|
|
2576
|
-
center:
|
|
2577
|
-
zoom:
|
|
2578
|
-
...
|
|
2579
|
-
...
|
|
2580
|
-
...
|
|
2581
|
-
...
|
|
2582
|
-
...typeof
|
|
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
|
-
|
|
2594
|
+
y.initialize(e.replace(/^#/, ""), x);
|
|
2585
2595
|
}
|
|
2586
2596
|
};
|
|
2587
2597
|
//#endregion
|
|
2588
|
-
export {
|
|
2598
|
+
export { Je as WebMapX, e as WebmapxBaseTool, t as WebmapxPluginTool, W as changeLocale, H as i18n, ve as t };
|