@arcgis/portal-components 5.0.0-next.9 → 5.0.0-next.90
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/5QMVDKB4.js +4 -0
- package/dist/cdn/6FPENFUB.js +4 -0
- package/dist/cdn/ARZTGPQ2.js +4 -0
- package/dist/cdn/FZ3WPLJ6.js +4 -0
- package/dist/cdn/GK32CM5B.js +4 -0
- package/dist/cdn/JG4U25EE.js +4 -0
- package/dist/cdn/{IN2QVHWI.js → KBR6BYDK.js} +2 -2
- package/dist/cdn/KBWTPZGX.js +4 -0
- package/dist/cdn/MHTIL3KS.js +6 -0
- package/dist/cdn/NDZBDPBI.js +4 -0
- package/dist/cdn/P4U6VPVJ.js +4 -0
- package/dist/cdn/{OKJI6RLS.js → Y7XMKINS.js} +2 -2
- package/dist/cdn/YLZXV5YU.js +4 -0
- package/dist/cdn/{P3ANBRVZ.js → YPYCZ3TH.js} +1 -1
- package/dist/cdn/ZZ5BR6LQ.js +4 -0
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/portal-classification-favorite/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ar.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.bg.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.bs.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ca.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.cs.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.da.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.de.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.el.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.es.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.et.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.fi.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.fr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.he.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.hr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.hu.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.id.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.it.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ja.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ko.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.lt.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.lv.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.nb.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.nl.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.no.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pl.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-BR.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.pt-PT.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ro.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.ru.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sk.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sl.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.sv.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.th.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.tr.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.uk.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.vi.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-CN.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-HK.json +1 -0
- package/dist/cdn/assets/portal-extent-picker/t9n/messages.zh-TW.json +1 -0
- package/dist/cdn/index.js +2 -2
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/common.js +1 -1
- package/dist/chunks/fieldAddDelete.js +164 -151
- package/dist/chunks/loadClassificationData.js +1 -1
- package/dist/chunks/requests.js +2 -2
- package/dist/chunks/runtime.js +2 -2
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-portal-classification-banner/customElement.js +2 -2
- package/dist/components/arcgis-portal-classification-config/customElement.d.ts +1 -1
- package/dist/components/arcgis-portal-classification-config/customElement.js +1 -1
- package/dist/components/arcgis-portal-classification-favorite/customElement.js +2 -2
- package/dist/components/arcgis-portal-classification-form-element/customElement.js +7 -7
- package/dist/components/arcgis-portal-extent-picker/customElement.d.ts +51 -0
- package/dist/components/arcgis-portal-extent-picker/customElement.js +553 -0
- package/dist/components/arcgis-portal-extent-picker/index.d.ts +8 -0
- package/dist/components/arcgis-portal-extent-picker/index.js +8 -0
- package/dist/components/arcgis-portal-extent-picker/mask-layer.d.ts +28 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.d.ts +26 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/customElement.js +60 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/index.d.ts +3 -0
- package/dist/components/arcgis-portal-extent-picker-coord-field/index.js +3 -0
- package/dist/components/arcgis-portal-field-delete/customElement.d.ts +4 -2
- package/dist/components/arcgis-portal-field-delete/customElement.js +60 -58
- package/dist/controllers/useClassificationModel.d.ts +1 -1
- package/dist/docs/api.json +301 -39
- package/dist/docs/docs.json +291 -12
- package/dist/docs/vscode.html-custom-data.json +33 -1
- package/dist/docs/web-types.json +131 -4
- package/dist/index.d.ts +27 -5
- package/dist/index.js +1 -1
- package/dist/loader.d.ts +1 -1
- package/dist/loader.js +6 -4
- package/dist/types/classification.d.ts +1 -1
- package/dist/types/components.d.ts +1 -1
- package/dist/types/lumina.d.ts +14 -5
- package/dist/types/preact.d.ts +15 -5
- package/dist/types/preact10.d.ts +16 -5
- package/dist/types/react.d.ts +16 -5
- package/dist/types/stencil.d.ts +14 -5
- package/dist/utils/commonFunctions.d.ts +2 -1
- package/dist/utils/style.d.ts +1 -0
- package/package.json +6 -6
- package/dist/cdn/2DYVQAC5.js +0 -4
- package/dist/cdn/AV752DNT.js +0 -4
- package/dist/cdn/BCVIEEK7.js +0 -4
- package/dist/cdn/BNHA7WX4.js +0 -6
- package/dist/cdn/EKVOI2PF.js +0 -4
- package/dist/cdn/MBAE27EC.js +0 -4
- package/dist/cdn/PFUTMEFJ.js +0 -4
- package/dist/cdn/WMPI3QY7.js +0 -4
- package/dist/cdn/XKTVUXPB.js +0 -4
|
@@ -5,12 +5,12 @@ import { css as d, html as i } from "lit";
|
|
|
5
5
|
import { u as h } from "../../chunks/useT9n.js";
|
|
6
6
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
8
|
-
v5.0.0-next.
|
|
8
|
+
v5.0.0-next.90 */
|
|
9
9
|
const m = d`.spacing-y{margin:var(--calcite-spacing-md) 0}.portal-classification-form-element-tooltip{display:flex;justify-content:space-between;align-items:center}`;
|
|
10
10
|
function l(n, e) {
|
|
11
11
|
return n.uiElement === e;
|
|
12
12
|
}
|
|
13
|
-
class
|
|
13
|
+
class g extends c {
|
|
14
14
|
constructor() {
|
|
15
15
|
super(...arguments), this.messages = h(), this.isRequiredErrors = /* @__PURE__ */ new Set(), this.arcgisAttributeValueChange = b();
|
|
16
16
|
}
|
|
@@ -48,13 +48,13 @@ class v extends c {
|
|
|
48
48
|
if (!Array.isArray(this.renderingInfo?.valueExpressionResult))
|
|
49
49
|
return;
|
|
50
50
|
const e = this.value;
|
|
51
|
-
return u(this.renderingInfo?.valueExpressionResult, (t) => t.label, (t) => i`<calcite-combobox-item .selected=${e === t.value}
|
|
51
|
+
return u(this.renderingInfo?.valueExpressionResult, (t) => t.label, (t) => i`<calcite-combobox-item .selected=${e === t.value} .heading=${t.label} .value=${t.value} data-testid=${`single-combobox-item-${t.value}`}></calcite-combobox-item>`);
|
|
52
52
|
}
|
|
53
53
|
_renderComboboxOptions() {
|
|
54
54
|
if (!Array.isArray(this.renderingInfo?.valueExpressionResult))
|
|
55
55
|
return;
|
|
56
56
|
const e = this.value;
|
|
57
|
-
return this.renderingInfo?.valueExpressionResult.map((t) => i`<calcite-combobox-item .selected=${e?.includes(t.value)}
|
|
57
|
+
return this.renderingInfo?.valueExpressionResult.map((t) => i`<calcite-combobox-item .selected=${e?.includes(t.value)} .heading=${t.label} .value=${t.value} data-testid=${`combobox-item-${t.value}`}></calcite-combobox-item>`);
|
|
58
58
|
}
|
|
59
59
|
renderMultiSelect() {
|
|
60
60
|
return l(this.attribute, "multi-select") ? i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey ?? a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${(e) => {
|
|
@@ -68,7 +68,7 @@ class v extends c {
|
|
|
68
68
|
if (!this.renderingInfo?.valueExpressionResult || Array.isArray(this.renderingInfo?.valueExpressionResult))
|
|
69
69
|
return;
|
|
70
70
|
const e = this.value;
|
|
71
|
-
return Object.entries(this.renderingInfo?.valueExpressionResult).map(([t, s]) => i`<calcite-combobox-item .selected=${e?.includes(t)}
|
|
71
|
+
return Object.entries(this.renderingInfo?.valueExpressionResult).map(([t, s]) => i`<calcite-combobox-item .selected=${e?.includes(t)} .heading=${t} .value=${t}>${s.map((r) => i`<calcite-combobox-item .selected=${e?.includes(r.value)} .heading=${r.label} .value=${r.value} data-testid=${`grouped-combobox-item-${r.value}`}></calcite-combobox-item>`)}</calcite-combobox-item>`);
|
|
72
72
|
}
|
|
73
73
|
renderMultiGroupedSelectNested() {
|
|
74
74
|
return l(this.attribute, "multi-grouped-select-nested") ? i`<calcite-label .for=${this.attributeKey}>${this.attribute.label}<calcite-combobox id=${this.attributeKey ?? a} .label=${this.attribute.label} .name=${this.attributeKey} @calciteComboboxChange=${(e) => {
|
|
@@ -97,7 +97,7 @@ class v extends c {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
o("arcgis-portal-classification-form-element",
|
|
100
|
+
o("arcgis-portal-classification-form-element", g);
|
|
101
101
|
export {
|
|
102
|
-
|
|
102
|
+
g as ArcgisPortalClassificationFormElement
|
|
103
103
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/// <reference path="../../index.d.ts" />
|
|
2
|
+
import { default as Extent } from '@arcgis/core/geometry/Extent.js';
|
|
3
|
+
import { PublicLitElement as LitElement, TargetedEvent, JsxNode } from '@arcgis/lumina';
|
|
4
|
+
import { default as Portal } from '@arcgis/core/portal/Portal.js';
|
|
5
|
+
|
|
6
|
+
export type ExtentValue = {
|
|
7
|
+
ymin: string;
|
|
8
|
+
ymax: string;
|
|
9
|
+
xmin: string;
|
|
10
|
+
xmax: string;
|
|
11
|
+
};
|
|
12
|
+
export type ExtentObj = {
|
|
13
|
+
extent: ExtentValue;
|
|
14
|
+
};
|
|
15
|
+
/** To select extent value from a map or by entering coordinates. */
|
|
16
|
+
export declare class ArcgisPortalExtentPicker extends LitElement {
|
|
17
|
+
/**
|
|
18
|
+
* if true, open the dialog
|
|
19
|
+
*
|
|
20
|
+
* @default false
|
|
21
|
+
*/
|
|
22
|
+
active: boolean;
|
|
23
|
+
/** current extent value */
|
|
24
|
+
extentValue?: ExtentValue;
|
|
25
|
+
/** Optional; if passed, use the itemId to load the Portal item */
|
|
26
|
+
itemId?: string;
|
|
27
|
+
/** Optional; Portal instance */
|
|
28
|
+
portal?: Portal;
|
|
29
|
+
/** Optional; URL of the extent service, used to initialize TileLayer */
|
|
30
|
+
extentService?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Optional; if true, show only the content without the calcite-dialog wrapper
|
|
33
|
+
*
|
|
34
|
+
* @default false
|
|
35
|
+
*/
|
|
36
|
+
contentOnly: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Optional; if true, display texts that are for areas rather than the default extent texts
|
|
39
|
+
*
|
|
40
|
+
* @default false
|
|
41
|
+
*/
|
|
42
|
+
isArea: boolean;
|
|
43
|
+
/** Returns the current extent value */
|
|
44
|
+
getExtent(): ExtentObj;
|
|
45
|
+
/** Emitted when the extent value changes */
|
|
46
|
+
readonly arcgisExtentPickerChange: TargetedEvent<this, ExtentObj>;
|
|
47
|
+
/** Emitted when the dialog is closed */
|
|
48
|
+
readonly arcgisExtentPickerClose: TargetedEvent<this, void>;
|
|
49
|
+
/** Emitted when the save button is clicked */
|
|
50
|
+
readonly arcgisExtentPickerSave: TargetedEvent<this, ExtentObj>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
import { c as S } from "../../chunks/runtime.js";
|
|
2
|
+
import { css as F, html as l } from "lit";
|
|
3
|
+
import M from "@arcgis/core/Basemap.js";
|
|
4
|
+
import L from "@arcgis/core/Color.js";
|
|
5
|
+
import E from "@arcgis/core/config.js";
|
|
6
|
+
import c from "@arcgis/core/geometry/Extent.js";
|
|
7
|
+
import * as V from "@arcgis/core/geometry/geometryEngine.js";
|
|
8
|
+
import u from "@arcgis/core/geometry/Point.js";
|
|
9
|
+
import h from "@arcgis/core/geometry/Polygon.js";
|
|
10
|
+
import C from "@arcgis/core/geometry/SpatialReference.js";
|
|
11
|
+
import * as p from "@arcgis/core/geometry/support/webMercatorUtils.js";
|
|
12
|
+
import g from "@arcgis/core/Graphic.js";
|
|
13
|
+
import * as $ from "@arcgis/core/intl.js";
|
|
14
|
+
import y from "@arcgis/core/layers/GraphicsLayer.js";
|
|
15
|
+
import R from "@arcgis/core/layers/Layer.js";
|
|
16
|
+
import P from "@arcgis/core/layers/TileLayer.js";
|
|
17
|
+
import I from "@arcgis/core/Map.js";
|
|
18
|
+
import A from "@arcgis/core/portal/PortalItem.js";
|
|
19
|
+
import T from "@arcgis/core/request.js";
|
|
20
|
+
import b from "@arcgis/core/symbols/SimpleFillSymbol.js";
|
|
21
|
+
import N from "@arcgis/core/views/MapView.js";
|
|
22
|
+
import O from "@arcgis/core/widgets/Search.js";
|
|
23
|
+
import D from "@arcgis/core/widgets/Sketch/SketchViewModel.js";
|
|
24
|
+
import { LitElement as G, createEvent as w, safeStyleMap as z, safeClassMap as j } from "@arcgis/lumina";
|
|
25
|
+
import { createRef as d, ref as x } from "lit/directives/ref.js";
|
|
26
|
+
import { u as B } from "../../chunks/useT9n.js";
|
|
27
|
+
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
28
|
+
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
29
|
+
v5.0.0-next.90 */
|
|
30
|
+
const W = F`.extent-picker-modal{z-index:1001}.extent-picker-content{display:flex;min-height:100%;height:100%}.side-panel{padding:var(--calcite-spacing-lg);display:flex;flex-direction:column;overflow-y:auto;max-height:100%;width:420px}.extent-button{margin-top:var(--calcite-spacing-lg)}.use-location-header{margin-top:var(--calcite-spacing-xxxl);margin-bottom:var(--calcite-spacing-lg)}.search-container,.search-container .esri-search{width:100%}.search-container calcite-autocomplete{width:100%}.map-panel{flex:1 1 0%;position:relative;display:flex}.map-loader{position:absolute;z-index:var(--calcite-z-index-1);top:50%;left:50%;transform:translate(-50%,-50%)}.map-container{flex:1 1 0%;opacity:0;transition:opacity .3s ease}.loader-container{flex:1 1 0%}.map-container--loaded{opacity:1}.coordinates-section{margin-top:var(--calcite-spacing-lg)}`;
|
|
31
|
+
class J {
|
|
32
|
+
constructor(t) {
|
|
33
|
+
this.outerRing = [
|
|
34
|
+
[180, -90],
|
|
35
|
+
[-180, -90],
|
|
36
|
+
[-180, 90],
|
|
37
|
+
[180, 90],
|
|
38
|
+
[180, -90]
|
|
39
|
+
], this.map = t;
|
|
40
|
+
}
|
|
41
|
+
init() {
|
|
42
|
+
this.maskSymbol = new b({
|
|
43
|
+
color: [0, 0, 0, 0.5],
|
|
44
|
+
outline: {
|
|
45
|
+
color: [128, 128, 128, 0.5],
|
|
46
|
+
width: "0px"
|
|
47
|
+
}
|
|
48
|
+
}), this.maskLayer = new y({ id: "maskLayer " }), this.overlapLayer = new y({ id: "overlapLayer" }), this.map?.add(this.maskLayer), this.map?.add(this.overlapLayer);
|
|
49
|
+
}
|
|
50
|
+
hide() {
|
|
51
|
+
this.maskLayer.visible = !1;
|
|
52
|
+
}
|
|
53
|
+
show() {
|
|
54
|
+
this.maskLayer.visible = !0;
|
|
55
|
+
}
|
|
56
|
+
add(t, e) {
|
|
57
|
+
const i = this.buildGraphic(t, e);
|
|
58
|
+
if (i)
|
|
59
|
+
return i.graphic && this.maskLayer?.add(i.graphic), i;
|
|
60
|
+
}
|
|
61
|
+
update(t, e, i) {
|
|
62
|
+
i ? this.remove(null, i) : this.clear();
|
|
63
|
+
const a = this.buildGraphic(t, e);
|
|
64
|
+
if (a)
|
|
65
|
+
return a.graphic && this.maskLayer?.add(a.graphic), a;
|
|
66
|
+
}
|
|
67
|
+
clear() {
|
|
68
|
+
this.maskLayer?.removeAll();
|
|
69
|
+
}
|
|
70
|
+
remove(t, e) {
|
|
71
|
+
!t && !e || (e && !t && (t = this.maskLayer?.graphics.getItemAt(e)), t && this.maskLayer?.remove(t));
|
|
72
|
+
}
|
|
73
|
+
buildGraphic(t, e = this.maskSymbol) {
|
|
74
|
+
const i = {};
|
|
75
|
+
if (!t)
|
|
76
|
+
return i;
|
|
77
|
+
if (t.type === "extent" && t.xmax === t.xmin) {
|
|
78
|
+
const r = new h({ rings: [this.outerRing] });
|
|
79
|
+
return i.graphic = new g({ geometry: r, symbol: e }), i;
|
|
80
|
+
}
|
|
81
|
+
t = this.toWGS84(t);
|
|
82
|
+
let a, o;
|
|
83
|
+
if (t.type === "extent") {
|
|
84
|
+
const r = this.checkPolyOverlap(t);
|
|
85
|
+
r ? (a = r?.ring?.reverse(), o = r?.oring?.reverse()) : a = [
|
|
86
|
+
[t.xmin, t.ymax],
|
|
87
|
+
[t.xmax, t.ymax],
|
|
88
|
+
[t.xmax, t.ymin],
|
|
89
|
+
[t.xmin, t.ymin],
|
|
90
|
+
[t.xmin, t.ymax]
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
let s = [];
|
|
94
|
+
t.xmin === t.xmax ? s = [this.outerRing] : s = [this.outerRing, a?.reverse() || [[]]];
|
|
95
|
+
const n = new h({
|
|
96
|
+
rings: s
|
|
97
|
+
});
|
|
98
|
+
return o && (i.overlap = o), i.graphic = new g({ geometry: n, symbol: e }), i;
|
|
99
|
+
}
|
|
100
|
+
checkPolyOverlap(t) {
|
|
101
|
+
const e = {};
|
|
102
|
+
if (t.xmax <= t.xmin) {
|
|
103
|
+
const i = [
|
|
104
|
+
[t.xmin, t.ymin],
|
|
105
|
+
[180, t.ymin],
|
|
106
|
+
[180, t.ymax],
|
|
107
|
+
[t.xmin, t.ymax],
|
|
108
|
+
[t.xmin, t.ymin]
|
|
109
|
+
], a = [
|
|
110
|
+
[-180, t.ymin],
|
|
111
|
+
[t.xmax, t.ymin],
|
|
112
|
+
[t.xmax, t.ymax],
|
|
113
|
+
[-180, t.ymax],
|
|
114
|
+
[-180, t.ymin]
|
|
115
|
+
], o = 180 - Math.abs(t.xmax), s = 180 - Math.abs(t.xmin);
|
|
116
|
+
return o > s ? (e.ring = a, e.oring = i) : (e.ring = i, e.oring = a), e;
|
|
117
|
+
} else
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
toWGS84(t) {
|
|
121
|
+
const e = new C({ wkid: 4326 });
|
|
122
|
+
return p.canProject(t, e) ? p.project(t, e) : t;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
function U(m) {
|
|
126
|
+
if (!m)
|
|
127
|
+
return;
|
|
128
|
+
let t = E.assetsPath;
|
|
129
|
+
t.endsWith("/") || (t += "/"), m?.firstElementChild?.insertAdjacentHTML(
|
|
130
|
+
"beforebegin",
|
|
131
|
+
`<link rel="stylesheet" href="${t}esri/themes/light/main.css" />`
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
class q extends G {
|
|
135
|
+
constructor() {
|
|
136
|
+
super(...arguments), this.polygonSymbol = new b({
|
|
137
|
+
style: "solid",
|
|
138
|
+
color: new L([227, 139, 79, 0]),
|
|
139
|
+
outline: {
|
|
140
|
+
color: new L([65, 105, 255]),
|
|
141
|
+
width: 0
|
|
142
|
+
}
|
|
143
|
+
}), this.dlOverlapSymbol = new b({
|
|
144
|
+
style: "solid",
|
|
145
|
+
color: [255, 0, 0, 0.5],
|
|
146
|
+
outline: {
|
|
147
|
+
color: [65, 105, 255],
|
|
148
|
+
width: 0
|
|
149
|
+
}
|
|
150
|
+
}), this.messages = B(), this.searchContainer = d(), this.mapContainer = d(), this.topCoordField = d(), this.bottomCoordField = d(), this.leftCoordField = d(), this.rightCoordField = d(), this.minLatLabel = "", this.maxLatLabel = "", this.minLngLabel = "", this.maxLngLabel = "", this.ymax = "0", this.ymin = "0", this.xmin = "0", this.xmax = "0", this.isDrawStart = !1, this.loading = !0, this.active = !1, this.contentOnly = !1, this.isArea = !1, this.arcgisExtentPickerChange = w(), this.arcgisExtentPickerClose = w(), this.arcgisExtentPickerSave = w();
|
|
151
|
+
}
|
|
152
|
+
static {
|
|
153
|
+
this.properties = { ymax: 16, ymin: 16, xmin: 16, xmax: 16, isDrawStart: 16, loading: 16, featureExtent: 16, initialValue: 16, active: 5, extentValue: 0, itemId: 1, portal: 0, extentService: 1, contentOnly: 5, isArea: 5 };
|
|
154
|
+
}
|
|
155
|
+
static {
|
|
156
|
+
this.styles = W;
|
|
157
|
+
}
|
|
158
|
+
getExtent() {
|
|
159
|
+
return this.getExtentValue();
|
|
160
|
+
}
|
|
161
|
+
async load() {
|
|
162
|
+
if (this.itemId) {
|
|
163
|
+
if (this.portal) {
|
|
164
|
+
const e = this.portal.url.replace("/sharing/rest/", "");
|
|
165
|
+
e !== E.portalUrl && (E.portalUrl = e);
|
|
166
|
+
}
|
|
167
|
+
const t = new Intl.NumberFormat($.getLocale(), {
|
|
168
|
+
minimumFractionDigits: 1,
|
|
169
|
+
maximumFractionDigits: 1
|
|
170
|
+
});
|
|
171
|
+
this.minLatLabel = t.format(-90), this.maxLatLabel = t.format(90), this.minLngLabel = t.format(-180), this.maxLngLabel = t.format(180), this.item = new A({
|
|
172
|
+
id: this.itemId,
|
|
173
|
+
portal: this.portal
|
|
174
|
+
}), await this.item.load();
|
|
175
|
+
}
|
|
176
|
+
if (this.portal && (this.orgExtent = this.portal.defaultExtent?.toJSON()), this.portal?.region) {
|
|
177
|
+
const t = this.portal.region, e = await T(`${this.portal.url.replace("/sharing/rest/", "")}/sharing/rest/portals/self?region=${t}&default=true&f=pjson`, {
|
|
178
|
+
responseType: "json"
|
|
179
|
+
});
|
|
180
|
+
this.orgRegionExtent = e.data.defaultExtent;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
async loaded() {
|
|
184
|
+
U(this.el.shadowRoot), await this.initMap();
|
|
185
|
+
}
|
|
186
|
+
convertToNumber(t) {
|
|
187
|
+
return this.parseNumber(t);
|
|
188
|
+
}
|
|
189
|
+
setFeatureExtent(t) {
|
|
190
|
+
let e;
|
|
191
|
+
t.spatialReference.isGeographic ? e = new c({
|
|
192
|
+
xmax: t.xmax,
|
|
193
|
+
xmin: t.xmin,
|
|
194
|
+
ymax: t.ymax,
|
|
195
|
+
ymin: t.ymin,
|
|
196
|
+
spatialReference: { wkid: 4326 }
|
|
197
|
+
}) : e = this.toWGS84(t), this.featureExtent ? (this.featureExtent.xmin = Math.min(e.xmin, this.featureExtent.xmin), this.featureExtent.ymin = Math.min(e.ymin, this.featureExtent.ymin), this.featureExtent.xmax = Math.max(e.xmax, this.featureExtent.xmax), this.featureExtent.ymax = Math.max(e.ymax, this.featureExtent.ymax)) : this.featureExtent = e;
|
|
198
|
+
}
|
|
199
|
+
async initMap() {
|
|
200
|
+
const t = new I({
|
|
201
|
+
basemap: "streets-vector"
|
|
202
|
+
});
|
|
203
|
+
if (this.extentService) {
|
|
204
|
+
const e = new P({
|
|
205
|
+
url: this.extentService
|
|
206
|
+
}), i = new M({
|
|
207
|
+
baseLayers: [e],
|
|
208
|
+
id: "org_basemap"
|
|
209
|
+
});
|
|
210
|
+
t.basemap = i;
|
|
211
|
+
}
|
|
212
|
+
if (this.mask = new J(t), this.mask.init(), this.dateLineLayer = new y({ id: "dateLineLayer" }), t.add(this.dateLineLayer), this.areasLayer = new y({ id: "areaGraphics" }), t.add(this.areasLayer), this.item?.type === "Feature Service" || this.item?.type === "Map Service") {
|
|
213
|
+
const e = await R.fromPortalItem({ portalItem: this.item });
|
|
214
|
+
e.visible = !1, t.add(e), e.when((i) => {
|
|
215
|
+
if ("layers" in i)
|
|
216
|
+
for (let a = 0; a < i.layers.length; a++)
|
|
217
|
+
i.layers.getItemAt(a).queryExtent().then((s) => {
|
|
218
|
+
s.extent && this.setFeatureExtent(s.extent);
|
|
219
|
+
});
|
|
220
|
+
else
|
|
221
|
+
i.queryExtent().then((a) => {
|
|
222
|
+
a.extent && this.setFeatureExtent(a.extent);
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
this.view = new N({
|
|
227
|
+
map: t,
|
|
228
|
+
popup: {
|
|
229
|
+
dockEnabled: !0,
|
|
230
|
+
dockOptions: {
|
|
231
|
+
// Disables the dock button from the popup
|
|
232
|
+
buttonEnabled: !1,
|
|
233
|
+
// Ignore the default sizes that trigger responsive docking
|
|
234
|
+
breakpoint: !1,
|
|
235
|
+
position: "bottom-center"
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
zoom: 2,
|
|
239
|
+
center: [0, 0],
|
|
240
|
+
container: this.mapContainer.value
|
|
241
|
+
}), this.view.when(async () => {
|
|
242
|
+
if (this.basemapExtent = this.getBasemapExtent(), this.itemExtent = this.item?.extent, this.extentValue?.xmax !== void 0 && this.extentValue?.xmin !== void 0 && this.extentValue?.ymax !== void 0 && this.extentValue?.ymin !== void 0)
|
|
243
|
+
this.ymin = this.extentValue?.ymin || "0", this.ymax = this.extentValue?.ymax || "0", this.xmax = this.extentValue?.xmax || "0", this.xmin = this.extentValue?.xmin || "0", this.handleInputChange(), this.initialValue = this.currentExtent;
|
|
244
|
+
else if (this.itemExtent)
|
|
245
|
+
await this.drawExtent(this.itemExtent), this.initialValue = this.itemExtent;
|
|
246
|
+
else if (this.featureExtent)
|
|
247
|
+
await this.drawExtent(this.featureExtent), this.initialValue = this.featureExtent;
|
|
248
|
+
else if (this.portal?.defaultExtent) {
|
|
249
|
+
const i = this.portal.defaultExtent.toJSON();
|
|
250
|
+
await this.drawExtent(i), this.initialValue = i;
|
|
251
|
+
}
|
|
252
|
+
this.initSearchWidget(), this.loading = !1;
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
getBasemapExtent() {
|
|
256
|
+
try {
|
|
257
|
+
let t, e, i, a;
|
|
258
|
+
if (this.view?.map?.basemap?.hasOwnProperty("baseLayers")) {
|
|
259
|
+
const o = this.view.map.basemap.baseLayers;
|
|
260
|
+
if (o.length > 0) {
|
|
261
|
+
for (const n of o) {
|
|
262
|
+
const r = n.fullExtent || { xmin: 0, ymin: 0, xmax: 0, ymax: 0 };
|
|
263
|
+
t = t !== void 0 && t > r?.xmin ? t : r.xmin, i = i !== void 0 && i > r?.ymin ? i : r.ymin, e = e !== void 0 && e < r.xmax ? e : r.xmax, a = a !== void 0 && a < r.ymax ? a : r.ymax;
|
|
264
|
+
}
|
|
265
|
+
return new c({
|
|
266
|
+
xmin: t,
|
|
267
|
+
xmax: e,
|
|
268
|
+
ymin: i,
|
|
269
|
+
ymax: a,
|
|
270
|
+
spatialReference: this.view.spatialReference
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return new c({
|
|
275
|
+
ymin: -90,
|
|
276
|
+
ymax: 90,
|
|
277
|
+
xmin: -180,
|
|
278
|
+
xmax: 180,
|
|
279
|
+
spatialReference: { wkid: 4326 }
|
|
280
|
+
});
|
|
281
|
+
} catch {
|
|
282
|
+
return new c({
|
|
283
|
+
ymin: -90,
|
|
284
|
+
ymax: 90,
|
|
285
|
+
xmin: -180,
|
|
286
|
+
xmax: 180,
|
|
287
|
+
spatialReference: { wkid: 4326 }
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
async drawExtent(t) {
|
|
292
|
+
if (!t || !t.xmin && t.xmin !== 0 || !t.xmax && t.xmax !== 0 || !t.ymin && t.ymin !== 0 || !t.ymax && t.ymax !== 0)
|
|
293
|
+
return;
|
|
294
|
+
const e = new h();
|
|
295
|
+
e.spatialReference = t.spatialReference, e.addRing([
|
|
296
|
+
new u({ x: t.xmin, y: t.ymin }),
|
|
297
|
+
new u({ x: t.xmin, y: t.ymax }),
|
|
298
|
+
new u({ x: t.xmax, y: t.ymax }),
|
|
299
|
+
new u({ x: t.xmax, y: t.ymin }),
|
|
300
|
+
new u({ x: t.xmin, y: t.ymin })
|
|
301
|
+
]), await this.addInitialExtentPicker({ geometry: e });
|
|
302
|
+
}
|
|
303
|
+
toWGS84(t) {
|
|
304
|
+
const e = new C({ wkid: 4326 });
|
|
305
|
+
return p.canProject(t, e) ? p.project(t, e) : t;
|
|
306
|
+
}
|
|
307
|
+
formatNum(t) {
|
|
308
|
+
return $.formatNumber(t, {
|
|
309
|
+
minimumFractionDigits: 6,
|
|
310
|
+
maximumFractionDigits: 6
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
strippedInvalidChars(t) {
|
|
314
|
+
const e = Array.from({ length: 10 }, (i, a) => a.toString()).join("");
|
|
315
|
+
return Array.from(t).filter((i) => e.includes(i) || i === "." || i === "-").join("");
|
|
316
|
+
}
|
|
317
|
+
parseNumber(t) {
|
|
318
|
+
let e = t.replace(",", ".");
|
|
319
|
+
return e = this.strippedInvalidChars(e), parseFloat(e);
|
|
320
|
+
}
|
|
321
|
+
async startupSketching(t, e) {
|
|
322
|
+
if (t && (t = this.toMap(t)), this.sketchViewModel = new D({
|
|
323
|
+
updateOnGraphicClick: !1,
|
|
324
|
+
layer: this.areasLayer,
|
|
325
|
+
view: this.view,
|
|
326
|
+
polygonSymbol: this.polygonSymbol
|
|
327
|
+
}), this.clearAllGraphics(), !e)
|
|
328
|
+
if (t) {
|
|
329
|
+
t.type === "extent" && (t = h.fromExtent(t)), this.currentExtent = this.toWGS84(t?.extent?.toJSON()), this.ymax = this.formatNum(this.currentExtent.ymax), this.ymin = this.formatNum(this.currentExtent.ymin), this.xmin = this.formatNum(this.currentExtent.xmin), this.xmax = this.formatNum(this.currentExtent.xmax), this.arcgisExtentPickerChange.emit(this.getExtentValue()), t = V.intersect(t, this.basemapExtent);
|
|
330
|
+
const i = new g({
|
|
331
|
+
symbol: this.polygonSymbol,
|
|
332
|
+
geometry: t
|
|
333
|
+
});
|
|
334
|
+
i.geometry && (this.fallbackExtent = i.geometry.extent, this.areasLayer?.add(i), this.mask?.clear(), this.mask?.update(i.geometry.extent), await this.zoomTo(), setTimeout(async () => {
|
|
335
|
+
try {
|
|
336
|
+
i.layer && await this.sketchViewModel?.update([i], {
|
|
337
|
+
tool: "transform",
|
|
338
|
+
enableRotation: !1,
|
|
339
|
+
toggleToolOnClick: !1,
|
|
340
|
+
reshapeOptions: {
|
|
341
|
+
enableCreateCurveFromStraightEdge: !1
|
|
342
|
+
}
|
|
343
|
+
});
|
|
344
|
+
} catch {
|
|
345
|
+
}
|
|
346
|
+
}, 0));
|
|
347
|
+
} else
|
|
348
|
+
this.sketchViewModel.create("rectangle");
|
|
349
|
+
this.addSketchListeners();
|
|
350
|
+
}
|
|
351
|
+
addSketchListeners() {
|
|
352
|
+
this.sketchViewModel?.on("update", async (t) => {
|
|
353
|
+
if (!t.toolEventInfo)
|
|
354
|
+
return;
|
|
355
|
+
const e = t?.graphics?.[0]?.geometry?.extent, i = e && this.mask?.update(e);
|
|
356
|
+
if (t.toolEventInfo.type === "scale-stop" || t.toolEventInfo.type === "move-stop") {
|
|
357
|
+
let a;
|
|
358
|
+
const o = parseFloat(`${e?.xmax ?? "0"}`).toFixed(6), s = parseFloat(`${e?.xmin ?? "0"}`).toFixed(6), n = parseFloat(`${e?.ymax ?? "0"}`).toFixed(6), r = parseFloat(`${e?.ymin ?? "0"}`).toFixed(6);
|
|
359
|
+
if (o === s || n === r ? (a = e, o === s && (a.xmax += 1), n === r && (a.ymax += 1)) : a = t?.graphics?.[0]?.geometry?.extent, i?.overlap) {
|
|
360
|
+
const v = i.graphic?.geometry, k = new h({
|
|
361
|
+
rings: [v?.rings[1]]
|
|
362
|
+
});
|
|
363
|
+
await this.addInitialExtentPicker({ geometry: k.extent });
|
|
364
|
+
} else
|
|
365
|
+
await this.startupSketching(a);
|
|
366
|
+
this.isDrawStart = !1;
|
|
367
|
+
} else if (this.dateLineLayer?.removeAll(), i?.overlap) {
|
|
368
|
+
const a = new g({
|
|
369
|
+
geometry: new h({ rings: [i.overlap] }),
|
|
370
|
+
symbol: this.dlOverlapSymbol
|
|
371
|
+
});
|
|
372
|
+
this.dateLineLayer?.add(a);
|
|
373
|
+
}
|
|
374
|
+
}), this.sketchViewModel?.on("create", async (t) => {
|
|
375
|
+
if (this.dateLineLayer?.removeAll(), !t.graphic)
|
|
376
|
+
return;
|
|
377
|
+
this.mask?.clear();
|
|
378
|
+
const e = t?.graphic?.geometry?.extent, i = this.mask?.add(e);
|
|
379
|
+
if (i?.overlap ? (this.remainderPoly = new g({
|
|
380
|
+
geometry: new h({ rings: [i.overlap] }),
|
|
381
|
+
symbol: this.dlOverlapSymbol
|
|
382
|
+
}), this.dateLineLayer?.add(this.remainderPoly)) : this.remainderPoly = null, t.state === "complete") {
|
|
383
|
+
let a;
|
|
384
|
+
const o = t.graphic?.geometry?.extent?.xmin || 0;
|
|
385
|
+
let s = t.graphic?.geometry?.extent?.xmax || 0;
|
|
386
|
+
const n = t.graphic?.geometry?.extent?.ymin || 0;
|
|
387
|
+
let r = t.graphic?.geometry?.extent?.ymax || 0;
|
|
388
|
+
if (o === s || n === r)
|
|
389
|
+
o === s && (s = s + 1), n === r && (r = r + 1), a = new c({
|
|
390
|
+
xmin: o,
|
|
391
|
+
xmax: s,
|
|
392
|
+
ymin: n,
|
|
393
|
+
ymax: r,
|
|
394
|
+
spatialReference: t.graphic?.geometry?.extent?.spatialReference
|
|
395
|
+
});
|
|
396
|
+
else {
|
|
397
|
+
const v = i?.graphic?.geometry;
|
|
398
|
+
a = new h({
|
|
399
|
+
rings: [v?.rings[1]]
|
|
400
|
+
}).extent;
|
|
401
|
+
}
|
|
402
|
+
this.remainderPoly ? await this.addInitialExtentPicker({ geometry: a }) : await this.startupSketching(a), this.isDrawStart = !1, this.mapContainer.value.focus();
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
async addInitialExtentPicker(t) {
|
|
407
|
+
if (!t.geometry) {
|
|
408
|
+
await this.startupSketching(null, !0);
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
const e = this.toMap(t.geometry);
|
|
412
|
+
await this.startupSketching(e);
|
|
413
|
+
}
|
|
414
|
+
async zoomTo() {
|
|
415
|
+
if (this.areasLayer?.graphics) {
|
|
416
|
+
let t;
|
|
417
|
+
if (this.areasLayer.graphics.forEach((i) => {
|
|
418
|
+
const a = i?.geometry?.extent;
|
|
419
|
+
t = t ? t.union(a) : a;
|
|
420
|
+
}), !t)
|
|
421
|
+
return;
|
|
422
|
+
const e = this.toMap(c.fromJSON(t.toJSON()).expand(1.35));
|
|
423
|
+
e && await this.view?.goTo(e);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
clearAllGraphics() {
|
|
427
|
+
this.sketchViewModel?.cancel(), this.view?.map?.layers?.forEach((e) => {
|
|
428
|
+
e.type === "graphics" && e.removeAll();
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
toMap(t) {
|
|
432
|
+
return this.view && p.canProject(t, this.view) ? p.project(t, this.view.spatialReference) : t;
|
|
433
|
+
}
|
|
434
|
+
initSearchWidget() {
|
|
435
|
+
const t = new O({
|
|
436
|
+
view: this.view,
|
|
437
|
+
popupEnabled: !1,
|
|
438
|
+
resultGraphicEnabled: !1,
|
|
439
|
+
container: this.searchContainer.value
|
|
440
|
+
}), e = t.viewModel;
|
|
441
|
+
t.viewModel.allSources.on("change", () => {
|
|
442
|
+
e.allSources.forEach((i) => {
|
|
443
|
+
i.zoomScale = null;
|
|
444
|
+
});
|
|
445
|
+
}), t.on("select-result", (i) => {
|
|
446
|
+
this.startupSketching(i.result.extent);
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
getExtentValue() {
|
|
450
|
+
return {
|
|
451
|
+
extent: {
|
|
452
|
+
ymin: this.normalizeDecimal(this.ymin),
|
|
453
|
+
ymax: this.normalizeDecimal(this.ymax),
|
|
454
|
+
xmin: this.normalizeDecimal(this.xmin),
|
|
455
|
+
xmax: this.normalizeDecimal(this.xmax)
|
|
456
|
+
}
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
handleInputChange() {
|
|
460
|
+
const t = this.parseNumber(this.ymin), e = this.parseNumber(this.ymax), i = this.parseNumber(this.xmin), a = this.parseNumber(this.xmax), o = new c({
|
|
461
|
+
spatialReference: { wkid: 4326 },
|
|
462
|
+
xmin: i,
|
|
463
|
+
xmax: a,
|
|
464
|
+
ymin: t,
|
|
465
|
+
ymax: e
|
|
466
|
+
});
|
|
467
|
+
this.currentExtent = o, this.drawExtent(o);
|
|
468
|
+
}
|
|
469
|
+
handleSave() {
|
|
470
|
+
if (!this.topCoordField.value.isValid()) {
|
|
471
|
+
this.topCoordField.value.setFocus();
|
|
472
|
+
return;
|
|
473
|
+
}
|
|
474
|
+
if (!this.bottomCoordField.value.isValid()) {
|
|
475
|
+
this.bottomCoordField.value.setFocus();
|
|
476
|
+
return;
|
|
477
|
+
}
|
|
478
|
+
if (!this.leftCoordField.value.isValid()) {
|
|
479
|
+
this.leftCoordField.value.setFocus();
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
if (!this.rightCoordField.value.isValid()) {
|
|
483
|
+
this.rightCoordField.value.setFocus();
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
this.arcgisExtentPickerSave.emit(this.getExtentValue());
|
|
487
|
+
}
|
|
488
|
+
normalizeDecimal(t) {
|
|
489
|
+
return t.replace(",", ".");
|
|
490
|
+
}
|
|
491
|
+
formatLongitudeError(t) {
|
|
492
|
+
return t.replace("${minLng}", this.minLngLabel).replace("${maxLng}", this.maxLngLabel);
|
|
493
|
+
}
|
|
494
|
+
formatLatitudeError(t) {
|
|
495
|
+
return t.replace("${minLat}", this.minLatLabel).replace("${maxLat}", this.maxLatLabel);
|
|
496
|
+
}
|
|
497
|
+
async timeout(t) {
|
|
498
|
+
return await new Promise((e) => setTimeout(e, t));
|
|
499
|
+
}
|
|
500
|
+
renderModal() {
|
|
501
|
+
return l`<calcite-dialog class="extent-picker-modal" role=dialog scale=l outside-close-disabled .open=${this.active} placement=cover @calciteDialogClose=${() => {
|
|
502
|
+
this.arcgisExtentPickerClose.emit();
|
|
503
|
+
}} style=${z({
|
|
504
|
+
"--calcite-dialog-content-space": "0"
|
|
505
|
+
})} .heading=${this.isArea ? this.messages.setArea : this.messages.setExtent} heading-level=3><div class="extent-picker-content">${this.renderContent()}</div>${this.initialValue && l`<calcite-button appearance=outline slot=footer-start icon-start=reset @click=${async () => {
|
|
506
|
+
if (this.initialValue) {
|
|
507
|
+
const t = +this.ymin === f(this.initialValue.ymin) && +this.ymax === f(this.initialValue.ymax);
|
|
508
|
+
+this.xmin === f(this.initialValue.xmin) && +this.xmax === f(this.initialValue.xmax) && t && (this.ymin = "0", this.ymax = "0", this.xmin = "0", this.xmax = "0", await this.timeout(100)), this.drawExtent(this.initialValue);
|
|
509
|
+
}
|
|
510
|
+
}}>${this.messages.revert}</calcite-button>` || ""}<calcite-button appearance=outline slot=footer-end @click=${() => this.arcgisExtentPickerClose.emit()}>${this.messages.cancel}</calcite-button><calcite-button slot=footer-end @click=${async () => this.handleSave()}>${this.messages.save}</calcite-button></calcite-dialog>`;
|
|
511
|
+
}
|
|
512
|
+
renderContent() {
|
|
513
|
+
const t = !!(this.portal && !this.portal.id), e = !!(this.orgExtent && !t), i = !!(this.orgRegionExtent && !t), a = !!this.featureExtent;
|
|
514
|
+
return l`<div class="side-panel">${!(!e && !i && !a) && l`<div>${this.isArea ? this.messages.areaBasedOn : this.messages.extentBasedOn}</div>${e && l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=organization @click=${() => {
|
|
515
|
+
this.drawExtent(this.orgExtent);
|
|
516
|
+
}}>${this.messages.orgExtent}</calcite-button>` || ""}${i && l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=organization @click=${() => {
|
|
517
|
+
this.drawExtent(this.orgRegionExtent);
|
|
518
|
+
}}>${this.messages.orgRegion}</calcite-button>` || ""}${a && l`<calcite-button class="extent-button" alignment=start scale=l kind=neutral appearance=outline-fill icon-start=feature-layer @click=${() => {
|
|
519
|
+
this.drawExtent(this.featureExtent);
|
|
520
|
+
}}>${this.messages.currentFeatures}</calcite-button>` || ""}` || ""}<div class="use-location-header">${this.messages.useLocation}</div><div class="search-container"><div ${x(this.searchContainer)}></div></div><div><div class="use-location-header">${this.isArea ? this.messages.drawAreaTitle : this.messages.drawExtentTitle}</div><calcite-action .text=${(this.isArea ? this.messages.drawArea : this.messages.drawExtent) || ""} text-enabled icon=rectangle-plus .active=${this.isDrawStart} .indicator=${this.isDrawStart} @click=${async () => {
|
|
521
|
+
this.isDrawStart = !this.isDrawStart, this.isDrawStart ? (this.sketchViewModel || await this.startupSketching(), this.clearAllGraphics(), this.sketchViewModel?.create("rectangle")) : (this.sketchViewModel?.cancel(), this.startupSketching(this.fallbackExtent));
|
|
522
|
+
}}></calcite-action></div><div class="coordinates-section"><calcite-accordion appearance=transparent icon-position=start scale=l><calcite-accordion-item .heading=${this.messages.coordinates}><p>${this.messages.coordinatesDescription}</p><arcgis-portal-extent-picker-coord-field input-id=top-coord .label=${this.messages.top} .value=${this.strippedInvalidChars(this.ymax)} .errorMessage=${this.formatLatitudeError(this.messages.invalidTop || "")} min=-90 max=90 @arcgisCoordChange=${(s) => {
|
|
523
|
+
this.ymax = s.detail;
|
|
524
|
+
const n = this.bottomCoordField.value.checkRelatedField();
|
|
525
|
+
n && (this.ymin = n), this.handleInputChange();
|
|
526
|
+
}} .relatedErrorMessage=${this.messages.topGreaterThanBottom} .validateRelated=${(s) => s > this.convertToNumber(this.ymin)} ${x(this.topCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=bottom-coord .label=${this.messages.bottom} .value=${this.strippedInvalidChars(this.ymin)} .errorMessage=${this.formatLatitudeError(this.messages.invalidBottom || "")} min=-90 max=90 @arcgisCoordChange=${(s) => {
|
|
527
|
+
this.ymin = s.detail;
|
|
528
|
+
const n = this.topCoordField.value.checkRelatedField();
|
|
529
|
+
n && (this.ymax = n), this.handleInputChange();
|
|
530
|
+
}} .relatedErrorMessage=${this.messages.bottomLessThanTop} .validateRelated=${(s) => s < this.convertToNumber(this.ymax)} ${x(this.bottomCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=left-coord .label=${this.messages.left} .value=${this.strippedInvalidChars(this.xmin)} .errorMessage=${this.formatLongitudeError(this.messages.invalidLeft || "")} min=-180 max=180 @arcgisCoordChange=${(s) => {
|
|
531
|
+
this.xmin = s.detail;
|
|
532
|
+
const n = this.rightCoordField.value.checkRelatedField();
|
|
533
|
+
n && (this.xmax = n), this.handleInputChange();
|
|
534
|
+
}} .relatedErrorMessage=${this.messages.leftLessThanRight} .validateRelated=${(s) => s < this.convertToNumber(this.xmax)} ${x(this.leftCoordField)}></arcgis-portal-extent-picker-coord-field><arcgis-portal-extent-picker-coord-field input-id=right-coord .label=${this.messages.right} .value=${this.strippedInvalidChars(this.xmax)} .errorMessage=${this.formatLongitudeError(this.messages.invalidRight || "")} min=-180 max=180 @arcgisCoordChange=${(s) => {
|
|
535
|
+
this.xmax = s.detail;
|
|
536
|
+
const n = this.leftCoordField.value.checkRelatedField();
|
|
537
|
+
n && (this.xmin = n), this.handleInputChange();
|
|
538
|
+
}} .relatedErrorMessage=${this.messages.rightGreaterThanLeft} .validateRelated=${(s) => s > this.convertToNumber(this.xmin)} ${x(this.rightCoordField)}></arcgis-portal-extent-picker-coord-field></calcite-accordion-item></calcite-accordion></div></div><div class="map-panel">${this.loading && l`<calcite-loader class="map-loader" label="Loading the application"></calcite-loader>` || ""}<div class=${j({
|
|
539
|
+
"map-container": !0,
|
|
540
|
+
"map-container--loaded": !this.loading
|
|
541
|
+
})} ${x(this.mapContainer)}></div></div>`;
|
|
542
|
+
}
|
|
543
|
+
render() {
|
|
544
|
+
return this.contentOnly ? l`<div class="extent-picker-content">${this.renderContent()}</div>` : this.renderModal();
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
function f(m) {
|
|
548
|
+
return Math.round(m * 1e6) / 1e6;
|
|
549
|
+
}
|
|
550
|
+
S("arcgis-portal-extent-picker", q);
|
|
551
|
+
export {
|
|
552
|
+
q as ArcgisPortalExtentPicker
|
|
553
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "@esri/calcite-components/components/calcite-dialog";
|
|
2
|
+
import "@esri/calcite-components/components/calcite-button";
|
|
3
|
+
import "@esri/calcite-components/components/calcite-action";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-accordion";
|
|
5
|
+
import "@esri/calcite-components/components/calcite-accordion-item";
|
|
6
|
+
import "../arcgis-portal-extent-picker-coord-field/index.js";
|
|
7
|
+
import "@esri/calcite-components/components/calcite-loader";
|
|
8
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "@esri/calcite-components/components/calcite-dialog";
|
|
2
|
+
import "@esri/calcite-components/components/calcite-button";
|
|
3
|
+
import "@esri/calcite-components/components/calcite-action";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-accordion";
|
|
5
|
+
import "@esri/calcite-components/components/calcite-accordion-item";
|
|
6
|
+
import "../arcgis-portal-extent-picker-coord-field/index.js";
|
|
7
|
+
import "@esri/calcite-components/components/calcite-loader";
|
|
8
|
+
export * from "./customElement.js";
|