@edugis-org/webmapx 0.1.5 → 0.1.6
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-B3cuq_hG.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.6/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-B3cuq_hG.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.6/src/locales";
|
|
1302
1302
|
async function W(e) {
|
|
1303
1303
|
if (H.hasResourceBundle(e, "webmapx")) {
|
|
1304
1304
|
await H.changeLanguage(e);
|
|
@@ -2536,53 +2536,62 @@ 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
|
+
position: "top-left",
|
|
2544
|
+
items: e.map((e) => ({ tool: e }))
|
|
2545
|
+
} };
|
|
2546
|
+
}
|
|
2547
|
+
var Je = class {
|
|
2540
2548
|
static async mount(e, t) {
|
|
2541
2549
|
let n = typeof t.config == "string" ? await fetch(t.config).then((e) => {
|
|
2542
2550
|
if (!e.ok) throw Error(`[webmapx] Failed to load config: ${t.config}`);
|
|
2543
2551
|
return e.json();
|
|
2544
2552
|
}) : t.config;
|
|
2545
2553
|
await _e();
|
|
2546
|
-
let i = n.engine ?? "maplibre";
|
|
2554
|
+
let i = n.engine ?? "maplibre", o = Array.isArray(n.tools) ? n.tools : [];
|
|
2547
2555
|
await Promise.all([
|
|
2548
2556
|
r(i),
|
|
2549
|
-
a(
|
|
2557
|
+
a(o),
|
|
2550
2558
|
n.plugins?.length ? s(n.plugins) : Promise.resolve()
|
|
2551
2559
|
]), n.locale && n.locale !== "en" && await W(n.locale);
|
|
2552
|
-
let
|
|
2553
|
-
if (!
|
|
2554
|
-
|
|
2555
|
-
let
|
|
2556
|
-
...
|
|
2560
|
+
let c = document.querySelector(e);
|
|
2561
|
+
if (!c) throw Error(`[webmapx] Mount target not found: "${e}"`);
|
|
2562
|
+
c.innerHTML = `<webmapx-map adapter="${i}"><webmapx-layout></webmapx-layout></webmapx-map>`;
|
|
2563
|
+
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({
|
|
2564
|
+
...h,
|
|
2557
2565
|
map: {
|
|
2558
2566
|
type: i,
|
|
2559
2567
|
center: [0, 0],
|
|
2560
2568
|
zoom: 2,
|
|
2561
|
-
...
|
|
2562
|
-
}
|
|
2569
|
+
...u
|
|
2570
|
+
},
|
|
2571
|
+
...g ? { tools: g } : {}
|
|
2563
2572
|
}, "WebMapX.mount");
|
|
2564
|
-
|
|
2565
|
-
let
|
|
2566
|
-
if (
|
|
2573
|
+
l.setConfig(_);
|
|
2574
|
+
let v = l.querySelector("webmapx-layout");
|
|
2575
|
+
if (v && v.childElementCount === 0) {
|
|
2567
2576
|
let { buildLayoutFromConfig: e } = await import("./dynamic-layout-DmLc5_yX.js");
|
|
2568
|
-
e(
|
|
2577
|
+
e(v, g ?? _.tools);
|
|
2569
2578
|
}
|
|
2570
|
-
let
|
|
2571
|
-
if (!
|
|
2579
|
+
let y = await l.getAdapterAsync?.();
|
|
2580
|
+
if (!y) {
|
|
2572
2581
|
console.error("[webmapx] Adapter not available — check engine config.");
|
|
2573
2582
|
return;
|
|
2574
2583
|
}
|
|
2575
|
-
let
|
|
2576
|
-
center:
|
|
2577
|
-
zoom:
|
|
2578
|
-
...
|
|
2579
|
-
...
|
|
2580
|
-
...
|
|
2581
|
-
...
|
|
2582
|
-
...typeof
|
|
2584
|
+
let b = u?.style ?? Ke, x = {
|
|
2585
|
+
center: u?.center ?? [0, 0],
|
|
2586
|
+
zoom: u?.zoom ?? 2,
|
|
2587
|
+
...u?.bearing == null ? {} : { bearing: u.bearing },
|
|
2588
|
+
...u?.pitch == null ? {} : { pitch: u.pitch },
|
|
2589
|
+
...u?.minZoom == null ? {} : { minZoom: u.minZoom },
|
|
2590
|
+
...u?.maxZoom == null ? {} : { maxZoom: u.maxZoom },
|
|
2591
|
+
...typeof b == "string" ? { styleUrl: b } : { style: b }
|
|
2583
2592
|
};
|
|
2584
|
-
|
|
2593
|
+
y.initialize(e.replace(/^#/, ""), x);
|
|
2585
2594
|
}
|
|
2586
2595
|
};
|
|
2587
2596
|
//#endregion
|
|
2588
|
-
export {
|
|
2597
|
+
export { Je as WebMapX, e as WebmapxBaseTool, t as WebmapxPluginTool, W as changeLocale, H as i18n, ve as t };
|