@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
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import { t as
|
|
6
|
-
import { t as
|
|
7
|
-
import {
|
|
8
|
-
import { customElement as u, property as d, state as f } from "lit/decorators.js";
|
|
1
|
+
import { a as e, c as t, h as n, i as r, o as i, p as a } from "./decorators-d8E4nZJy.js";
|
|
2
|
+
import { t as o } from "./decorate-DNmmPsJp.js";
|
|
3
|
+
import "./icon-DIjRqLFJ.js";
|
|
4
|
+
import "./button-B_8TR-jN.js";
|
|
5
|
+
import { i as s, n as c, r as l, t as u } from "./geo-calculations-DbFJAUoI.js";
|
|
6
|
+
import { t as d } from "./throttle-BeneRNYK.js";
|
|
7
|
+
import { t as f } from "./webmapx-modal-tool-CftNio2w.js";
|
|
9
8
|
//#region src/components/webmapx-measure-tool.ts
|
|
10
|
-
var p = "webmapx-measure-static-source", m = "webmapx-measure-points", h = "webmapx-measure-lines", g = "webmapx-measure-polygon", _ = "webmapx-measure-segment-labels", v = "webmapx-measure-rubberband-source", y = "webmapx-measure-rubberband-layer", b = class extends
|
|
9
|
+
var p = "webmapx-measure-static-source", m = "webmapx-measure-points", h = "webmapx-measure-lines", g = "webmapx-measure-polygon", _ = "webmapx-measure-segment-labels", v = "webmapx-measure-rubberband-source", y = "webmapx-measure-rubberband-layer", b = class extends f {
|
|
11
10
|
constructor(...e) {
|
|
12
11
|
super(...e), this.toolId = "measure", this.closeThreshold = 10, this.finishThreshold = 10, this.points = [], this.segments = [], this.totalDistanceCm = 0, this.cursorPosition = null, this.isClosed = !1, this.areaM2 = 0, this.finished = !1, this.touchMQ = window.matchMedia("(pointer: coarse)"), this.isTouchDevice = this.touchMQ.matches, this.onTouchMQChange = (e) => {
|
|
13
12
|
this.isTouchDevice = e.matches;
|
|
14
|
-
}, this.layersCreated = !1, this.throttledUpdateVisualization =
|
|
13
|
+
}, this.layersCreated = !1, this.throttledUpdateVisualization = d(() => {
|
|
15
14
|
this.doUpdateRubberbandVisualization();
|
|
16
15
|
}, 50), this.unsubClick = null, this.unsubDblClick = null, this.unsubPointerMove = null, this.unsubContextMenu = null, this.keydownHandler = null;
|
|
17
16
|
}
|
|
@@ -19,7 +18,7 @@ var p = "webmapx-measure-static-source", m = "webmapx-measure-points", h = "webm
|
|
|
19
18
|
return this.finished || this.isClosed;
|
|
20
19
|
}
|
|
21
20
|
static {
|
|
22
|
-
this.styles =
|
|
21
|
+
this.styles = n`
|
|
23
22
|
:host {
|
|
24
23
|
display: block;
|
|
25
24
|
pointer-events: auto;
|
|
@@ -474,25 +473,25 @@ var p = "webmapx-measure-static-source", m = "webmapx-measure-points", h = "webm
|
|
|
474
473
|
return (e + 3 * Math.PI) % (2 * Math.PI) - Math.PI;
|
|
475
474
|
}
|
|
476
475
|
addPoint(e) {
|
|
477
|
-
let
|
|
478
|
-
if (
|
|
479
|
-
let e =
|
|
476
|
+
let t = [...this.points, e];
|
|
477
|
+
if (t.length >= 2) {
|
|
478
|
+
let e = t[t.length - 2], n = t[t.length - 1], r = s(e, n), i = {
|
|
480
479
|
from: e,
|
|
481
|
-
to:
|
|
482
|
-
distanceCm:
|
|
480
|
+
to: n,
|
|
481
|
+
distanceCm: r
|
|
483
482
|
};
|
|
484
|
-
this.segments = [...this.segments,
|
|
483
|
+
this.segments = [...this.segments, i], this.totalDistanceCm += r;
|
|
485
484
|
}
|
|
486
|
-
this.points =
|
|
485
|
+
this.points = t, this.updateMapVisualization();
|
|
487
486
|
}
|
|
488
487
|
closePolygon() {
|
|
489
488
|
if (this.points.length < 3) return;
|
|
490
|
-
let e = this.points[this.points.length - 1],
|
|
489
|
+
let e = this.points[this.points.length - 1], t = this.points[0], n = s(e, t), r = {
|
|
491
490
|
from: e,
|
|
492
|
-
to:
|
|
493
|
-
distanceCm:
|
|
491
|
+
to: t,
|
|
492
|
+
distanceCm: n
|
|
494
493
|
};
|
|
495
|
-
this.segments = [...this.segments,
|
|
494
|
+
this.segments = [...this.segments, r], this.totalDistanceCm += n, this.areaM2 = l(this.points), this.isClosed = !0, this.cursorPosition = null, this.updateMapVisualization(), this.doUpdateRubberbandVisualization();
|
|
496
495
|
}
|
|
497
496
|
finishMeasurement() {
|
|
498
497
|
this.finished = !0, this.cursorPosition = null, this.doUpdateRubberbandVisualization();
|
|
@@ -529,38 +528,38 @@ var p = "webmapx-measure-static-source", m = "webmapx-measure-points", h = "webm
|
|
|
529
528
|
}));
|
|
530
529
|
}
|
|
531
530
|
renderSegments() {
|
|
532
|
-
return this.segments.length === 0 ?
|
|
531
|
+
return this.segments.length === 0 ? t : a`
|
|
533
532
|
<div class="segment-list">
|
|
534
|
-
${this.segments.map((e, t) =>
|
|
533
|
+
${this.segments.map((e, t) => a`
|
|
535
534
|
<div class="segment">
|
|
536
535
|
<span class="segment-label">Segment ${t + 1}</span>
|
|
537
|
-
<span class="segment-value">${
|
|
536
|
+
<span class="segment-value">${c(e.distanceCm)}</span>
|
|
538
537
|
</div>
|
|
539
538
|
`)}
|
|
540
539
|
</div>
|
|
541
540
|
`;
|
|
542
541
|
}
|
|
543
542
|
renderTotal() {
|
|
544
|
-
return this.segments.length === 0 ?
|
|
543
|
+
return this.segments.length === 0 ? t : a`
|
|
545
544
|
<div class="total-row">
|
|
546
545
|
<span>Total</span>
|
|
547
|
-
<span>${
|
|
546
|
+
<span>${c(this.totalDistanceCm)}</span>
|
|
548
547
|
</div>
|
|
549
548
|
`;
|
|
550
549
|
}
|
|
551
550
|
renderArea() {
|
|
552
|
-
return !this.isClosed || this.areaM2 === 0 ?
|
|
551
|
+
return !this.isClosed || this.areaM2 === 0 ? t : a`
|
|
553
552
|
<div class="area-row">
|
|
554
553
|
<span>Area</span>
|
|
555
|
-
<span>${
|
|
554
|
+
<span>${u(this.areaM2)}</span>
|
|
556
555
|
</div>
|
|
557
556
|
`;
|
|
558
557
|
}
|
|
559
558
|
renderInstructions() {
|
|
560
|
-
return this.isFinished ? this.isTouchDevice ?
|
|
559
|
+
return this.isFinished ? this.isTouchDevice ? a`<p class="instructions">Measurement finished. Tap Clear to start a new measurement.</p>` : a`<p class="instructions">Measurement finished. Click Clear, or click the map to start a new measurement.</p>` : this.points.length === 0 ? a`<p class="instructions">Click on the map to start measuring.</p>` : this.points.length < 3 ? a`<p class="instructions">Click to add points. Double-click, right-click or ESC to finish.</p>` : a`<p class="instructions">Click near first point to close polygon, or double-click/right-click/ESC to finish.</p>`;
|
|
561
560
|
}
|
|
562
561
|
render() {
|
|
563
|
-
return
|
|
562
|
+
return a`
|
|
564
563
|
<div class="tool-content measure-container">
|
|
565
564
|
<div class="measure-content">
|
|
566
565
|
${this.renderInstructions()}
|
|
@@ -579,12 +578,12 @@ var p = "webmapx-measure-static-source", m = "webmapx-measure-points", h = "webm
|
|
|
579
578
|
`;
|
|
580
579
|
}
|
|
581
580
|
};
|
|
582
|
-
|
|
581
|
+
o([e({
|
|
583
582
|
type: Number,
|
|
584
583
|
attribute: "close-threshold"
|
|
585
|
-
})], b.prototype, "closeThreshold", void 0),
|
|
584
|
+
})], b.prototype, "closeThreshold", void 0), o([e({
|
|
586
585
|
type: Number,
|
|
587
586
|
attribute: "finish-threshold"
|
|
588
|
-
})], b.prototype, "finishThreshold", void 0),
|
|
587
|
+
})], b.prototype, "finishThreshold", void 0), o([r()], b.prototype, "points", void 0), o([r()], b.prototype, "segments", void 0), o([r()], b.prototype, "totalDistanceCm", void 0), o([r()], b.prototype, "cursorPosition", void 0), o([r()], b.prototype, "isClosed", void 0), o([r()], b.prototype, "areaM2", void 0), o([r()], b.prototype, "finished", void 0), o([r()], b.prototype, "isTouchDevice", void 0), b = o([i("webmapx-measure-tool")], b);
|
|
589
588
|
//#endregion
|
|
590
589
|
export { b as WebmapxMeasureTool };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as n } from "./
|
|
3
|
-
import {
|
|
1
|
+
import { a as e } from "./decorators-d8E4nZJy.js";
|
|
2
|
+
import { r as t, t as n } from "./decorate-DNmmPsJp.js";
|
|
3
|
+
import { t as r } from "./webmapx-base-tool-idjVnrFA.js";
|
|
4
4
|
//#region src/components/webmapx-modal-tool.ts
|
|
5
|
-
var i = class extends
|
|
5
|
+
var i = class extends r {
|
|
6
6
|
constructor(...e) {
|
|
7
7
|
super(...e), this.isModal = !0, this._active = !1, this.registerWithToolManager = !0, this.portalContainer = null, this.toolManager = null;
|
|
8
8
|
}
|
|
@@ -13,9 +13,9 @@ var i = class extends n {
|
|
|
13
13
|
let t = this._active;
|
|
14
14
|
e !== t && (this._active = e, e ? this.onActivate() : this.onDeactivate(), this.requestUpdate("active", t));
|
|
15
15
|
}
|
|
16
|
-
onMapAttached(
|
|
17
|
-
super.onMapAttached(
|
|
18
|
-
let n =
|
|
16
|
+
onMapAttached(e) {
|
|
17
|
+
super.onMapAttached(e);
|
|
18
|
+
let n = t(this);
|
|
19
19
|
this.registerWithToolManager && n?.toolManager && (this.toolManager = n.toolManager, this.toolManager.register(this));
|
|
20
20
|
}
|
|
21
21
|
onMapDetached() {
|
|
@@ -70,13 +70,13 @@ var i = class extends n {
|
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
-
|
|
73
|
+
n([e({ type: String })], i.prototype, "label", void 0), n([e({ attribute: !1 })], i.prototype, "icon", void 0), n([e({
|
|
74
74
|
type: Boolean,
|
|
75
75
|
reflect: !0
|
|
76
|
-
})], i.prototype, "active", null),
|
|
76
|
+
})], i.prototype, "active", null), n([e({
|
|
77
77
|
type: String,
|
|
78
78
|
attribute: "render-target"
|
|
79
|
-
})], i.prototype, "renderTarget", void 0),
|
|
79
|
+
})], i.prototype, "renderTarget", void 0), n([e({
|
|
80
80
|
type: Boolean,
|
|
81
81
|
attribute: "register-with-toolmanager"
|
|
82
82
|
})], i.prototype, "registerWithToolManager", void 0);
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { customElement as r, property as i } from "lit/decorators.js";
|
|
1
|
+
import { a as e, o as t, p as n, s as r } from "./decorators-d8E4nZJy.js";
|
|
2
|
+
import { t as i } from "./decorate-DNmmPsJp.js";
|
|
4
3
|
//#region src/components/webmapx-plugin-tool.ts
|
|
5
|
-
var a = class extends
|
|
4
|
+
var a = class extends r {
|
|
6
5
|
constructor(...e) {
|
|
7
6
|
super(...e), this.toolId = "", this.pluginElement = null, this.configReadyHandler = (e) => this.handleConfigReady(e);
|
|
8
7
|
}
|
|
@@ -37,9 +36,9 @@ var a = class extends t {
|
|
|
37
36
|
this.pluginElement && !this.contains(this.pluginElement) && this.appendChild(this.pluginElement);
|
|
38
37
|
}
|
|
39
38
|
};
|
|
40
|
-
|
|
39
|
+
i([e({
|
|
41
40
|
type: String,
|
|
42
41
|
attribute: "tool-id"
|
|
43
|
-
})], a.prototype, "toolId", void 0), a =
|
|
42
|
+
})], a.prototype, "toolId", void 0), a = i([t("webmapx-plugin-tool")], a);
|
|
44
43
|
//#endregion
|
|
45
44
|
export { a as t };
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import { t as
|
|
8
|
-
import "./
|
|
9
|
-
import
|
|
10
|
-
import { customElement as c, state as l } 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 "./button-B_8TR-jN.js";
|
|
4
|
+
import "./checkbox-DOopjfpt.js";
|
|
5
|
+
import "./input-DUaeAHt8.js";
|
|
6
|
+
import "./spinner-D_cltutw.js";
|
|
7
|
+
import { i as o, r as s, t as c } from "./attribution-format-CZg2WjHO.js";
|
|
8
|
+
import { t as l } from "./webmapx-modal-tool-CftNio2w.js";
|
|
9
|
+
import "./option-LnK7BxuV.js";
|
|
11
10
|
//#region src/components/webmapx-print-tool.ts
|
|
12
11
|
var u = 210, d = 297, f = 40, p = 10, m = 50, h = 12, g = 6, _ = 96 / 25.4;
|
|
13
12
|
function v(e) {
|
|
@@ -25,12 +24,12 @@ function x(e) {
|
|
|
25
24
|
h: (y(e) ? u : d) - 2 * p
|
|
26
25
|
};
|
|
27
26
|
}
|
|
28
|
-
var S = class extends
|
|
27
|
+
var S = class extends l {
|
|
29
28
|
constructor(...e) {
|
|
30
29
|
super(...e), this.toolId = "print", this.mapTitle = "", this.format = "portrait", this.addLink = !1, this.printing = !1, this.errorMsg = "", this.zoomDelta = 0, this.printBoxEl = null, this.resizeObserver = null;
|
|
31
30
|
}
|
|
32
31
|
static {
|
|
33
|
-
this.styles =
|
|
32
|
+
this.styles = e`
|
|
34
33
|
:host { display: block; font-size: var(--sl-font-size-small); }
|
|
35
34
|
.tool-content {
|
|
36
35
|
padding: var(--webmapx-tool-panel-padding, 12px);
|
|
@@ -54,8 +53,8 @@ var S = class extends a {
|
|
|
54
53
|
`;
|
|
55
54
|
}
|
|
56
55
|
onActivate() {
|
|
57
|
-
let
|
|
58
|
-
if (!
|
|
56
|
+
let e = i(this);
|
|
57
|
+
if (!e) return;
|
|
59
58
|
this.printBoxEl = document.createElement("div"), this.printBoxEl.className = "webmapx-print-box", Object.assign(this.printBoxEl.style, {
|
|
60
59
|
position: "absolute",
|
|
61
60
|
boxSizing: "border-box",
|
|
@@ -71,8 +70,8 @@ var S = class extends a {
|
|
|
71
70
|
boxShadow: "0 0 0 9999px rgba(0,0,0,0.35)",
|
|
72
71
|
pointerEvents: "none"
|
|
73
72
|
});
|
|
74
|
-
let
|
|
75
|
-
|
|
73
|
+
let t = e.querySelector("webmapx-layout");
|
|
74
|
+
e.insertBefore(this.printBoxEl, t ?? e.firstChild), this.resizeObserver = new ResizeObserver(() => this.updateBox()), this.resizeObserver.observe(e), this.updateBox();
|
|
76
75
|
}
|
|
77
76
|
onDeactivate() {
|
|
78
77
|
this.printBoxEl?.remove(), this.printBoxEl = null, this.resizeObserver?.disconnect(), this.resizeObserver = null;
|
|
@@ -81,17 +80,17 @@ var S = class extends a {
|
|
|
81
80
|
this.updateBox();
|
|
82
81
|
}
|
|
83
82
|
updateBox() {
|
|
84
|
-
let
|
|
85
|
-
if (!this.printBoxEl || !
|
|
86
|
-
let
|
|
87
|
-
if (s <=
|
|
83
|
+
let e = i(this);
|
|
84
|
+
if (!this.printBoxEl || !e) return;
|
|
85
|
+
let t = e.clientWidth, n = e.clientHeight, r = t - 2 * f, a = n - 2 * f, o = x(this.format), s = v(o.w), c = v(o.h) - (this.mapTitle.trim() ? v(h) : 0) - (this.addLink ? v(g) : 0), l, u;
|
|
86
|
+
if (s <= r && c <= a) l = s, u = c, this.zoomDelta = 0;
|
|
88
87
|
else {
|
|
89
|
-
let e = Math.min(
|
|
88
|
+
let e = Math.min(r / s, a / c);
|
|
90
89
|
l = s * e, u = c * e, this.zoomDelta = Math.log2(s / l);
|
|
91
90
|
}
|
|
92
91
|
Object.assign(this.printBoxEl.style, {
|
|
93
|
-
left: `${(
|
|
94
|
-
top: `${(
|
|
92
|
+
left: `${(t - l) / 2}px`,
|
|
93
|
+
top: `${(n - u) / 2}px`,
|
|
95
94
|
width: `${l}px`,
|
|
96
95
|
height: `${u}px`
|
|
97
96
|
});
|
|
@@ -107,9 +106,9 @@ var S = class extends a {
|
|
|
107
106
|
}
|
|
108
107
|
}
|
|
109
108
|
async renderAndPrint() {
|
|
110
|
-
let
|
|
111
|
-
if (!
|
|
112
|
-
let
|
|
109
|
+
let e = this.adapter;
|
|
110
|
+
if (!e) throw Error("No map adapter available.");
|
|
111
|
+
let t = i(this), n = this.format, r = y(n), a = b(n), o = v(r ? d : u), s = v(r ? u : d), c = v(p), l = this.mapTitle.trim() ? v(h) : 0, f = this.addLink ? v(g) : 0, _ = a ? v(m) : 0, S = x(n), C = v(S.w), w = v(S.h) - l - f, T = t.getBoundingClientRect(), E = this.printBoxEl.getBoundingClientRect(), D = E.left - T.left, O = E.top - T.top, k = E.width, A = e.engineId === "maplibre", j = document.createElement("div");
|
|
113
112
|
if (j.id = "webmapx-print-overlay", Object.assign(j.style, {
|
|
114
113
|
position: "fixed",
|
|
115
114
|
top: "-99999px",
|
|
@@ -227,15 +226,15 @@ var S = class extends a {
|
|
|
227
226
|
})));
|
|
228
227
|
let I = () => {}, L;
|
|
229
228
|
if (A) {
|
|
230
|
-
let
|
|
231
|
-
if (!
|
|
232
|
-
let r =
|
|
229
|
+
let n = e.core?.mapInstance;
|
|
230
|
+
if (!n) throw Error("MapLibre map not initialised.");
|
|
231
|
+
let r = n.unproject([D + k / 2, O + E.height / 2]), i = n.getZoom() + Math.log2(C / k), { default: a } = await import("maplibre-gl"), o = new a.Map({
|
|
233
232
|
container: P,
|
|
234
|
-
style:
|
|
233
|
+
style: n.getStyle(),
|
|
235
234
|
center: r,
|
|
236
235
|
zoom: i,
|
|
237
|
-
bearing:
|
|
238
|
-
pitch:
|
|
236
|
+
bearing: n.getBearing(),
|
|
237
|
+
pitch: n.getPitch(),
|
|
239
238
|
interactive: !1,
|
|
240
239
|
attributionControl: !1
|
|
241
240
|
});
|
|
@@ -247,21 +246,21 @@ var S = class extends a {
|
|
|
247
246
|
}), I = () => o.remove(), L = `
|
|
248
247
|
body > * { display: none !important; }
|
|
249
248
|
#webmapx-print-overlay { display: flex !important; position: fixed !important; top: 0 !important; left: 0 !important; }
|
|
250
|
-
#${
|
|
249
|
+
#${t.id} > .webmapx-print-box { display: none !important; }`;
|
|
251
250
|
} else {
|
|
252
|
-
let e = C / k,
|
|
251
|
+
let e = C / k, n = c, r = c + l, i = T.width, a = T.height, o = O, s = i - D - k, u = a - O - E.height, d = D;
|
|
253
252
|
L = `
|
|
254
253
|
body > * { visibility: hidden !important; }
|
|
255
|
-
#${
|
|
254
|
+
#${t.id} {
|
|
256
255
|
visibility: visible !important;
|
|
257
256
|
position: fixed !important; top: 0 !important; left: 0 !important;
|
|
258
257
|
width: ${i}px !important; height: ${a}px !important;
|
|
259
258
|
transform-origin: 0 0 !important;
|
|
260
|
-
transform: translate(${
|
|
259
|
+
transform: translate(${n}px,${r}px) scale(${e}) translate(${-D}px,${-O}px) !important;
|
|
261
260
|
clip-path: inset(${o}px ${s}px ${u}px ${d}px) !important;
|
|
262
261
|
}
|
|
263
|
-
#${
|
|
264
|
-
#${
|
|
262
|
+
#${t.id} * { visibility: visible !important; }
|
|
263
|
+
#${t.id} > .webmapx-print-box { display: none !important; }
|
|
265
264
|
webmapx-layout { display: none !important; }
|
|
266
265
|
#webmapx-print-overlay { display: flex !important; visibility: visible !important; position: fixed !important; top: 0 !important; left: 0 !important; background: transparent !important; }
|
|
267
266
|
#webmapx-print-overlay * { visibility: visible !important; }`;
|
|
@@ -269,7 +268,7 @@ var S = class extends a {
|
|
|
269
268
|
let R = document.createElement("style");
|
|
270
269
|
R.id = "webmapx-print-style", R.textContent = `
|
|
271
270
|
@media print {
|
|
272
|
-
@page { size: A4 ${
|
|
271
|
+
@page { size: A4 ${r ? "landscape" : "portrait"}; margin: 0; }
|
|
273
272
|
html, body { margin: 0 !important; padding: 0 !important; overflow: hidden !important; background: white !important; }
|
|
274
273
|
${L}
|
|
275
274
|
}`, document.head.appendChild(R), window.addEventListener("afterprint", () => {
|
|
@@ -277,30 +276,30 @@ var S = class extends a {
|
|
|
277
276
|
}, { once: !0 }), requestAnimationFrame(() => requestAnimationFrame(() => window.print()));
|
|
278
277
|
}
|
|
279
278
|
buildAttributionText() {
|
|
280
|
-
let e = this.layerDataConfig, t = this.store?.getState()?.mapLayers ?? {},
|
|
279
|
+
let e = this.layerDataConfig, t = this.store?.getState()?.mapLayers ?? {}, n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
281
280
|
if (e) {
|
|
282
|
-
for (let t of e.sources ?? [])
|
|
283
|
-
for (let t of e.layers ?? [])
|
|
281
|
+
for (let t of e.sources ?? []) n.set(t.id, t);
|
|
282
|
+
for (let t of e.layers ?? []) r.set(t.id, t);
|
|
284
283
|
}
|
|
285
|
-
let
|
|
284
|
+
let i = /* @__PURE__ */ new Set(), a = [], l = (e) => {
|
|
286
285
|
if (e) for (let t of e.split("|")) {
|
|
287
|
-
let e =
|
|
288
|
-
e && !
|
|
286
|
+
let e = c(o(t)).trim();
|
|
287
|
+
e && !i.has(e) && (i.add(e), a.push(e));
|
|
289
288
|
}
|
|
290
289
|
};
|
|
291
|
-
for (let [e,
|
|
292
|
-
if (
|
|
293
|
-
let t =
|
|
294
|
-
if (t) l(
|
|
290
|
+
for (let [e, i] of Object.entries(t)) {
|
|
291
|
+
if (i.visible === !1) continue;
|
|
292
|
+
let t = r.get(e);
|
|
293
|
+
if (t) l(s(t, n));
|
|
295
294
|
else {
|
|
296
|
-
let e = typeof
|
|
295
|
+
let e = typeof i.sourceId == "string" ? i.sourceId : null;
|
|
297
296
|
e && l(this.adapter?.getSourceAttribution?.(e));
|
|
298
297
|
}
|
|
299
298
|
}
|
|
300
|
-
return
|
|
299
|
+
return a.join(" • ");
|
|
301
300
|
}
|
|
302
301
|
render() {
|
|
303
|
-
return
|
|
302
|
+
return r`
|
|
304
303
|
<div class="tool-content">
|
|
305
304
|
<p class="description">Position the map inside the box, then click Print to save as PDF.</p>
|
|
306
305
|
<div class="field">
|
|
@@ -331,18 +330,18 @@ var S = class extends a {
|
|
|
331
330
|
this.addLink = e.target.checked, this.updateBox();
|
|
332
331
|
}}
|
|
333
332
|
>Add viewer link</sl-checkbox>
|
|
334
|
-
${Math.abs(this.zoomDelta) > .05 ?
|
|
333
|
+
${Math.abs(this.zoomDelta) > .05 ? r`
|
|
335
334
|
<p class="warning">
|
|
336
335
|
<strong>Note:</strong> The print zoom differs from the screen zoom
|
|
337
336
|
(${this.zoomDelta > 0 ? "+" : ""}${this.zoomDelta.toFixed(1)} levels).
|
|
338
337
|
Labels and zoom-dependent layers may look different in the print.
|
|
339
338
|
</p>` : ""}
|
|
340
|
-
${this.printing ?
|
|
341
|
-
${this.errorMsg ?
|
|
339
|
+
${this.printing ? r`<div class="busy"><sl-spinner></sl-spinner> Rendering map…</div>` : r`<sl-button variant="primary" size="small" @click=${this.handlePrint}>Print</sl-button>`}
|
|
340
|
+
${this.errorMsg ? r`<p class="error">${this.errorMsg}</p>` : ""}
|
|
342
341
|
</div>
|
|
343
342
|
`;
|
|
344
343
|
}
|
|
345
344
|
};
|
|
346
|
-
|
|
345
|
+
a([t()], S.prototype, "mapTitle", void 0), a([t()], S.prototype, "format", void 0), a([t()], S.prototype, "addLink", void 0), a([t()], S.prototype, "printing", void 0), a([t()], S.prototype, "errorMsg", void 0), a([t()], S.prototype, "zoomDelta", void 0), S = a([n("webmapx-print-tool")], S);
|
|
347
346
|
//#endregion
|
|
348
347
|
export { S as WebmapxPrintTool };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
3
|
-
import {
|
|
4
|
-
import { customElement as a, state as o } 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";
|
|
5
4
|
//#region src/components/webmapx-search-tool.ts
|
|
6
|
-
var s, c = class extends
|
|
5
|
+
var s, c = class extends o {
|
|
7
6
|
static {
|
|
8
7
|
s = this;
|
|
9
8
|
}
|
|
@@ -43,7 +42,7 @@ var s, c = class extends n {
|
|
|
43
42
|
return s.KNOWN_PROVIDERS.has(e.toLowerCase());
|
|
44
43
|
}
|
|
45
44
|
static {
|
|
46
|
-
this.styles =
|
|
45
|
+
this.styles = e`
|
|
47
46
|
:host { display: block; width: 100%; pointer-events: auto; }
|
|
48
47
|
:host([hidden]) { display: none !important; }
|
|
49
48
|
.container { width: 100%; max-width: 100%; color: var(--webmapx-search-color, var(--color-text-primary)); box-sizing: border-box; padding: var(--webmapx-tool-padding, 0); }
|
|
@@ -57,8 +56,8 @@ var s, c = class extends n {
|
|
|
57
56
|
.meta { font-size: small; color: var(--color-text-secondary); }
|
|
58
57
|
`;
|
|
59
58
|
}
|
|
60
|
-
onMapAttached(
|
|
61
|
-
super.onMapAttached(
|
|
59
|
+
onMapAttached(e) {
|
|
60
|
+
super.onMapAttached(e), this.adapter = e, this.mapElement = i(this), this.subscribeToConfig();
|
|
62
61
|
}
|
|
63
62
|
onMapDetached() {
|
|
64
63
|
this.adapter = null, this.mapElement = null, this.unsubscribeFromConfig(), super.onMapDetached();
|
|
@@ -380,7 +379,7 @@ var s, c = class extends n {
|
|
|
380
379
|
r = n?.detail && typeof n.detail.checked == "boolean" ? n.detail.checked : !!t.target?.checked, r ? this.isPersisted(e) || (this.clearPreview(), this.addPersistedFeature(e), this.persistedChanged(e, !0)) : this.isPersisted(e) && (this.removePersistedFeature(e), this.persistedChanged(e, !1)), this.requestUpdate();
|
|
381
380
|
}
|
|
382
381
|
render() {
|
|
383
|
-
return
|
|
382
|
+
return r`
|
|
384
383
|
<div class="container tool-content">
|
|
385
384
|
<div class="title">Search</div>
|
|
386
385
|
<div class="searchbox">
|
|
@@ -402,14 +401,14 @@ var s, c = class extends n {
|
|
|
402
401
|
</div>
|
|
403
402
|
|
|
404
403
|
<div class="results">
|
|
405
|
-
${this.searching ?
|
|
406
|
-
${this.results ?
|
|
404
|
+
${this.searching ? r`<div>Searching...</div>` : ""}
|
|
405
|
+
${this.results ? r`
|
|
407
406
|
<div style="display:flex; align-items:center; gap:8px; padding:2px 6px; font-size:11px; color:var(--color-text-secondary); border-bottom:1px solid var(--color-border);">
|
|
408
407
|
<span style="flex:0 0 auto; min-width:1.5rem; text-align:center;" title="Check to add result as a permanent layer on the map">📌</span>
|
|
409
408
|
<span>hover to preview · click to zoom</span>
|
|
410
409
|
</div>
|
|
411
410
|
<ul>
|
|
412
|
-
${(this.results.features || []).map((e, t) =>
|
|
411
|
+
${(this.results.features || []).map((e, t) => r`
|
|
413
412
|
<li class="result-item" ?selected=${t === this.selectedIndex}
|
|
414
413
|
@mouseenter=${() => this.showPreviewForFeature(e)}
|
|
415
414
|
@mouseleave=${() => this.clearPreview()}>
|
|
@@ -426,12 +425,12 @@ var s, c = class extends n {
|
|
|
426
425
|
</li>
|
|
427
426
|
`)}
|
|
428
427
|
</ul>
|
|
429
|
-
` :
|
|
428
|
+
` : r``}
|
|
430
429
|
</div>
|
|
431
430
|
</div>
|
|
432
431
|
`;
|
|
433
432
|
}
|
|
434
433
|
};
|
|
435
|
-
|
|
434
|
+
a([t()], c.prototype, "query", void 0), a([t()], c.prototype, "results", void 0), a([t()], c.prototype, "searching", void 0), a([t()], c.prototype, "selectedIndex", void 0), c = s = a([n("webmapx-search-tool")], c);
|
|
436
435
|
//#endregion
|
|
437
436
|
export { c as WebmapxSearchTool };
|