@arcgis/core 4.33.11 → 4.33.13
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/applications/KnowledgeStudio/reshape.d.ts +5 -0
- package/applications/KnowledgeStudio/reshape.js +5 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{1415d4e2f5f3193be004.js → 012dee84d97b71461397.js} +1 -1
- package/assets/esri/core/workers/chunks/{658e82c9b722852e02d0.js → 0aa1f9e81789cb183599.js} +1 -1
- package/assets/esri/core/workers/chunks/{342f61e784c9364a493b.js → 1ebff223f0f241686669.js} +1 -1
- package/assets/esri/core/workers/chunks/{fdfb5d601d318d6a49f9.js → 2f2cb0348f36a5157293.js} +1 -1
- package/assets/esri/core/workers/chunks/{cb16ba9512ae0a09c55d.js → 4ab87eea6345818de60f.js} +1 -1
- package/assets/esri/core/workers/chunks/{c1822b03302c3db71b1f.js → 4e5ececbf08bd5dc5944.js} +1 -1
- package/assets/esri/core/workers/chunks/{e9aa1d9ded8a52a40c57.js → 5d74b754ee0140afbd22.js} +1 -1
- package/assets/esri/core/workers/chunks/{d33a5d79f2163ad62b1d.js → 64aebb3780ac4c8bfdc7.js} +1 -1
- package/assets/esri/core/workers/chunks/8be5fa1777b66b064767.js +1 -0
- package/assets/esri/core/workers/chunks/{c6cd8784a3e222eb2d4a.js → 8edd8ebca441d670380f.js} +1 -1
- package/assets/esri/core/workers/chunks/{cf25f487fe4eb1579aee.js → 9128902b127d0ec70fe0.js} +1 -1
- package/assets/esri/core/workers/chunks/{17c623db3d9a06a9b711.js → a5fab8d7d8403b4de682.js} +1 -1
- package/assets/esri/core/workers/chunks/{11587332ed09d46fa368.js → a9095cb096fb4278d3a8.js} +1 -1
- package/assets/esri/core/workers/chunks/{bac5e1d50b69f0d94694.js → ad2a29aca4e5bcd545cc.js} +1 -1
- package/assets/esri/core/workers/chunks/{9049c81445cc044286f1.js → bbb92d0ba6a34c7a7d1b.js} +1 -1
- package/assets/esri/core/workers/chunks/{7b9d14cc4a466ef18d71.js → bfd51df0a44a05596061.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ca6f893fd58f5b17af5.js → c410b2b9d0645e9cea89.js} +1 -1
- package/assets/esri/core/workers/chunks/{8008f5479f4d16964088.js → dded6853cebf2165cb37.js} +1 -1
- package/assets/esri/core/workers/chunks/{db192728fa0ee08a776a.js → e7ca7ced4dfb04c81e84.js} +1 -1
- package/assets/esri/core/workers/chunks/{0155e6806621f3588ffa.js → fe71a2ea7965e75ee881.js} +1 -1
- package/assets/esri/core/workers/chunks/{71e1a8bd432947c66357.js → ffeda53fee883f8025ed.js} +1 -1
- package/assets/esri/themes/base/widgets/_VideoPlayer.scss +16 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
- package/chunks/MultiPathImpl.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/Point2D.js +1 -1
- package/chunks/ProjectionTransformation.js +1 -1
- package/chunks/sphere.js +1 -1
- package/chunks/vec42.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec4.js +1 -1
- package/core/quantityFormatUtils.js +1 -1
- package/core/unitFormatUtils.js +1 -1
- package/geometry/coordinateFormatter.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +195 -0
- package/kernel.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/knowledgeGraph/nodeMovementUtils.js +5 -0
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/package.json +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/rest/knowledgeGraph/GraphApplyEditsResult.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToUpdateResponseFactories.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/support/previewSymbol3D.js +1 -1
- package/undoredo/support/Services.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/utils/navigationUtils.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/LinkChartView.js +1 -1
- package/views/draw/DrawOperation.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/draw/support/HighlightHelper.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/interactive/Tooltip.js +1 -1
- package/views/interactive/sketch/SketchLabelOptions.js +1 -1
- package/views/interactive/sketch/SketchOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipOptions.js +1 -1
- package/views/interactive/sketch/SketchTooltipVisibleElements.js +1 -1
- package/views/interactive/sketch/SketchValueOptions.js +1 -1
- package/views/interactive/sketch/Units.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureCollectionSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/FeatureServiceSnappingSource.js +1 -1
- package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
- package/views/interactive/tooltip/fields/fields.js +1 -1
- package/views/interactive/tooltip/fields/parsingAndFormattingUtils.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/support/angularMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
- package/widgets/VideoPlayer/css.js +1 -1
- package/widgets/VideoPlayer.js +1 -1
- package/assets/esri/core/workers/chunks/710ee12aa955e3eea371.js +0 -1
package/interfaces.d.ts
CHANGED
|
@@ -1991,6 +1991,134 @@ declare namespace __esri {
|
|
|
1991
1991
|
|
|
1992
1992
|
export const layerInternalAccessUtils: layerInternalAccessUtils;
|
|
1993
1993
|
|
|
1994
|
+
/**
|
|
1995
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
1996
|
+
*
|
|
1997
|
+
* A utility method for getting a Reshape instance with support for connected reshaping.
|
|
1998
|
+
*/
|
|
1999
|
+
interface reshape {
|
|
2000
|
+
/**
|
|
2001
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2002
|
+
*
|
|
2003
|
+
* Returns a reshape operation.
|
|
2004
|
+
*
|
|
2005
|
+
* @param properties The constructor properties.
|
|
2006
|
+
*/
|
|
2007
|
+
getReshape(properties: ConstructProperties): Promise<Reshape>;
|
|
2008
|
+
/**
|
|
2009
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2010
|
+
*
|
|
2011
|
+
* Registers a callback to be called when the node movement reshape operation stops.
|
|
2012
|
+
*
|
|
2013
|
+
* @param targetView The LinkChartView in which the node movement reshape operation is taking place.
|
|
2014
|
+
* @param movementStopCallback The callback function to be called when the node movement stops.
|
|
2015
|
+
*/
|
|
2016
|
+
onNodeMovementStop(targetView: LinkChartView, movementStopCallback: MovementStopCallback): IHandle;
|
|
2017
|
+
/**
|
|
2018
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2019
|
+
*
|
|
2020
|
+
* Starts a node movement reshape operation in the LinkChartView.
|
|
2021
|
+
*
|
|
2022
|
+
* @param targetEntityId The ID of the entity to be moved.
|
|
2023
|
+
* @param targetEntityType The type of the entity to be moved.
|
|
2024
|
+
* @param targetView The LinkChartView in which the node movement reshape operation will take place.
|
|
2025
|
+
* @param options Optional parameters.
|
|
2026
|
+
*/
|
|
2027
|
+
studioStartNodeMovement(targetEntityId: string, targetEntityType: string, targetView: LinkChartView, options?: any): Promise<StudioNodeMovementReturnType>;
|
|
2028
|
+
}
|
|
2029
|
+
|
|
2030
|
+
export const reshape: reshape;
|
|
2031
|
+
export type CancelNodeMovement = () => void;
|
|
2032
|
+
export type CommitNodeMovement = () => Promise<Point>;
|
|
2033
|
+
|
|
2034
|
+
/**
|
|
2035
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2036
|
+
*
|
|
2037
|
+
* An object that provides "connected reshaping" functionality for a feature or vertex being reshaped.
|
|
2038
|
+
*/
|
|
2039
|
+
export interface ConnectedReshapeProvider {
|
|
2040
|
+
updating: boolean;
|
|
2041
|
+
translate: Translate;
|
|
2042
|
+
}
|
|
2043
|
+
|
|
2044
|
+
export interface ConnectedReshapeProviderFactory {
|
|
2045
|
+
getFeatureReshapeProvider: GetFeatureReshapeProvider;
|
|
2046
|
+
getVertexReshapeProvider: GetVertexReshapeProvider;
|
|
2047
|
+
}
|
|
2048
|
+
|
|
2049
|
+
export interface ConstructProperties {
|
|
2050
|
+
connectedReshapeProviders: ConnectedReshapeProviderFactory[] | nullish;
|
|
2051
|
+
graphic: Graphic;
|
|
2052
|
+
layer: GraphicsLayer;
|
|
2053
|
+
view: MapView;
|
|
2054
|
+
}
|
|
2055
|
+
|
|
2056
|
+
export type Destroy = () => void;
|
|
2057
|
+
export type GetFeatureReshapeProvider = (features: ReshapeFeature[]) => ConnectedReshapeProvider | nullish;
|
|
2058
|
+
export type GetVertexReshapeProvider = (
|
|
2059
|
+
feature: ReshapeFeature,
|
|
2060
|
+
vertices: VertexInfo[],
|
|
2061
|
+
) => ConnectedReshapeProvider | nullish;
|
|
2062
|
+
|
|
2063
|
+
/**
|
|
2064
|
+
* Note: reserved for internal use only, this is not part of the stable public API.
|
|
2065
|
+
*
|
|
2066
|
+
* Represents a feature that has been modified by a ConnectedReshapeProvider due to being connected (or otherwise spatially related to) the feature(s) or vertex(es) being reshaped.
|
|
2067
|
+
*/
|
|
2068
|
+
export interface ModifiedFeature {
|
|
2069
|
+
graphic: Graphic;
|
|
2070
|
+
layer: | GeoJSONLayer
|
|
2071
|
+
| FeatureLayer
|
|
2072
|
+
| OrientedImageryLayer
|
|
2073
|
+
| SceneLayer
|
|
2074
|
+
| SubtypeSublayer
|
|
2075
|
+
| GraphicsLayer
|
|
2076
|
+
| KnowledgeGraphSublayer;
|
|
2077
|
+
originalGraphic: Graphic;
|
|
2078
|
+
uniqueId: string | number;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
export type MovementStopCallback = (event: MovementStopCallbackEvent) => void;
|
|
2082
|
+
|
|
2083
|
+
export interface Reshape {
|
|
2084
|
+
connectedReshapeProviders: ConnectedReshapeProviderFactory[] | nullish;
|
|
2085
|
+
graphic: Graphic;
|
|
2086
|
+
layer: GraphicsLayer;
|
|
2087
|
+
view: MapView;
|
|
2088
|
+
destroy: Destroy;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
export interface ReshapeFeature {
|
|
2092
|
+
graphic: Graphic;
|
|
2093
|
+
layer: | GeoJSONLayer
|
|
2094
|
+
| FeatureLayer
|
|
2095
|
+
| OrientedImageryLayer
|
|
2096
|
+
| SceneLayer
|
|
2097
|
+
| SubtypeSublayer
|
|
2098
|
+
| GraphicsLayer
|
|
2099
|
+
| KnowledgeGraphSublayer
|
|
2100
|
+
| nullish;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
2103
|
+
export interface StudioNodeMovementReturnType {
|
|
2104
|
+
commitNodeMovement: CommitNodeMovement;
|
|
2105
|
+
cancelNodeMovement: CancelNodeMovement;
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
export type StudioStartNodeMovementOptions = () => void;
|
|
2109
|
+
export type Translate = (deltaX: number, deltaY: number, deltaZ: number | nullish) => ModifiedFeature[];
|
|
2110
|
+
|
|
2111
|
+
export interface VertexInfo {
|
|
2112
|
+
pathIndex: number;
|
|
2113
|
+
vertexIndex: number;
|
|
2114
|
+
}
|
|
2115
|
+
|
|
2116
|
+
export interface MovementStopCallbackEvent {
|
|
2117
|
+
mover: Graphic;
|
|
2118
|
+
dx: number;
|
|
2119
|
+
dy: number;
|
|
2120
|
+
}
|
|
2121
|
+
|
|
1994
2122
|
interface resourceSerializationUtils {
|
|
1995
2123
|
fetchAndConvertSerializedKnowledgeIdMap(idCollectionsUrl: string, generateAllSublayers?: boolean): Promise<InclusionModeDefinitionOptimizedGeometry>;
|
|
1996
2124
|
fetchAndConvertSerializedLinkChart(serializedResourceURLs: SerializedResourceURLs): Promise<InclusionModeDefinitionOptimizedGeometry>;
|
|
@@ -62446,6 +62574,7 @@ declare namespace __esri {
|
|
|
62446
62574
|
export interface GraphApplyEditsOptions {
|
|
62447
62575
|
inputQuantizationParameters?: InputQuantizationParameters;
|
|
62448
62576
|
cascadeDelete?: boolean;
|
|
62577
|
+
cascadeProvenanceDelete?: boolean;
|
|
62449
62578
|
}
|
|
62450
62579
|
|
|
62451
62580
|
/**
|
|
@@ -62460,6 +62589,21 @@ declare namespace __esri {
|
|
|
62460
62589
|
}
|
|
62461
62590
|
|
|
62462
62591
|
export class GraphApplyEditsResult extends Accessor {
|
|
62592
|
+
/**
|
|
62593
|
+
* Returns a list of the Provenance entities that were deleted as a result of the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html#executeApplyEdits executeApplyEdits()}
|
|
62594
|
+
* call with the `cascadeProvenanceDeletes` option enabled.
|
|
62595
|
+
*
|
|
62596
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphApplyEditsResult.html#cascadeProvenanceDeleteResults Read more...}
|
|
62597
|
+
*/
|
|
62598
|
+
cascadeProvenanceDeleteResults: CascadeProvenanceDeleteResults[];
|
|
62599
|
+
/**
|
|
62600
|
+
* Returns a list of objects for each {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html relationship type}
|
|
62601
|
+
* that was deleted by as a result of deleting its origin or destination entity during an {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html#executeApplyEdits executeApplyEdits()}
|
|
62602
|
+
* call with the `cascadeDeletes` option enabled.
|
|
62603
|
+
*
|
|
62604
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphApplyEditsResult.html#cascadeRelationshipDeleteResults Read more...}
|
|
62605
|
+
*/
|
|
62606
|
+
cascadeRelationshipDeleteResults: CascadeRelationshipDeleteResults[];
|
|
62463
62607
|
/**
|
|
62464
62608
|
* Returns a list of objects for each {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-EntityType.html entity type} or
|
|
62465
62609
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html relationship type} that added, updated or deleted records by
|
|
@@ -62492,6 +62636,21 @@ declare namespace __esri {
|
|
|
62492
62636
|
}
|
|
62493
62637
|
|
|
62494
62638
|
interface GraphApplyEditsResultProperties {
|
|
62639
|
+
/**
|
|
62640
|
+
* Returns a list of the Provenance entities that were deleted as a result of the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html#executeApplyEdits executeApplyEdits()}
|
|
62641
|
+
* call with the `cascadeProvenanceDeletes` option enabled.
|
|
62642
|
+
*
|
|
62643
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphApplyEditsResult.html#cascadeProvenanceDeleteResults Read more...}
|
|
62644
|
+
*/
|
|
62645
|
+
cascadeProvenanceDeleteResults?: CascadeProvenanceDeleteResults[];
|
|
62646
|
+
/**
|
|
62647
|
+
* Returns a list of objects for each {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html relationship type}
|
|
62648
|
+
* that was deleted by as a result of deleting its origin or destination entity during an {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraphService.html#executeApplyEdits executeApplyEdits()}
|
|
62649
|
+
* call with the `cascadeDeletes` option enabled.
|
|
62650
|
+
*
|
|
62651
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphApplyEditsResult.html#cascadeRelationshipDeleteResults Read more...}
|
|
62652
|
+
*/
|
|
62653
|
+
cascadeRelationshipDeleteResults?: CascadeRelationshipDeleteResults[];
|
|
62495
62654
|
/**
|
|
62496
62655
|
* Returns a list of objects for each {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-EntityType.html entity type} or
|
|
62497
62656
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-RelationshipType.html relationship type} that added, updated or deleted records by
|
|
@@ -62514,6 +62673,29 @@ declare namespace __esri {
|
|
|
62514
62673
|
hasError?: boolean;
|
|
62515
62674
|
}
|
|
62516
62675
|
|
|
62676
|
+
/**
|
|
62677
|
+
* CascadeProvenanceDeleteResults contains the `id` of the Provenance {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphNamedObject.html GraphNamedObject}
|
|
62678
|
+
* that was deleted from the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-KnowledgeGraph.html KnowledgeGraph} as well as any errors that occurred during the operation,
|
|
62679
|
+
* when edits were applied with `cascadeProvenanceDelete` set to true.
|
|
62680
|
+
*
|
|
62681
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphApplyEditsResult.html#CascadeProvenanceDeleteResults Read more...}
|
|
62682
|
+
*/
|
|
62683
|
+
export interface CascadeProvenanceDeleteResults {
|
|
62684
|
+
id: string;
|
|
62685
|
+
error?: Error;
|
|
62686
|
+
}
|
|
62687
|
+
|
|
62688
|
+
/**
|
|
62689
|
+
* cascadeRelationshipDeletesResults returns a list of all {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-Relationship.html relationships} of each {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphObjectType.html type}
|
|
62690
|
+
* that were deleted from the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-KnowledgeGraph.html KnowledgeGraph} due to one of their endpoints being deleted, as well as any errors that occurred during the operation.
|
|
62691
|
+
*
|
|
62692
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphApplyEditsResult.html#CascadeRelationshipDeleteResults Read more...}
|
|
62693
|
+
*/
|
|
62694
|
+
export interface CascadeRelationshipDeleteResults {
|
|
62695
|
+
typeName: string;
|
|
62696
|
+
cascadeRelationshipDeletes: NamedObjectCascadeRelationshipDeleteResults[];
|
|
62697
|
+
}
|
|
62698
|
+
|
|
62517
62699
|
/**
|
|
62518
62700
|
* editResultsObject returns a list of all {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-Entity.html entities}
|
|
62519
62701
|
* and {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-Relationship.html relationships} of each {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphObjectType.html type}
|
|
@@ -62528,6 +62710,19 @@ declare namespace __esri {
|
|
|
62528
62710
|
deletes: NamedObjectEditResults[];
|
|
62529
62711
|
}
|
|
62530
62712
|
|
|
62713
|
+
/**
|
|
62714
|
+
* NamedObjectCascadeRelationshipDeleteResults contains the `id` of the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-Relationship.html Relationship} that
|
|
62715
|
+
* was deleted from the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-KnowledgeGraph.html KnowledgeGraph} along with its origin id, destination id and error information.
|
|
62716
|
+
*
|
|
62717
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphApplyEditsResult.html#NamedObjectCascadeRelationshipDeleteResults Read more...}
|
|
62718
|
+
*/
|
|
62719
|
+
export interface NamedObjectCascadeRelationshipDeleteResults {
|
|
62720
|
+
id: string;
|
|
62721
|
+
originId: string;
|
|
62722
|
+
destinationId: string;
|
|
62723
|
+
error?: Error;
|
|
62724
|
+
}
|
|
62725
|
+
|
|
62531
62726
|
/**
|
|
62532
62727
|
* NamedObjectEditResults contains the `id` of the {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-GraphNamedObject.html GraphNamedObject}
|
|
62533
62728
|
* ({@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-Entity.html Entity} or {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-knowledgeGraph-Relationship.html Relationship}) that
|
package/kernel.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.33";let s,r=e;r="4.33.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.33";let s,r=e;r="4.33.13";function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"./FeatureLayer.js";import{useViewTimeProperty as s}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as p,orientedImageryTypeMap as m,timeIntervalUnitTypeMap as l,verticalMeasurementTypeMap as d,padAccuracyArray as y,isOrientationAccuracy as u}from"./orientedImagery/core/utils.js";import c from"../tables/AttributeTableTemplate.js";import{T as h}from"../chunks/TimeExtent.js";import{SaveOperationType as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"./FeatureLayer.js";import{useViewTimeProperty as s}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as p,orientedImageryTypeMap as m,timeIntervalUnitTypeMap as l,verticalMeasurementTypeMap as d,padAccuracyArray as y,isOrientationAccuracy as u}from"./orientedImagery/core/utils.js";import c from"../tables/AttributeTableTemplate.js";import{T as h}from"../chunks/TimeExtent.js";import{SaveOperationType as g}from"../webdoc/interfaces.js";const f=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),v=(e,t)=>!f.has(t)&&e,j=(e,t,i)=>{const r=`orientedImageryProperties.${e}`;return{name:r,write:t?{ignoreOrigin:!0,target:r,writer:t}:{ignoreOrigin:!0},read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function P(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function S(e,t,i,r){const{name:o,write:a,read:n}=j(e,t,i),s={name:o,write:a,read:n,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:v(a,e),read:v(n,e)},"web-map":{name:o,write:a,read:n}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}let x=class extends n{constructor(){super(...arguments),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.virtualCacheDirectory=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return p(e,t,i)}async save(e){return this._debouncedSaveOperations(g.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(g.SAVE_AS,t,e)}findFirstValidLayerId(e){return e.layers?.find((e=>this.supportedSourceTypes.has(e.type)))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:c,json:{write:!1,read:!1}})],x.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:S("cameraHeading")})],x.prototype,"cameraHeading",void 0),e([o({type:Number,json:S("cameraHeight")})],x.prototype,"cameraHeight",void 0),e([o({type:Number,json:S("cameraPitch")})],x.prototype,"cameraPitch",void 0),e([o({type:Number,json:S("cameraRoll")})],x.prototype,"cameraRoll",void 0),e([o({type:Number,json:S("coveragePercent")})],x.prototype,"coveragePercent",void 0),e([o({type:String,json:S("demPathPrefix")})],x.prototype,"demPathPrefix",void 0),e([o({type:String,json:S("demPathSuffix")})],x.prototype,"demPathSuffix",void 0),e([o({type:String,json:S("depthImagePathPrefix")})],x.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:S("depthImagePathSuffix")})],x.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:S("elevationSource")})],x.prototype,"elevationSource",void 0),e([o({readOnly:!0})],x.prototype,"effectiveElevationSource",null),e([o({type:Number,json:S("farDistance")})],x.prototype,"farDistance",void 0),e([o()],x.prototype,"geometryType",void 0),e([o({type:Number,json:S("horizontalFieldOfView")})],x.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:S("horizontalMeasurementUnit")})],x.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...S("imageGeometryField"),default:"ImageGeometry"}})],x.prototype,"imageGeometryField",void 0),e([o({type:String,json:S("imagePathPrefix")})],x.prototype,"imagePathPrefix",void 0),e([o({type:String,json:S("imagePathSuffix")})],x.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...S("imageReferenceField"),default:"OIObjectID"}})],x.prototype,"imageReferenceField",void 0),e([o({type:Number,json:S("imageRotation")})],x.prototype,"imageRotation",void 0),e([o({type:Number,json:S("maximumDistance")})],x.prototype,"maximumDistance",void 0),e([o({type:Number,json:S("nearDistance")})],x.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],x.prototype,"operationalLayerType",void 0),e([o({json:{...S("orientationAccuracy",((e,t,i)=>{r(i,e.join(";"),t)}),(e=>{const t=e?.split(";")?.map(Number);return u(t)?y(t):[0,0,0,0,0,0,0,0]}),String)}})],x.prototype,"orientationAccuracy",void 0),e([o({json:{...S("orientedImageryType",m.write,m.read,m.jsonValues.slice(1))}})],x.prototype,"orientedImageryType",void 0),e([o({type:String,json:{...S("referenceIDField"),default:"OBJECTID"}})],x.prototype,"referenceIDField",void 0),e([o({type:String,json:{...S("sequenceOrderField"),default:"SequenceOrder"}})],x.prototype,"sequenceOrderField",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],x.prototype,"type",void 0),e([o({type:l.apiValues,json:{...S("timeIntervalUnit",l.write,l.read,l.jsonValues)}})],x.prototype,"timeIntervalUnit",void 0),e([o(P(i(s)))],x.prototype,"useViewTime",void 0),e([o({type:Number,json:S("verticalFieldOfView")})],x.prototype,"verticalFieldOfView",void 0),e([o({type:d.apiValues,json:{...S("verticalMeasurementUnit",d.write,d.read,d.jsonValues)}})],x.prototype,"verticalMeasurementUnit",void 0),e([o({type:String,json:S("videoPathPrefix")})],x.prototype,"videoPathPrefix",void 0),e([o({type:String,json:S("videoPathSuffix")})],x.prototype,"videoPathSuffix",void 0),e([o({type:String,json:{read:!1,write:!1,origins:{service:{name:"orientedImageryInfo.orientedImageryProperties.virtualCacheDirectory",read:!0}}}})],x.prototype,"virtualCacheDirectory",void 0),e([o({type:h,json:{origins:{"web-scene":{write:!1,read:!1}}}})],x.prototype,"visibilityTimeExtent",void 0),x=e([a("esri.layers.OrientedImageryLayer")],x);const I=x;export{I as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import i from"../../core/Error.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{parseWhereClause as a}from"../../core/sql.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../geometry/Extent.js";import l from"../../geometry/Polygon.js";import{initializeProjection as m,project as h}from"../../geometry/projectionUtils.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{systemOidFieldName as y,systemOriginIdFieldName as u,systemDestinationIdFieldName as f,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as b}from"./constants.js";import w from"./SessionMemoryStorage.js";import{utilsExtentToInBoundsRings as T}from"./supportUtils.js";import{executeQueryStreaming as I}from"../../rest/knowledgeGraphService.js";import M from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import D from"../../rest/support/Query.js";let E=class extends t{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach((i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach((e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})})))})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach((e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})})))})),e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((i,s)=>{if("entity"===t.get(s))this.entityTypeNames.add(s);else{if("relationship"!==t.get(s))return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this.relationshipTypeNames.add(s)}const a=new Map;i.members?.forEach((e=>{o(this.memberIdTypeLookup,e.id,(()=>new Set)).add(s);const t=this.getById(e.id);t&&a.set(e.id,t)})),this.sublayerCaches.set(s,a)}))}addToLayer(e){e.forEach((({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),o(this.memberIdTypeLookup,t,(()=>new Set)).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),o(this.memberIdTypeLookup,t,(()=>new Set)).add(e)}}))}getById(e){return w.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new D({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),o=n.outFields;o&&1===o.length&&o[0]===y&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return s.forEach((i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[u]),o=this.memberIdTypeLookup.get(i.attributes[f]),s=this._isEndEntitySpatial(n,i,u),a=this._isEndEntitySpatial(o,i,f);i.attributes[g]=Number(s&&a)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[g]=1:i.attributes[g]=0}i.attributes[b]=i.geometry,a.push(i)})),a}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let o="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)o=o+e+"|";o=o.slice(0,-1)}const a={},r=[];for(const[l,m]of s){const e=`${l}_ids`;a[e]=m,t&&0!==t?.length?r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r:${o}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!r.length)return n;const p=r.join(" UNION "),d=(await I(this.knowledgeGraph,new M({openCypherQuery:p,bindParameters:a}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const o={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[d,l]of n.entries()){const e=`${d}_ids`;o[e]=l,s.push(`MATCH (n:${d}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),r=[],p=(await I(this.knowledgeGraph,new M({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];r.push({id:e[0],typeName:e[1]})}}return r}async getRelationshipsFromNodes(e,t,i,n){const o=this._getNamedTypeIdMapFromNodeIds(e);if(0===o.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},a=[];for(const[m,h]of o.entries()){const e=`${m}_ids`;s[e]=h,a.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const r=a.join(" UNION "),p=new Map,d=(await I(this.knowledgeGraph,new M({openCypherQuery:r,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];let n=p.get(e[1]);n||(n=new Set,p.set(e[1],n)),n.add(e[0])}}const l=[];for(const[m,h]of p)for(const e of h)l.push({id:e,typeName:m});return l}async refreshCacheContent(e,t,n,a=!0,r){const p=w.getInstance(),d=[],l=new Map,m=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&m.set(e.name,e)})),this.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&m.set(e.name,e)})),e||this.inclusionModeDefinition?e?e.forEach((e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))l.has(t)?l.get(t)?.push(e):l.set(t,[e])})):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e.useAllData?l.set(t,null):e.members&&e.members.forEach((e=>{l.has(t)&&null!==l.get(t)?l.get(t)?.push(e.id):l.set(t,[e.id])}))})):(this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&l.set(e.name,null)})),this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&l.set(e.name,null)})));for(const[s,h]of l){const e=new Set(h),l=new Promise(((d,l)=>{const c=async()=>{const d=new Set,l=[];let c,u="",f=!1;if(t||m.get(s)?.properties?.forEach((e=>{e.name&&d.add(e.name)})),n&&this.geographicLookup.has(s)){const e=this.geographicLookup.get(s)?.name;e&&d.add(e)}if(this.entityTypeNames.has(s))u=`MATCH (n:${s}) ${h?"WHERE id(n) IN $ids ":""}return ID(n)`,d.forEach((e=>{u+=`, n.${e}`,l.push(e)}));else{if(!this.relationshipTypeNames.has(s))throw new i("knowledge-graph:layer-data-manager",`The graph type of ${s} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,u=`MATCH ()-[n:${s}]->() ${h?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,d.forEach((e=>{u+=`, n.${e}`,l.push(e)}))}c=new M(h?{openCypherQuery:u,bindParameters:{ids:h}}:{openCypherQuery:u});const g=(await I(this.knowledgeGraph,c,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const n=[];for(let s=0;s<i.length;s++){const t=i[s];let a=0,r=0;const p={properties:{}};for(p.id=t[a],a++,r++,f&&(p.originId=t[a],a++,r++,p.destinationId=t[a],a++,r++,o(this.nodeConnectionsLookup,p.originId,(()=>new Set)).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,(()=>new Set)).add(p.id),o(this.relationshipConnectionsLookup,p.id,(()=>[p.originId,p.destinationId])));a<t.length;a++)p.properties[l[a-r]]=t[a];e.delete(p.id),n.push(p)}const r=p.writeToStore(n,y,this.geographicLookup.get(s)?.name);this.sublayerCaches.has(s)||this.sublayerCaches.set(s,new Map),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(s)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(s,{useAllData:!1,members:new Map}),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(s).members=new Map);const d=this.sublayerCaches.get(s);r.forEach((e=>{d?.set(e.attributes[y],e),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.has(e.attributes[y])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.set(e.attributes[y],{id:e.attributes[y]}),o(this.memberIdTypeLookup,e.attributes[y],(()=>new Set)).add(s))}))}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(s);if(b)for(const t of e)b.members?.delete(t)};c().then((()=>{d(null)})).catch((e=>{"AbortError"===e.name?d(null):l(e)}))}));d.push(l),this._processingCacheUpdatesLookup.get(s)?.push(l)}if(await Promise.all(d),r?.signal?.aborted)throw s()}removeFromLayer(e){const t=new Set,i=new Set(e.map((e=>e.id)));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)}));t.forEach((e=>{this.sublayerCaches.get(e)?.forEach(((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)}))}))}async retrieveDataFromService(e,t,n){const o=w.getInstance(),s=new Set,r=[];let p,u="",f=[];const g="relationship"===t.graphType,b=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,D=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let E=!b&&D?Array.from(D).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(E=e.objectIds);else if(null!=e.objectIds&&E&&E.length>0){const t=e.objectIds;e.objectIds=E.filter((e=>t.includes(e)))}else if(null!=e.objectIds)E=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=E}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach((e=>{s.add(e.name)})):i.forEach((e=>{e!==y&&e!==t.geometryFieldName&&s.add(e)}))}if(null!=e.geometry){const n=e.geometry;let o;const y=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,f=y?.spatialReference,b=y?.serviceCapabilities?.geometryCapabilities;let w=b?.geometryMaxBoundingRectangleSizeX,I=b?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await m(e.spatialReference,c),e=h(e,c)),o=new d({spatialReference:c,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await m(n.extent.spatialReference,c),o=h(n.extent,c)):o=n.extent;if(w&&I&&f){if(4326!==f.wkid){const e=new d({spatialReference:f,xmax:w,ymax:I}),t=h(e,c);w=t.xmax,I=t.ymax}if(o.xmax-o.xmin>w)throw new i("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${w}° latitude, limit exceeded`);if(o.ymax-o.ymin>I)throw new i("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${I}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await a(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach((e=>{i.fieldNames.includes(e.name)&&s.add(e.name)}))}u=g?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach((e=>{u+=`, n.${e}`,r.push(e)})),p=new M({openCypherQuery:u,bindParameters:{param_filter_geom:new l({rings:T(o)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await a(e.where,t.fieldsIndex);t.fields.forEach((e=>{n.fieldNames.includes(e.name)&&s.add(e.name)}));const o=new Set(["column-reference","string","number","binary-expression"]),r=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let p=!1;const d=e=>{if("column-reference"===e.type)return`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&o.has(e.left.type)&&o.has(e.right.type)&&r.has(e.operator))return`${d(e.left)} ${e.operator} ${d(e.right)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let t="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)t+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return p=!0,"";t+=`lower(n.${e.left.column})`}if(t+=" CONTAINS (","string"!==e.right.type)return p=!0,"";{let i=e.right.value;"%"===i.charAt(0)&&(i=i.slice(1)),"%"===i.charAt(i.length-1)&&(i=i.slice(0,-1)),t+=`'${i.toLowerCase()}')`}return t}return p=!0,""};i=d(n.parseTree),p&&(i="")}let n="";n=g?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;E&&(o=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=o?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",g&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach((e=>{n+=`, n.${e}`,r.push(e)})),p=new M(E?{openCypherQuery:n,bindParameters:{ids:E}}:{openCypherQuery:n})}const N=(await I(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await N.read();if(e)break;const n=[];for(let t=0;t<i.length;t++){const e=i[t];let o=0,s=0;const a={properties:{}};for(a.id=e[o],o++,s++,g&&(a.originId=e[o],o++,s++,a.destinationId=e[o],o++,s++);o<e.length;o++)a.properties[r[o-s]]=e[o];n.push(a)}f=f.concat(o.writeToStore(n,y,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return f}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),o=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&o?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach((e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}})),t}};e([r()],E.prototype,"knowledgeGraph",void 0),e([r()],E.prototype,"inclusionModeDefinition",void 0),e([r()],E.prototype,"entityTypeNames",void 0),e([r()],E.prototype,"relationshipTypeNames",void 0),e([r()],E.prototype,"geographicLookup",void 0),e([r()],E.prototype,"sublayerCaches",void 0),e([r()],E.prototype,"nodeConnectionsLookup",void 0),e([r()],E.prototype,"relationshipConnectionsLookup",void 0),e([r()],E.prototype,"memberIdTypeLookup",void 0),E=e([p("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],E);export{E as KnowledgeGraphLayerDataManager};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Accessor.js";import i from"../../core/Error.js";import n from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{createAbortError as s}from"../../core/promiseUtils.js";import{parseWhereClause as a}from"../../core/sql.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import d from"../../geometry/Extent.js";import l from"../../geometry/Polygon.js";import{initializeProjection as m,project as h}from"../../geometry/projectionUtils.js";import{wgs84 as c}from"../../geometry/support/spatialReferenceUtils.js";import{systemOidFieldName as y,systemOriginIdFieldName as u,systemDestinationIdFieldName as f,systemIsSpatialFieldName as g,systemLayoutGeometryFieldName as b}from"./constants.js";import w from"./SessionMemoryStorage.js";import{utilsExtentToInBoundsRings as T}from"./supportUtils.js";import{executeQueryStreaming as I}from"../../rest/knowledgeGraphService.js";import M from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import D from"../../rest/support/Query.js";let E=class extends t{constructor(e){super(e),this._processingCacheUpdatesLookup=new Map,this.knowledgeGraph=null,this.inclusionModeDefinition={generateAllSublayers:!0,namedTypeDefinitions:new Map},this.entityTypeNames=new Set,this.relationshipTypeNames=new Set,this.geographicLookup=new Map,this.sublayerCaches=new Map,this.nodeConnectionsLookup=new Map,this.relationshipConnectionsLookup=new Map,this.memberIdTypeLookup=new Map;const t=new Map;e.knowledgeGraph.dataModel.entityTypes?.forEach((i=>{i.name&&(t.set(i.name,"entity"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.entityTypeNames.add(i.name),i.properties?.forEach((e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})})))})),e.knowledgeGraph.dataModel.relationshipTypes?.forEach((i=>{i.name&&(t.set(i.name,"relationship"),this._processingCacheUpdatesLookup.set(i.name,[]),e.inclusionModeDefinition&&!e.inclusionModeDefinition?.generateAllSublayers||this.relationshipTypeNames.add(i.name),i.properties?.forEach((e=>{e.geometryType&&"esriGeometryNull"!==e.geometryType&&this.geographicLookup.set(i.name,{name:e.name??"",geometryType:e.geometryType})})))})),e.inclusionModeDefinition?.namedTypeDefinitions.forEach(((i,s)=>{if("entity"===t.get(s))this.entityTypeNames.add(s);else{if("relationship"!==t.get(s))return n.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);this.relationshipTypeNames.add(s)}const a=new Map;i.members?.forEach((e=>{o(this.memberIdTypeLookup,e.id,(()=>new Set)).add(s)})),this.sublayerCaches.set(s,a)}))}addToLayer(e){e.forEach((({typeName:e,id:t})=>{if(!this.inclusionModeDefinition)throw new i("knowledge-graph:layer-data-manager","You cannot add to a layer's exclusion list if it was not created with an exclusion list originally");if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){if(this.inclusionModeDefinition.namedTypeDefinitions.has(e)){const i=this.inclusionModeDefinition.namedTypeDefinitions.get(e);i.members||(i.members=new Map),i.members.set(t,{id:t}),o(this.memberIdTypeLookup,t,(()=>new Set)).add(e)}}else{const i=new Map;i.set(t,{id:t}),this.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:i}),o(this.memberIdTypeLookup,t,(()=>new Set)).add(e)}}))}getById(e){return w.getInstance().readFromStoreById(e)}async getData(e,t,i){if(t.objectType.name&&this.inclusionModeDefinition?.namedTypeDefinitions&&this.inclusionModeDefinition.namedTypeDefinitions.size>0&&!this.inclusionModeDefinition.namedTypeDefinitions.has(t.objectType.name))return[];let n;if(n=e||new D({where:"1=1",outFields:["*"]}),"link-chart"===t.parentCompositeLayer.type){const e=t.parentCompositeLayer,i=this._processingCacheUpdatesLookup.get(t.objectType.name??""),o=n.outFields;o&&1===o.length&&o[0]===y&&"1=1"===n.where||await Promise.all(i??[]);const s=this.sublayerCaches.has(t.objectType.name??"")?Array.from(this.sublayerCaches.get(t.objectType.name)?.values()):[],a=[];return s.forEach((i=>{if(this.relationshipTypeNames.has(t.objectType.name)){i.geometry=e.relationshipLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.memberIdTypeLookup.get(i.attributes[u]),o=this.memberIdTypeLookup.get(i.attributes[f]),s=this._isEndEntitySpatial(n,i,u),a=this._isEndEntitySpatial(o,i,f);i.attributes[g]=Number(s&&a)}else{i.geometry=e.entityLinkChartDiagramLookup.get(i.attributes[t.objectIdField]);const n=this.geographicLookup.get(t.objectType.name);n&&i.attributes[n.name]?i.attributes[g]=1:i.attributes[g]=0}i.attributes[b]=i.geometry,a.push(i)})),a}return this.retrieveDataFromService(n,t,i)}async getConnectedRecordIds(e,t,i){const n=[];let o="";const s=this._getNamedTypeIdMapFromNodeIds(e);if(t&&0!==t?.length){for(const e of t)o=o+e+"|";o=o.slice(0,-1)}const a={},r=[];for(const[l,m]of s){const e=`${l}_ids`;a[e]=m,t&&0!==t?.length?r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r:${o}]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`):r.push(`MATCH (n:${l}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) RETURN id(r), type(r), id(m), labels(m)[0]`)}if(!r.length)return n;const p=r.join(" UNION "),d=(await I(this.knowledgeGraph,new M({openCypherQuery:p,bindParameters:a}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];n.push({id:e[0],typeName:e[1]}),n.push({id:e[2],typeName:e[3]})}}return n}async getRelationshipsBetweenNodes(e,t,i){const n=this._getNamedTypeIdMapFromNodeIds(e);if(0===n.size)return[];const o={relationshipExclusionIds:t,possibleConnectionEntityIds:e},s=[];for(const[d,l]of n.entries()){const e=`${d}_ids`;o[e]=l,s.push(`MATCH (n:${d}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]->(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const a=s.join(" UNION "),r=[],p=(await I(this.knowledgeGraph,new M({openCypherQuery:a,bindParameters:o}),{signal:i?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];r.push({id:e[0],typeName:e[1]})}}return r}async getRelationshipsFromNodes(e,t,i,n){const o=this._getNamedTypeIdMapFromNodeIds(e);if(0===o.size||0===t.length)return[];const s={relationshipExclusionIds:i,possibleConnectionEntityIds:t},a=[];for(const[m,h]of o.entries()){const e=`${m}_ids`;s[e]=h,a.push(`MATCH (n:${m}) WHERE id(n) IN $${e} WITH n MATCH (n)-[r]-(m) WHERE id(m) IN $possibleConnectionEntityIds AND NOT id(r) IN $relationshipExclusionIds RETURN id(r), type(r)`)}const r=a.join(" UNION "),p=new Map,d=(await I(this.knowledgeGraph,new M({openCypherQuery:r,bindParameters:s}),{signal:n?.signal})).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await d.read();if(e)break;for(let i=0;i<t.length;i++){const e=t[i];let n=p.get(e[1]);n||(n=new Set,p.set(e[1],n)),n.add(e[0])}}const l=[];for(const[m,h]of p)for(const e of h)l.push({id:e,typeName:m});return l}async refreshCacheContent(e,t,n,a=!0,r){const p=w.getInstance(),d=[],l=new Map,m=new Map;this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&m.set(e.name,e)})),this.knowledgeGraph.dataModel.relationshipTypes?.forEach((e=>{e.name&&m.set(e.name,e)})),e||this.inclusionModeDefinition?e?e.forEach((e=>{if(this.memberIdTypeLookup.has(e))for(const t of this.memberIdTypeLookup.get(e))l.has(t)?l.get(t)?.push(e):l.set(t,[e])})):this.inclusionModeDefinition?.namedTypeDefinitions?.forEach(((e,t)=>{e.useAllData?l.set(t,null):e.members&&e.members.forEach((e=>{l.has(t)&&null!==l.get(t)?l.get(t)?.push(e.id):l.set(t,[e.id])}))})):(this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&l.set(e.name,null)})),this.knowledgeGraph.dataModel.entityTypes?.forEach((e=>{e.name&&l.set(e.name,null)})));for(const[s,h]of l){const e=new Set(h),l=new Promise(((d,l)=>{const c=async()=>{const d=new Set,l=[];let c,u="",f=!1;if(t||m.get(s)?.properties?.forEach((e=>{e.name&&d.add(e.name)})),n&&this.geographicLookup.has(s)){const e=this.geographicLookup.get(s)?.name;e&&d.add(e)}if(this.entityTypeNames.has(s))u=`MATCH (n:${s}) ${h?"WHERE id(n) IN $ids ":""}return ID(n)`,d.forEach((e=>{u+=`, n.${e}`,l.push(e)}));else{if(!this.relationshipTypeNames.has(s))throw new i("knowledge-graph:layer-data-manager",`The graph type of ${s} could not be determined. Was this type set in the KG data model and inclusion definition?`);f=!0,u=`MATCH ()-[n:${s}]->() ${h?"WHERE id(n) IN $ids ":""}return ID(n), id(startNode(n)), id(endNode(n))`,d.forEach((e=>{u+=`, n.${e}`,l.push(e)}))}c=new M(h?{openCypherQuery:u,bindParameters:{ids:h}}:{openCypherQuery:u});const g=(await I(this.knowledgeGraph,c,{signal:r?.signal})).resultRowsStream.getReader();for(;;){const{done:t,value:i}=await g.read();if(t)break;const n=[];for(let s=0;s<i.length;s++){const t=i[s];let a=0,r=0;const p={properties:{}};for(p.id=t[a],a++,r++,f&&(p.originId=t[a],a++,r++,p.destinationId=t[a],a++,r++,o(this.nodeConnectionsLookup,p.originId,(()=>new Set)).add(p.id),o(this.nodeConnectionsLookup,p.destinationId,(()=>new Set)).add(p.id),o(this.relationshipConnectionsLookup,p.id,(()=>[p.originId,p.destinationId])));a<t.length;a++)p.properties[l[a-r]]=t[a];e.delete(p.id),n.push(p)}const r=p.writeToStore(n,y,this.geographicLookup.get(s)?.name);this.sublayerCaches.has(s)||this.sublayerCaches.set(s,new Map),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.has(s)&&this.inclusionModeDefinition?.namedTypeDefinitions.set(s,{useAllData:!1,members:new Map}),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members&&(this.inclusionModeDefinition.namedTypeDefinitions.get(s).members=new Map);const d=this.sublayerCaches.get(s);r.forEach((e=>{d?.set(e.attributes[y],e),a&&!this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.has(e.attributes[y])&&(this.inclusionModeDefinition?.namedTypeDefinitions.get(s).members.set(e.attributes[y],{id:e.attributes[y]}),o(this.memberIdTypeLookup,e.attributes[y],(()=>new Set)).add(s))}))}const b=this.inclusionModeDefinition?.namedTypeDefinitions.get(s);if(b)for(const t of e)b.members?.delete(t)};c().then((()=>{d(null)})).catch((e=>{"AbortError"===e.name?d(null):l(e)}))}));d.push(l),this._processingCacheUpdatesLookup.get(s)?.push(l)}if(await Promise.all(d),r?.signal?.aborted)throw s()}removeFromLayer(e){const t=new Set,i=new Set(e.map((e=>e.id)));for(const n of e)t.add(n.typeName),1===this.memberIdTypeLookup.get(n.id)?.size?this.memberIdTypeLookup.delete(n.id):this.memberIdTypeLookup.get(n.id)?.delete(n.typeName),this.inclusionModeDefinition?.namedTypeDefinitions.forEach(((e,t)=>{t===n.typeName&&e.members?.has(n.id)&&e.members.delete(n.id)}));t.forEach((e=>{this.sublayerCaches.get(e)?.forEach(((t,n)=>{i.has(n)&&this.sublayerCaches.get(e)?.delete(n)}))}))}async retrieveDataFromService(e,t,n){const o=w.getInstance(),s=new Set,r=[];let p,u="",f=[];const g="relationship"===t.graphType,b=this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData,D=t.parentCompositeLayer.sublayerIdsCache.get(t.objectType.name);let E=!b&&D?Array.from(D).sort():null;if(this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData)this.inclusionModeDefinition?.namedTypeDefinitions?.get(t.objectType.name)?.useAllData&&null!=e.objectIds&&(E=e.objectIds);else if(null!=e.objectIds&&E&&E.length>0){const t=e.objectIds;e.objectIds=E.filter((e=>t.includes(e)))}else if(null!=e.objectIds)E=e.objectIds;else{if(this.inclusionModeDefinition?.namedTypeDefinitions.has(t.objectType.name)&&(!this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members||this.inclusionModeDefinition.namedTypeDefinitions.get(t.objectType.name)?.members?.size<1))return e.objectIds=[],[];e.objectIds=E}if(null!=e.outFields){const i=e.outFields;i.includes("*")?t.fields.forEach((e=>{s.add(e.name)})):i.forEach((e=>{e!==y&&e!==t.geometryFieldName&&s.add(e)}))}if(null!=e.geometry){const n=e.geometry;let o;const y=t.parentCompositeLayer.dataManager.knowledgeGraph.serviceDefinition,f=y?.spatialReference,b=y?.serviceCapabilities?.geometryCapabilities;let w=b?.geometryMaxBoundingRectangleSizeX,I=b?.geometryMaxBoundingRectangleSizeY;if("point"===n.type){let e=n;e.spatialReference?.isWGS84||(await m(e.spatialReference,c),e=h(e,c)),o=new d({spatialReference:c,xmin:e.x-1e-4,ymin:e.y-1e-4,xmax:e.x+1e-4,ymax:e.y+1e-4})}else n?.extent?.spatialReference&&!n.spatialReference?.isWGS84?(await m(n.extent.spatialReference,c),o=h(n.extent,c)):o=n.extent;if(w&&I&&f){if(4326!==f.wkid){const e=new d({spatialReference:f,xmax:w,ymax:I}),t=h(e,c);w=t.xmax,I=t.ymax}if(o.xmax-o.xmin>w)throw new i("knowledge-graph:layer-data-manager",`Extent x bounds should be within ${w}° latitude, limit exceeded`);if(o.ymax-o.ymin>I)throw new i("knowledge-graph:layer-data-manager",`Extent y bounds should be within ${I}° longitude, limit exceeded`)}if(null!=e.where&&"1=1"!==e.where){const i=await a(e.where.toUpperCase(),t.fieldsIndex);t.fields.forEach((e=>{i.fieldNames.includes(e.name)&&s.add(e.name)}))}u=g?`Match ()-[n:${t.objectType.name}]->() WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n), id(startNode(r)), id(endNode(r))`:`Match (n:${t.objectType.name}) WHERE esri.graph.ST_Intersects($param_filter_geom, n.${t.geometryFieldName}) return ID(n)`,t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach((e=>{u+=`, n.${e}`,r.push(e)})),p=new M({openCypherQuery:u,bindParameters:{param_filter_geom:new l({rings:T(o)})}})}else{let i="";if(null!=e.where&&"1=1"!==e.where){const n=await a(e.where,t.fieldsIndex);t.fields.forEach((e=>{n.fieldNames.includes(e.name)&&s.add(e.name)}));const o=new Set(["column-reference","string","number","binary-expression"]),r=new Set(["=","<","<=","<>",">",">=","AND","OR","LIKE"]);let p=!1;const d=e=>{if("column-reference"===e.type)return`n.${e.column}`;if("string"===e.type)return`'${e.value}'`;if("number"===e.type)return`${e.value}`;if("binary-expression"===e.type&&o.has(e.left.type)&&o.has(e.right.type)&&r.has(e.operator))return`${d(e.left)} ${e.operator} ${d(e.right)}`;if("binary-expression"===e.type&&"LIKE"===e.operator){let t="";if("function"===e.left.type&&"column-reference"===e.left.args.value[0].type)t+=`lower(n.${e.left.args.value[0].column})`;else{if("column-reference"!==e.left.type)return p=!0,"";t+=`lower(n.${e.left.column})`}if(t+=" CONTAINS (","string"!==e.right.type)return p=!0,"";{let i=e.right.value;"%"===i.charAt(0)&&(i=i.slice(1)),"%"===i.charAt(i.length-1)&&(i=i.slice(0,-1)),t+=`'${i.toLowerCase()}')`}return t}return p=!0,""};i=d(n.parseTree),p&&(i="")}let n="";n=g?`Match ()-[n:${t.objectType.name}]->()`:`Match (n:${t.objectType.name})`;let o=!1;E&&(o=!0,n+=" WHERE ID(n) IN $ids"),i&&(n+=o?" AND":" WHERE",n+=` ${i}`),n+=" return ID(n)",g&&(n+=", id(startNode(n)), id(endNode(n))"),e.returnGeometry&&t.geometryFieldName&&s.add(t.geometryFieldName),s.forEach((e=>{n+=`, n.${e}`,r.push(e)})),p=new M(E?{openCypherQuery:n,bindParameters:{ids:E}}:{openCypherQuery:n})}const N=(await I(t.parentCompositeLayer.dataManager.knowledgeGraph,p,n)).resultRowsStream.getReader();for(;;){const{done:e,value:i}=await N.read();if(e)break;const n=[];for(let t=0;t<i.length;t++){const e=i[t];let o=0,s=0;const a={properties:{}};for(a.id=e[o],o++,s++,g&&(a.originId=e[o],o++,s++,a.destinationId=e[o],o++,s++);o<e.length;o++)a.properties[r[o-s]]=e[o];n.push(a)}f=f.concat(o.writeToStore(n,y,t.parentCompositeLayer.dataManager.geographicLookup.get(t.objectType.name)?.name))}return f}_isEndEntitySpatial(e,t,i){for(const n of e??[])if(this.entityTypeNames.has(n)){const e=this.geographicLookup.get(n),o=e&&this.sublayerCaches.get(n)?.get(t.attributes[i]);if(e&&o?.attributes[e.name])return!0}return!1}_getNamedTypeIdMapFromNodeIds(e){const t=new Map;return e.forEach((e=>{if(this.memberIdTypeLookup.has(e))for(const i of this.memberIdTypeLookup.get(e)){if(!this.entityTypeNames.has(i))return;t.has(i)?t.get(i)?.push(e):t.set(i,[e])}})),t}};e([r()],E.prototype,"knowledgeGraph",void 0),e([r()],E.prototype,"inclusionModeDefinition",void 0),e([r()],E.prototype,"entityTypeNames",void 0),e([r()],E.prototype,"relationshipTypeNames",void 0),e([r()],E.prototype,"geographicLookup",void 0),e([r()],E.prototype,"sublayerCaches",void 0),e([r()],E.prototype,"nodeConnectionsLookup",void 0),e([r()],E.prototype,"relationshipConnectionsLookup",void 0),e([r()],E.prototype,"memberIdTypeLookup",void 0),E=e([p("esri.layers.knowledgeGraph.KnowledgeGraphLayerDataManager")],E);export{E as KnowledgeGraphLayerDataManager};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{MultiOriginJSONMixin as o}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as p}from"../../core/accessorSupport/PropertyOrigin.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import m from"../../geometry/Polyline.js";import{initializeProjection as d,project as h}from"../../geometry/projectionUtils.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import j from"../Layer.js";import b from"../graphics/data/FeatureStore.js";import{QueryEngine as w}from"../graphics/data/QueryEngine.js";import{createCapabilities as T,createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as v,systemAggregationCountFieldName as S,systemIsSpatialFieldName as O,systemLayoutGeometryFieldName as E,systemOriginIdFieldName as x,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as L}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as F,getLinkChartDefaultLabelingInfo as _,getMapDefaultLabelingInfo as R,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as C}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as k,effectProperty as J}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as P,displayFilterEnabledProperty as D,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as G,featureEffectProperty as U}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as K}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as H,useViewTimeProperty as W}from"../mixins/TemporalLayer.js";import{legendEnabled as Y,maxScale as z,minScale as X,opacity as $,popupEnabled as ee}from"../support/commonProperties.js";import{featureReductionProperty as te}from"../support/featureReductionUtils.js";import re from"../support/Field.js";import{fixRendererFields as ie,fixTimeInfoFields as oe}from"../support/fieldUtils.js";import se from"../support/LabelClass.js";import{reader as ne}from"../support/labelingInfo.js";import ae from"../support/TimeInfo.js";import pe from"../../renderers/SimpleRenderer.js";import{fromJSON as le}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ye}from"../../renderers/support/typeUtils.js";import ue from"../../rest/support/FeatureSet.js";import me from"../../rest/support/Query.js";import{createPopupTemplate as de}from"../../support/popupUtils.js";import{applyColorToSymbol as he}from"../../symbols/support/utils.js";import ce from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=ge(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ge(e.write))}return e}function ge(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=je(e)),e):!0===e?be():e}function je(e){const{target:t,writer:r,overridePolicy:i,...o}=e;return function(e,t){const r=we.call(this,e,t);return r.enabled?{...o,...r}:r}}function be(){return{overridePolicy:we}}function we(e,t){const r=!!this.geometryType;let i={enabled:r};return r&&(i={...i,...Te.call(this,e,t)}),i}function Te(e,t){return{ignoreOrigin:this.originIdOf(t)>p.DEFAULTS}}let Ie=class extends(L(P(A(G(M(Z(H(K(V(o(j))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=T(!1,!0),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=v,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new ce(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=me.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(re.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(re.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),re.fromJSON({name:S,type:"esriFieldTypeInteger",alias:S,editable:!1}),re.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return E;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;const e=this.objectType.properties?F(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?_(this.graphType,this.graphTypeName,e):R(this.graphTypeName,this.geometryType,e)}set renderer(e){ie(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map((e=>e.name)).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new pe({type:"simple",symbol:C(r)});const e=le(I(g.toJSON("point")).renderer);return he(e.symbol,r),e}const i=le(I(g.toJSON(this.geometryType)).renderer);return he(i.symbol,r),i}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return de(this,e)}createQuery(){return new me({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e),o=ue.fromJSON(await i.executeQuery(r.toJSON(),t?.signal));return o.features.forEach((e=>{e.sourceLayer=this})),o}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(r),s=await o.executeQueryForExtent(i.toJSON(),t?.signal);let n;return n=null!=s.extent?.xmin&&null!=s.extent?.xmax&&null!=s.extent?.ymin&&null!=s.extent?.ymax?new l(s.extent):new l,{count:s.count,extent:n}}async queryObjectIds(e,t){await this.load();const r=me.from(e);let i;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(e)}return await i.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new b({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new w({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new me({where:"1=1",outFields:[v]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then((()=>oe(this.timeInfo,this.fieldsIndex)))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=me.from(e),i=r.geometry;if(i&&!i.spatialReference?.isWGS84&&(await d(i.spatialReference,f),r.geometry=h(i instanceof u||i instanceof m||i instanceof y?i:i.extent,f)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const o=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(o)}}};function ve(e,t,r){const o=[["ESRI__AGGREGATION_COUNT",S],["ESRI__ORIGIN_ID",x],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",E]];try{for(const t of e)for(const[e,r]of o)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(s){i.getLogger(this).warn("Error updating labelingInfo",s)}return ne(e,t,r)}e([s(fe(r(k)))],Ie.prototype,"blendMode",void 0),e([s()],Ie.prototype,"capabilities",void 0),e([s({readOnly:!0})],Ie.prototype,"userHasUpdateItemPrivileges",null),e([s({json:{origins:{"web-scene":{write:!1}},write:be()}})],Ie.prototype,"charts",void 0),e([s({readOnly:!0})],Ie.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ie.prototype,"definitionExpression",void 0),e([s()],Ie.prototype,"displayField",void 0),e([s(fe(r(D)))],Ie.prototype,"displayFilterEnabled",void 0),e([s(fe(r(q)))],Ie.prototype,"displayFilterInfo",void 0),e([s(fe(r(J)))],Ie.prototype,"effect",void 0),e([s()],Ie.prototype,"elevationInfo",void 0),e([s(fe(r(U)))],Ie.prototype,"featureEffect",void 0),e([s(fe(r(te)))],Ie.prototype,"featureReduction",null),e([s()],Ie.prototype,"fields",null),e([s()],Ie.prototype,"geometryType",null),e([s()],Ie.prototype,"geometryFieldName",null),e([s({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphType",void 0),e([s({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphTypeName",null),e([s()],Ie.prototype,"hasM",null),e([s()],Ie.prototype,"hasZ",null),e([s({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ie.prototype,"id",void 0),e([s({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ie.prototype,"labelsVisible",void 0),e([s({type:[se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:ve,write:be()}})],Ie.prototype,"labelingInfo",null),e([s({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"layerType",void 0),e([s(fe(r(Y)))],Ie.prototype,"legendEnabled",void 0),e([s(fe(r(z)))],Ie.prototype,"maxScale",void 0),e([s(fe(r(X)))],Ie.prototype,"minScale",void 0),e([s()],Ie.prototype,"objectIdField",void 0),e([s()],Ie.prototype,"objectType",void 0),e([s(fe(r($)))],Ie.prototype,"opacity",void 0),e([s(fe(r(B)))],Ie.prototype,"orderBy",void 0),e([s({clonable:!1})],Ie.prototype,"parent",void 0),e([s()],Ie.prototype,"parentCompositeLayer",void 0),e([s(fe(r(ee)))],Ie.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ie.prototype,"popupTemplate",void 0),e([s({type:Number,json:{write:{overridePolicy:Te}}})],Ie.prototype,"refreshInterval",void 0),e([s({types:ye,json:{name:"layerDefinition.drawingInfo.renderer",write:be()}})],Ie.prototype,"renderer",null),e([s()],Ie.prototype,"source",void 0),e([s()],Ie.prototype,"spatialReference",null),e([s({type:ae,json:{name:"layerDefinition.timeInfo",write:!0,origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:!0},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:!0}}}})],Ie.prototype,"timeInfo",null),e([s({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"title",null),e([a("title")],Ie.prototype,"writeTitle",null),e([s({json:{read:!1}})],Ie.prototype,"type",void 0),e([s(fe(r(W)))],Ie.prototype,"useViewTime",void 0),e([s({type:Boolean,json:{name:"visibility",write:be()}})],Ie.prototype,"visible",void 0),Ie=e([n("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ie);export{Ie as default};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../PopupTemplate.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{MultiOriginJSONMixin as o}from"../../core/MultiOriginJSONSupport.js";import"../../core/workers/workers.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{OriginId as p}from"../../core/accessorSupport/PropertyOrigin.js";import l from"../../geometry/Extent.js";import y from"../../geometry/Point.js";import u from"../../geometry/Polygon.js";import m from"../../geometry/Polyline.js";import{initializeProjection as d,project as h}from"../../geometry/projectionUtils.js";import c from"../../geometry/SpatialReference.js";import{wgs84 as f}from"../../geometry/support/spatialReferenceUtils.js";import{featureGeometryTypeKebabDictionary as g}from"../../geometry/support/typeUtils.js";import j from"../Layer.js";import b from"../graphics/data/FeatureStore.js";import{QueryEngine as w}from"../graphics/data/QueryEngine.js";import{createCapabilities as T,createDrawingInfo as I}from"../graphics/sources/support/clientSideDefaults.js";import{systemOidFieldName as v,systemAggregationCountFieldName as S,systemIsSpatialFieldName as O,systemLayoutGeometryFieldName as E,systemOriginIdFieldName as x,systemDestinationIdFieldName as N}from"./constants.js";import{KnowledgeGraphSublayerBase as L}from"./KnowledgeGraphSublayerBase.js";import{getDisplayLabelProperty as F,getLinkChartDefaultLabelingInfo as _,getMapDefaultLabelingInfo as R,getKGSublayerSymbolColor as Q,getDefaultLCRelationshipSublayerSymbol as C}from"./layerUtils.js";import{BlendLayer as M,blendModeProperty as P,effectProperty as k}from"../mixins/BlendLayer.js";import{DisplayFilteredLayer as J,displayFilterEnabledProperty as D,displayFilterInfoProperty as q}from"../mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as G,featureEffectProperty as U}from"../mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as A}from"../mixins/FeatureReductionLayer.js";import{OrderedLayer as Z,orderByProperty as B}from"../mixins/OrderedLayer.js";import{RefreshableLayer as V}from"../mixins/RefreshableLayer.js";import{ScaleRangeLayer as K}from"../mixins/ScaleRangeLayer.js";import{TemporalLayer as H,useViewTimeProperty as W}from"../mixins/TemporalLayer.js";import{legendEnabled as Y,maxScale as z,minScale as X,opacity as $,popupEnabled as ee}from"../support/commonProperties.js";import{featureReductionProperty as te}from"../support/featureReductionUtils.js";import re from"../support/Field.js";import{fixRendererFields as ie,fixTimeInfoFields as oe}from"../support/fieldUtils.js";import se from"../support/LabelClass.js";import{reader as ne}from"../support/labelingInfo.js";import ae from"../support/TimeInfo.js";import pe from"../../renderers/SimpleRenderer.js";import{fromJSON as le}from"../../renderers/support/jsonUtils.js";import{rendererTypes as ye}from"../../renderers/support/typeUtils.js";import ue from"../../rest/support/FeatureSet.js";import me from"../../rest/support/Query.js";import{createPopupTemplate as de}from"../../support/popupUtils.js";import{applyColorToSymbol as he}from"../../symbols/support/utils.js";import ce from"../../core/workers/RemoteClient.js";function fe(e){if(!e.json)return e;e.json.write=ge(e.json.write);const t=e.json.origins;if(!t)return e;let r;for(r in t){const e=t[r];e&&(e.write=ge(e.write))}return e}function ge(e){return"object"==typeof e&&e?(!1!==e.enabled&&(e.overridePolicy=je(e)),e):!0===e?be():e}function je(e){const{target:t,writer:r,overridePolicy:i,...o}=e;return function(e,t){const r=we.call(this,e,t);return r.enabled?{...o,...r}:r}}function be(){return{overridePolicy:we}}function we(e,t){const r=!!this.geometryType;let i={enabled:r};return r&&(i={...i,...Te.call(this,e,t)}),i}function Te(e,t){return{ignoreOrigin:this.originIdOf(t)>p.DEFAULTS}}let Ie=class extends(L(J(A(G(M(Z(H(K(V(o(j))))))))))){constructor(e){super(e),this.blendMode="normal",this.capabilities=T(!1,!0),this.charts=null,this.definitionExpression=null,this.displayField="",this.displayFilterEnabled=!0,this.displayFilterInfo=null,this.effect=null,this.elevationInfo=null,this.featureEffect=null,this.graphType=null,this.labelsVisible=!0,this.layerType=null,this.legendEnabled=!0,this.maxScale=0,this.minScale=0,this.objectIdField=v,this.objectType=null,this.opacity=1,this.orderBy=null,this.parent=null,this.parentCompositeLayer=null,this.persistenceEnabled=!0,this.popupEnabled=!0,this.popupTemplate=null,this.refreshInterval=0,this.source={openPorts:()=>this.load().then((()=>{const e=new MessageChannel;return new ce(e.port1,{channel:e,client:{queryFeatures:(e,t={})=>{const r=me.fromJSON(e);return this.queryFeaturesJSON(r,t)}}}),[e.port2]}))},this.type="knowledge-graph-sublayer",this.useViewTime=!0,this.visible=!0}get userHasUpdateItemPrivileges(){return!!this.parent?.userHasUpdateItemPrivileges}get defaultPopupTemplate(){return this.createPopupTemplate()}set featureReduction(e){const t=this._normalizeFeatureReduction(e);this._set("featureReduction",t)}get fields(){const e=[];return this.objectType?.properties?.forEach((t=>{const r="esriFieldTypeOID"===t.fieldType?"esriFieldTypeInteger":t.fieldType;e.push(re.fromJSON({name:t.name,type:r,alias:t.alias,defaultValue:t.defaultValue,editable:t.editable,nullable:t.nullable}))})),e.push(re.fromJSON({name:this.objectIdField,type:"esriFieldTypeString",alias:this.objectIdField,editable:!1}),re.fromJSON({name:S,type:"esriFieldTypeInteger",alias:S,editable:!1}),re.fromJSON({name:O,type:"esriFieldTypeInteger",alias:O,editable:!1})),e}get geometryType(){if("link-chart"===this.parentCompositeLayer?.type)return"relationship"===this.graphType?"polyline":"point";const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.geometryType;return t&&"esriGeometryNull"!==t?g.fromJSON(t):null}get geometryFieldName(){if("link-chart"===this.parentCompositeLayer?.type)return E;const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name);return e?.name??null}get graphTypeName(){return this.objectType?.name}get hasM(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasM??!1}get hasZ(){const e=this.parentCompositeLayer?.dataManager.geographicLookup.get(this.objectType?.name),t=e?.name,r=t?this.objectType?.properties?.[t]:null;return r?.hasZ??!1}set labelingInfo(e){this._set("labelingInfo",e)}get labelingInfo(){if(this._isOverridden("labelingInfo"))return this._get("labelingInfo");if(!this.objectType||!this.parentCompositeLayer||!this.graphTypeName)return null;const e=this.objectType.properties?F(this.objectType.properties):"ESRI__ID";return"link-chart"===this.parentCompositeLayer.type?_(this.graphType,this.graphTypeName,e):R(this.graphTypeName,this.geometryType,e)}set renderer(e){ie(e,this.fieldsIndex),this._set("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const e=this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel,t=[...e?.entityTypes??[],...e?.relationshipTypes??[]].map((e=>e.name)).indexOf(this.graphTypeName),r=Q(t);if("link-chart"===this.parentCompositeLayer?.type){if("relationship"===this.graphType)return new pe({type:"simple",symbol:C(r)});const e=le(I(g.toJSON("point")).renderer);return he(e.symbol,r),e}const i=le(I(g.toJSON(this.geometryType)).renderer);return he(i.symbol,r),i}get spatialReference(){return this.parentCompositeLayer?.dataManager?.knowledgeGraph?.dataModel?.spatialReference??c.WGS84}set timeInfo(e){this._set("timeInfo",e)}get title(){return this._isOverridden("title")?this._get("title"):this.graphTypeName}set title(e){this._set("title",e)}writeTitle(e,t){t.title=e??"Layer"}createPopupTemplate(e){return de(this,e)}createQuery(){return new me({where:"1=1",outFields:["*"]})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){return null}async queryFeatures(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e),o=ue.fromJSON(await i.executeQuery(r.toJSON(),t?.signal));return o.features.forEach((e=>{e.sourceLayer=this})),o}async queryFeaturesJSON(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return await i.executeQuery(r.toJSON(),t?.signal)}async queryFeatureCount(e,t){await this.load();const{resolvedQuery:r,queryEngine:i}=await this._setupQueryObjects(e);return i.executeQueryForCount(r.toJSON(),t?.signal)}async queryExtent(e={},t){await this.load();const r={...e,returnGeometry:!0},{resolvedQuery:i,queryEngine:o}=await this._setupQueryObjects(r),s=await o.executeQueryForExtent(i.toJSON(),t?.signal);let n;return n=null!=s.extent?.xmin&&null!=s.extent?.xmax&&null!=s.extent?.ymin&&null!=s.extent?.ymax?new l(s.extent):new l,{count:s.count,extent:n}}async queryObjectIds(e,t){await this.load();const r=me.from(e);let i;if("link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)i=this._cachedQueryEngine;else{const e=await this.parentCompositeLayer.dataManager.getData(r,this,t);i=this.loadQueryEngine(e)}return await i.executeQueryForIds(r.toJSON(),t?.signal)}loadQueryEngine(e){const t=new b({geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ}),r=new w({fieldsIndex:this.fieldsIndex.toJSON(),geometryType:g.toJSON(this.geometryType),hasM:this.hasM,hasZ:this.hasZ,featureIdInfo:{type:"object-id",fieldName:this.objectIdField},spatialReference:this.spatialReference.toJSON(),timeInfo:this.timeInfo?.toJSON(),featureStore:t});return r.featureStore.addMany(e),r}async refreshCachedQueryEngine(){const e=await this.parentCompositeLayer.dataManager.getData(new me({where:"1=1",outFields:[v]}),this);this._cachedQueryEngine=this.loadQueryEngine(e)}load(e){return this.addResolvingPromise(this.parent.load(e).then((()=>oe(this.timeInfo,this.fieldsIndex)))),Promise.resolve(this)}async _setupQueryObjects(e,t){const r=me.from(e),i=r.geometry;if(i&&!i.spatialReference?.isWGS84&&(await d(i.spatialReference,f),r.geometry=h(i instanceof u||i instanceof m||i instanceof y?i:i.extent,f)),"link-chart"===this.parentCompositeLayer.type&&this._cachedQueryEngine)return{resolvedQuery:r,queryEngine:this._cachedQueryEngine};const o=await this.parentCompositeLayer.dataManager.getData(r,this,t);return{resolvedQuery:r,queryEngine:this.loadQueryEngine(o)}}};function ve(e,t,r){const o=[["ESRI__AGGREGATION_COUNT",S],["ESRI__ORIGIN_ID",x],["ESRI__DESTINATION_ID",N],["ESRI__LAYOUT_GEOMETRY",E]];try{for(const t of e)for(const[e,r]of o)t.labelExpression=t.labelExpression?.replaceAll(e,r),t.labelExpressionInfo?.expression&&(t.labelExpressionInfo.expression=t.labelExpressionInfo.expression.replaceAll(e,r))}catch(s){i.getLogger(this).warn("Error updating labelingInfo",s)}return ne(e,t,r)}e([s(fe(r(P)))],Ie.prototype,"blendMode",void 0),e([s()],Ie.prototype,"capabilities",void 0),e([s({readOnly:!0})],Ie.prototype,"userHasUpdateItemPrivileges",null),e([s({json:{origins:{"web-scene":{write:!1}},write:be()}})],Ie.prototype,"charts",void 0),e([s({readOnly:!0})],Ie.prototype,"defaultPopupTemplate",null),e([s({type:String,json:{origins:{service:{read:!1}},name:"layerDefinition.definitionExpression",write:{ignoreOrigin:!0}}})],Ie.prototype,"definitionExpression",void 0),e([s()],Ie.prototype,"displayField",void 0),e([s(fe(r(D)))],Ie.prototype,"displayFilterEnabled",void 0),e([s(fe(r(q)))],Ie.prototype,"displayFilterInfo",void 0),e([s(fe(r(k)))],Ie.prototype,"effect",void 0),e([s()],Ie.prototype,"elevationInfo",void 0),e([s(fe(r(U)))],Ie.prototype,"featureEffect",void 0),e([s(fe(r(te)))],Ie.prototype,"featureReduction",null),e([s()],Ie.prototype,"fields",null),e([s()],Ie.prototype,"geometryType",null),e([s()],Ie.prototype,"geometryFieldName",null),e([s({type:["entity","relationship"],nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphType",void 0),e([s({type:String,nonNullable:!0,json:{write:{isRequired:!0,ignoreOrigin:!0}}})],Ie.prototype,"graphTypeName",null),e([s()],Ie.prototype,"hasM",null),e([s()],Ie.prototype,"hasZ",null),e([s({type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}},write:{ignoreOrigin:!0}}})],Ie.prototype,"id",void 0),e([s({type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",default:!1,write:{overridePolicy(){return{enabled:!!this.geometryType,alwaysWriteDefaults:!0,ignoreOrigin:!0}}}}})],Ie.prototype,"labelsVisible",void 0),e([s({type:[se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:ve,write:be()}})],Ie.prototype,"labelingInfo",null),e([s({readOnly:!0,json:{read:!1,write:{writer(e,t){switch(this.parentCompositeLayer?.type){case"link-chart":t.layerType="LinkChartSubLayer";break;case"knowledge-graph":t.layerType=this.geometryType?"KnowledgeGraphSubLayer":"KnowledgeGraphSubTable"}},isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"layerType",void 0),e([s(fe(r(Y)))],Ie.prototype,"legendEnabled",void 0),e([s(fe(r(z)))],Ie.prototype,"maxScale",void 0),e([s(fe(r(X)))],Ie.prototype,"minScale",void 0),e([s()],Ie.prototype,"objectIdField",void 0),e([s()],Ie.prototype,"objectType",void 0),e([s(fe(r($)))],Ie.prototype,"opacity",void 0),e([s(fe(r(B)))],Ie.prototype,"orderBy",void 0),e([s({clonable:!1})],Ie.prototype,"parent",void 0),e([s()],Ie.prototype,"parentCompositeLayer",void 0),e([s(fe(r(ee)))],Ie.prototype,"popupEnabled",void 0),e([s({type:t,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],Ie.prototype,"popupTemplate",void 0),e([s({type:Number,json:{write:{overridePolicy:Te}}})],Ie.prototype,"refreshInterval",void 0),e([s({types:ye,json:{name:"layerDefinition.drawingInfo.renderer",write:be()}})],Ie.prototype,"renderer",null),e([s()],Ie.prototype,"source",void 0),e([s()],Ie.prototype,"spatialReference",null),e([s({type:ae,json:{name:"layerDefinition.timeInfo",write:{overridePolicy:Te},origins:{"web-document":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:Te}},"portal-item":{name:"layerDefinition.timeInfo",read:!0,write:{overridePolicy:Te}}}}})],Ie.prototype,"timeInfo",null),e([s({type:String,json:{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],Ie.prototype,"title",null),e([a("title")],Ie.prototype,"writeTitle",null),e([s({json:{read:!1}})],Ie.prototype,"type",void 0),e([s(fe(r(W)))],Ie.prototype,"useViewTime",void 0),e([s({type:Boolean,json:{name:"visibility",write:be()}})],Ie.prototype,"visible",void 0),Ie=e([n("esri.layers.knowledgeGraph.KnowledgeGraphSublayer")],Ie);export{Ie as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import e from"../../core/Error.js";import{makeHandle as t}from"../../core/handleUtils.js";import{getOrCreateMapValue as r}from"../../core/MapUtils.js";import{floatEqualRelative as a}from"../../core/mathUtils.js";import o from"../../geometry/Point.js";import i from"../../geometry/Polyline.js";import{initializeProjection as s,project as n}from"../../geometry/projectionUtils.js";import c from"../../geometry/SpatialReference.js";import p from"../GraphicsLayer.js";import{convertToGeometry as h}from"../graphics/featureConversionUtils.js";import{kgRestServices as d}from"../../rest/knowledgeGraphService.js";import u from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import l from"../../rest/knowledgeGraph/KnowledgeGraph.js";import m from"../../views/draw/support/Reshape.js";import{loadAutomaticAreaMeasurementUtils as g}from"../../views/support/automaticAreaMeasurementUtils.js";import{loadAutomaticLengthMeasurementUtils as f}from"../../views/support/automaticLengthMeasurementUtils.js";const y={newReshapeWrapper:async({getFeatureReshapeProvider:e,targetGraphic:t,reshapeGraphicsLayer:r,view:a,snappingManager:o})=>new m({automaticAreaMeasurementUtils:await g(),automaticLengthMeasurementUtils:await f(),connectedReshapeProviders:[{getFeatureReshapeProvider:e,getVertexReshapeProvider(){throw new Error("Link Charts do not support vertex (polyline) reshape at this time")}}],enableMidpoints:!1,graphic:t,layer:r,view:a,snappingManager:o})},w=async({targetEntityId:r,targetEntityType:i,view:d,snappingManager:u})=>{await s(c.WGS84,d.spatialReference);const l=d.map?.activeLinkChartLayer?.layers.find((e=>e.objectType.name===i));if(!l)throw new e("LinkChartView:target-layer-not-found",`No layer found for target entity type ${i}`);const m=l.createQuery();m.objectIds=[r];const g=await l.queryFeatures(m);if(0===g.features.length)throw new e("LinkChartView:no-matching-feature-found",`No feature found with ID ${r} in layer ${l.title}`);const f=g.features[0].clone(),w=f.attributes.ESRI__ID;if(!f.sourceLayer)throw new e("LinkChartView:no-source-layer",`The target graphic does not have a source layer: ${w}`);const L=new p({listMode:"hide",internal:!0});f.geometry=n(new o(h(f.attributes.ESRI__LayoutGeometry,"esriGeometryPoint",!1,!1)),d.spatialReference),d.map.add(L),L.add(f);const j=f.sourceLayer,M=j.parent,R=new Map([[w,[]]]),_=new Map,C=new Map,b=await I(r,l,d),G=new Map;for(const e of M.layers)G.set(e.objectType.name,e);const D=new Map;for(const[e,t]of M.sublayerIdsCache)M.dataManager.relationshipTypeNames.has(e)&&D.set(e,Array.from(t));const E=await v(w,j.objectType.name,M.knowledgeGraph,D),F=M.entityLinkChartDiagramLookup.get(w);for(const e of E){let t=_.get(e.id);if(t||(t=M.relationshipLinkChartDiagramLookup.get(e.id),_.set(e.id,t??null)),t){const r=G.get(e.typeName);r&&a(t.coords[0],F.coords[0])&&a(t.coords[1],F.coords[1])?R.get(w)?.push({objectId:e.id,pathIndex:0,vertexIndex:0,associatedSublayer:r}):r&&a(t.coords.at(-2),F.coords[0])&&a(t.coords.at(-1),F.coords[1])&&R.get(w)?.push({objectId:e.id,pathIndex:0,vertexIndex:t.coords.length/2-1,associatedSublayer:r})}}const x=e=>new k(e,C,R,d),S=await y.newReshapeWrapper({getFeatureReshapeProvider:x,targetGraphic:f,reshapeGraphicsLayer:L,view:d,snappingManager:u});S.on("move-stop",(e=>{d.emit("node-movement-stop",e)}));const T=t((()=>{b.remove(),L.removeAll(),d.map.remove(L),L.destroy(),C.clear(),_.clear(),S.destroy()}));return{currentReshapeGraphic:S.graphic,localEdits:C,originalRelationshipGeometries:_,teardownHandle:T}},I=async(e,t,r)=>{const a=await r.whenLayerView(t);return a.setVisibility(e,!1),{remove:()=>a.setVisibility(e,!0)}},v=async(e,t,r,a,o)=>{const i={sourceId:e},s=[],n=[];for(const[h,d]of a){const e=`${h}_ids`;i[e]=d,n.push(`Match (n:${t}) WHERE id(n) = $sourceId WITH n MATCH (n)-[r:${h}]-() WHERE ID(r) IN $${e} RETURN {id: ID(r), typeName: type(r)} as result`)}const c=n.join(" UNION "),p=(await d.executeQueryStreaming(new l(JSON.parse(JSON.stringify(r))),new u({openCypherQuery:c,bindParameters:i}),o)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await p.read();if(e)break;t.forEach((e=>{s.push(e[0].properties)}))}return s};class L{constructor(e,t){this.modifiedFeatures=new Map,this.updating=!1,this._totalDx=0,this._totalDy=0,this._localEditsCache=e,this._view=t}async initializeModifiedFeatures(e){const t=new Map;for(const r of this._view.map?.activeLinkChartLayer?.layers??[]){const e=r;t.set(e.objectType.name,e)}const a=new Map;for(const o of e){const t=this._localEditsCache.get(o.objectId);if(t)this.initializeModifiedFeature(t,e);else{r(a,o.associatedSublayer.objectType.name,(()=>[])).push(o.objectId)}}for(const[r,o]of a){const a=t.get(r),i=a.createQuery();i.outFields=["ESRI__ID"],i.objectIds=o,a.queryFeatures(i).then((t=>{for(const r of t.features)this.initializeModifiedFeature(this.makeModifiedFeature(r,a),e)}))}}makeModifiedFeature(e,t){const r=e.attributes.ESRI__ID,a={graphic:e,layer:t,originalGraphic:e.clone(),uniqueId:r};return this._localEditsCache.set(r,a),a}initializeModifiedFeature(e,t){const r=t.filter((({objectId:t})=>t===e.uniqueId));this.modifiedFeatures.set(e,r);let a=e.graphic.geometry?n(e.graphic.geometry,this._view.spatialReference):void 0;const o=e.graphic.sourceLayer,s=o.parent;if(!a&&"relationship"===o.graphType){const t=s.relationshipLinkChartDiagramLookup.get(e.uniqueId);a=n(new i(h(t,"esriGeometryPolyline",!1,!1)),this._view.spatialReference)}let p=a.clone();for(const{pathIndex:i,vertexIndex:n}of r)p=this.getTranslatedGeometry(a,i,n,this._totalDx,this._totalDy);e.graphic.geometry=n(p,c.WGS84),s.relationshipLinkChartDiagramLookup.get(e.uniqueId)&&(s.relationshipLinkChartDiagramLookup.set(e.uniqueId,null),o.refreshCachedQueryEngine().then((()=>{o.emit("refresh",{dataChanged:!0})})))}translate(e,t){this._totalDx+=e,this._totalDy+=t;const r=new Set;for(const[a,o]of this.modifiedFeatures){let s=a.graphic.geometry?n(a.graphic.geometry,this._view.spatialReference):void 0;const p=a.graphic.sourceLayer,d=p.parent;if(p&&!a.graphic.geometry&&"relationship"===p.graphType){const e=d.relationshipLinkChartDiagramLookup.get(a.uniqueId);s=n(new i(h(e,"esriGeometryPolyline",!1,!1)),this._view.spatialReference)}for(const i of o){if(!s)continue;const o=this.getTranslatedGeometry(s,i.pathIndex,i.vertexIndex,e,t);a.graphic.geometry=n(o,c.WGS84),d.relationshipLinkChartDiagramLookup.get(a.uniqueId)&&(d.relationshipLinkChartDiagramLookup.set(a.uniqueId,null),r.add(p))}}for(const a of r)a.refreshCachedQueryEngine().then((()=>{a.emit("refresh",{dataChanged:!0})}));return Array.from(this.modifiedFeatures.keys())}getTranslatedGeometry(e,t,r,a,o){const i=e.clone(),s=e.paths.slice();return null==s.at(t)?.at(r)||(s[t][r][0]+=a??0,s[t][r][1]+=o??0,i.paths=s),i}}class k extends L{constructor(e,t,r,a){super(t,a),this._connectedVerticesLookup=r;const o=[];for(const i of e){const e=this.getConnectedVerticesForFeature(i);for(const t of e)o.push(t)}this.initializeModifiedFeatures(o)}getConnectedVerticesForFeature(e){return this._connectedVerticesLookup.get(e.graphic.attributes.ESRI__ID)??[]}}export{k as ConnectedFeatureReshapeProvider,w as startNodeMovement,y as wrapperObject};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Clonable.js";import r from"../../../core/Error.js";import o from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../../core/accessorSupport/decorators/cast.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../../core/accessorSupport/decorators/reader.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{writer as c}from"../../../core/accessorSupport/decorators/writer.js";import m from"../../../geometry/Point.js";import{getGeometryZScaler as u}from"../../../geometry/support/zscale.js";import y from"./CameraOrientation.js";import d from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as f,getEffectiveElevationSource as g,getMetersPerUnitOfSR as h,orientedImageryTypeMap as v}from"./utils.js";import{CameraOrientationType as w}from"../enums/CameraOrientationType.js";import{ltpToGeographic as O}from"../transformations/utils.js";function b(e){throw new r("exposure-point:missing-default-value",`a value for ${e} is missing in default properties`)}function j(e,t){throw new r("exposure-point:missing-attribute-value",`a value for ${e} is missing in attribute table`,{exposurePoint:t})}const S=e=>({cast:e=>{const t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,r)=>{t[r]=Number.isFinite(e)?e:void 0}}}}),I=e=>({cast:e=>"string"==typeof e?e.split(";").map(Number):e,json:{default:e,write:{writer:(e,t,r)=>{t[r]=e?.join(";")}}}});let N=class extends(t.ClonableMixin(o)){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){const r={},{attributes:o,geometry:a}=e,i={};for(const s in o)r[s.toLowerCase()]=o[s],i[s.toLowerCase()]=s;const n=e.layer??{};n.sequenceOrderField?.length&&(r.sequenceorder=o[n.sequenceOrderField],i.sequenceorder=n.sequenceOrderField),super.read({geometry:a,layer:n,sourceMap:i,...r},t)}write(e,t){const r=super.write(e,t),{sourceMap:o}=this;if(!o||!r)return r;const a={};for(const i in r){const e=o[i.toLowerCase()];e&&(a[e]=r[i])}return a}readCameraHeading(e,t){const{cameraheading:r,camheading:o,layer:a}=t;return r??o??a.cameraHeading}readCameraHeight(e,t){const{cameraheight:r,avghtag:o,layer:a}=t;return r??o??a.cameraHeight}readCamOffset(e,t){const{cameraoffset:r,camoffset:o}=t;return r?.split(";").map(Number)??o?.split(";").map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(";"))}readCameraOrientation(e,t){const{cameraorientation:r,camori:o}=t;return r??o}readCameraPitch(e,t){const{camerapitch:r,campitch:o,layer:a}=t;return r??o??a.cameraPitch}readCameraRoll(e,t){const{cameraroll:r,camroll:o,layer:a}=t;return r??o??a.cameraRoll}readDepthImage(e,t){const{depthimage:r,depthimg:o,layer:a}=t,i=r??o??null,{depthImagePathPrefix:n,depthImagePathSuffix:s}=a??{};return f(i,n,s)}readElevationSource(e,t){const{elevationsource:r,layer:o}=t,{demPathSuffix:a,demPathPrefix:i}=o;if(r){const e=this._parseIfJSON(r);return g(e,i,a)}return o.effectiveElevationSource}readFarDistance(e,t){const{fardistance:r,fardist:o,layer:a}=t;return r??o??a.farDistance}get geometry(){const e=this._geometry.clone();if(!e)return null;const{cameraOffset:t}=this;if(t){const[r,o,a]=t;e.x+=r,e.y+=o,null!=e.z&&null!=a&&(e.z+=a)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){const{horizontalfieldofview:r,hfov:o,layer:a}=t;return r??o??a.horizontalFieldOfView}readImageURL(e,t){const{imagepath:r,layer:o}=t;r||j("imagePath",this);const{imagePathPrefix:a,imagePathSuffix:i}=o;return f(r,a,i)}readImageRotation(e,t){const{imagerotation:r,imgrot:o,layer:a}=t;return r??o??a.imageRotation}get isHorizontal(){return"horizontal"===this.orientedImageryType}get isInspection(){return"inspection"===this.orientedImageryType}get isNadir(){return"nadir"===this.orientedImageryType}get isOblique(){return"oblique"===this.orientedImageryType}get isSpherical(){return"360"===this.orientedImageryType}get location(){const{cameraOrientation:e,cameraHeight:t,elevation:r}=this;if(e){const{type:t,x:r,y:o,z:a,horizontalWKID:i,verticalWKID:n}=e,s="number"==typeof i?{wkid:i}:{wkt:i};if(t===w.LTP){const{latitude:t,longitude:r,ellipsoidRadius:o,squaredEccentricity:a,properties:i}=e,{x:n,y:s,z:p}=i;return new m(O([n,s,p],[t,r,o,a]))}const p=new m({x:r,y:o,z:a,spatialReference:s}),l=n?u("point",{wkid:n},s):null;return l&&l(p),p}if("number"!=typeof t)throw b("cameraHeight");const o=this.geometry.clone(),i=(r??0)+t/h(o.spatialReference);if("360"===this.orientedImageryType&&o.hasZ){const e=i-o.z;return null!=r&&Math.abs(e)>.001&&(a.getLogger(this).warnOnce("The elevation value is different from the geometry's z value. The geometry's z value will be updated.",{elevation:r,geometryZ:o.z}),o.z=i),o}return o.z=o.hasZ?o.z:i,o}set matrix(e){if(e)return 9!==e.length?(a.getLogger(this).warnOnce("Ignoring rotation matrix because it doesn't have 9 values",{value:e}),void this._set("matrix",null)):void this._set("matrix",e)}readNearDistance(e,t){const{neardistance:r,neardist:o,layer:a}=t;return r??o??a.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){const{accuracy:r,orientationaccuracy:o}=t;return o?.split(";").map(Number)??r?.split(";").map(Number)??null}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(";"))}readOIType(e,t){const{orientedimagerytype:r,oitype:o,camerapitch:a,campitch:i,layer:n}=t,s=v.read(r??o??n.orientedImageryType),p=a??i??n.cameraPitch;return"oblique"===s?p<10?"nadir":"oblique":s}set radial(e){if(e)if("string"!=typeof e)this._set("radial",e);else{const[t,r,o]=e.split(";").map(Number);this._set("radial",[t??0,r??0,o??0])}else this._set("radial",[0,0,0])}readSequenceOrder(e,t){const{layer:r}=t;return t[r.sequenceOrderField.toLowerCase()]}writeSequenceOrder(e,t){if(!e)return;const{sourceMap:r}=this;if(r){t[r.sequenceorder]=e}}set tangential(e){if(e)if("string"!=typeof e)this._set("tangential",e);else{const[t,r]=e.split(";").map(Number);this._set("tangential",[t??0,r??0])}else this._set("tangential",[0,0])}readVFOV(e,t){const{verticalfieldofview:r,vfov:o,layer:a}=t;return r??o??a.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(r){a.getLogger(this).error("couldn't parse the given elevation source JSON",e,r)}return t}clone(){const e=super.clone();return e._geometry=this._geometry.clone(),e}};e([i()],N.prototype,"_geometry",void 0),e([i(S())],N.prototype,"a0",void 0),e([i(S())],N.prototype,"a1",void 0),e([i(S())],N.prototype,"a2",void 0),e([i({type:Date,json:{write:{enabled:!0,target:"acquisitionDate"},name:"acquisitiondate"}})],N.prototype,"acquisitionDate",void 0),e([i(S())],N.prototype,"b0",void 0),e([i(S())],N.prototype,"b1",void 0),e([i(S())],N.prototype,"b2",void 0),e([i({type:Number,json:{write:!0,read:{source:["cameraheading","camheading","layer.cameraHeading"]}}})],N.prototype,"cameraHeading",void 0),e([p("cameraHeading")],N.prototype,"readCameraHeading",null),e([i({type:Number,json:{write:!0}})],N.prototype,"cameraHeight",void 0),e([p("cameraHeight",["cameraheight","avghtag","layer.cameraHeight"])],N.prototype,"readCameraHeight",null),e([i()],N.prototype,"cameraOffset",void 0),e([p("cameraOffset",["cameraoffset","camoffset"])],N.prototype,"readCamOffset",null),e([c("cameraOffset")],N.prototype,"writeCameraOffset",null),e([i({json:{write:{writer:(e,t,r)=>{t[r]=e.toString()}}},type:y}),n((e=>e?d.getCameraOrientation(e):null))],N.prototype,"cameraOrientation",void 0),e([p("cameraOrientation",["cameraorientation","camori"])],N.prototype,"readCameraOrientation",null),e([i({type:Number,json:{write:!0}})],N.prototype,"cameraPitch",void 0),e([p("cameraPitch",["camerapitch","campitch","layer.cameraPitch"])],N.prototype,"readCameraPitch",null),e([i({type:Number,json:{write:!0}})],N.prototype,"cameraRoll",void 0),e([p("cameraRoll",["cameraroll","camroll","layer.cameraRoll"])],N.prototype,"readCameraRoll",null),e([i({json:{write:!0},type:String})],N.prototype,"depthImage",void 0),e([p("depthImage",["depthimage","depthimg"])],N.prototype,"readDepthImage",null),e([i({type:Number,json:{write:!0}})],N.prototype,"elevation",void 0),e([i({json:{write:!0},clonable:"reference"})],N.prototype,"elevationSource",void 0),e([p("elevationSource",["elevationsource","layer.effectiveElevationSource"])],N.prototype,"readElevationSource",null),e([i({json:{name:"exposurestationid",write:{target:"exposureStationId"}},type:String})],N.prototype,"exposureStationId",void 0),e([i({type:Number,json:{write:!0}})],N.prototype,"farDistance",void 0),e([p("farDistance",["fardistance","fardist","layer.farDistance"])],N.prototype,"readFarDistance",null),e([i(S("focallength"))],N.prototype,"focalLength",void 0),e([i({type:m,json:{name:"geometry"}})],N.prototype,"geometry",null),e([c("geometry")],N.prototype,"writeGeometry",null),e([i({type:Number,json:{write:!0}})],N.prototype,"horizontalFieldOfView",void 0),e([p("horizontalFieldOfView",["horizontalfieldofview","hfov","layer.horizontalFieldOfView"])],N.prototype,"readHFOV",null),e([i({json:{write:!0},type:String})],N.prototype,"imagePath",void 0),e([p("imagePath",["imagepath"])],N.prototype,"readImageURL",null),e([i({type:Number,json:{write:!0}})],N.prototype,"imageRotation",void 0),e([p("imageRotation",["imagerotation","imgrot","layer.imageRotation"])],N.prototype,"readImageRotation",null),e([i()],N.prototype,"isHorizontal",null),e([i()],N.prototype,"isInspection",null),e([i()],N.prototype,"isNadir",null),e([i()],N.prototype,"isOblique",null),e([i()],N.prototype,"isSpherical",null),e([i()],N.prototype,"location",null),e([i(I())],N.prototype,"matrix",null),e([i({json:{write:!0},type:String})],N.prototype,"name",void 0),e([i({type:Number,json:{write:!0}})],N.prototype,"nearDistance",void 0),e([p("nearDistance",["neardistance","neardist","layer.nearDistance"])],N.prototype,"readNearDistance",null),e([i({json:{write:!0,name:"objectid"},type:Number})],N.prototype,"objectId",void 0),e([i({type:Number,json:{write:!0}})],N.prototype,"offsetFromStart",void 0),e([p("offsetFromStart",["offsetfromstart"])],N.prototype,"readOffsetFromStart",null),e([i()],N.prototype,"orientationAccuracy",void 0),e([p("orientationAccuracy",["accuracy","orientationaccuracy"])],N.prototype,"readOrientationAccuracy",null),e([c("orientationAccuracy")],N.prototype,"writeOrientationAccuracy",null),e([s(v)],N.prototype,"orientedImageryType",void 0),e([p("orientedImageryType",["orientedimagerytype","oitype","layer.orientedImageryType"])],N.prototype,"readOIType",null),e([i({type:Number,json:{write:!0,read:{source:"principalx"}}})],N.prototype,"principalX",void 0),e([i({type:Number,json:{write:!0,read:{source:"principaly"}}})],N.prototype,"principalY",void 0),e([i(I([0,0,0]))],N.prototype,"radial",null),e([i({type:String})],N.prototype,"sequenceOrder",void 0),e([p("sequenceOrder",["sequenceorder","layer.sequenceOrderField"])],N.prototype,"readSequenceOrder",null),e([c("sequenceOrder")],N.prototype,"writeSequenceOrder",null),e([i({type:Object})],N.prototype,"sourceMap",void 0),e([i(I([0,0]))],N.prototype,"tangential",null),e([i({type:Number,json:{write:!0}})],N.prototype,"verticalFieldOfView",void 0),e([p("verticalFieldOfView",["verticalfieldofview","vfov","layer.verticalFieldOfView"])],N.prototype,"readVFOV",null),N=e([l("esri.layers.orientedImagery.core.ExposurePoint")],N);export{N as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Clonable.js";import r from"../../../core/Error.js";import o from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../../core/accessorSupport/decorators/cast.js";import{enumeration as s}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../../core/accessorSupport/decorators/reader.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../../core/accessorSupport/decorators/writer.js";import m from"../../../geometry/Point.js";import{getGeometryZScaler as u}from"../../../geometry/support/zscale.js";import y from"./CameraOrientation.js";import d from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as f,getEffectiveElevationSource as g,getArcGISServerUrl as h,getMetersPerUnitOfSR as v,orientedImageryTypeMap as w}from"./utils.js";import{CameraOrientationType as O}from"../enums/CameraOrientationType.js";import{ltpToGeographic as b}from"../transformations/utils.js";function j(e){throw new r("exposure-point:missing-default-value",`a value for ${e} is missing in default properties`)}function S(e,t){throw new r("exposure-point:missing-attribute-value",`a value for ${e} is missing in attribute table`,{exposurePoint:t})}const I=e=>({cast:e=>{const t=parseFloat(e);return Number.isFinite(t)?t:void 0},json:{name:e,write:{writer:(e,t,r)=>{t[r]=Number.isFinite(e)?e:void 0}}}}),N=e=>({cast:e=>"string"==typeof e?e.split(";").map(Number):e,json:{default:e,write:{writer:(e,t,r)=>{t[r]=e?.join(";")}}}}),F="$virtualCacheDirectory:";let x=class extends(t.ClonableMixin(o)){constructor(e){super(e),this._geometry=null,this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,t){const r={},{attributes:o,geometry:a}=e,i={};for(const s in o)r[s.toLowerCase()]=o[s],i[s.toLowerCase()]=s;const n=e.layer??{};n.sequenceOrderField?.length&&(r.sequenceorder=o[n.sequenceOrderField],i.sequenceorder=n.sequenceOrderField),super.read({geometry:a,layer:n,sourceMap:i,...r},t)}write(e,t){const r=super.write(e,t),{sourceMap:o}=this;if(!o||!r)return r;const a={};for(const i in r){const e=o[i.toLowerCase()];e&&(a[e]=r[i])}return a}readCameraHeading(e,t){const{cameraheading:r,camheading:o,layer:a}=t;return r??o??a.cameraHeading}readCameraHeight(e,t){const{cameraheight:r,avghtag:o,layer:a}=t;return r??o??a.cameraHeight}readCamOffset(e,t){const{cameraoffset:r,camoffset:o}=t;return r?.split(";").map(Number)??o?.split(";").map(Number)??null}writeCameraOffset(e,t){e&&(t.cameraOffset=e.join(";"))}readCameraOrientation(e,t){const{cameraorientation:r,camori:o}=t;return r??o}readCameraPitch(e,t){const{camerapitch:r,campitch:o,layer:a}=t;return r??o??a.cameraPitch}readCameraRoll(e,t){const{cameraroll:r,camroll:o,layer:a}=t;return r??o??a.cameraRoll}readDepthImage(e,t){const{depthimage:r,depthimg:o,layer:a}=t,i=r??o??null,{depthImagePathPrefix:n,depthImagePathSuffix:s}=a??{};return f(i,n,s)}readElevationSource(e,t){const{elevationsource:r,layer:o}=t,{demPathSuffix:a,demPathPrefix:i}=o;if(r){const e=this._parseIfJSON(r);return g(e,i,a)}return o.effectiveElevationSource}readFarDistance(e,t){const{fardistance:r,fardist:o,layer:a}=t;return r??o??a.farDistance}get geometry(){const e=this._geometry.clone();if(!e)return null;const{cameraOffset:t}=this;if(t){const[r,o,a]=t;e.x+=r,e.y+=o,null!=e.z&&null!=a&&(e.z+=a)}return e}set geometry(e){this._geometry=e}writeGeometry(e,t){t.geometry=this._geometry.toJSON()}readHFOV(e,t){const{horizontalfieldofview:r,hfov:o,layer:a}=t;return r??o??a.horizontalFieldOfView}readImageURL(e,t){const{imagepath:r,layer:o}=t;r||S("imagePath",this);const{imagePathPrefix:a,imagePathSuffix:i}=o;if(r.startsWith(F)){return`${h(o.url)}${r.replace(F,o.virtualCacheDirectory+"/")}`}return f(r,a,i)}readImageRotation(e,t){const{imagerotation:r,imgrot:o,layer:a}=t;return r??o??a.imageRotation}get isHorizontal(){return"horizontal"===this.orientedImageryType}get isInspection(){return"inspection"===this.orientedImageryType}get isNadir(){return"nadir"===this.orientedImageryType}get isOblique(){return"oblique"===this.orientedImageryType}get isSpherical(){return"360"===this.orientedImageryType}get location(){const{cameraOrientation:e,cameraHeight:t,elevation:r}=this;if(e){const{type:t,x:r,y:o,z:a,horizontalWKID:i,verticalWKID:n}=e,s="number"==typeof i?{wkid:i}:{wkt:i};if(t===O.LTP){const{latitude:t,longitude:r,ellipsoidRadius:o,squaredEccentricity:a,properties:i}=e,{x:n,y:s,z:p}=i;return new m(b([n,s,p],[t,r,o,a]))}const p=new m({x:r,y:o,z:a,spatialReference:s}),c=n?u("point",{wkid:n},s):null;return c&&c(p),p}if("number"!=typeof t)throw j("cameraHeight");const o=this.geometry.clone(),i=(r??0)+t/v(o.spatialReference);if("360"===this.orientedImageryType&&o.hasZ){const e=i-o.z;return null!=r&&Math.abs(e)>.001&&(a.getLogger(this).warnOnce("The elevation value is different from the geometry's z value. The geometry's z value will be updated.",{elevation:r,geometryZ:o.z}),o.z=i),o}return o.z=o.hasZ?o.z:i,o}set matrix(e){if(e)return 9!==e.length?(a.getLogger(this).warnOnce("Ignoring rotation matrix because it doesn't have 9 values",{value:e}),void this._set("matrix",null)):void this._set("matrix",e)}readNearDistance(e,t){const{neardistance:r,neardist:o,layer:a}=t;return r??o??a.nearDistance}readOffsetFromStart(e,t){return t.offsetfromstart??null}readOrientationAccuracy(e,t){const{accuracy:r,orientationaccuracy:o}=t;return o?.split(";").map(Number)??r?.split(";").map(Number)??null}writeOrientationAccuracy(e,t){e&&(t.orientationAccuracy=e.join(";"))}readOIType(e,t){const{orientedimagerytype:r,oitype:o,camerapitch:a,campitch:i,layer:n}=t,s=w.read(r??o??n.orientedImageryType),p=a??i??n.cameraPitch;return"oblique"===s?p<10?"nadir":"oblique":s}set radial(e){if(e)if("string"!=typeof e)this._set("radial",e);else{const[t,r,o]=e.split(";").map(Number);this._set("radial",[t??0,r??0,o??0])}else this._set("radial",[0,0,0])}readSequenceOrder(e,t){const{layer:r}=t;return t[r.sequenceOrderField.toLowerCase()]}writeSequenceOrder(e,t){if(!e)return;const{sourceMap:r}=this;if(r){t[r.sequenceorder]=e}}set tangential(e){if(e)if("string"!=typeof e)this._set("tangential",e);else{const[t,r]=e.split(";").map(Number);this._set("tangential",[t??0,r??0])}else this._set("tangential",[0,0])}readVFOV(e,t){const{verticalfieldofview:r,vfov:o,layer:a}=t;return r??o??a.verticalFieldOfView}_parseIfJSON(e){let t=null;try{t=JSON.parse(e)}catch(r){a.getLogger(this).error("couldn't parse the given elevation source JSON",e,r)}return t}clone(){const e=super.clone();return e._geometry=this._geometry.clone(),e}};e([i()],x.prototype,"_geometry",void 0),e([i(I())],x.prototype,"a0",void 0),e([i(I())],x.prototype,"a1",void 0),e([i(I())],x.prototype,"a2",void 0),e([i({type:Date,json:{write:{enabled:!0,target:"acquisitionDate"},name:"acquisitiondate"}})],x.prototype,"acquisitionDate",void 0),e([i(I())],x.prototype,"b0",void 0),e([i(I())],x.prototype,"b1",void 0),e([i(I())],x.prototype,"b2",void 0),e([i({type:Number,json:{write:!0,read:{source:["cameraheading","camheading","layer.cameraHeading"]}}})],x.prototype,"cameraHeading",void 0),e([p("cameraHeading")],x.prototype,"readCameraHeading",null),e([i({type:Number,json:{write:!0}})],x.prototype,"cameraHeight",void 0),e([p("cameraHeight",["cameraheight","avghtag","layer.cameraHeight"])],x.prototype,"readCameraHeight",null),e([i()],x.prototype,"cameraOffset",void 0),e([p("cameraOffset",["cameraoffset","camoffset"])],x.prototype,"readCamOffset",null),e([l("cameraOffset")],x.prototype,"writeCameraOffset",null),e([i({json:{write:{writer:(e,t,r)=>{t[r]=e.toString()}}},type:y}),n((e=>e?d.getCameraOrientation(e):null))],x.prototype,"cameraOrientation",void 0),e([p("cameraOrientation",["cameraorientation","camori"])],x.prototype,"readCameraOrientation",null),e([i({type:Number,json:{write:!0}})],x.prototype,"cameraPitch",void 0),e([p("cameraPitch",["camerapitch","campitch","layer.cameraPitch"])],x.prototype,"readCameraPitch",null),e([i({type:Number,json:{write:!0}})],x.prototype,"cameraRoll",void 0),e([p("cameraRoll",["cameraroll","camroll","layer.cameraRoll"])],x.prototype,"readCameraRoll",null),e([i({json:{write:!0},type:String})],x.prototype,"depthImage",void 0),e([p("depthImage",["depthimage","depthimg"])],x.prototype,"readDepthImage",null),e([i({type:Number,json:{write:!0}})],x.prototype,"elevation",void 0),e([i({json:{write:!0},clonable:"reference"})],x.prototype,"elevationSource",void 0),e([p("elevationSource",["elevationsource","layer.effectiveElevationSource"])],x.prototype,"readElevationSource",null),e([i({json:{name:"exposurestationid",write:{target:"exposureStationId"}},type:String})],x.prototype,"exposureStationId",void 0),e([i({type:Number,json:{write:!0}})],x.prototype,"farDistance",void 0),e([p("farDistance",["fardistance","fardist","layer.farDistance"])],x.prototype,"readFarDistance",null),e([i(I("focallength"))],x.prototype,"focalLength",void 0),e([i({type:m,json:{name:"geometry"}})],x.prototype,"geometry",null),e([l("geometry")],x.prototype,"writeGeometry",null),e([i({type:Number,json:{write:!0}})],x.prototype,"horizontalFieldOfView",void 0),e([p("horizontalFieldOfView",["horizontalfieldofview","hfov","layer.horizontalFieldOfView"])],x.prototype,"readHFOV",null),e([i({json:{write:!0},type:String})],x.prototype,"imagePath",void 0),e([p("imagePath",["imagepath"])],x.prototype,"readImageURL",null),e([i({type:Number,json:{write:!0}})],x.prototype,"imageRotation",void 0),e([p("imageRotation",["imagerotation","imgrot","layer.imageRotation"])],x.prototype,"readImageRotation",null),e([i()],x.prototype,"isHorizontal",null),e([i()],x.prototype,"isInspection",null),e([i()],x.prototype,"isNadir",null),e([i()],x.prototype,"isOblique",null),e([i()],x.prototype,"isSpherical",null),e([i()],x.prototype,"location",null),e([i(N())],x.prototype,"matrix",null),e([i({json:{write:!0},type:String})],x.prototype,"name",void 0),e([i({type:Number,json:{write:!0}})],x.prototype,"nearDistance",void 0),e([p("nearDistance",["neardistance","neardist","layer.nearDistance"])],x.prototype,"readNearDistance",null),e([i({json:{write:!0,name:"objectid"},type:Number})],x.prototype,"objectId",void 0),e([i({type:Number,json:{write:!0}})],x.prototype,"offsetFromStart",void 0),e([p("offsetFromStart",["offsetfromstart"])],x.prototype,"readOffsetFromStart",null),e([i()],x.prototype,"orientationAccuracy",void 0),e([p("orientationAccuracy",["accuracy","orientationaccuracy"])],x.prototype,"readOrientationAccuracy",null),e([l("orientationAccuracy")],x.prototype,"writeOrientationAccuracy",null),e([s(w)],x.prototype,"orientedImageryType",void 0),e([p("orientedImageryType",["orientedimagerytype","oitype","layer.orientedImageryType"])],x.prototype,"readOIType",null),e([i({type:Number,json:{write:!0,read:{source:"principalx"}}})],x.prototype,"principalX",void 0),e([i({type:Number,json:{write:!0,read:{source:"principaly"}}})],x.prototype,"principalY",void 0),e([i(N([0,0,0]))],x.prototype,"radial",null),e([i({type:String})],x.prototype,"sequenceOrder",void 0),e([p("sequenceOrder",["sequenceorder","layer.sequenceOrderField"])],x.prototype,"readSequenceOrder",null),e([l("sequenceOrder")],x.prototype,"writeSequenceOrder",null),e([i({type:Object})],x.prototype,"sourceMap",void 0),e([i(N([0,0]))],x.prototype,"tangential",null),e([i({type:Number,json:{write:!0}})],x.prototype,"verticalFieldOfView",void 0),e([p("verticalFieldOfView",["verticalfieldofview","vfov","layer.verticalFieldOfView"])],x.prototype,"readVFOV",null),x=e([c("esri.layers.orientedImagery.core.ExposurePoint")],x);export{x as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import{geographicToWebMercator as r}from"../../../geometry/support/webMercatorUtils.js";import n from"./cameraOrientationRegistry.js";import{isConstantElevation as i,ConstantElevation as o,ElevationSource as s}from"./ElevationSourceDefinitions.js";import{CameraOrientationType as l}from"../enums/CameraOrientationType.js";function a(e,t,r){return t&&(e=`${t}${e}`),r&&(e+=`${r}`),e}function u(e,t,r){let{url:n}=e;return n?(n=a(n,t,r),new s({...e,url:n})):null}function c(e,t,r){return e?i(e)?new o(e):u(e,t,r):e}const f=new e({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),p=new e({Feet:"feet",Meter:"meter"}),m=new e({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique",Terrestrial360Video:"terrestrial-360-video",TerrestrialFrameVideo:"terrestrial-frame-video",Aerial360Video:"aerial-360-video",AerialFrameVideo:"aerial-frame-video","":null}),h=new Map;function g(e){const[t,r,n,i,o,s,l,a,u,c,f,p,m,h,g,d,w,
|
|
5
|
+
import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import{geographicToWebMercator as r}from"../../../geometry/support/webMercatorUtils.js";import n from"./cameraOrientationRegistry.js";import{isConstantElevation as i,ConstantElevation as o,ElevationSource as s}from"./ElevationSourceDefinitions.js";import{CameraOrientationType as l}from"../enums/CameraOrientationType.js";function a(e,t,r){return t&&(e=`${t}${e}`),r&&(e+=`${r}`),e}function u(e,t,r){let{url:n}=e;return n?(n=a(n,t,r),new s({...e,url:n})):null}function c(e,t,r){return e?i(e)?new o(e):u(e,t,r):e}const f=new e({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),p=new e({Feet:"feet",Meter:"meter"}),m=new e({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique",Terrestrial360Video:"terrestrial-360-video",TerrestrialFrameVideo:"terrestrial-frame-video",Aerial360Video:"aerial-360-video",AerialFrameVideo:"aerial-frame-video","":null}),h=new Map;function g(e){const[t,r,n,i,o,s,l,a,u,c,f,p,m,h,g,d,v,w,D,$,z,j]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,omega:s,phi:l,kappa:a,...y([u,c,f,p,m,h],[d,v],[w,D,$],[z,j],g)}}h.set(`${l.HPR}`,v),h.set(`${l.YPR}`,w),h.set(`${l.OPK}`,g),h.set(`${l.LTP}`,D);const d=e=>{const t=e.map((e=>parseFloat(e))).filter((e=>!isNaN(e)));if(t.length===e.length)return t};function y(e,t,r,n,i){const o=d(e),s=d(t),l=d(r),a=d(n);return{affineTransformations:6===o?.length?o:void 0,focalLength:6===o?.length?parseFloat(i):void 0,principalOffsetPoint:2!==s?.length?[0,0]:s,radialDistortionCoefficients:3!==l?.length?[0,0,0]:l,tangentialDistortionCoefficients:2!==a?.length?[0,0]:a}}function v(e){const[t,r,n,i,o,s,l,a,u,c,f,p,m,h,g,d,v,w,D,$,z,j]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,heading:s,pitch:l,roll:a,...y([u,c,f,p,m,h],[d,v],[w,D,$],[z,j],g)}}function w(e){const[t,r,n,i,o,s,l,a,u,c,f,p,m,h,g,d,v,w,D,$,z,j]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,yaw:s,pitch:l,roll:a,...y([u,c,f,p,m,h],[d,v],[w,D,$],[z,j],g)}}function D(e){const[t,r,i,o,s,...l]=e.slice(1),a=h.get(s),u=n.get(s)?.constructor;if(!a||!u)return null;return{latitude:t,longitude:r,ellipsoidRadius:i,squaredEccentricity:o,properties:new u(a([s,"",...l]))}}function $(e){if(!e)return null;const t=`${e}`.split("|");if(0===t.length)return null;const r=n.get(t[0]);if(!r)return null;const i=h.get(t[0]);if(!i)return null;return new(0,r.constructor)(i(t))}function z(e){return Array.isArray(e)&&e?.length>5&&!e.some(isNaN)}function j(e){for(e=e.slice(0,8);e.length<8;)e.push(0);return e}function I(e){return e.spatialReference.isGeographic?r(e):e.clone()}function K(e){return e.isGeographic?1:t(e)}function W(e){const t=e.match(/^(.*)\/rest\/services\/(.*)$/);return t?t[1]:null}export{a as appendPrefixAndSuffix,I as convertGeographicToWebMercator,$ as createCameraOrientation,W as getArcGISServerUrl,c as getEffectiveElevationSource,K as getMetersPerUnitOfSR,z as isOrientationAccuracy,m as orientedImageryTypeMap,j as padAccuracyArray,u as processElevationSource,f as timeIntervalUnitTypeMap,h as transformersRegistry,p as verticalMeasurementTypeMap};
|