@arcgis/map-components 5.2.0-next.13 → 5.2.0-next.15
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/{QKER2AXN.js → 47YKMHEI.js} +1 -1
- package/dist/cdn/BXK5DVDN.js +2 -0
- package/dist/cdn/{MCIDCKIS.js → FXNJNCK7.js} +1 -1
- package/dist/cdn/IFWIGLKK.js +2 -0
- package/dist/cdn/IHDXJ4C3.js +2 -0
- package/dist/cdn/{R66ZOECE.js → IYEZB6EU.js} +1 -1
- package/dist/cdn/{2KXO5AYW.js → MJ2AUX7N.js} +1 -1
- package/dist/cdn/{3PT4D6BD.js → UA3OPWND.js} +1 -1
- package/dist/cdn/{HSGEBM7Q.js → XVNU3EUN.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/useArcgisViewReadyError.js +7 -7
- package/dist/components/arcgis-editor/customElement.d.ts +63 -0
- package/dist/components/arcgis-editor/customElement.js +5 -5
- package/dist/components/arcgis-features-next/customElement.js +2 -2
- package/dist/components/arcgis-layer-list-next/customElement.js +18 -5
- package/dist/components/arcgis-sketch/customElement.d.ts +90 -1
- package/dist/components/arcgis-sketch/customElement.js +35 -25
- package/dist/components/arcgis-utility-network-trace-location/customElement.js +66 -83
- 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/loader.js +2 -2
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/package.json +5 -5
- package/dist/cdn/25P6ABDR.js +0 -2
- package/dist/cdn/L3BUIPXT.js +0 -2
- package/dist/cdn/TXDMKNIB.js +0 -2
|
@@ -8,9 +8,10 @@ import type SnappingOptions from "@arcgis/core/views/interactive/snapping/Snappi
|
|
|
8
8
|
import type TextSymbol from "@arcgis/core/symbols/TextSymbol.js";
|
|
9
9
|
import type SketchTooltipOptions from "@arcgis/core/views/interactive/sketch/SketchTooltipOptions.js";
|
|
10
10
|
import type Collection from "@arcgis/core/core/Collection.js";
|
|
11
|
+
import type { SketchGroupName } from "@arcgis/core/applications/ExperienceBuilder/sketchUtils.js";
|
|
11
12
|
import type { PublicLitElement as LitElement } from "@arcgis/lumina";
|
|
12
13
|
import type { ArcgisReferenceElement, IconName } from "../types.js";
|
|
13
|
-
import type { CreateOptions, CreateTool, UpdateEvent, UndoEvent, RedoEvent, DeleteEvent, CreateEvent, SketchTool, SelectionTool, CreationMode, UpdateOptions, Layout, SketchPointSymbol, SketchPolygonSymbol, SketchPolylineSymbol, State, ToolbarKind } from "@arcgis/core/widgets/Sketch/types.js";
|
|
14
|
+
import type { CreateOptions, CreateTool, UpdateEvent, UndoEvent, RedoEvent, DeleteEvent, CreateEvent, CustomToolOptions, CustomActionProperties, SketchTool, SelectionTool, CreationMode, UpdateOptions, Layout, SketchPointSymbol, SketchPolygonSymbol, SketchPolylineSymbol, State, ToolbarKind } from "@arcgis/core/widgets/Sketch/types.js";
|
|
14
15
|
import type { MapViewOrSceneView } from "@arcgis/core/views/MapViewOrSceneView.js";
|
|
15
16
|
import type { Icon } from "@esri/calcite-components/components/calcite-icon";
|
|
16
17
|
import type { Button as Button } from "@esri/calcite-components/components/calcite-button";
|
|
@@ -222,6 +223,69 @@ export abstract class ArcgisSketch extends LitElement {
|
|
|
222
223
|
* @since 5.0
|
|
223
224
|
*/
|
|
224
225
|
accessor hideSnappingControlsElementsFeatureEnabledToggle: boolean;
|
|
226
|
+
/**
|
|
227
|
+
* Indicates whether to hide the `gridControls` (configuration of the snapping grid).
|
|
228
|
+
*
|
|
229
|
+
* @default false
|
|
230
|
+
* @since 5.1
|
|
231
|
+
*/
|
|
232
|
+
accessor hideSnappingControlsElementsGridControls: boolean;
|
|
233
|
+
/**
|
|
234
|
+
* Indicates whether to hide the `colorSelection` within the snapping grid controls.
|
|
235
|
+
*
|
|
236
|
+
* @default false
|
|
237
|
+
* @since 5.1
|
|
238
|
+
*/
|
|
239
|
+
accessor hideSnappingControlsElementsGridControlsElementsColorSelection: boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Indicates whether to hide the `dynamicScaleToggle` within the snapping grid controls.
|
|
242
|
+
*
|
|
243
|
+
* @default false
|
|
244
|
+
* @since 5.1
|
|
245
|
+
*/
|
|
246
|
+
accessor hideSnappingControlsElementsGridControlsElementsDynamicScaleToggle: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Indicates whether to hide the `lineIntervalInput` within the snapping grid controls.
|
|
249
|
+
*
|
|
250
|
+
* @default false
|
|
251
|
+
* @since 5.1
|
|
252
|
+
*/
|
|
253
|
+
accessor hideSnappingControlsElementsGridControlsElementsLineIntervalInput: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* Indicates whether to hide the `numericInputs` within the snapping grid controls.
|
|
256
|
+
*
|
|
257
|
+
* @default false
|
|
258
|
+
* @since 5.1
|
|
259
|
+
*/
|
|
260
|
+
accessor hideSnappingControlsElementsGridControlsElementsNumericInputs: boolean;
|
|
261
|
+
/**
|
|
262
|
+
* Indicates whether to hide the `outOfScaleWarning` within the snapping grid controls.
|
|
263
|
+
*
|
|
264
|
+
* @default false
|
|
265
|
+
* @since 5.1
|
|
266
|
+
*/
|
|
267
|
+
accessor hideSnappingControlsElementsGridControlsElementsOutOfScaleWarning: boolean;
|
|
268
|
+
/**
|
|
269
|
+
* Indicates whether to hide the `placementButtons` within the snapping grid controls.
|
|
270
|
+
*
|
|
271
|
+
* @default false
|
|
272
|
+
* @since 5.1
|
|
273
|
+
*/
|
|
274
|
+
accessor hideSnappingControlsElementsGridControlsElementsPlacementButtons: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Indicates whether to hide the `rotateWithMapToggle` within the snapping grid controls.
|
|
277
|
+
*
|
|
278
|
+
* @default false
|
|
279
|
+
* @since 5.1
|
|
280
|
+
*/
|
|
281
|
+
accessor hideSnappingControlsElementsGridControlsElementsRotateWithMapToggle: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Indicates whether to hide the `gridEnabledToggle` (snap-to-grid).
|
|
284
|
+
*
|
|
285
|
+
* @default false
|
|
286
|
+
* @since 5.1
|
|
287
|
+
*/
|
|
288
|
+
accessor hideSnappingControlsElementsGridEnabledToggle: boolean;
|
|
225
289
|
/**
|
|
226
290
|
* Indicates whether to hide the [FeatureSnappingLayerSource](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/snapping/FeatureSnappingLayerSource/) layerList. The layerlist provides the available layer sources supported for snapping.
|
|
227
291
|
*
|
|
@@ -432,6 +496,13 @@ export abstract class ArcgisSketch extends LitElement {
|
|
|
432
496
|
accessor tooltipOptions: SketchTooltipOptions;
|
|
433
497
|
/** An array of [graphics](https://developers.arcgis.com/javascript/latest/references/core/Graphic/) that are being updated by the Sketch component. */
|
|
434
498
|
get updateGraphics(): Collection<Graphic>;
|
|
499
|
+
/**
|
|
500
|
+
* Controls whether the user can click a graphic in the layer to start updating it.
|
|
501
|
+
*
|
|
502
|
+
* @default false
|
|
503
|
+
* @since 5.1
|
|
504
|
+
*/
|
|
505
|
+
accessor updateOnGraphicClickDisabled: boolean;
|
|
435
506
|
/**
|
|
436
507
|
* Starting at version 5.0, `arcgis-sketch` is transitioning to a next generation geometry
|
|
437
508
|
* creation experience. This new experience provides advanced curve creation tools
|
|
@@ -472,8 +543,26 @@ export abstract class ArcgisSketch extends LitElement {
|
|
|
472
543
|
delete(): Promise<void>;
|
|
473
544
|
/** Permanently destroy the component. */
|
|
474
545
|
destroy(): Promise<void>;
|
|
546
|
+
/**
|
|
547
|
+
* @internal
|
|
548
|
+
* @since 5.1
|
|
549
|
+
*/
|
|
550
|
+
dismissFloatingElements(): Promise<void>;
|
|
475
551
|
duplicate(): Promise<void>;
|
|
476
552
|
redo(): Promise<void>;
|
|
553
|
+
/**
|
|
554
|
+
* @param createToolOptions
|
|
555
|
+
* @param customActionOptions
|
|
556
|
+
* @internal
|
|
557
|
+
* @since 5.1
|
|
558
|
+
*/
|
|
559
|
+
setCustomTools(createToolOptions?: CustomToolOptions[] | null, customActionOptions?: CustomActionProperties[] | null): Promise<void>;
|
|
560
|
+
/**
|
|
561
|
+
* @param options
|
|
562
|
+
* @internal
|
|
563
|
+
* @since 5.1
|
|
564
|
+
*/
|
|
565
|
+
setGroupAllowCollapseOptions(options: Map<SketchGroupName, boolean>): Promise<void>;
|
|
477
566
|
/**
|
|
478
567
|
* @param graphic
|
|
479
568
|
* @param updateOptions
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { c as o } from "../../chunks/runtime.js";
|
|
3
|
+
import { dismissFloatingElements as l, setCustomTools as n, setGroupAllowCollapse as r } from "@arcgis/core/applications/ExperienceBuilder/sketchUtils.js";
|
|
4
|
+
import { usePropertyChange as a } from "@arcgis/lumina/controllers";
|
|
5
|
+
import { reEmitEvent as s } from "@arcgis/lumina/controllers/accessor";
|
|
6
|
+
import c from "@arcgis/core/layers/GraphicsLayer.js";
|
|
7
|
+
import p from "@arcgis/core/widgets/Sketch.js";
|
|
8
|
+
import { LitElement as d, createEvent as h } from "@arcgis/lumina";
|
|
9
|
+
import { m as g } from "../../chunks/useWidget.js";
|
|
10
|
+
import { css as m } from "lit";
|
|
11
|
+
import { watch as b } from "@arcgis/core/core/reactiveUtils.js";
|
|
12
|
+
const w = m`calcite-block>.esri-grid-controls{background:0 0;padding:0}.esri-grid-controls{-webkit-user-select:none;user-select:none;padding:var(--arcgis-internal-padding);flex-flow:column wrap;display:flex;calcite-label.esri-labeled-switch__label{margin-block-end:var(--calcite-spacing-sm, .5rem)}}.esri-grid-controls__switch--bordered{border-width:0 0 var(--calcite-spacing-px) 0;border-style:solid;border-color:var(--calcite-color-border-1)}.esri-grid-controls__container{gap:var(--calcite-spacing-sm);flex-direction:column;flex:auto;display:flex}.esri-grid-controls__tilegroup{column-gap:var(--calcite-spacing-sm);align-items:start;display:flex;flex-wrap:wrap}.esri-grid-controls__tile__content{row-gap:var(--calcite-spacing-md);padding:var(--calcite-spacing-md);color:var(--calcite-color-text-2);flex-direction:column;align-items:center;display:flex}.esri-grid-controls__tile__content calcite-label{margin-bottom:calc(0px - var(--calcite-label-margin-bottom, .75rem));font-weight:var(--calcite-font-weight-medium)}.esri-grid-controls__tile{position:relative}.esri-grid-controls__tile:focus-within{outline:2px solid var(--calcite-color-brand);outline-offset:2px}.esri-grid-controls__tile--disabled{opacity:var(--calcite-opacity-disabled)}.esri-grid-controls__tile input[type=radio]{appearance:none;opacity:.001;border:var(--calcite-spacing-px) solid transparent;cursor:pointer;position:absolute;inset:0}.esri-grid-controls__tile input[type=radio]:checked+.esri-grid-controls__tile__content{border:var(--calcite-spacing-px) solid var(--calcite-color-brand)}.esri-grid-controls__tile input[type=radio]+.esri-grid-controls__tile__content{border:var(--calcite-spacing-px) solid transparent}.esri-grid-controls__numeric-inputs__container{gap:var(--calcite-spacing-sm);grid-auto-columns:1fr;grid-auto-flow:column;display:grid}.esri-grid-controls__inline-icon{margin-left:var(--calcite-spacing-xs);vertical-align:top;color:var(--calcite-color-status-warning)}:host{--response-toolbar-vert-width: 0;--response-toolbar-vert-height: 100%;--response-toolbar-horiz-width: 100%;--response-toolbar-horiz-height: 0}.esri-responsive-toolbar__ruler{opacity:0;pointer-events:none;position:absolute}.esri-responsive-toolbar__ruler--bar{visibility:hidden;height:0;display:block;position:absolute;top:0;left:0;right:0}.esri-responsive-toolbar__ruler--bar--vertical,.esri-responsive-toolbar__ruler--pad--vertical{width:var(--response-toolbar-vert-width);height:var(--response-toolbar-vert-height)}.esri-responsive-toolbar__ruler--pad--horizontal{width:var(--response-toolbar-horiz-width);height:var(--response-toolbar-horiz-height)}.esri-responsive-toolbar__bar>div{display:contents}.esri-responsive-toolbar__bar--horizontal{min-width:100%}.esri-responsive-toolbar__bar--vertical{min-height:100%}.esri-responsive-toolbar__pad{width:min-content;display:contents}.esri-responsive-toolbar__pad>div{display:contents}.esri-responsive-toolbar__ruler--pad--vertical{width:0;height:min(100vh - 120px,100cqh - 120px)}.esri-responsive-toolbar__ruler--pad--horizontal{width:min(100vw - 60px,100cqw - 60px);height:0}.esri-split-button--split-part--vertical--s{--calcite-size-sm: 16px;max-height:16px}.esri-split-button--split-part--vertical--m{--calcite-size-md: 24px;max-height:24px}.esri-split-button--split-part--vertical--l{--calcite-size-l: 40px;max-height:40px}.esri-split-button--split-part--horizontal--s,.esri-split-button--split-part--horizontal--m{max-width:16px}.esri-split-button--split-part--horizontal--l{max-width:24px}.esri-snapping-controls__toggle-block{min-width:100%;margin:0}.esri-snapping-controls__layer-list-block{border-bottom:none;min-width:225px}.esri-snapping-controls__layer-list-block[open]{margin-block:0}.esri-snapping-controls__layer-list{overflow:auto}.esri-snapping-controls__layer-list__filter{margin-bottom:10px}.esri-snapping-controls__layer-list__button{margin-bottom:6px}.esri-snapping-controls__layer-list__item calcite-accordion-item calcite-icon,.esri-snapping-controls__layer-list__item calcite-action calcite-icon{margin-inline-start:0}.esri-snapping-controls__layer-list__item calcite-icon{color:var(--calcite-color-brand);margin-inline-start:var(--calcite-list-item-spacing-indent, 1em)}.esri-snapping-controls{flex-flow:column wrap;display:flex}.esri-snapping-controls__container{flex-direction:column;flex:auto;display:flex}.esri-snapping-controls__container :only-child{border-block-end:none}.esri-snapping-controls__panel{width:320px}.esri-snapping-controls__item{border:1px solid #adadad4d;cursor:pointer;background-color:var(--calcite-color-foreground-2);border-color:var(--calcite-color-border-1);border-radius:2px;justify-content:space-between;margin:3px 0;padding:3px;transition:border-color .125s ease-in-out;display:flex;box-shadow:0 1px #adadad4d}.esri-snapping-controls__item-action-icon{flex:0 0 16px;width:16px;height:16px;margin-top:.1em;font-size:var(--calcite-font-size-md);display:inline-block}.esri-snapping-controls__action-toggle{opacity:1;cursor:pointer;border:1px solid var(--calcite-color-border-1);flex-flow:row-reverse;justify-content:space-between;align-items:flex-start;width:100%;margin:0;padding:6px 15px;font-size:var(--calcite-font-size-sm);transition:opacity .25s ease-in-out .25s,background-color .25s ease-in-out;display:flex}.esri-snapping-controls__action-toggle .esri-snapping-controls__item-action-title{margin-left:0}.esri-snapping-controls__action-toggle .esri-snapping-controls__item-action-icon{background-color:var(--calcite-color-foreground-1);border-radius:16px;flex:0 0 28px;width:16px;height:16px;padding:0;transition:background-color .125s ease-in-out;position:relative;overflow:hidden;box-shadow:0 0 0 1px #adadad}.esri-snapping-controls__action-toggle .esri-snapping-controls__item-action-icon:before{content:"";background-color:var(--calcite-color-foreground-2);border-radius:100%;width:12px;height:12px;margin:2px;transition:background-color .125s ease-in-out,left .125s ease-in-out;display:block;position:absolute;top:0;left:0;box-shadow:0 0 0 1px #242424}.esri-snapping-controls__action-toggle--on .esri-snapping-controls__item-action-icon{background-color:var(--calcite-color-foreground-1);box-shadow:0 0 0 1px #adadad}.esri-snapping-controls__action-toggle--on .esri-snapping-controls__item-action-icon:before{background-color:var(--calcite-color-foreground-3);left:12px}.esri-snapping-controls__nested-container{flex-direction:column;gap:6px;display:flex}.esri-snapping-controls__nested-container:not(:empty){padding-top:6px;padding-inline-start:1em}.esri-labeled-switch__label{--calcite-label-margin-bottom: 0}.esri-labeled-switch__label-content{text-wrap:balance;flex:1;align-items:center;gap:7px;display:flex}.esri-labeled-switch__label-content>div{flex-grow:1}.esri-labeled-switch__icon{margin-top:-1px}.esri-labeled-switch__icon_info{color:var(--calcite-color-status-info)}.esri-labeled-switch__icon_warning{color:var(--calcite-color-status-warning)}.esri-labeled-switch__tooltip{text-wrap:wrap}:host{display:flex;max-width:100%;justify-content:flex-end;pointer-events:none;--sketch-pad-flex-flow: wrap;--sketch-view-height-offset: 63px ;--sketch-view-margin-offset: 30px;--sketch-popover-header-offset: 49px}:host([scale="s"]){--sketch-view-height-offset: 47px ;--sketch-view-margin-offset: 30px;--sketch-popover-header-offset: 33px}:host([scale="l"]){--sketch-view-height-offset: 79px ;--sketch-view-margin-offset: 30px;--sketch-popover-header-offset: 65px}div:has(>.esri-sketch){display:contents}.esri-sketch{-webkit-user-select:none;user-select:none;pointer-events:none;display:flex}.esri-sketch-pad{gap:var(--arcgis-internal-sketch-gap, var(--calcite-spacing-sm));flex-flow:var(--sketch-pad-flex-flow);justify-content:var(--arcgis-internal-sketch-justify-content, flex-start)}.esri-sketch-pad:dir(rtl){flex-flow:row-reverse wrap}.esri-sketch-pad.esri-sketch--vertical{flex-flow:var(--sketch-pad-flex-flow, column wrap);justify-content:flex-start;--sketch-view-height-offset: 30px;--sketch-view-margin-offset: 15px}.esri-sketch-pad.esri-sketch--vertical:dir(rtl){flex-flow:var(--sketch-pad-flex-flow, column wrap-reverse)}.esri-sketch-pad.esri-sketch--vertical .esri-selection-toolbar__container{flex-direction:column}.esri-sketch>*{pointer-events:initial;display:flex}.esri-sketch-bar{flex-direction:column;gap:0;margin:0;flex-basis:100%}.esri-sketch-bar.esri-sketch--vertical{flex-flow:row}.esri-sketch__popover-wrapper{inline-size:max-content;min-inline-size:300px;max-height:calc(100cqh - (var(--sketch-view-height-offset, 90px)) - var(--sketch-view-margin-offset, 15px) - var(--sketch-popover-header-offset, 1000px));-webkit-user-select:none;user-select:none;max-inline-size:400px;overflow-y:auto}.esri-sketch__popover-wrapper .esri-sketch-tooltip-controls:not(:only-child) calcite-block{border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.esri-sketch__selection-count-chip--horizontal{margin-block:var(--calcite-spacing-xxs);margin-inline:var(--calcite-spacing-xs);align-self:center}.esri-sketch__selection-count-chip--vertical{margin-block:calc(var(--calcite-spacing-md) * var(--sketch-chip-margin-scale-factor, 1));scale:var(--sketch-chip-rescale, 1);align-self:center;margin-inline:0}.esri-sketch__selection-count-chip--vertical--s{--sketch-chip-rescale: .8;--sketch-chip-margin-scale-factor: .5}.esri-sketch--vertical{max-height:min(100vh - 120px,100cqh - 120px)}.esri-expand__popover-content .esri-sketch{gap:0}.esri-sketch-tooltip-controls{flex-flow:column wrap;min-width:100%;display:flex}.esri-sketch-tooltip-controls__block{border-block-end:none;margin:0}.esri-sketch-tooltip-controls__block-content{flex-direction:column;gap:6px;display:flex}.esri-sketch-tooltip-controls__radio-button-label-wrapper{align-items:center;gap:2px;display:flex}.esri-sketch-tooltip-controls calcite-label:last-child{--calcite-label-margin-bottom: 0}`, u = g(p);
|
|
13
|
+
class v extends d {
|
|
13
14
|
constructor() {
|
|
14
|
-
super(), this._visualScale = "m", this.widget =
|
|
15
|
+
super(), this._visualScale = "m", this.widget = u(this), this.viewModel = this.widget.viewModel, this._defaultGraphicsLayer = null, this.view = this.widget.view, this.activeTool = this.widget.activeTool, this.autoDestroyDisabled = !1, this.availableCreateTools = this.widget.availableCreateTools, this.createGraphic = this.widget.createGraphic, this.creationMode = this.widget.creationMode, this.defaultCreateOptions = this.widget.defaultCreateOptions, this.defaultGraphicsLayerDisabled = !1, this.defaultUpdateOptions = this.widget.defaultUpdateOptions, this.hideCreateToolsCircle = this.widget.visibleElements.createTools.circle, this.hideCreateToolsMultipoint = this.widget.visibleElements.createTools.multipoint, this.hideCreateToolsPoint = this.widget.visibleElements.createTools.point, this.hideCreateToolsPolygon = this.widget.visibleElements.createTools.polygon, this.hideCreateToolsPolyline = this.widget.visibleElements.createTools.polyline, this.hideCreateToolsRectangle = this.widget.visibleElements.createTools.rectangle, this.hideDuplicateButton = this.widget.visibleElements.duplicateButton, this.hideDeleteButton = this.widget.visibleElements.deleteButton, this.hideSelectionCountLabel = this.widget.visibleElements.selectionCountLabel, this.hideLabelsToggle = this.widget.visibleElements.labelsToggle, this.hideSelectionToolsLassoSelection = this.widget.visibleElements.selectionTools["lasso-selection"], this.hideSelectionToolsRectangleSelection = this.widget.visibleElements.selectionTools["rectangle-selection"], this.hideSettingsMenu = this.widget.visibleElements.settingsMenu, this.hideSnappingControls = this.widget.visibleElements.snappingControls, this.hideSnappingControlsElementsEnabledToggle = this.widget.visibleElements.snappingControlsElements.enabledToggle, this.hideSnappingControlsElementsFeatureEnabledToggle = this.widget.visibleElements.snappingControlsElements.featureEnabledToggle, this.hideSnappingControlsElementsLayerList = this.widget.visibleElements.snappingControlsElements.layerList, this.hideSnappingControlsElementsSelfEnabledToggle = this.widget.visibleElements.snappingControlsElements.selfEnabledToggle, this.hideSnappingControlsElementsGridEnabledToggle = this.widget.visibleElements.snappingControlsElements.gridEnabledToggle, this.hideSnappingControlsElementsGridControls = this.widget.visibleElements.snappingControlsElements.gridControls, this.hideSnappingControlsElementsGridControlsElementsColorSelection = this.widget.visibleElements.snappingControlsElements.gridControlsElements.colorSelection, this.hideSnappingControlsElementsGridControlsElementsDynamicScaleToggle = this.widget.visibleElements.snappingControlsElements.gridControlsElements.dynamicScaleToggle, this.hideSnappingControlsElementsGridControlsElementsLineIntervalInput = this.widget.visibleElements.snappingControlsElements.gridControlsElements.lineIntervalInput, this.hideSnappingControlsElementsGridControlsElementsNumericInputs = this.widget.visibleElements.snappingControlsElements.gridControlsElements.numericInputs, this.hideSnappingControlsElementsGridControlsElementsOutOfScaleWarning = this.widget.visibleElements.snappingControlsElements.gridControlsElements.outOfScaleWarning, this.hideSnappingControlsElementsGridControlsElementsPlacementButtons = this.widget.visibleElements.snappingControlsElements.gridControlsElements.placementButtons, this.hideSnappingControlsElementsGridControlsElementsRotateWithMapToggle = this.widget.visibleElements.snappingControlsElements.gridControlsElements.rotateWithMapToggle, this.hideTooltipsToggle = this.widget.visibleElements.tooltipsToggle, this.hideUndoRedoMenu = this.widget.visibleElements.undoRedoMenu, this.icon = this.widget.icon, this.label = this.widget.label, this.labelOptions = this.widget.labelOptions, this.layer = this.widget.layer, this.layout = this.widget.layout, this.pointSymbol = this.viewModel.pointSymbol, this.polygonSymbol = this.viewModel.polygonSymbol, this.polylineSymbol = this.viewModel.polylineSymbol, this.showSnappingControlsElementsHeader = this.widget.visibleElements.snappingControlsElements.header, this.showCreateToolsFreehandPolygon = this.widget.visibleElements.createTools.freehandPolygon, this.showCreateToolsFreehandPolyline = this.widget.visibleElements.createTools.freehandPolyline, this.showCreateToolsText = this.widget.visibleElements.createTools.text, this.snappingOptions = this.widget.snappingOptions, this.state = this.widget.state, this.textSymbol = this.viewModel.textSymbol, this.toolbarKind = this.widget.toolbarKind, this.tooltipOptions = this.widget.tooltipOptions, this.useLegacyCreateTools = this.viewModel.useLegacyCreateTools, this.updateOnGraphicClickDisabled = this.viewModel.updateOnGraphicClick, this.updateGraphics = this.widget.updateGraphics, this.arcgisCreate = s(() => this.widget, "create"), this.arcgisDelete = s(() => this.widget, "delete"), this.arcgisPropertyChange = a()("state"), this.arcgisReady = h(), this.arcgisRedo = s(() => this.widget, "redo"), this.arcgisUndo = s(() => this.widget, "undo"), this.arcgisUpdate = s(() => this.widget, "update"), this.listen("arcgisReady", this._arcgisReadyHandler);
|
|
15
16
|
}
|
|
16
17
|
static {
|
|
17
|
-
this.properties = { view: 0, activeTool: 35, autoDestroyDisabled: 5, availableCreateTools: 0, createGraphic: 32, creationMode: 1, defaultCreateOptions: 0, defaultGraphicsLayerDisabled: 5, defaultUpdateOptions: 0, hideCreateToolsCircle: 5, hideCreateToolsMultipoint: 5, hideCreateToolsPoint: 5, hideCreateToolsPolygon: 5, hideCreateToolsPolyline: 5, hideCreateToolsRectangle: 5, hideDuplicateButton: 5, hideDeleteButton: 5, hideSelectionCountLabel: 5, hideLabelsToggle: 5, hideSelectionToolsLassoSelection: 5, hideSelectionToolsRectangleSelection: 5, hideSettingsMenu: 5, hideSnappingControls: 5, hideSnappingControlsElementsEnabledToggle: 5, hideSnappingControlsElementsFeatureEnabledToggle: 5, hideSnappingControlsElementsLayerList: 5, hideSnappingControlsElementsSelfEnabledToggle: 5, hideTooltipsToggle: 5, hideUndoRedoMenu: 5, icon: 1, label: 1, labelOptions: 0, layer: 0, layout: 1, pointSymbol: 0, polygonSymbol: 0, polylineSymbol: 0, referenceElement: 1, scale: 1, visualScale: 1, showSnappingControlsElementsHeader: 5, showCreateToolsFreehandPolygon: 5, showCreateToolsFreehandPolyline: 5, showCreateToolsText: 5, snappingOptions: 0, state: 32, textSymbol: 0, toolbarKind: 1, tooltipOptions: 0, useLegacyCreateTools: 5, updateGraphics: 32 };
|
|
18
|
+
this.properties = { view: 0, activeTool: 35, autoDestroyDisabled: 5, availableCreateTools: 0, createGraphic: 32, creationMode: 1, defaultCreateOptions: 0, defaultGraphicsLayerDisabled: 5, defaultUpdateOptions: 0, hideCreateToolsCircle: 5, hideCreateToolsMultipoint: 5, hideCreateToolsPoint: 5, hideCreateToolsPolygon: 5, hideCreateToolsPolyline: 5, hideCreateToolsRectangle: 5, hideDuplicateButton: 5, hideDeleteButton: 5, hideSelectionCountLabel: 5, hideLabelsToggle: 5, hideSelectionToolsLassoSelection: 5, hideSelectionToolsRectangleSelection: 5, hideSettingsMenu: 5, hideSnappingControls: 5, hideSnappingControlsElementsEnabledToggle: 5, hideSnappingControlsElementsFeatureEnabledToggle: 5, hideSnappingControlsElementsLayerList: 5, hideSnappingControlsElementsSelfEnabledToggle: 5, hideSnappingControlsElementsGridEnabledToggle: 5, hideSnappingControlsElementsGridControls: 5, hideSnappingControlsElementsGridControlsElementsColorSelection: 5, hideSnappingControlsElementsGridControlsElementsDynamicScaleToggle: 5, hideSnappingControlsElementsGridControlsElementsLineIntervalInput: 5, hideSnappingControlsElementsGridControlsElementsNumericInputs: 5, hideSnappingControlsElementsGridControlsElementsOutOfScaleWarning: 5, hideSnappingControlsElementsGridControlsElementsPlacementButtons: 5, hideSnappingControlsElementsGridControlsElementsRotateWithMapToggle: 5, hideTooltipsToggle: 5, hideUndoRedoMenu: 5, icon: 1, label: 1, labelOptions: 0, layer: 0, layout: 1, pointSymbol: 0, polygonSymbol: 0, polylineSymbol: 0, referenceElement: 1, scale: 1, visualScale: 1, showSnappingControlsElementsHeader: 5, showCreateToolsFreehandPolygon: 5, showCreateToolsFreehandPolyline: 5, showCreateToolsText: 5, snappingOptions: 0, state: 32, textSymbol: 0, toolbarKind: 1, tooltipOptions: 0, useLegacyCreateTools: 5, updateOnGraphicClickDisabled: 5, updateGraphics: 32 };
|
|
18
19
|
}
|
|
19
20
|
static {
|
|
20
|
-
this.styles =
|
|
21
|
+
this.styles = w;
|
|
21
22
|
}
|
|
22
23
|
get scale() {
|
|
23
24
|
return this._visualScale;
|
|
@@ -32,13 +33,13 @@ class m extends n {
|
|
|
32
33
|
this._visualScale = e, this.widget.scale = e;
|
|
33
34
|
}
|
|
34
35
|
async cancel() {
|
|
35
|
-
this.widget?.cancel();
|
|
36
|
+
this.requestUpdate(), this.widget?.cancel();
|
|
36
37
|
}
|
|
37
38
|
async complete() {
|
|
38
39
|
this.widget?.complete();
|
|
39
40
|
}
|
|
40
|
-
async create(e,
|
|
41
|
-
await this.widget?.create(e,
|
|
41
|
+
async create(e, t) {
|
|
42
|
+
await this.widget?.create(e, t);
|
|
42
43
|
}
|
|
43
44
|
async delete() {
|
|
44
45
|
this.widget?.delete();
|
|
@@ -52,14 +53,23 @@ class m extends n {
|
|
|
52
53
|
async redo() {
|
|
53
54
|
this.widget?.redo();
|
|
54
55
|
}
|
|
55
|
-
async
|
|
56
|
-
this.widget
|
|
56
|
+
async dismissFloatingElements() {
|
|
57
|
+
l(this.widget);
|
|
58
|
+
}
|
|
59
|
+
async setCustomTools(e, t) {
|
|
60
|
+
n(this.widget, e, t);
|
|
61
|
+
}
|
|
62
|
+
async setGroupAllowCollapseOptions(e) {
|
|
63
|
+
r(this.widget, e);
|
|
64
|
+
}
|
|
65
|
+
async triggerUpdate(e, t) {
|
|
66
|
+
this.widget?.update(e, t);
|
|
57
67
|
}
|
|
58
68
|
async undo() {
|
|
59
69
|
this.widget?.undo();
|
|
60
70
|
}
|
|
61
71
|
_arcgisReadyHandler() {
|
|
62
|
-
this.defaultGraphicsLayerDisabled || (this._defaultGraphicsLayer = new
|
|
72
|
+
this.defaultGraphicsLayerDisabled || (this._defaultGraphicsLayer = new c({ title: "Sketch Layer" }), this.widget.availableCreateTools = [
|
|
63
73
|
"point",
|
|
64
74
|
"polyline",
|
|
65
75
|
"freehandPolyline",
|
|
@@ -67,15 +77,15 @@ class m extends n {
|
|
|
67
77
|
"freehandPolygon",
|
|
68
78
|
"rectangle",
|
|
69
79
|
"circle"
|
|
70
|
-
], this.widget.layer = this._defaultGraphicsLayer, this.el.view?.map?.add(this.widget.layer), this.manager.onLifecycle(() =>
|
|
71
|
-
const
|
|
72
|
-
!
|
|
80
|
+
], this.widget.layer = this._defaultGraphicsLayer, this.el.view?.map?.add(this.widget.layer), this.manager.onLifecycle(() => b(() => this.el.view?.map, (e, t) => {
|
|
81
|
+
const i = this._defaultGraphicsLayer;
|
|
82
|
+
!i || this.widget.layer !== i || (t?.allLayers.includes(i) && t.remove(i), e?.add(i));
|
|
73
83
|
})), this.manager.onDestroy(() => {
|
|
74
84
|
this._defaultGraphicsLayer && this.el.view?.map?.allLayers.includes(this._defaultGraphicsLayer) && this.el.view?.map?.remove(this._defaultGraphicsLayer), this._defaultGraphicsLayer?.destroy(), this._defaultGraphicsLayer = null;
|
|
75
85
|
}));
|
|
76
86
|
}
|
|
77
87
|
}
|
|
78
|
-
|
|
88
|
+
o("arcgis-sketch", v);
|
|
79
89
|
export {
|
|
80
|
-
|
|
90
|
+
v as ArcgisSketch
|
|
81
91
|
};
|
|
@@ -5,18 +5,18 @@ import * as C from "@arcgis/core/geometry/operators/cutOperator.js";
|
|
|
5
5
|
import * as m from "@arcgis/core/geometry/operators/lengthOperator.js";
|
|
6
6
|
import * as b from "@arcgis/core/geometry/operators/projectOperator.js";
|
|
7
7
|
import I from "@arcgis/core/geometry/Polyline.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
8
|
+
import G from "@arcgis/core/geometry/SpatialReference.js";
|
|
9
|
+
import F from "@arcgis/core/Graphic.js";
|
|
10
10
|
import T from "@arcgis/core/rest/networks/support/TraceLocation.js";
|
|
11
|
-
import
|
|
12
|
-
import { LitElement as
|
|
13
|
-
import { log as
|
|
11
|
+
import L from "@arcgis/core/symbols/SimpleMarkerSymbol.js";
|
|
12
|
+
import { LitElement as v, createEvent as w } from "@arcgis/lumina";
|
|
13
|
+
import { log as l, composeMissingPropertyMessage as g } from "@arcgis/toolkit/log";
|
|
14
14
|
import { u as A } from "../../chunks/useT9n.js";
|
|
15
15
|
import { d as S, i as P } from "../../chunks/layer-utils.js";
|
|
16
16
|
const N = x`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{justify-content:center;display:grid}.clear-button{--calcite-button-border-color: transparent}`;
|
|
17
|
-
class R extends
|
|
17
|
+
class R extends v {
|
|
18
18
|
constructor() {
|
|
19
|
-
super(...arguments), this.messages = A({ blocking: !0 }), this.isSelectWaiting = !1, this.traceLocationType = "starting-point", this.spatialTolerance = 0.05, this.autoDestroyDisabled = !1, this.arcgisTraceLocationChange =
|
|
19
|
+
super(...arguments), this.messages = A({ blocking: !0 }), this.isSelectWaiting = !1, this.traceLocationType = "starting-point", this.spatialTolerance = 0.05, this.autoDestroyDisabled = !1, this.arcgisTraceLocationChange = w(), this.arcgisTraceLocationSelectEnd = w(), this.arcgisTraceLocationSelectStart = w();
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
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 };
|
|
@@ -35,25 +35,25 @@ class R extends G {
|
|
|
35
35
|
hasZ: !1,
|
|
36
36
|
hasM: !0,
|
|
37
37
|
paths: e,
|
|
38
|
-
spatialReference: new
|
|
38
|
+
spatialReference: new G({ wkid: t })
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
_calculatePercentAlong(e, t) {
|
|
42
|
-
const r = e.spatialReference, s = this._createPolyline(e.paths, r.wkid),
|
|
42
|
+
const r = e.spatialReference, s = this._createPolyline(e.paths, r.wkid), o = t.x - 0.5, a = t.x + 0.5, c = t.y - 0.5, i = t.y + 0.5, u = [
|
|
43
43
|
[
|
|
44
|
-
[
|
|
44
|
+
[o, c],
|
|
45
45
|
[a, i]
|
|
46
46
|
]
|
|
47
|
-
],
|
|
47
|
+
], n = this._createPolyline(u, t.spatialReference.wkid), p = b.execute(n, r);
|
|
48
48
|
if (!p)
|
|
49
|
-
return
|
|
49
|
+
return l("error", this, "Unable to project flag geometry to source geometry spatial reference."), -1;
|
|
50
50
|
const d = C.execute(s, p);
|
|
51
51
|
if (d.length > 0) {
|
|
52
|
-
const
|
|
53
|
-
let
|
|
54
|
-
return d[0].paths[0][0][0] === s.paths[0][0][0] ?
|
|
52
|
+
const h = m.execute(s, { unit: "feet" });
|
|
53
|
+
let f;
|
|
54
|
+
return d[0].paths[0][0][0] === s.paths[0][0][0] ? f = m.execute(d[0], { unit: "feet" }) : d.length > 1 ? f = m.execute(d[1], { unit: "feet" }) : f = 0, f / h;
|
|
55
55
|
}
|
|
56
|
-
return
|
|
56
|
+
return l("warn", this, "Unable to cut the source geometry with the flag geometry."), -1;
|
|
57
57
|
}
|
|
58
58
|
get _edgeSourceLayerIds() {
|
|
59
59
|
const e = this.utilityNetwork?.dataElement?.domainNetworks;
|
|
@@ -62,7 +62,7 @@ class R extends G {
|
|
|
62
62
|
async _handleAddButtonClick() {
|
|
63
63
|
const { view: e, sketchViewModel: t } = this;
|
|
64
64
|
if (!(e && t)) {
|
|
65
|
-
|
|
65
|
+
l("error", this, "Cannot add trace location."), t || l("error", this, g("sketchViewModel")), e || l("error", this, g("view"));
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
if (this.beforeTraceLocationSelectStart) {
|
|
@@ -73,10 +73,10 @@ class R extends G {
|
|
|
73
73
|
this.isSelectWaiting = !1;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
await this._startSketch(e, t);
|
|
77
77
|
}
|
|
78
78
|
async _startSketch(e, t) {
|
|
79
|
-
this._clickHandler?.remove(), this._clickHandler = t.on("create", (
|
|
79
|
+
this.arcgisTraceLocationSelectStart.emit({ cancelSelect: () => t.cancel() }).defaultPrevented || (this._clickHandler?.remove(), this._clickHandler = t.on("create", (s) => this._handleSketchComplete(s, e, t)), "acquireCursor" in e && e.acquireCursor("crosshair"), t.snappingOptions.enabled = !0, t.create("point"));
|
|
80
80
|
}
|
|
81
81
|
_handleSketchComplete(e, t, r) {
|
|
82
82
|
if (e.state === "complete" && e.graphic) {
|
|
@@ -88,104 +88,87 @@ class R extends G {
|
|
|
88
88
|
async _performHitTest(e, t, r) {
|
|
89
89
|
const { utilityNetwork: s } = this;
|
|
90
90
|
if (!s) {
|
|
91
|
-
|
|
91
|
+
l("error", this, g("utilityNetwork")), this._resetCursor(), this.arcgisTraceLocationSelectEnd.emit();
|
|
92
92
|
return;
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const o = e.graphic?.geometry, a = t.toScreen(o);
|
|
95
95
|
if (!a) {
|
|
96
|
-
|
|
96
|
+
l("warn", this, "No screen point available for hit test."), this._startSketch(t, r);
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
const i = (await t.hitTest(a, {
|
|
100
100
|
include: this.filterLayers
|
|
101
|
-
})).results.filter((
|
|
101
|
+
})).results.filter((n) => n.type === "graphic" && n?.layer && n.graphic);
|
|
102
102
|
if (i.length === 0) {
|
|
103
|
-
|
|
103
|
+
l("info", this, "No usable hit test results found."), this._startSketch(t, r);
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
-
this._resetCursor(), await this._processHitTestResults(i,
|
|
106
|
+
this._resetCursor(), await this._processHitTestResults(i, o, t) ? this.arcgisTraceLocationSelectEnd.emit() : this._startSketch(t, r);
|
|
107
107
|
}
|
|
108
108
|
_resetCursor() {
|
|
109
109
|
const { view: e, sketchViewModel: t } = this;
|
|
110
110
|
if (!e) {
|
|
111
|
-
|
|
111
|
+
l("error", this, g("view"));
|
|
112
112
|
return;
|
|
113
113
|
}
|
|
114
114
|
t && (t.snappingOptions.enabled = !1), this._clickHandler?.remove(), this._clickHandler = void 0, "acquireCursor" in e && e.acquireCursor("default");
|
|
115
115
|
}
|
|
116
116
|
async _processHitTestResults(e, t, r) {
|
|
117
|
-
if (e.length === 0)
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
const o = i, l = o.graphic;
|
|
123
|
-
return l.origin = o.layer, l.sourceLayer = o.layer, l;
|
|
117
|
+
if (e.length === 0)
|
|
118
|
+
return l("error", this, "There are no hit test results to process."), !1;
|
|
119
|
+
const s = e[0], o = e.map((u) => {
|
|
120
|
+
const n = u, p = n.graphic;
|
|
121
|
+
return p.origin = n.layer, p.sourceLayer = n.layer, p;
|
|
124
122
|
});
|
|
125
123
|
let a = s.graphic;
|
|
126
124
|
if (this.afterHitTest)
|
|
127
125
|
try {
|
|
128
|
-
a = await this.afterHitTest(
|
|
126
|
+
a = await this.afterHitTest(o);
|
|
129
127
|
} catch {
|
|
130
128
|
a = null;
|
|
131
129
|
}
|
|
132
|
-
if (!a)
|
|
133
|
-
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
130
|
+
if (!a)
|
|
131
|
+
return l("error", this, "No graphic available from hit test results."), this.arcgisTraceLocationSelectEnd.emit(), !0;
|
|
136
132
|
const c = await this._ensureNecessaryAttributes(a);
|
|
137
|
-
|
|
138
|
-
u("error", this, "Unable to ensure necessary attributes on the selected graphic."), this.arcgisTraceLocationSelectEnd.emit();
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
await this._generateTraceLocation(c, t, r);
|
|
133
|
+
return c ? await this._generateTraceLocation(c, t, r) : (l("error", this, "Unable to ensure necessary attributes on the selected graphic."), this.arcgisTraceLocationSelectEnd.emit(), !0);
|
|
142
134
|
}
|
|
143
135
|
async _ensureNecessaryAttributes(e) {
|
|
144
|
-
const t = (S(e.layer), e.layer), r = t.geometryType === null, s = t.fieldsIndex?.get("assetgroup") ?? !1,
|
|
145
|
-
if (i &&
|
|
136
|
+
const t = (S(e.layer), e.layer), r = t.geometryType === null, s = t.fieldsIndex?.get("assetgroup") ?? !1, o = t.fieldsIndex?.get("assetgroup")?.name ?? "assetgroup", a = t.fieldsIndex?.get("assettype") ?? !1, c = t.fieldsIndex?.get("assettype")?.name ?? "assettype", i = e.getGlobalId(), u = e.getObjectId(), n = s ? !!e.getAttribute(o) : !0, p = a ? !!e.getAttribute(c) : !0, d = !!e.geometry;
|
|
137
|
+
if (i && u && n && p && (d || r))
|
|
146
138
|
return e;
|
|
147
|
-
const
|
|
148
|
-
return
|
|
139
|
+
const h = t.createQuery();
|
|
140
|
+
return h.objectIds = [u], (await t.queryFeatures(h))?.features[0] || null;
|
|
149
141
|
}
|
|
150
142
|
async _generateTraceLocation(e, t, r) {
|
|
151
|
-
const { traceLocations: s } = this,
|
|
152
|
-
if (!c)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
const i = s?.filter((l) => l.spatialProperties.mapGraphic?.getGlobalId() === n) ?? [];
|
|
143
|
+
const { traceLocations: s } = this, o = e.getGlobalId() ?? "", a = e.geometry?.type, c = await this._generateFlagInfo(e, t);
|
|
144
|
+
if (!c)
|
|
145
|
+
return l("error", this, "Unable to generate flag info for trace location."), !1;
|
|
146
|
+
const i = s?.filter((n) => n.spatialProperties.mapGraphic?.getGlobalId() === o) ?? [];
|
|
157
147
|
if (i.length > 0) {
|
|
158
|
-
if (a !== "polyline")
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
u("warn", this, "A flag with the same globalId already exists within tolerance.");
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
148
|
+
if (a !== "polyline")
|
|
149
|
+
return l("warn", this, "A flag with the same globalId already exists."), !1;
|
|
150
|
+
if (i.some((n) => Math.abs(n.traceLocation.percentAlong - c.traceLocation.percentAlong) <= this.spatialTolerance))
|
|
151
|
+
return l("warn", this, "A flag with the same globalId already exists within tolerance."), !1;
|
|
165
152
|
}
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
u("warn", this, "Unable to add flag graphic.");
|
|
169
|
-
return;
|
|
170
|
-
}
|
|
171
|
-
c.spatialProperties.flagGraphic = o, s?.add(c);
|
|
153
|
+
const u = this._addFlagGraphic(e, t, r);
|
|
154
|
+
return u ? (c.spatialProperties.flagGraphic = u, s?.add(c), !0) : (l("warn", this, "Unable to add flag graphic."), !1);
|
|
172
155
|
}
|
|
173
156
|
async _generateFlagInfo(e, t) {
|
|
174
|
-
const { traceLocationType: r, utilityNetwork: s } = this,
|
|
157
|
+
const { traceLocationType: r, utilityNetwork: s } = this, o = e.getGlobalId() ?? "", a = e.geometry?.type, c = await this._generateItemTitle(e);
|
|
175
158
|
if (a === "point" || a === "polygon") {
|
|
176
|
-
const i = s?.getTerminalConfiguration(e),
|
|
159
|
+
const i = s?.getTerminalConfiguration(e), u = i ? i.terminals[0].id : 1;
|
|
177
160
|
return {
|
|
178
161
|
traceLocation: new T({
|
|
179
162
|
type: r,
|
|
180
163
|
isFilterBarrier: !1,
|
|
181
|
-
globalId:
|
|
182
|
-
terminalId:
|
|
164
|
+
globalId: o,
|
|
165
|
+
terminalId: u
|
|
183
166
|
}),
|
|
184
167
|
flagProperties: {
|
|
185
168
|
title: c,
|
|
186
169
|
expanded: !1,
|
|
187
170
|
terminalConfiguration: i ?? void 0,
|
|
188
|
-
selectedTerminals: i ? /* @__PURE__ */ new Set([
|
|
171
|
+
selectedTerminals: i ? /* @__PURE__ */ new Set([u]) : void 0
|
|
189
172
|
},
|
|
190
173
|
spatialProperties: {
|
|
191
174
|
mapPoint: t,
|
|
@@ -194,11 +177,11 @@ class R extends G {
|
|
|
194
177
|
};
|
|
195
178
|
} else if (a === "polyline") {
|
|
196
179
|
const i = this._calculatePercentAlong(e.geometry, t);
|
|
197
|
-
return {
|
|
180
|
+
return i < 0 ? (l("warn", this, "Unable to calculate percent along for polyline flag."), null) : {
|
|
198
181
|
traceLocation: new T({
|
|
199
182
|
type: r,
|
|
200
183
|
isFilterBarrier: !1,
|
|
201
|
-
globalId:
|
|
184
|
+
globalId: o,
|
|
202
185
|
percentAlong: i
|
|
203
186
|
}),
|
|
204
187
|
flagProperties: {
|
|
@@ -213,20 +196,20 @@ class R extends G {
|
|
|
213
196
|
}
|
|
214
197
|
};
|
|
215
198
|
} else if (!a) {
|
|
216
|
-
const i = P(e.layer) ? e.layer.parent : e.layer,
|
|
199
|
+
const i = P(e.layer) ? e.layer.parent : e.layer, u = i && this._edgeSourceLayerIds.includes(i.layerId), n = s?.getTerminalConfiguration(e), p = n ? n.terminals[0].id : u ? -1 : 1, d = u ? 0.5 : -1;
|
|
217
200
|
return {
|
|
218
201
|
traceLocation: new T({
|
|
219
202
|
type: r,
|
|
220
203
|
isFilterBarrier: !1,
|
|
221
|
-
globalId:
|
|
204
|
+
globalId: o,
|
|
222
205
|
terminalId: p,
|
|
223
206
|
percentAlong: d
|
|
224
207
|
}),
|
|
225
208
|
flagProperties: {
|
|
226
209
|
title: c,
|
|
227
210
|
expanded: !1,
|
|
228
|
-
terminalConfiguration:
|
|
229
|
-
selectedTerminals:
|
|
211
|
+
terminalConfiguration: n ?? void 0,
|
|
212
|
+
selectedTerminals: n ? /* @__PURE__ */ new Set([p]) : void 0
|
|
230
213
|
},
|
|
231
214
|
spatialProperties: {
|
|
232
215
|
mapPoint: t,
|
|
@@ -241,16 +224,16 @@ class R extends G {
|
|
|
241
224
|
return ("getFeatureTitle" in r ? await r.getFeatureTitle(e) : null) || e?.getObjectId()?.toString() || t.labels.unknown;
|
|
242
225
|
}
|
|
243
226
|
_addFlagGraphic(e, t, r) {
|
|
244
|
-
const s = e.geometry ? e.geometry.type === "point" ? e.geometry : t : null,
|
|
227
|
+
const s = e.geometry ? e.geometry.type === "point" ? e.geometry : t : null, o = this._createFlagSymbol(), a = new F({
|
|
245
228
|
geometry: s,
|
|
246
|
-
symbol:
|
|
229
|
+
symbol: o,
|
|
247
230
|
attributes: e.attributes
|
|
248
231
|
});
|
|
249
232
|
return r.graphics.add(a), a;
|
|
250
233
|
}
|
|
251
234
|
_createFlagSymbol() {
|
|
252
235
|
const { traceLocationType: e } = this, t = [244, 21, 21, 0.6], r = [21, 244, 21, 0.6];
|
|
253
|
-
return e === "stopping-point" ? new
|
|
236
|
+
return e === "stopping-point" ? new L({
|
|
254
237
|
color: t,
|
|
255
238
|
style: "x",
|
|
256
239
|
size: 12,
|
|
@@ -258,7 +241,7 @@ class R extends G {
|
|
|
258
241
|
color: t,
|
|
259
242
|
width: 2
|
|
260
243
|
}
|
|
261
|
-
}) : e === "barrier" ? new
|
|
244
|
+
}) : e === "barrier" ? new L({
|
|
262
245
|
color: t,
|
|
263
246
|
style: "square",
|
|
264
247
|
size: 12,
|
|
@@ -266,7 +249,7 @@ class R extends G {
|
|
|
266
249
|
color: t,
|
|
267
250
|
width: 0
|
|
268
251
|
}
|
|
269
|
-
}) : new
|
|
252
|
+
}) : new L({
|
|
270
253
|
color: r,
|
|
271
254
|
style: "circle",
|
|
272
255
|
size: 12,
|
|
@@ -283,7 +266,7 @@ class R extends G {
|
|
|
283
266
|
}), t?.removeAll();
|
|
284
267
|
}
|
|
285
268
|
renderAddLocationBlock() {
|
|
286
|
-
const { traceLocationType: e, messages: t, traceLocations: r, view: s } = this,
|
|
269
|
+
const { traceLocationType: e, messages: t, traceLocations: r, view: s } = this, o = e === "starting-point" ? t.types.startingPoint : e === "barrier" ? t.types.barrier : t.types.stoppingPoint, a = o.heading, c = o.description, i = o.buttonText;
|
|
287
270
|
return y`<calcite-block .heading=${a} .label=${a} expanded .description=${c}>${r?.length ? y`<calcite-button class="clear-button" slot=actions-end appearance=transparent .label=${t.buttons.clear} @click=${() => this._handleClearButtonClick()}>${t.buttons.clear}</calcite-button><arcgis-utility-network-trace-location-list .traceLocations=${r} .traceLocationType=${e} .view=${s}></arcgis-utility-network-trace-location-list>` : null}<div class="button-container"><calcite-button .loading=${this.isSelectWaiting} class="add-location-button" icon-start=select appearance=outline .label=${i} @click=${() => this._handleAddButtonClick()}>${i}</calcite-button></div></calcite-block>`;
|
|
288
271
|
}
|
|
289
272
|
render() {
|