@arcgis/map-components 5.2.0-next.105 → 5.2.0-next.106
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/cdn/2W7OTZWE.js +2 -0
- package/dist/cdn/{CB564G7T.js → 3Q5ZNKFA.js} +1 -1
- package/dist/cdn/54ST7ZFM.js +2 -0
- package/dist/cdn/5IWPAMQX.js +2 -0
- package/dist/cdn/{PXSNOIDS.js → 5VFOV7OL.js} +1 -1
- package/dist/cdn/{L4DWZT4V.js → 6CXH46LW.js} +1 -1
- package/dist/cdn/{6PKJBJML.js → 6FNDBTL7.js} +1 -1
- package/dist/cdn/BTDEIRWG.js +2 -0
- package/dist/cdn/{WLGR4IHZ.js → GTGJEBPK.js} +1 -1
- package/dist/cdn/{KGFMFLEB.js → HUPYGWUJ.js} +1 -1
- package/dist/cdn/J7ZMGZ6U.js +2 -0
- package/dist/cdn/{SHMHGYVB.js → KDM7EERW.js} +1 -1
- package/dist/cdn/{RC2T53I5.js → KXGRFYAN.js} +1 -1
- package/dist/cdn/{5FWT3N7B.js → N4ECCRHC.js} +1 -1
- package/dist/cdn/{EHMCN2NS.js → NG4IEHMS.js} +1 -1
- package/dist/cdn/P5JRSGJG.js +2 -0
- package/dist/cdn/{CKO4VE36.js → Q4VMXDGI.js} +1 -1
- package/dist/cdn/{72HH6FSN.js → RFAICLUF.js} +1 -1
- package/dist/cdn/{BNZQH6YD.js → T7L5Q45E.js} +1 -1
- package/dist/cdn/WJKXUGQQ.js +2 -0
- package/dist/cdn/{6SEM26SM.js → XYIEHNTE.js} +1 -1
- package/dist/cdn/{R2WAEZ4G.js → Y4XJQ6Z7.js} +1 -1
- package/dist/cdn/{BR6D5EO4.js → Y6UJT3A4.js} +1 -1
- package/dist/cdn/{EYHS3JDR.js → YBXUZO5Y.js} +1 -1
- package/dist/cdn/assets/layer-list-next/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/utility-network-trace-locations/t9n/messages.en.json +1 -0
- package/dist/cdn/index.js +1 -1
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/utils2.js +36 -28
- package/dist/components/arcgis-basemap-layer-list-next/customElement.js +25 -25
- package/dist/components/arcgis-coordinate-conversion-next/customElement.js +1 -1
- package/dist/components/arcgis-directional-pad/customElement.js +10 -10
- package/dist/components/arcgis-features/customElement.js +1 -1
- package/dist/components/arcgis-features-next/customElement.d.ts +2 -0
- package/dist/components/arcgis-features-next/customElement.js +2 -2
- package/dist/components/arcgis-layer-list-item-panel/customElement.js +1 -1
- package/dist/components/arcgis-layer-list-next/customElement.d.ts +27 -0
- package/dist/components/arcgis-layer-list-next/customElement.js +22 -22
- package/dist/components/arcgis-layer-list-next/layer-list-item/customElement.js +44 -44
- package/dist/components/arcgis-layer-list-next/types.d.ts +9 -0
- package/dist/components/arcgis-link-chart-layout-switcher/customElement.js +5 -5
- package/dist/components/arcgis-navigation-toggle/customElement.js +1 -1
- package/dist/components/arcgis-paste/customElement.js +1 -1
- package/dist/components/arcgis-popup/customElement.d.ts +2 -0
- package/dist/components/arcgis-print-layout-panel/customElement.js +1 -1
- package/dist/components/arcgis-print-map-only-panel/customElement.js +1 -1
- package/dist/components/arcgis-reverse-geocode-list/customElement.js +1 -1
- package/dist/components/arcgis-scene/customElement.d.ts +10 -0
- package/dist/components/arcgis-time-bar/customElement.js +1 -1
- package/dist/components/arcgis-utility-network-trace-analysis/customElement.d.ts +1 -1
- package/dist/components/arcgis-utility-network-trace-analysis-next/customElement.d.ts +2 -2
- package/dist/components/arcgis-utility-network-trace-analysis-next/customElement.js +1 -1
- package/dist/components/arcgis-utility-network-trace-inputs-next/customElement.d.ts +2 -2
- package/dist/components/arcgis-utility-network-trace-inputs-next/customElement.js +101 -161
- package/dist/components/arcgis-utility-network-trace-inputs-next/index.js +1 -1
- package/dist/components/{arcgis-utility-network-trace-location-next → arcgis-utility-network-trace-locations}/customElement.d.ts +47 -26
- package/dist/components/arcgis-utility-network-trace-locations/customElement.js +397 -0
- package/dist/components/{arcgis-utility-network-trace-location-list-next → arcgis-utility-network-trace-locations}/index.js +2 -0
- package/dist/components/arcgis-utility-network-validate-network-topology/customElement.d.ts +1 -1
- package/dist/components/arcgis-utility-network-validate-network-topology/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +7 -11
- package/dist/loader.js +2 -3
- package/dist/types/lumina.d.ts +6 -11
- package/dist/types/preact.d.ts +7 -13
- package/dist/types/react.d.ts +8 -15
- package/dist/types/stencil.d.ts +6 -11
- package/package.json +5 -5
- package/dist/cdn/5LGT6I7Y.js +0 -2
- package/dist/cdn/GH2RPE3P.js +0 -2
- package/dist/cdn/JHWTX3YJ.js +0 -2
- package/dist/cdn/NRT2ZCWC.js +0 -2
- package/dist/cdn/R5GMCIAH.js +0 -2
- package/dist/cdn/VZXCU47M.js +0 -2
- package/dist/cdn/YELCBIGX.js +0 -2
- package/dist/cdn/assets/utility-network-trace-location-list-next/t9n/messages.en.json +0 -1
- package/dist/cdn/assets/utility-network-trace-location-next/t9n/messages.en.json +0 -1
- package/dist/components/arcgis-utility-network-trace-location-list-next/customElement.d.ts +0 -43
- package/dist/components/arcgis-utility-network-trace-location-list-next/customElement.js +0 -70
- package/dist/components/arcgis-utility-network-trace-location-next/customElement.js +0 -292
- package/dist/components/arcgis-utility-network-trace-location-next/index.d.ts +0 -1
- package/dist/components/arcgis-utility-network-trace-location-next/index.js +0 -4
- /package/dist/components/{arcgis-utility-network-trace-location-list-next → arcgis-utility-network-trace-locations}/index.d.ts +0 -0
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as m } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as p, html as a } from "lit";
|
|
4
|
-
import h from "@arcgis/core/core/Collection.js";
|
|
5
|
-
import { substitute as u } from "@arcgis/core/intl.js";
|
|
6
|
-
import { LitElement as g } from "@arcgis/lumina";
|
|
7
|
-
import { log as l, composeEmptyPropertyMessage as b } from "@arcgis/toolkit/log";
|
|
8
|
-
import { u as f } from "../../chunks/useT9n.js";
|
|
9
|
-
const v = p`:host{padding:0 var(--calcite-spacing-sm) var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}calcite-list{border:solid 1px var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sm);overflow:hidden}calcite-list-item[selected] [slot=content-bottom]{display:block}.warning{color:var(--calcite-color-status-danger)}.terminals{padding:var(--calcite-spacing-sm) var(--calcite-spacing-md);display:flex;flex-direction:column}.filter-barrier{display:flex;justify-content:space-between;align-items:center;width:100%}`;
|
|
10
|
-
class $ extends g {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments), this._messages = f({ blocking: !0 }), this.traceLocations = new h(), this.traceLocationType = "starting-point";
|
|
13
|
-
}
|
|
14
|
-
static {
|
|
15
|
-
this.properties = { traceLocations: 0, traceLocationType: 1, view: 0 };
|
|
16
|
-
}
|
|
17
|
-
static {
|
|
18
|
-
this.styles = v;
|
|
19
|
-
}
|
|
20
|
-
loaded() {
|
|
21
|
-
this.traceLocations.length || l("warn", this, b("traceLocations"));
|
|
22
|
-
}
|
|
23
|
-
#e(e) {
|
|
24
|
-
const { traceLocations: i, view: t } = this;
|
|
25
|
-
e.spatialProperties.flagGraphic && t && t.graphics.remove(e.spatialProperties.flagGraphic), i?.remove(e);
|
|
26
|
-
}
|
|
27
|
-
#t(e, i) {
|
|
28
|
-
const { flagProperties: t } = e, { selectedTerminals: r } = t, { name: s, id: c } = i, n = r?.has(c) ?? !1;
|
|
29
|
-
return a`<calcite-label layout=inline><calcite-checkbox .value=${c} .checked=${n} @calciteCheckboxChange=${(o) => {
|
|
30
|
-
o.target.checked ? r?.add(c) : r?.delete(c), this.requestUpdate();
|
|
31
|
-
}}></calcite-checkbox>${s}</calcite-label>`;
|
|
32
|
-
}
|
|
33
|
-
#i() {
|
|
34
|
-
return a`<calcite-notice kind=danger open scale=s width=auto><div slot=message>${this._messages.errors.noTerminalSelected}</div></calcite-notice>`;
|
|
35
|
-
}
|
|
36
|
-
#r(e) {
|
|
37
|
-
const { traceLocation: i } = e;
|
|
38
|
-
return a`<calcite-label layout=inline><div class="filter-barrier">${this._messages.labels.filterBarrier}<calcite-switch .checked=${i.isFilterBarrier} @calciteSwitchChange=${(t) => {
|
|
39
|
-
i.isFilterBarrier = t.target.checked;
|
|
40
|
-
}}></calcite-switch></div></calcite-label>`;
|
|
41
|
-
}
|
|
42
|
-
#c(e) {
|
|
43
|
-
const { flagProperties: i } = e, { terminalConfiguration: t, selectedTerminals: r } = i, s = e.traceLocation.type === "barrier", c = t && t.terminals.length > 0 && r?.size === 0;
|
|
44
|
-
return a`<calcite-action .icon=${i.expanded ? "chevron-up" : "chevron-down"} slot=actions-end scale=s text @click=${() => {
|
|
45
|
-
i.expanded = !i.expanded, this.requestUpdate();
|
|
46
|
-
}}></calcite-action>${c && a`<calcite-icon class="warning" icon=exclamation-mark-triangle scale=s slot=content-start></calcite-icon>` || ""}${i.expanded && a`<div class="terminals" slot=content-bottom>${s && this.#r(e) || ""}${t && this.#a(e) || ""}${c && this.#i() || ""}</div>` || ""}`;
|
|
47
|
-
}
|
|
48
|
-
#a(e) {
|
|
49
|
-
const { flagProperties: i } = e, { terminalConfiguration: t } = i;
|
|
50
|
-
if (!t)
|
|
51
|
-
return l("warn", this, "One or more locations are missing the required flag property `terminalConfiguration`."), [];
|
|
52
|
-
const r = t.terminals;
|
|
53
|
-
return r.length ? r.length === 1 ? [] : r.map((c) => this.#t(e, c)) : (l("warn", this, "`terminalConfiguration.terminals` is required but either missing or empty.`"), []);
|
|
54
|
-
}
|
|
55
|
-
#s(e) {
|
|
56
|
-
const { flagProperties: i } = e, { terminalConfiguration: t, expanded: r, title: s } = i, c = t && t.id !== 0, n = e.traceLocation.type === "barrier", o = c || n, d = t?.name ?? void 0;
|
|
57
|
-
return a`<calcite-list-item .label=${s} .description=${d} .value=${s} .expanded=${r}>${o ? this.#c(e) : a`<div slot=content-bottom></div>`}<calcite-action icon=x slot=actions-end scale=s text @click=${() => this.#e(e)}></calcite-action></calcite-list-item>`;
|
|
58
|
-
}
|
|
59
|
-
render() {
|
|
60
|
-
const e = this.traceLocations.map((t) => this.#s(t)).toArray();
|
|
61
|
-
if (!e.length)
|
|
62
|
-
return null;
|
|
63
|
-
const i = u(this._messages.labels.list, { traceLocationType: this.traceLocationType });
|
|
64
|
-
return a`<div><calcite-list interaction-mode=static selection-mode=none .label=${i}>${e}</calcite-list></div>`;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
m("arcgis-utility-network-trace-location-list-next", $);
|
|
68
|
-
export {
|
|
69
|
-
$ as ArcgisUtilityNetworkTraceLocationListNext
|
|
70
|
-
};
|
|
@@ -1,292 +0,0 @@
|
|
|
1
|
-
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as k } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as I, html as b } from "lit";
|
|
4
|
-
import * as C from "@arcgis/core/geometry/operators/cutOperator.js";
|
|
5
|
-
import * as T from "@arcgis/core/geometry/operators/lengthOperator.js";
|
|
6
|
-
import * as L from "@arcgis/core/geometry/operators/projectOperator.js";
|
|
7
|
-
import * as v from "@arcgis/core/geometry/operators/proximityOperator.js";
|
|
8
|
-
import A from "@arcgis/core/geometry/Polyline.js";
|
|
9
|
-
import N from "@arcgis/core/Graphic.js";
|
|
10
|
-
import w from "@arcgis/core/rest/networks/support/TraceLocation.js";
|
|
11
|
-
import S from "@arcgis/core/symbols/SimpleMarkerSymbol.js";
|
|
12
|
-
import { LitElement as E, createEvent as x } from "@arcgis/lumina";
|
|
13
|
-
import { log as l, composeMissingPropertyMessage as m } from "@arcgis/toolkit/log";
|
|
14
|
-
import { u as F } from "../../chunks/useT9n.js";
|
|
15
|
-
import { d as G, b as P } from "../../chunks/layer-utils.js";
|
|
16
|
-
const R = I`calcite-block{--calcite-block-content-space: 0;--calcite-block-border-color: transparent;margin:0}.add-location-button{--calcite-button-border-color: var(--calcite-color-border-1);--calcite-button-icon-color: var(--calcite-color-text-1);--calcite-button-text-color: var(--calcite-color-text-1)}.button-container{display:flex;justify-content:center}`;
|
|
17
|
-
class $ extends E {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments), this._messages = F({ blocking: !0 }), this._isSelectWaiting = !1, this.traceLocationType = "starting-point", this.spatialTolerance = 0.05, this.autoDestroyDisabled = !1, this.arcgisTraceLocationChange = x(), this.arcgisTraceLocationSelectEnd = x(), this.arcgisTraceLocationSelectStart = x();
|
|
20
|
-
}
|
|
21
|
-
static {
|
|
22
|
-
this.properties = { _isSelectWaiting: 16, beforeTraceLocationSelectStart: 0, afterHitTest: 0, view: 0, traceLocationType: 1, traceLocations: 0, filterLayers: 0, sketchViewModel: 0, spatialTolerance: 9, autoDestroyDisabled: 5, utilityNetwork: 0 };
|
|
23
|
-
}
|
|
24
|
-
static {
|
|
25
|
-
this.styles = R;
|
|
26
|
-
}
|
|
27
|
-
#e;
|
|
28
|
-
async destroy() {
|
|
29
|
-
this.#r(), await this.manager.destroy();
|
|
30
|
-
}
|
|
31
|
-
async load() {
|
|
32
|
-
L.isLoaded() || await L.load();
|
|
33
|
-
}
|
|
34
|
-
#a(t, e) {
|
|
35
|
-
const r = t.clone(), o = r.spatialReference, i = e.spatialReference;
|
|
36
|
-
if (!o || !i)
|
|
37
|
-
return l("warn", this, "Unable to calculate percent along because geometry is missing a spatial reference."), -1;
|
|
38
|
-
let s = e;
|
|
39
|
-
if (!o.equals(i)) {
|
|
40
|
-
const d = L.execute(e, o);
|
|
41
|
-
if (!d)
|
|
42
|
-
return l("warn", this, "Unable to project flag point to source geometry spatial reference."), -1;
|
|
43
|
-
s = d;
|
|
44
|
-
}
|
|
45
|
-
const n = v.getNearestCoordinate(r, s);
|
|
46
|
-
if (n.isEmpty)
|
|
47
|
-
return l("warn", this, "Unable to compute nearest coordinate for polyline flag."), -1;
|
|
48
|
-
const a = n.coordinate, c = a.x - 0.5, u = a.y - 0.5, p = a.x + 0.5, h = a.y + 0.5, g = new A({
|
|
49
|
-
hasZ: !1,
|
|
50
|
-
hasM: !0,
|
|
51
|
-
paths: [
|
|
52
|
-
[
|
|
53
|
-
[c, u],
|
|
54
|
-
[p, h]
|
|
55
|
-
]
|
|
56
|
-
],
|
|
57
|
-
spatialReference: r.spatialReference
|
|
58
|
-
}), f = C.execute(r, g);
|
|
59
|
-
if (f.length > 0) {
|
|
60
|
-
const d = T.execute(r, { unit: "feet" });
|
|
61
|
-
let y;
|
|
62
|
-
return f[0].paths[0][0][0] === r.paths[0][0][0] ? y = T.execute(f[0], { unit: "feet" }) : f.length > 1 ? y = T.execute(f[1], { unit: "feet" }) : y = 0, y / d;
|
|
63
|
-
}
|
|
64
|
-
return l("warn", this, "Unable to cut the source geometry with the flag geometry."), -1;
|
|
65
|
-
}
|
|
66
|
-
get #i() {
|
|
67
|
-
const t = this.utilityNetwork?.dataElement?.domainNetworks;
|
|
68
|
-
return t ? t.flatMap((e) => e.edgeSources).map((e) => e.layerId).filter(Boolean) : [];
|
|
69
|
-
}
|
|
70
|
-
async #s() {
|
|
71
|
-
const { view: t, sketchViewModel: e } = this;
|
|
72
|
-
if (!(t && e)) {
|
|
73
|
-
l("error", this, "Cannot add trace location."), e || l("error", this, m("sketchViewModel")), t || l("error", this, m("view"));
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
if (this.beforeTraceLocationSelectStart) {
|
|
77
|
-
this._isSelectWaiting = !0;
|
|
78
|
-
try {
|
|
79
|
-
await this.beforeTraceLocationSelectStart();
|
|
80
|
-
} finally {
|
|
81
|
-
this._isSelectWaiting = !1;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
await this.#t(t, e);
|
|
85
|
-
}
|
|
86
|
-
async #t(t, e) {
|
|
87
|
-
this.arcgisTraceLocationSelectStart.emit({ cancelSelect: () => e.cancel() }).defaultPrevented || (this.#e?.remove(), this.#e = e.on("create", (o) => this.#o(o, t, e)), "acquireCursor" in t && t.acquireCursor("crosshair"), e.snappingOptions.enabled = !0, e.create("point"));
|
|
88
|
-
}
|
|
89
|
-
#o(t, e, r) {
|
|
90
|
-
if (t.state === "complete" && t.graphic) {
|
|
91
|
-
r.layer.remove(t.graphic), this.#n(t, e, r);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
t.state === "cancel" && (this.#r(), this.arcgisTraceLocationSelectEnd.emit());
|
|
95
|
-
}
|
|
96
|
-
async #n(t, e, r) {
|
|
97
|
-
const { utilityNetwork: o } = this, { graphic: i } = t;
|
|
98
|
-
if (!o) {
|
|
99
|
-
l("error", this, m("utilityNetwork")), this.#r(), this.arcgisTraceLocationSelectEnd.emit();
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
if (i?.geometry?.type !== "point") {
|
|
103
|
-
l("warn", this, "No screen point available for hit test."), this.#t(e, r);
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
const s = i.geometry, n = e.toScreen(s);
|
|
107
|
-
if (!n) {
|
|
108
|
-
l("warn", this, "No screen point available for hit test."), this.#t(e, r);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
const c = (await e.hitTest(n, {
|
|
112
|
-
include: this.filterLayers
|
|
113
|
-
})).results.filter((p) => p.type === "graphic" && p?.layer && p.graphic);
|
|
114
|
-
if (!c.length) {
|
|
115
|
-
l("info", this, "No usable hit test results found."), this.#t(e, r);
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
this.#r(), await this.#c(c, s, e) ? this.arcgisTraceLocationSelectEnd.emit() : this.#t(e, r);
|
|
119
|
-
}
|
|
120
|
-
#r() {
|
|
121
|
-
const { view: t, sketchViewModel: e } = this;
|
|
122
|
-
if (!t) {
|
|
123
|
-
l("error", this, m("view"));
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
e && (e.snappingOptions.enabled = !1), this.#e?.remove(), this.#e = void 0, "acquireCursor" in t && t.acquireCursor("default");
|
|
127
|
-
}
|
|
128
|
-
async #c(t, e, r) {
|
|
129
|
-
if (!t.length)
|
|
130
|
-
return l("error", this, "There are no hit test results to process."), !1;
|
|
131
|
-
let i = t[0].graphic;
|
|
132
|
-
if (this.afterHitTest) {
|
|
133
|
-
const n = t.map((a) => {
|
|
134
|
-
const c = a, u = c.graphic;
|
|
135
|
-
return u.origin = c.layer, u.sourceLayer = c.layer, u;
|
|
136
|
-
});
|
|
137
|
-
try {
|
|
138
|
-
i = await this.afterHitTest(n);
|
|
139
|
-
} catch {
|
|
140
|
-
i = null;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (!i)
|
|
144
|
-
return l("error", this, "No graphic available from hit test results."), this.arcgisTraceLocationSelectEnd.emit(), !0;
|
|
145
|
-
const s = await this.#l(i);
|
|
146
|
-
return s ? await this.#u(s, e, r) : (l("error", this, "Unable to ensure necessary attributes on the selected graphic."), this.arcgisTraceLocationSelectEnd.emit(), !0);
|
|
147
|
-
}
|
|
148
|
-
async #l(t) {
|
|
149
|
-
const e = (G(t.layer), t.layer), r = e.geometryType === null, o = e.fieldsIndex?.get("assetgroup") ?? !1, i = e.fieldsIndex?.get("assetgroup")?.name ?? "assetgroup", s = e.fieldsIndex?.get("assettype") ?? !1, n = e.fieldsIndex?.get("assettype")?.name ?? "assettype", a = t.getGlobalId(), c = t.getObjectId(), u = o ? !!t.getAttribute(i) : !0, p = s ? !!t.getAttribute(n) : !0, h = !!t.geometry;
|
|
150
|
-
if (a && c && u && p && (h || r))
|
|
151
|
-
return t;
|
|
152
|
-
const g = e.createQuery();
|
|
153
|
-
return g.objectIds = [c], (await e.queryFeatures(g)).features[0] || null;
|
|
154
|
-
}
|
|
155
|
-
async #u(t, e, r) {
|
|
156
|
-
const { traceLocations: o } = this, i = t.getGlobalId() ?? "", s = t.geometry?.type, n = await this.#p(t, e);
|
|
157
|
-
if (!n)
|
|
158
|
-
return l("error", this, "Unable to generate flag info for trace location."), !1;
|
|
159
|
-
const a = o?.filter((u) => u.spatialProperties.mapGraphic?.getGlobalId() === i) ?? [];
|
|
160
|
-
if (a.length > 0) {
|
|
161
|
-
if (s !== "polyline")
|
|
162
|
-
return l("warn", this, "A flag with the same globalId already exists."), !1;
|
|
163
|
-
if (a.some((u) => Math.abs(u.traceLocation.percentAlong - n.traceLocation.percentAlong) <= this.spatialTolerance))
|
|
164
|
-
return l("warn", this, "A flag with the same globalId already exists within tolerance."), !1;
|
|
165
|
-
}
|
|
166
|
-
const c = this.#h(t, e, r);
|
|
167
|
-
return c ? (n.spatialProperties.flagGraphic = c, o?.add(n), !0) : (l("warn", this, "Unable to add flag graphic."), !1);
|
|
168
|
-
}
|
|
169
|
-
async #p(t, e) {
|
|
170
|
-
const { traceLocationType: r, utilityNetwork: o } = this, i = t.getGlobalId() ?? "", s = t.geometry?.type, n = await this.#f(t);
|
|
171
|
-
if (s === "point" || s === "polygon") {
|
|
172
|
-
const a = o?.getTerminalConfiguration(t), c = a ? a.terminals[0].id : 1;
|
|
173
|
-
return {
|
|
174
|
-
traceLocation: new w({
|
|
175
|
-
type: r,
|
|
176
|
-
isFilterBarrier: !1,
|
|
177
|
-
globalId: i,
|
|
178
|
-
terminalId: c
|
|
179
|
-
}),
|
|
180
|
-
flagProperties: {
|
|
181
|
-
title: n,
|
|
182
|
-
expanded: !1,
|
|
183
|
-
terminalConfiguration: a ?? void 0,
|
|
184
|
-
selectedTerminals: a ? /* @__PURE__ */ new Set([c]) : void 0
|
|
185
|
-
},
|
|
186
|
-
spatialProperties: {
|
|
187
|
-
mapPoint: e,
|
|
188
|
-
mapGraphic: t
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
} else if (s === "polyline") {
|
|
192
|
-
const a = this.#a(t.geometry, e);
|
|
193
|
-
return a < 0 ? (l("warn", this, "Unable to calculate percent along for polyline flag."), null) : {
|
|
194
|
-
traceLocation: new w({
|
|
195
|
-
type: r,
|
|
196
|
-
isFilterBarrier: !1,
|
|
197
|
-
globalId: i,
|
|
198
|
-
percentAlong: a
|
|
199
|
-
}),
|
|
200
|
-
flagProperties: {
|
|
201
|
-
title: n,
|
|
202
|
-
expanded: !1,
|
|
203
|
-
terminalConfiguration: void 0,
|
|
204
|
-
selectedTerminals: void 0
|
|
205
|
-
},
|
|
206
|
-
spatialProperties: {
|
|
207
|
-
mapPoint: e,
|
|
208
|
-
mapGraphic: t
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
} else if (!s) {
|
|
212
|
-
const a = P(t.layer) ? t.layer.parent : t.layer, c = a && this.#i.includes(a.layerId), u = o?.getTerminalConfiguration(t), p = u ? u.terminals[0].id : c ? -1 : 1, h = c ? 0.5 : -1;
|
|
213
|
-
return {
|
|
214
|
-
traceLocation: new w({
|
|
215
|
-
type: r,
|
|
216
|
-
isFilterBarrier: !1,
|
|
217
|
-
globalId: i,
|
|
218
|
-
terminalId: p,
|
|
219
|
-
percentAlong: h
|
|
220
|
-
}),
|
|
221
|
-
flagProperties: {
|
|
222
|
-
title: n,
|
|
223
|
-
expanded: !1,
|
|
224
|
-
terminalConfiguration: u ?? void 0,
|
|
225
|
-
selectedTerminals: u ? /* @__PURE__ */ new Set([p]) : void 0
|
|
226
|
-
},
|
|
227
|
-
spatialProperties: {
|
|
228
|
-
mapPoint: e,
|
|
229
|
-
mapGraphic: t
|
|
230
|
-
}
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
return null;
|
|
234
|
-
}
|
|
235
|
-
async #f(t) {
|
|
236
|
-
const e = (G(t.layer), t.layer);
|
|
237
|
-
return ("getFeatureTitle" in e ? await e.getFeatureTitle(t) : null) || t.getObjectId()?.toString() || this._messages.unknown;
|
|
238
|
-
}
|
|
239
|
-
#h(t, e, r) {
|
|
240
|
-
const o = t.geometry ? t.geometry.type === "point" ? t.geometry : e : null, i = this.#d(), s = new N({
|
|
241
|
-
geometry: o,
|
|
242
|
-
symbol: i,
|
|
243
|
-
attributes: t.attributes
|
|
244
|
-
});
|
|
245
|
-
return r.graphics.add(s), s;
|
|
246
|
-
}
|
|
247
|
-
#d() {
|
|
248
|
-
const { traceLocationType: t } = this, e = [244, 21, 21, 0.6], r = [21, 244, 21, 0.6];
|
|
249
|
-
return t === "stopping-point" ? new S({
|
|
250
|
-
color: e,
|
|
251
|
-
style: "x",
|
|
252
|
-
size: 12,
|
|
253
|
-
outline: {
|
|
254
|
-
color: e,
|
|
255
|
-
width: 2
|
|
256
|
-
}
|
|
257
|
-
}) : t === "barrier" ? new S({
|
|
258
|
-
color: e,
|
|
259
|
-
style: "square",
|
|
260
|
-
size: 12,
|
|
261
|
-
outline: {
|
|
262
|
-
color: e,
|
|
263
|
-
width: 0
|
|
264
|
-
}
|
|
265
|
-
}) : new S({
|
|
266
|
-
color: r,
|
|
267
|
-
style: "circle",
|
|
268
|
-
size: 12,
|
|
269
|
-
outline: {
|
|
270
|
-
color: r,
|
|
271
|
-
width: 0
|
|
272
|
-
}
|
|
273
|
-
});
|
|
274
|
-
}
|
|
275
|
-
#g() {
|
|
276
|
-
const { view: t, traceLocations: e } = this;
|
|
277
|
-
e?.forEach((r) => {
|
|
278
|
-
r.spatialProperties.flagGraphic && t && t.graphics.remove(r.spatialProperties.flagGraphic);
|
|
279
|
-
}), e?.removeAll();
|
|
280
|
-
}
|
|
281
|
-
#y() {
|
|
282
|
-
const { traceLocationType: t, _messages: e, traceLocations: r, view: o } = this, i = t === "starting-point" ? e.types.startingPoint : t === "barrier" ? e.types.barrier : e.types.stoppingPoint, s = i.heading, n = i.description, a = i.buttonText;
|
|
283
|
-
return b`<calcite-block .heading=${s} .label=${s} expanded .description=${n}>${r?.length ? b`<calcite-button slot=actions-end appearance=transparent .label=${e.buttons.clear} @click=${() => this.#g()}>${e.buttons.clear}</calcite-button><arcgis-utility-network-trace-location-list-next .traceLocations=${r} .traceLocationType=${t} .view=${o}></arcgis-utility-network-trace-location-list-next>` : null}<div class="button-container"><calcite-button .loading=${this._isSelectWaiting} class="add-location-button" icon-start=select appearance=outline .label=${a} @click=${() => this.#s()}>${a}</calcite-button></div></calcite-block>`;
|
|
284
|
-
}
|
|
285
|
-
render() {
|
|
286
|
-
return b`<div class="root">${this.#y()}</div>`;
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
k("arcgis-utility-network-trace-location-next", $);
|
|
290
|
-
export {
|
|
291
|
-
$ as ArcgisUtilityNetworkTraceLocationNext
|
|
292
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./customElement.js";
|