@edugis-org/webmapx 0.1.15 → 0.2.0
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/{alert-C_G5X6J8.js → alert-CM5EIQzP.js} +28 -30
- package/dist-lib/{attribution-format-B4f05_u0.js → attribution-format-CZg2WjHO.js} +1 -1
- package/dist-lib/{button-BlZd3WPH.js → button-B_8TR-jN.js} +34 -38
- package/dist-lib/{checkbox-DB4oPyyw.js → checkbox-DOopjfpt.js} +25 -29
- package/dist-lib/{chunk.36O46B5H-km1dakSW.js → chunk.36O46B5H-EYkf8iaY.js} +8 -8
- package/dist-lib/{chunk.3RPBFEDE-Cxq6VVR6.js → chunk.3RPBFEDE-DC091CnT.js} +1 -1
- package/dist-lib/{chunk.5JY5FUCG-CYkzbQXS.js → chunk.5JY5FUCG-BmZ-LXEt.js} +324 -306
- package/dist-lib/{chunk.AJ3ENQ5C-DXVGX5Dn.js → chunk.AJ3ENQ5C-BhSO747I.js} +22 -25
- package/dist-lib/chunk.NYIIDP5N-DoNij0Gf.js +99 -0
- package/dist-lib/{chunk.SI4ACBFK-CLb9VfMG.js → chunk.SI4ACBFK-CdJVQctt.js} +1 -1
- package/dist-lib/{chunk.YHLNUJ7P-ByKy0MKm.js → chunk.YHLNUJ7P-DINaI4pI.js} +22 -24
- package/dist-lib/{decorate-CKr8yG1g.js → decorate-DNmmPsJp.js} +1 -1
- package/dist-lib/decorators-d8E4nZJy.js +624 -0
- package/dist-lib/{divider-BOFbR_Ny.js → divider-Ly2UhLd1.js} +6 -7
- package/dist-lib/{icon-CBNpO1lq.js → icon-DIjRqLFJ.js} +1 -1
- package/dist-lib/{icon-button-B5rXu3Gg.js → icon-button-C5K3NZWf.js} +39 -42
- package/dist-lib/{input-B212BH6L.js → input-DUaeAHt8.js} +63 -49
- package/dist-lib/{option-BQN9Zz_8.js → option-LnK7BxuV.js} +56 -59
- package/dist-lib/{spinner-DdcBaa3z.js → spinner-D_cltutw.js} +2 -2
- package/dist-lib/{toast-Bq2PmEpm.js → toast-DDqkINxT.js} +1 -1
- package/dist-lib/{tooltip-CBGOiZwJ.js → tooltip-C86FhPFx.js} +26 -27
- package/dist-lib/{webmapx-3d-tool-CKoLGMpk.js → webmapx-3d-tool-DXzN9Tha.js} +6 -7
- package/dist-lib/{webmapx-base-tool-Bc9Wz0yA.js → webmapx-base-tool-idjVnrFA.js} +8 -8
- package/dist-lib/{webmapx-config-edit-tool-7265_DNz.js → webmapx-config-edit-tool-B14KD1ak.js} +21 -22
- package/dist-lib/{webmapx-coordinates-tool-CSwh6fBU.js → webmapx-coordinates-tool-D57LfNy6.js} +25 -26
- package/dist-lib/{webmapx-core-bundle-Q6mWOib1.js → webmapx-core-bundle-C4M7AiLh.js} +726 -723
- package/dist-lib/{webmapx-draw-tool-6QRr5Gip.js → webmapx-draw-tool-utv2v3LN.js} +345 -325
- package/dist-lib/{webmapx-geolocation-tool-qxN5aaVB.js → webmapx-geolocation-tool-BIEqZkMX.js} +27 -28
- package/dist-lib/{webmapx-import-layer-tool-tJ374qHR.js → webmapx-import-layer-tool-DcFxtRJN.js} +18 -19
- package/dist-lib/{webmapx-info-tool-C3txgv3v.js → webmapx-info-tool-DDrllfth.js} +69 -70
- package/dist-lib/{webmapx-language-osmvector-jQzTOPU1.js → webmapx-language-osmvector-D_OP-fC3.js} +8 -9
- package/dist-lib/{webmapx-measure-tool-Cxxrzgdf.js → webmapx-measure-tool-D-6STy8v.js} +33 -34
- package/dist-lib/{webmapx-modal-tool-DQVHNXqX.js → webmapx-modal-tool-CftNio2w.js} +10 -10
- package/dist-lib/{webmapx-plugin-tool-BNZ61x6s.js → webmapx-plugin-tool-CGwliIUs.js} +5 -6
- package/dist-lib/{webmapx-print-tool-BDOTbS6u.js → webmapx-print-tool-DVL_0Hqz.js} +55 -56
- package/dist-lib/{webmapx-search-tool-CHlsE2Wx.js → webmapx-search-tool-D6y6WT8q.js} +13 -14
- package/dist-lib/{webmapx-settings-B0AT9Vjn.js → webmapx-settings--mFVPZsD.js} +41 -45
- package/dist-lib/{webmapx-truearea-tool-dxSgcbOj.js → webmapx-truearea-tool-nQzVCTAC.js} +31 -32
- package/dist-lib/{webmapx-view-mode-tool-DVSMakdh.js → webmapx-view-mode-tool-CQI54rFj.js} +11 -12
- package/dist-lib/webmapx.css +1 -1
- package/dist-lib/webmapx.js +22 -19
- package/package.json +1 -1
- package/dist-lib/chunk.NYIIDP5N-B4UCI-rQ.js +0 -34
package/dist-lib/{webmapx-geolocation-tool-qxN5aaVB.js → webmapx-geolocation-tool-BIEqZkMX.js}
RENAMED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import { customElement as c, property as l, state as u } from "lit/decorators.js";
|
|
1
|
+
import { a as e, h as t, i as n, o as r, p as i } from "./decorators-d8E4nZJy.js";
|
|
2
|
+
import { r as a, t as o } from "./decorate-DNmmPsJp.js";
|
|
3
|
+
import { t as s } from "./webmapx-base-tool-idjVnrFA.js";
|
|
4
|
+
import "./button-B_8TR-jN.js";
|
|
5
|
+
import "./input-DUaeAHt8.js";
|
|
6
|
+
import "./spinner-D_cltutw.js";
|
|
7
|
+
import "./icon-button-C5K3NZWf.js";
|
|
8
|
+
import { a as c, i as l, t as u } from "./zip.js-DVhmtjxZ.js";
|
|
10
9
|
//#region src/components/webmapx-geolocation-tool.ts
|
|
11
10
|
var d, f = "webmapx-geolocation-tracks", p = "webmapx-geolocation-track-last-id";
|
|
12
11
|
function m() {
|
|
@@ -81,7 +80,7 @@ function y(e, t, n) {
|
|
|
81
80
|
let o = t.accuracy / e.accuracy;
|
|
82
81
|
return o > 2.5 ? null : i <= e.accuracy + t.accuracy && o <= 1 ? t : a > Math.max(300, n * 4) ? null : t;
|
|
83
82
|
}
|
|
84
|
-
var b = class extends
|
|
83
|
+
var b = class extends s {
|
|
85
84
|
static {
|
|
86
85
|
d = this;
|
|
87
86
|
}
|
|
@@ -113,7 +112,7 @@ var b = class extends n {
|
|
|
113
112
|
this.boundReacquireWakeLock = () => d.reacquireWakeLockIfNeeded();
|
|
114
113
|
}
|
|
115
114
|
static {
|
|
116
|
-
this.styles =
|
|
115
|
+
this.styles = t`
|
|
117
116
|
:host {
|
|
118
117
|
display: block;
|
|
119
118
|
box-sizing: border-box;
|
|
@@ -173,8 +172,8 @@ var b = class extends n {
|
|
|
173
172
|
disconnectedCallback() {
|
|
174
173
|
this.panelElement?.removeEventListener("webmapx-panel-close", this.boundHandlePanelClose), this.panelElement = null, this.panelLinked = !1, super.disconnectedCallback();
|
|
175
174
|
}
|
|
176
|
-
onMapAttached(
|
|
177
|
-
this.adapter =
|
|
175
|
+
onMapAttached(e) {
|
|
176
|
+
this.adapter = e, this.mapElement = a(this), this.incrementSharedState(), this.panelLinked && this.mapElement && (this.mapElement.addEventListener("webmapx-tool-select", this.boundHandleToolSelect), this.mapElement.addEventListener("webmapx-tool-activated", this.boundHandleToolActivated));
|
|
178
177
|
}
|
|
179
178
|
onMapDetached() {
|
|
180
179
|
this.active && (this.hidden = !0, this.stopTracking()), this.releaseSharedState(), this.mapElement && (this.mapElement.removeEventListener("webmapx-tool-select", this.boundHandleToolSelect), this.mapElement.removeEventListener("webmapx-tool-activated", this.boundHandleToolActivated)), this.adapter = null, this.mapElement = null;
|
|
@@ -623,11 +622,11 @@ var b = class extends n {
|
|
|
623
622
|
};
|
|
624
623
|
}
|
|
625
624
|
render() {
|
|
626
|
-
return
|
|
625
|
+
return i`
|
|
627
626
|
<div class="tool-content">
|
|
628
627
|
<div class="title">
|
|
629
628
|
Location
|
|
630
|
-
${this.status === "locating" ?
|
|
629
|
+
${this.status === "locating" ? i`<sl-spinner></sl-spinner>` : ""}
|
|
631
630
|
<sl-icon-button
|
|
632
631
|
name="box-arrow-up"
|
|
633
632
|
label="Export tracked points"
|
|
@@ -654,7 +653,7 @@ var b = class extends n {
|
|
|
654
653
|
@sl-request-close=${() => {
|
|
655
654
|
this.exportDialogOpen = !1, this.exportFilenameStep = !1;
|
|
656
655
|
}}>
|
|
657
|
-
${this.exportFilenameStep ?
|
|
656
|
+
${this.exportFilenameStep ? i`
|
|
658
657
|
<div style="display:flex; align-items:center; gap:0.4rem;">
|
|
659
658
|
<span>Filename</span>
|
|
660
659
|
<sl-input style="flex:1;" size="small" .value=${this.exportFilename} aria-label="Export filename"
|
|
@@ -670,7 +669,7 @@ var b = class extends n {
|
|
|
670
669
|
this.exportFilenameStep = !1;
|
|
671
670
|
}}>Back</sl-button>
|
|
672
671
|
</div>
|
|
673
|
-
` :
|
|
672
|
+
` : i`
|
|
674
673
|
<p>Save the recorded GPS tracks as GeoJSON, or add them to the map.</p>
|
|
675
674
|
<p>${this.storedPointCount} point(s) stored.</p>
|
|
676
675
|
<label style="display:flex; align-items:center; gap:0.4rem; margin-bottom:0.5rem;">
|
|
@@ -696,10 +695,10 @@ var b = class extends n {
|
|
|
696
695
|
this.exportFilename = `gps-tracks-${t}`, this.exportFilenameStep = !0;
|
|
697
696
|
}
|
|
698
697
|
async handleExportSaveFiles() {
|
|
699
|
-
let { points: e, lines: t } = _(m()), n = this.exportFilename.trim() || "gps-tracks",
|
|
700
|
-
await
|
|
701
|
-
let
|
|
702
|
-
await
|
|
698
|
+
let { points: e, lines: t } = _(m()), n = this.exportFilename.trim() || "gps-tracks", r = new u(new l("application/zip"));
|
|
699
|
+
await r.add("gps-track-points.geojson", new c(JSON.stringify(e, null, 2))), await r.add("gps-track-lines.geojson", new c(JSON.stringify(t, null, 2)));
|
|
700
|
+
let i = this.buildTracksStyleConfig("gps-track-lines.geojson", "gps-track-points.geojson");
|
|
701
|
+
await r.add("style.json", new c(JSON.stringify(i, null, 2))), this.downloadBlob(await r.close(), `${n}.zip`), this.eraseAfterExport && this.eraseStoredTracks(), this.exportFilenameStep = !1, this.exportDialogOpen = !1;
|
|
703
702
|
}
|
|
704
703
|
buildTracksStyleConfig(e, t) {
|
|
705
704
|
return {
|
|
@@ -765,24 +764,24 @@ var b = class extends n {
|
|
|
765
764
|
r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
|
|
766
765
|
}
|
|
767
766
|
};
|
|
768
|
-
|
|
767
|
+
o([e({
|
|
769
768
|
type: Boolean,
|
|
770
769
|
attribute: "watch"
|
|
771
|
-
})], b.prototype, "watch", void 0),
|
|
770
|
+
})], b.prototype, "watch", void 0), o([e({
|
|
772
771
|
type: Boolean,
|
|
773
772
|
attribute: "high-accuracy"
|
|
774
|
-
})], b.prototype, "highAccuracy", void 0),
|
|
773
|
+
})], b.prototype, "highAccuracy", void 0), o([e({
|
|
775
774
|
type: Number,
|
|
776
775
|
attribute: "timeout"
|
|
777
|
-
})], b.prototype, "timeout", void 0),
|
|
776
|
+
})], b.prototype, "timeout", void 0), o([e({
|
|
778
777
|
type: Number,
|
|
779
778
|
attribute: "max-age"
|
|
780
|
-
})], b.prototype, "maxAge", void 0),
|
|
779
|
+
})], b.prototype, "maxAge", void 0), o([e({ type: Number })], b.prototype, "zoom", void 0), o([e({
|
|
781
780
|
type: Boolean,
|
|
782
781
|
attribute: "follow"
|
|
783
|
-
})], b.prototype, "follow", void 0),
|
|
782
|
+
})], b.prototype, "follow", void 0), o([e({
|
|
784
783
|
type: Boolean,
|
|
785
784
|
reflect: !0
|
|
786
|
-
})], b.prototype, "active", void 0),
|
|
785
|
+
})], b.prototype, "active", void 0), o([n()], b.prototype, "status", void 0), o([n()], b.prototype, "message", void 0), o([n()], b.prototype, "lastUpdate", void 0), o([n()], b.prototype, "exportDialogOpen", void 0), o([n()], b.prototype, "storedPointCount", void 0), o([n()], b.prototype, "exportFilenameStep", void 0), o([n()], b.prototype, "exportFilename", void 0), o([n()], b.prototype, "eraseAfterExport", void 0), b = d = o([r("webmapx-geolocation-tool")], b);
|
|
787
786
|
//#endregion
|
|
788
787
|
export { b as WebmapxGeolocationTool, y as evaluateGeolocationFix };
|
package/dist-lib/{webmapx-import-layer-tool-tJ374qHR.js → webmapx-import-layer-tool-DcFxtRJN.js}
RENAMED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { customElement as o, state as s } from "lit/decorators.js";
|
|
1
|
+
import { h as e, i as t, o as n, p as r } from "./decorators-d8E4nZJy.js";
|
|
2
|
+
import { r as i, t as a } from "./decorate-DNmmPsJp.js";
|
|
3
|
+
import { t as o } from "./webmapx-base-tool-idjVnrFA.js";
|
|
4
|
+
import { discoverLayers as s } from "./layer-discovery-DFP-WHAh.js";
|
|
6
5
|
//#region src/components/webmapx-import-layer-tool.ts
|
|
7
|
-
var c = class extends
|
|
6
|
+
var c = class extends o {
|
|
8
7
|
constructor(...e) {
|
|
9
8
|
super(...e), this.active = !1, this.mapElement = null, this.url = "", this.discovering = !1, this.results = [], this.selected = /* @__PURE__ */ new Set(), this.error = null, this.filterText = "", this.catalog = [], this.fileDropActive = !1, this.fileImporting = !1, this.discoverySeq = 0;
|
|
10
9
|
}
|
|
11
10
|
static {
|
|
12
|
-
this.styles =
|
|
11
|
+
this.styles = e`
|
|
13
12
|
:host { display: block; width: 100%; pointer-events: auto; }
|
|
14
13
|
:host([hidden]) { display: none !important; }
|
|
15
14
|
.container { width: 100%; color: var(--color-text-primary); box-sizing: border-box; padding: var(--webmapx-tool-padding, 0); }
|
|
@@ -44,8 +43,8 @@ var c = class extends n {
|
|
|
44
43
|
input[type="file"] { display: none; }
|
|
45
44
|
`;
|
|
46
45
|
}
|
|
47
|
-
onMapAttached(
|
|
48
|
-
super.onMapAttached(
|
|
46
|
+
onMapAttached(e) {
|
|
47
|
+
super.onMapAttached(e), this.adapter = e, this.mapElement = i(this);
|
|
49
48
|
}
|
|
50
49
|
onMapDetached() {
|
|
51
50
|
this.adapter = null, this.mapElement = null, super.onMapDetached();
|
|
@@ -64,7 +63,7 @@ var c = class extends n {
|
|
|
64
63
|
let t = ++this.discoverySeq;
|
|
65
64
|
this.discovering = !0, this.error = null, this.results = [], this.catalog = [], this.selected = /* @__PURE__ */ new Set(), this.filterText = "";
|
|
66
65
|
try {
|
|
67
|
-
let n = await
|
|
66
|
+
let n = await s(e);
|
|
68
67
|
if (t !== this.discoverySeq) return;
|
|
69
68
|
this.results = n.layers, this.catalog = n.catalog ?? [], this.selected = /* @__PURE__ */ new Set(), n.layers.length === 0 && this.catalog.length === 0 && (this.error = "No services discovered at this URL.");
|
|
70
69
|
} catch (e) {
|
|
@@ -142,7 +141,7 @@ var c = class extends n {
|
|
|
142
141
|
e.dataTransfer?.types.includes("Files") && (e.preventDefault(), e.stopPropagation(), e.dataTransfer.dropEffect = "copy", this.fileDropActive = !0);
|
|
143
142
|
}
|
|
144
143
|
render() {
|
|
145
|
-
return
|
|
144
|
+
return r`
|
|
146
145
|
<div class="container tool-content">
|
|
147
146
|
<div class="section-title">From URL</div>
|
|
148
147
|
<div class="urlbox">
|
|
@@ -167,16 +166,16 @@ var c = class extends n {
|
|
|
167
166
|
<sl-button size="small" ?loading=${this.discovering} ?disabled=${this.discovering} @click="${() => this.handleDiscover()}">Discover</sl-button>
|
|
168
167
|
</div>
|
|
169
168
|
|
|
170
|
-
${this.error ?
|
|
169
|
+
${this.error ? r`<div class="error">${this.error}</div>` : ""}
|
|
171
170
|
|
|
172
|
-
${this.catalog.length === 0 ? "" :
|
|
171
|
+
${this.catalog.length === 0 ? "" : r`
|
|
173
172
|
<div class="results">
|
|
174
173
|
<ul>
|
|
175
|
-
${this.catalog.map((e) =>
|
|
174
|
+
${this.catalog.map((e) => r`
|
|
176
175
|
<li class="result-item" @click="${() => this.openCatalogEntry(e)}" style="cursor:pointer;">
|
|
177
176
|
<div style="flex:1; min-width:0;">
|
|
178
177
|
<div style="white-space:normal; word-break:break-word;" title="${e.name}">${e.kind === "folder" ? "📁" : "🗺"} ${e.name}</div>
|
|
179
|
-
${e.type ?
|
|
178
|
+
${e.type ? r`<div class="meta">${e.type}</div>` : ""}
|
|
180
179
|
</div>
|
|
181
180
|
</li>
|
|
182
181
|
`)}
|
|
@@ -184,7 +183,7 @@ var c = class extends n {
|
|
|
184
183
|
</div>
|
|
185
184
|
`}
|
|
186
185
|
|
|
187
|
-
${this.results.length === 0 ? "" :
|
|
186
|
+
${this.results.length === 0 ? "" : r`
|
|
188
187
|
<input
|
|
189
188
|
type="text"
|
|
190
189
|
class="filter"
|
|
@@ -202,7 +201,7 @@ var c = class extends n {
|
|
|
202
201
|
</div>
|
|
203
202
|
<div class="results">
|
|
204
203
|
<ul>
|
|
205
|
-
${this.filteredResults.map((e) =>
|
|
204
|
+
${this.filteredResults.map((e) => r`
|
|
206
205
|
<li class="result-item">
|
|
207
206
|
<sl-checkbox
|
|
208
207
|
.checked=${this.selected.has(e)}
|
|
@@ -211,7 +210,7 @@ var c = class extends n {
|
|
|
211
210
|
<div style="flex:1; min-width:0;">
|
|
212
211
|
<div style="white-space:normal; word-break:break-word;" title="${e.title}">${e.title}</div>
|
|
213
212
|
<div class="meta">${e.serviceType}</div>
|
|
214
|
-
${e.abstract ?
|
|
213
|
+
${e.abstract ? r`<div class="meta">${e.abstract}</div>` : ""}
|
|
215
214
|
</div>
|
|
216
215
|
</li>
|
|
217
216
|
`)}
|
|
@@ -245,6 +244,6 @@ var c = class extends n {
|
|
|
245
244
|
`;
|
|
246
245
|
}
|
|
247
246
|
};
|
|
248
|
-
|
|
247
|
+
a([t()], c.prototype, "url", void 0), a([t()], c.prototype, "discovering", void 0), a([t()], c.prototype, "results", void 0), a([t()], c.prototype, "selected", void 0), a([t()], c.prototype, "error", void 0), a([t()], c.prototype, "filterText", void 0), a([t()], c.prototype, "catalog", void 0), a([t()], c.prototype, "fileDropActive", void 0), a([t()], c.prototype, "fileImporting", void 0), c = a([n("webmapx-import-layer-tool")], c);
|
|
249
248
|
//#endregion
|
|
250
249
|
export { c as WebmapxImportLayerTool };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import { customElement as s, state as c } from "lit/decorators.js";
|
|
1
|
+
import { c as e, h as t, i as n, o as r, p as i } from "./decorators-d8E4nZJy.js";
|
|
2
|
+
import { t as a } from "./decorate-DNmmPsJp.js";
|
|
3
|
+
import { t as o } from "./webmapx-base-tool-idjVnrFA.js";
|
|
4
|
+
import "./icon-DIjRqLFJ.js";
|
|
5
|
+
import "./spinner-D_cltutw.js";
|
|
6
|
+
import { t as s } from "./throttle-BeneRNYK.js";
|
|
7
|
+
import { t as c } from "./wms-feature-info-C0RVMEQC.js";
|
|
9
8
|
//#region src/components/webmapx-info-tool.ts
|
|
10
|
-
var l = "webmapx-info-pin", u = 8, d = 120, f = 4, p = 6, m = class extends
|
|
9
|
+
var l = "webmapx-info-pin", u = 8, d = 120, f = 4, p = 6, m = class extends o {
|
|
11
10
|
constructor(...e) {
|
|
12
|
-
super(...e), this.active = !1, this.features = [], this.loading = !1, this.mode = "hover", this.pinnedLocation = null, this.pinnedPixel = null, this.pinMarkerAdded = !1, this.unsubClick = null, this.unsubPointerMove = null, this.throttledHoverQuery =
|
|
11
|
+
super(...e), this.active = !1, this.features = [], this.loading = !1, this.mode = "hover", this.pinnedLocation = null, this.pinnedPixel = null, this.pinMarkerAdded = !1, this.unsubClick = null, this.unsubPointerMove = null, this.throttledHoverQuery = s(async (e, t) => {
|
|
13
12
|
if (this.mode !== "hover" || !this.active || !this.adapter) return;
|
|
14
13
|
let n;
|
|
15
14
|
try {
|
|
@@ -27,7 +26,7 @@ var l = "webmapx-info-pin", u = 8, d = 120, f = 4, p = 6, m = class extends t {
|
|
|
27
26
|
}, d);
|
|
28
27
|
}
|
|
29
28
|
static {
|
|
30
|
-
this.styles =
|
|
29
|
+
this.styles = t`
|
|
31
30
|
:host {
|
|
32
31
|
display: block;
|
|
33
32
|
pointer-events: auto;
|
|
@@ -258,40 +257,40 @@ var l = "webmapx-info-pin", u = 8, d = 120, f = 4, p = 6, m = class extends t {
|
|
|
258
257
|
}
|
|
259
258
|
async queryGFILayers(e, t) {
|
|
260
259
|
if (!this.adapter) return [];
|
|
261
|
-
let n = this.adapter.store.getState().mapLayers ?? {},
|
|
262
|
-
west: t[0] -
|
|
263
|
-
south: t[1] -
|
|
264
|
-
east: t[0] +
|
|
265
|
-
north: t[1] +
|
|
266
|
-
},
|
|
260
|
+
let n = this.adapter.store.getState().mapLayers ?? {}, r = 128 * (360 / (256 * 2 ** (this.adapter.getViewportState()?.zoom ?? 0))), i = {
|
|
261
|
+
west: t[0] - r,
|
|
262
|
+
south: t[1] - r,
|
|
263
|
+
east: t[0] + r,
|
|
264
|
+
north: t[1] + r
|
|
265
|
+
}, a = [];
|
|
267
266
|
return await Promise.all(Object.entries(n).map(async ([e, t]) => {
|
|
268
|
-
let n = t,
|
|
269
|
-
if (
|
|
270
|
-
let t = new URL(
|
|
267
|
+
let n = t, r = typeof n?.getFeatureInfoUrl == "string" ? n.getFeatureInfoUrl : null;
|
|
268
|
+
if (r) try {
|
|
269
|
+
let t = new URL(r), o = (e) => {
|
|
271
270
|
for (let [n, r] of t.searchParams) if (n.toLowerCase() === e) return r;
|
|
272
271
|
return null;
|
|
273
|
-
},
|
|
272
|
+
}, s = await c({
|
|
274
273
|
sourceConfig: {
|
|
275
274
|
id: e,
|
|
276
275
|
type: "raster",
|
|
277
276
|
service: "wms",
|
|
278
|
-
url:
|
|
279
|
-
version:
|
|
280
|
-
layers:
|
|
277
|
+
url: r,
|
|
278
|
+
version: o("version") ?? "1.1.1",
|
|
279
|
+
layers: o("layers") ?? o("query_layers") ?? "",
|
|
281
280
|
format: typeof n.getFeatureInfoFormat == "string" ? n.getFeatureInfoFormat : "application/json",
|
|
282
|
-
crs:
|
|
281
|
+
crs: o("crs") ?? o("srs") ?? "EPSG:3857"
|
|
283
282
|
},
|
|
284
283
|
layerId: e,
|
|
285
284
|
layerTitle: typeof n.label == "string" ? n.label : e,
|
|
286
|
-
bounds:
|
|
285
|
+
bounds: i,
|
|
287
286
|
containerWidth: 256,
|
|
288
287
|
containerHeight: 256,
|
|
289
288
|
pixelX: 128,
|
|
290
289
|
pixelY: 128
|
|
291
290
|
});
|
|
292
|
-
|
|
291
|
+
a.push(...s);
|
|
293
292
|
} catch {}
|
|
294
|
-
})),
|
|
293
|
+
})), a;
|
|
295
294
|
}
|
|
296
295
|
updatePinMarker(e) {
|
|
297
296
|
this.adapter && (this.pinMarkerAdded ? this.adapter.moveMarker(l, e) : (this.adapter.addMarker(l, e, { color: "#0f62fe" }), this.pinMarkerAdded = !0));
|
|
@@ -303,33 +302,33 @@ var l = "webmapx-info-pin", u = 8, d = 120, f = 4, p = 6, m = class extends t {
|
|
|
303
302
|
this.mode = "hover", this.pinnedLocation = null, this.pinnedPixel = null, this.features = [], this.removePinMarker();
|
|
304
303
|
}
|
|
305
304
|
renderFeatures() {
|
|
306
|
-
if (this.features.length === 0) return
|
|
307
|
-
let
|
|
308
|
-
for (let
|
|
309
|
-
let n =
|
|
310
|
-
n ? n.push(
|
|
305
|
+
if (this.features.length === 0) return e;
|
|
306
|
+
let t = /* @__PURE__ */ new Map();
|
|
307
|
+
for (let e of this.features) {
|
|
308
|
+
let n = t.get(e.layerId);
|
|
309
|
+
n ? n.push(e) : t.set(e.layerId, [e]);
|
|
311
310
|
}
|
|
312
|
-
return
|
|
313
|
-
${[...
|
|
314
|
-
let n = this.adapter?.store.getState().mapLayers?.[e], r = Array.isArray(n?.sublayers) && n.sublayers.length > 1,
|
|
311
|
+
return i`
|
|
312
|
+
${[...t.entries()].map(([e, t]) => {
|
|
313
|
+
let n = this.adapter?.store.getState().mapLayers?.[e], r = Array.isArray(n?.sublayers) && n.sublayers.length > 1, a = r ? "composite" : t[0].source, o = typeof n?.featureInfoLimit == "number" ? n.featureInfoLimit : null, s = o !== null && t.length > o, c = s ? t.slice(0, o) : t, l = /* @__PURE__ */ new Map();
|
|
315
314
|
for (let e of c) {
|
|
316
315
|
let t = e.subLayerId ?? "", n = l.get(t);
|
|
317
316
|
n ? n.push(e) : l.set(t, [e]);
|
|
318
317
|
}
|
|
319
|
-
return
|
|
318
|
+
return i`
|
|
320
319
|
<div class="layer-group">
|
|
321
320
|
<div class="layer-title">
|
|
322
321
|
${t[0].layerTitle ?? e}
|
|
323
|
-
<span class="source-badge ${r ? "composite" : t[0].source}">${
|
|
322
|
+
<span class="source-badge ${r ? "composite" : t[0].source}">${a}</span>
|
|
324
323
|
</div>
|
|
325
|
-
${[...l.entries()].map(([e, t]) =>
|
|
326
|
-
${e ?
|
|
324
|
+
${[...l.entries()].map(([e, t]) => i`
|
|
325
|
+
${e ? i`<div class="sub-layer-title">
|
|
327
326
|
<span class="sub-layer-name">${e}</span>
|
|
328
|
-
${t[0].subLayerType ?
|
|
327
|
+
${t[0].subLayerType ? i`<span class="sub-layer-type">${t[0].subLayerType}</span>` : ""}
|
|
329
328
|
</div>` : ""}
|
|
330
329
|
${t.map((e) => this.renderPropsTable(e))}
|
|
331
330
|
`)}
|
|
332
|
-
${s ?
|
|
331
|
+
${s ? i`<div class="feature-limit-notice">Showing ${o} of ${t.length} features</div>` : ""}
|
|
333
332
|
</div>`;
|
|
334
333
|
})}
|
|
335
334
|
`;
|
|
@@ -347,66 +346,66 @@ var l = "webmapx-info-pin", u = 8, d = 120, f = 4, p = 6, m = class extends t {
|
|
|
347
346
|
};
|
|
348
347
|
}
|
|
349
348
|
renderPropsTable(e) {
|
|
350
|
-
let t = this.getPropertySchema(e.layerId), { translations: n, allowed: r, denied:
|
|
351
|
-
if (o._raw) return
|
|
349
|
+
let t = this.getPropertySchema(e.layerId), { translations: n, allowed: r, denied: a } = this.getAttributeMeta(e.layerId), o = e.properties;
|
|
350
|
+
if (o._raw) return i`<div class="raw-value">${o._raw}</div>`;
|
|
352
351
|
let s = [], c = /* @__PURE__ */ new Set();
|
|
353
352
|
for (let e of n) {
|
|
354
353
|
let n = e.name;
|
|
355
|
-
if (
|
|
354
|
+
if (a.has(n) || r && !r.has(n) || !(n in o) || o[n] === null || o[n] === void 0) continue;
|
|
356
355
|
c.add(n);
|
|
357
|
-
let
|
|
358
|
-
if (e.multiplier && !isNaN(parseFloat(String(e.multiplier))) && (
|
|
356
|
+
let i = o[n];
|
|
357
|
+
if (e.multiplier && !isNaN(parseFloat(String(e.multiplier))) && (i = parseFloat(String(i)) * parseFloat(String(e.multiplier))), e.decimals !== void 0 && !isNaN(parseInt(String(e.decimals)))) {
|
|
359
358
|
let t = 10 ** parseInt(String(e.decimals));
|
|
360
|
-
|
|
359
|
+
i = Math.round(parseFloat(String(i)) * t) / t;
|
|
361
360
|
}
|
|
362
361
|
if (e.valuemap && Array.isArray(e.valuemap)) {
|
|
363
|
-
let t = e.valuemap.find((e) => e.value ===
|
|
364
|
-
t && (
|
|
362
|
+
let t = e.valuemap.find((e) => e.value === i);
|
|
363
|
+
t && (i = t.label);
|
|
365
364
|
}
|
|
366
|
-
e.date && (
|
|
367
|
-
let l = e.unit && !isNaN(Number(
|
|
365
|
+
e.date && (i &&= new Date(i).toLocaleString());
|
|
366
|
+
let l = e.unit && !isNaN(Number(i)) ? e.unit : "", u = e.translation || n, d = l ? `${i}${l}` : typeof i == "object" ? JSON.stringify(i) : String(i ?? "");
|
|
368
367
|
s.push(this.renderPropRow(n, u, d, t));
|
|
369
368
|
}
|
|
370
|
-
for (let [e,
|
|
371
|
-
if (e === "_raw" || c.has(e) ||
|
|
372
|
-
let o = typeof
|
|
369
|
+
for (let [e, i] of Object.entries(o)) {
|
|
370
|
+
if (e === "_raw" || c.has(e) || a.has(e) || r && !r.has(e) || i == null || n.length > 0 && !n.find((t) => t.name === e) && r === null) continue;
|
|
371
|
+
let o = typeof i == "object" ? JSON.stringify(i) : String(i ?? "");
|
|
373
372
|
s.push(this.renderPropRow(e, e.replace(/_/g, " "), o, t));
|
|
374
373
|
}
|
|
375
|
-
return s.length === 0 ?
|
|
374
|
+
return s.length === 0 ? i`<div class="empty-hint">No properties</div>` : i`<div class="props-list">${s}</div>`;
|
|
376
375
|
}
|
|
377
376
|
renderPropRow(e, t, n, r) {
|
|
378
|
-
let
|
|
379
|
-
return
|
|
377
|
+
let a = r?.find((t) => t.name === e)?.type ?? "string", o = /^https?:\/\/\S+$/.test(n.trim()), s = /^data:image\//i.test(n), c = a === "string" ? s ? "imageURL" : o ? "linkURL" : "string" : a;
|
|
378
|
+
return i`
|
|
380
379
|
<div class="props-row">
|
|
381
380
|
<span class="props-key" title=${e}>${t}</span>
|
|
382
|
-
<span class="props-val">${(c === "create-time" || c === "update-time") && n ? new Date(Number(n)).toLocaleString() : c === "imageURL" && n ?
|
|
381
|
+
<span class="props-val">${(c === "create-time" || c === "update-time") && n ? new Date(Number(n)).toLocaleString() : c === "imageURL" && n ? i`<img src=${n} @error=${(e) => {
|
|
383
382
|
let t = e.target, n = document.createElement("span");
|
|
384
383
|
n.className = "img-error", n.textContent = "⚠ invalid image", t.replaceWith(n);
|
|
385
|
-
}}>` : c === "linkURL" && n ?
|
|
384
|
+
}}>` : c === "linkURL" && n ? i`<a href=${n} target="_blank" rel="noopener noreferrer">${n}</a>` : n.split(",").map((e, t) => t === 0 ? i`${e}` : i`,<wbr>${e}`)}</span>
|
|
386
385
|
</div>
|
|
387
386
|
`;
|
|
388
387
|
}
|
|
389
388
|
render() {
|
|
390
|
-
let
|
|
391
|
-
return
|
|
389
|
+
let t = this.mode === "pinned";
|
|
390
|
+
return i`
|
|
392
391
|
<div class="info-container">
|
|
393
|
-
<div class="mode-badge ${
|
|
394
|
-
<sl-icon name=${
|
|
395
|
-
${
|
|
396
|
-
${this.loading ?
|
|
392
|
+
<div class="mode-badge ${t ? "pinned" : ""}">
|
|
393
|
+
<sl-icon name=${t ? "pin-angle-fill" : "cursor"}></sl-icon>
|
|
394
|
+
${t ? "Pinned" : "Hover"}
|
|
395
|
+
${this.loading ? i`<sl-spinner></sl-spinner>` : e}
|
|
397
396
|
</div>
|
|
398
397
|
|
|
399
|
-
${!
|
|
398
|
+
${!t && this.features.length === 0 ? i`<p class="instructions">Move cursor over features to inspect. Click to pin and query WMS.</p>` : e}
|
|
400
399
|
|
|
401
|
-
${
|
|
400
|
+
${t && !this.loading && this.features.length === 0 ? i`<p class="empty-hint">No features at this location.</p>` : e}
|
|
402
401
|
|
|
403
402
|
${this.renderFeatures()}
|
|
404
403
|
|
|
405
|
-
${
|
|
404
|
+
${t ? i`<p class="instructions">Click same location to unpin.</p>` : e}
|
|
406
405
|
</div>
|
|
407
406
|
`;
|
|
408
407
|
}
|
|
409
408
|
};
|
|
410
|
-
|
|
409
|
+
a([n()], m.prototype, "features", void 0), a([n()], m.prototype, "loading", void 0), a([n()], m.prototype, "mode", void 0), a([n()], m.prototype, "pinnedLocation", void 0), m = a([r("webmapx-info-tool")], m);
|
|
411
410
|
//#endregion
|
|
412
411
|
export { m as WebmapxInfoTool };
|
package/dist-lib/{webmapx-language-osmvector-jQzTOPU1.js → webmapx-language-osmvector-D_OP-fC3.js}
RENAMED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import { customElement as i, property as a } from "lit/decorators.js";
|
|
1
|
+
import { a as e, h as t, o as n, p as r } from "./decorators-d8E4nZJy.js";
|
|
2
|
+
import { t as i } from "./decorate-DNmmPsJp.js";
|
|
3
|
+
import { t as a } from "./webmapx-modal-tool-CftNio2w.js";
|
|
4
|
+
import "./option-LnK7BxuV.js";
|
|
6
5
|
//#region src/components/webmapx-language-osmvector.ts
|
|
7
6
|
var o = "webmapx-language-osmvector", s = "webmapx-language-osmvector-change", c = /* @__PURE__ */ new WeakMap(), l = [
|
|
8
7
|
{
|
|
@@ -385,7 +384,7 @@ var o = "webmapx-language-osmvector", s = "webmapx-language-osmvector-change", c
|
|
|
385
384
|
label: "Toki Pona",
|
|
386
385
|
en: "Toki Pona"
|
|
387
386
|
}
|
|
388
|
-
], u = /"name(?:[:_][\w-]+)?"/, d = class extends
|
|
387
|
+
], u = /"name(?:[:_][\w-]+)?"/, d = class extends a {
|
|
389
388
|
constructor(...e) {
|
|
390
389
|
super(...e), this.toolId = "maplanguage", this.hideUi = !1, this.language = localStorage.getItem(o) ?? "browser", this.boundLanguageChangeEvent = (e) => {
|
|
391
390
|
let t = e.detail?.language;
|
|
@@ -393,7 +392,7 @@ var o = "webmapx-language-osmvector", s = "webmapx-language-osmvector-change", c
|
|
|
393
392
|
};
|
|
394
393
|
}
|
|
395
394
|
static {
|
|
396
|
-
this.styles =
|
|
395
|
+
this.styles = t`
|
|
397
396
|
:host {
|
|
398
397
|
display: block;
|
|
399
398
|
}
|
|
@@ -481,9 +480,9 @@ var o = "webmapx-language-osmvector", s = "webmapx-language-osmvector-change", c
|
|
|
481
480
|
`;
|
|
482
481
|
}
|
|
483
482
|
};
|
|
484
|
-
|
|
483
|
+
i([e({
|
|
485
484
|
type: Boolean,
|
|
486
485
|
attribute: "hide-ui"
|
|
487
|
-
})], d.prototype, "hideUi", void 0),
|
|
486
|
+
})], d.prototype, "hideUi", void 0), i([e({ type: String })], d.prototype, "language", void 0), d = i([n("webmapx-language-osmvector")], d);
|
|
488
487
|
//#endregion
|
|
489
488
|
export { d as WebmapxLanguageOsmVector };
|