▾
import "@arcgis/map-components/components/arcgis-utility-network-trace-aggregated-geometry-result-item";- Inheritance
- ArcgisUtilityNetworkTraceAggregatedGeometryResultItem→
HTMLElement
- Since
- ArcGIS Maps SDK for JavaScript 5.2
The Utility Network Trace Aggregated Geometry Result Item component displays the aggregated geometry returned by a utility network trace. It creates graphics for the result's line, multipoint, and polygon geometries and displays them in the view. Provides options to show or hide the graphics, change their color and size.
Add this component directly to the default slot of arcgis-utility-network-trace-results. The parent supplies the required read-only properties for the trace result and MapView.
By default, the arcgis-utility-network-trace-results component displays the aggregated geometry, elements, and functions result items for the result types returned by the trace. Adding content to its default slot replaces all default result items. Add each result item that the custom configuration should display.
By default, the component creates and manages a graphics layer. Set graphicsLayer to render the aggregated geometry graphics in an existing layer instead.
- Examples
The following example displays aggregated geometry in a custom set of trace result items. Providing result items in the default slot replaces the parent's default result items. This example displays only aggregated geometry results.
<arcgis-map item-id="471eb0bf37074b1fbb972b1da70fb310"><arcgis-utility-network-trace-analysis slot="bottom-left"><arcgis-utility-network-trace-results slot="results"><arcgis-utility-network-trace-aggregated-geometry-result-item></arcgis-utility-network-trace-aggregated-geometry-result-item></arcgis-utility-network-trace-results></arcgis-utility-network-trace-analysis></arcgis-map>Customize the color and size of the aggregated geometry graphics. Setting
hide-graphicsinitially hides the graphics from the map. Users can show them with the component's toggle.<arcgis-map item-id="471eb0bf37074b1fbb972b1da70fb310"><arcgis-utility-network-trace-analysis slot="bottom-left"><arcgis-utility-network-trace-results slot="results"><arcgis-utility-network-trace-aggregated-geometry-result-itemgraphics-color="rgba(0, 122, 194, 0.6)"selection-size="8"hide-graphics></arcgis-utility-network-trace-aggregated-geometry-result-item></arcgis-utility-network-trace-results></arcgis-utility-network-trace-analysis></arcgis-map>
Properties
| Property | Attribute | Type |
|---|---|---|
| auto-destroy-disabled | ||
| readonly | | true |
| readonly | | Graphic[] |
| graphics-color | ||
| | ||
| heading | ||
| hide-graphics | ||
| | ||
| selection-size | ||
| readonly | | |
| readonly | | |
| readonly | |
autoDestroyDisabled
- Type
- boolean
If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the destroy() method when you are done to prevent memory leaks.
- Attribute
- auto-destroy-disabled
- Default value
- false
- Example
- <arcgis-utility-network-trace-aggregated-geometry-result-item auto-destroy-disabled></arcgis-utility-network-trace-aggregated-geometry-result-item>utilityNetworkTraceAggregatedGeometryResultItemElement.autoDestroyDisabled = true;
emitsArcgisResultReady
- Type
- true
Whether the component emits event @arcgisResultReady.
This property is always true for arcgis-utility-network-trace-aggregated-geometry-result-item.
- Default value
- false
geometryGraphics
- Type
- Graphic[]
The graphics created from the line, multipoint, and polygon geometries in the aggregated geometry result.
Read this property after @arcgisResultReady fires.
graphicsColor
- Type
- Color
The color of the aggregated geometry graphics. The default is yellow with 0.6 opacity.
- See also
- Attribute
- graphics-color
graphicsLayer
- Type
- GraphicsLayer | undefined
The layer used to render the aggregated geometry graphics.
When the result is cleared or the component is destroyed:
- If the layer is provided by the application, the component removes only the aggregated geometry graphics it created. The layer and any other graphics remain unchanged.
- If no layer is provided, the component creates and manages a layer. It removes the aggregated geometry graphics and the component-owned layer from the map.
hideGraphics
- Type
- boolean
Whether to hide the aggregated geometry graphics from the map.
When true, the graphics remain available through geometryGraphics but are removed from the graphicsLayer.
- Attribute
- hide-graphics
- Default value
- false
selectionSize
- Type
- number
The marker size and line or polygon-outline width of the aggregated geometry graphics, in points. The default is 12.
- Attribute
- selection-size
- Default value
- 12
traceResult
- Type
- TraceResult | undefined
The trace result containing the aggregated geometry to display.
view
The MapView supplied by the parent arcgis-utility-network-trace-results component. Used to display the aggregated geometry graphics.
Methods
| Method | Signature |
|---|---|
| clearResult(): void | |
| inherited | componentOnReady(): Promise<this> |
| destroy(): Promise<void> |
clearResult
- Signature
-
clearResult (): void
Removes the aggregated geometry graphics from the graphicsLayer. If the layer was created by the component, it is also removed from the map.
The method also clears
traceResult and
geometryGraphics and resets
state to "ready".
Does not emit @arcgisResultReady.
- Returns
- void
componentOnReady
- Signature
-
componentOnReady (): Promise<this>
Creates a promise that resolves once the component is fully loaded.
- Returns
- Promise<this>
- Example
- const arcgisUtilityNetworkTraceAggregatedGeometryResultItem = document.createElement("arcgis-utility-network-trace-aggregated-geometry-result-item");document.body.append(arcgisUtilityNetworkTraceAggregatedGeometryResultItem);await arcgisUtilityNetworkTraceAggregatedGeometryResultItem.componentOnReady();console.log("arcgis-utility-network-trace-aggregated-geometry-result-item is ready to go!");
Events
| Name | Type |
|---|---|
| CustomEvent<{ name: "hideGraphics" | "geometryGraphics" | "graphicsColor" | "selectionSize" | "state"; }> | |
arcgisPropertyChange
arcgisPropertyChange: CustomEvent<{ name: "hideGraphics" | "geometryGraphics" | "graphicsColor" | "selectionSize" | "state"; }> Emitted when the value of a property is changed. Use this to listen to changes to properties.
arcgisResultReady
arcgisResultReady: CustomEvent<void> Fires when the component finishes processing the current trace result.
For a result with aggregated geometry, the event fires after the graphics are created and, unless
hideGraphics is true, added to
the map. The event also fires when processing completes without graphics because the result, aggregated geometry,
or map view is unavailable.
Clearing a result with clearResult() does not emit this event.