@arcgis/core 5.2.0-next.113 → 5.2.0-next.115
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/Graphic.d.ts +5 -3
- package/Ground.d.ts +5 -4
- package/applications/Urban/LineImagePattern3D.js +1 -1
- package/arcgisGlobal.d.ts +2 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02f94f9d704f03ddb5c6.js +1 -0
- package/assets/esri/core/workers/chunks/{c517e732cab41093b2e0.js → 0312c40d94b248ad71e3.js} +1 -1
- package/assets/esri/core/workers/chunks/0463c807b37f01bbc35c.js +1 -0
- package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +1 -0
- package/assets/esri/core/workers/chunks/2e0fd0536408053ac6f5.js +1 -0
- package/assets/esri/core/workers/chunks/{6b264006b96cbf93d8ed.js → 48d3da636be15581fd7d.js} +1 -1
- package/assets/esri/core/workers/chunks/515fe302743c0b46f7e0.js +1 -0
- package/assets/esri/core/workers/chunks/{982a396bd4fffa62e911.js → 526cc64ae46dec3fbeda.js} +1 -1
- package/assets/esri/core/workers/chunks/{d13cf2e8b24e978ea77c.js → 7243d5721bb6a7329055.js} +1 -1
- package/assets/esri/core/workers/chunks/{785206da3962ba23de16.js → 84b89c523d3e16a5ee46.js} +1 -1
- package/assets/esri/core/workers/chunks/{484b3e2a220c440ccbb4.js → 9b92c41907e2da80c288.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d2553219ffd223b0e90.js → a774006be107e449bc29.js} +1 -1
- package/assets/esri/core/workers/chunks/b45ebb1b64ee7314375e.js +1 -0
- package/assets/esri/core/workers/chunks/{e0f417992889a6c41095.js → baa8bce361a2677533ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{96ebf76661b12128ddd5.js → be4de7111bc21bc69de1.js} +1 -1
- package/assets/esri/core/workers/chunks/f18ee2eaa96d103627a6.js +1 -0
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ar.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.bg.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.bs.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ca.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.cs.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.da.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.de.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.el.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.es.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.et.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.fi.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.fr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.he.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.hr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.hu.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.id.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.it.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ja.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ko.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.lt.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.lv.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.nl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.no.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.pl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.pt-BR.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ro.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.ru.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sk.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sl.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.sv.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.th.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.tr.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.uk.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.vi.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.zh-CN.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.zh-HK.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/messages.zh-TW.json +1 -1
- package/assets/esri/views/3d/analysis/VolumeMeasurement/t9n/messages.ja.json +1 -1
- package/assets/esri/views/3d/environment/resources/milkyway-band.ktx2 +0 -0
- package/assets/esri/widgets/DistanceMeasurement2D/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/DistanceMeasurement2D/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/Expand/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/Features/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/Features/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.hu.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.id.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.nl.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.th.json +1 -1
- package/assets/esri/widgets/Home/t9n/messages.tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/Print/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/Print/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/Print/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/Print/t9n/messages.pt-PT.json +1 -1
- package/assets/esri/widgets/Print/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/Print/t9n/messages.sr.json +1 -1
- package/assets/esri/widgets/Search/t9n/messages.bs.json +1 -1
- package/assets/esri/widgets/Search/t9n/messages.de.json +1 -1
- package/assets/esri/widgets/Search/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/Search/t9n/messages.et.json +1 -1
- package/assets/esri/widgets/Search/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/Search/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/Search/t9n/messages.hr.json +1 -1
- package/assets/esri/widgets/Search/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/Search/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ar.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ca.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.cs.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.el.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.es.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.fi.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.he.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.it.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.lt.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.lv.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.pl.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ro.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.ru.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.sl.json +1 -1
- package/assets/esri/widgets/smartMapping/HeatmapSlider/t9n/messages.uk.json +1 -1
- package/assets/esri/widgets/support/GridControls/t9n/messages.pt-BR.json +1 -1
- package/chunks/DeepSky.glsl.js +1 -1
- package/chunks/RibbonLine.glsl.js +63 -58
- package/config.js +1 -1
- package/core/Evented.d.ts +1 -1
- package/core/screenUtils.js +1 -1
- package/core/units.js +1 -1
- package/form/elements/AttachmentElement.d.ts +5 -5
- package/form/elements/inputs/attachments/AttachmentInput.d.ts +1 -1
- package/graphic/getGraphicOriginTitle.d.ts +10 -0
- package/graphic/getGraphicOriginTitle.js +2 -0
- package/kernel.js +1 -1
- package/layers/FeatureLayer.d.ts +2 -2
- package/layers/MapNotesLayer.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/FeatureReductionBinning.d.ts +2 -2
- package/layers/support/FeatureReductionCluster.d.ts +2 -2
- package/layers/support/Field.js +1 -1
- package/layers/support/SubtypeSublayer.d.ts +1 -1
- package/layers/support/TimeSeriesInfo.d.ts +1 -1
- package/layers/support/featurePopupQueryUtils.js +1 -1
- package/layers/support/timeSeriesUtils.js +1 -1
- package/layers/support/types.d.ts +1 -1
- package/layers/types.d.ts +1 -2
- package/package.json +3 -3
- package/popup/FeatureContent.d.ts +7 -7
- package/portal/schemas/definitions.js +1 -1
- package/portal/types.d.ts +1 -1
- package/renderers/DotDensityRenderer.d.ts +2 -2
- package/rest/knowledgeGraph/ReplicaDefinition.d.ts +1 -1
- package/rest/knowledgeGraphService.d.ts +2 -2
- package/rest/support/OutDistance.d.ts +19 -18
- package/rest/support/Query.d.ts +49 -21
- package/rest/support/RelationshipQuery.d.ts +1 -1
- package/smartMapping/renderers/support/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/LineSymbol3D.js +1 -1
- package/symbols/cim/types.d.ts +32 -0
- package/symbols/patterns/LinePattern3D.js +1 -1
- package/symbols/patterns/LineStylePattern3D.js +1 -1
- package/symbols/patterns/LineTemplatePattern3D.js +1 -1
- package/symbols/patterns/utils.js +1 -1
- package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/support/clippingUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.d.ts +1 -1
- package/views/3d/analysis/Viewshed/ViewshedEditTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/webgl-engine/effects/glow/BlurEmission.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeView.js +2 -0
- package/views/3d/webgl-engine/lib/attributeViewUtils.js +2 -0
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/BreakpointsOwner.d.ts +2 -2
- package/views/PopupView.d.ts +64 -2
- package/views/SceneView.js +1 -1
- package/views/SelectionManager.d.ts +24 -24
- package/views/View.js +1 -1
- package/views/View2D.js +1 -1
- package/views/interactive/support/types.d.ts +0 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/views/support/DefaultsFromMap.js +1 -1
- package/widgets/Attachments/support/attachmentUtils.d.ts +8 -0
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +1 -0
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListVisibleElements.d.ts +5 -1
- package/widgets/BasemapLayerList/types.d.ts +15 -2
- package/widgets/BasemapLayerList.d.ts +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +14 -0
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +29 -2
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/MultipleChoiceController.d.ts +1 -5
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/types.d.ts +8 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +2 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListVisibleElements.d.ts +5 -1
- package/widgets/CatalogLayerList/types.d.ts +12 -1
- package/widgets/CatalogLayerList.d.ts +2 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +2 -2
- package/widgets/Editor.d.ts +2 -2
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +6 -6
- package/widgets/FeatureTable/support/FeatureStore.d.ts +2 -2
- package/widgets/FeatureTable.d.ts +5 -5
- package/widgets/LayerList/LayerListVisibleElements.d.ts +4 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/TableList/ListItem.d.ts +2 -0
- package/widgets/TableList/ListItemPanel.d.ts +4 -0
- package/widgets/TableList/TableListViewModel.d.ts +4 -0
- package/widgets/TableList/TableListViewModel.js +1 -1
- package/widgets/TableList/TableListVisibleElements.d.ts +6 -1
- package/widgets/TableList/types.d.ts +12 -1
- package/widgets/TableList.d.ts +3 -0
- package/widgets/TableList.js +1 -1
- package/widgets/support/SelectionList/SelectionListViewModel.d.ts +1 -1
- package/assets/esri/core/workers/chunks/078ed48eb055dd213ee6.js +0 -1
- package/assets/esri/core/workers/chunks/1004e77593dfa506cd5d.js +0 -1
- package/assets/esri/core/workers/chunks/510a190a6f0a60ae38c3.js +0 -1
- package/assets/esri/core/workers/chunks/cd0f5cd0fefe7f49e3d8.js +0 -1
- package/assets/esri/core/workers/chunks/e6fb7b93cf73b05b1079.js +0 -1
- package/assets/esri/core/workers/chunks/f86ea5cf4814b458d50b.js +0 -1
- package/assets/esri/core/workers/chunks/f9b29d2ce1cd31c0fce1.js +0 -1
- package/graphic/graphicOrigins.js +0 -2
package/portal/types.d.ts
CHANGED
|
@@ -204,7 +204,7 @@ export interface FetchResourcesParameters {
|
|
|
204
204
|
*/
|
|
205
205
|
start?: number;
|
|
206
206
|
/**
|
|
207
|
-
* The maximum number of results to be included in the [FetchResourcesResult
|
|
207
|
+
* The maximum number of results to be included in the [FetchResourcesResult](https://developers.arcgis.com/javascript/latest/references/core/portal/types/#FetchResourcesResult-resources) response. The maximum value allowed is
|
|
208
208
|
* `100`. The `start` property combined with the `num` property can be used to paginate the search results.
|
|
209
209
|
*
|
|
210
210
|
* @default 10
|
|
@@ -91,7 +91,7 @@ export interface DotDensityRendererProperties extends RendererProperties, Visual
|
|
|
91
91
|
outline?: SimpleLineSymbolProperties;
|
|
92
92
|
/**
|
|
93
93
|
* An array of [Size Visual Variable](https://developers.arcgis.com/javascript/latest/references/core/renderers/visualVariables/SizeVariable/) objects. Only one
|
|
94
|
-
* should be provided. This visual variable is used to vary the [outline](
|
|
94
|
+
* should be provided. This visual variable is used to vary the [outline](https://developers.arcgis.com/javascript/latest/references/core/renderers/DotDensityRenderer/#outline) width based on the [view.scale](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#scale).
|
|
95
95
|
* See the snippet below for an example of this.
|
|
96
96
|
*
|
|
97
97
|
* @example
|
|
@@ -382,7 +382,7 @@ export default class DotDensityRenderer extends DotDensityRendererSuperclass {
|
|
|
382
382
|
get type(): "dot-density";
|
|
383
383
|
/**
|
|
384
384
|
* An array of [Size Visual Variable](https://developers.arcgis.com/javascript/latest/references/core/renderers/visualVariables/SizeVariable/) objects. Only one
|
|
385
|
-
* should be provided. This visual variable is used to vary the [outline](
|
|
385
|
+
* should be provided. This visual variable is used to vary the [outline](https://developers.arcgis.com/javascript/latest/references/core/renderers/DotDensityRenderer/#outline) width based on the [view.scale](https://developers.arcgis.com/javascript/latest/references/core/views/MapView/#scale).
|
|
386
386
|
* See the snippet below for an example of this.
|
|
387
387
|
*
|
|
388
388
|
* @example
|
|
@@ -47,7 +47,7 @@ export type ReplicaDocumentOptions = {
|
|
|
47
47
|
/**
|
|
48
48
|
* Entity type and relationship type definitions included in the replica definition.
|
|
49
49
|
*
|
|
50
|
-
* At least one of [
|
|
50
|
+
* At least one of [ReplicaStaticDefinition](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/ReplicaDefinition/#ReplicaStaticDefinition-entityTypeReplicaDefinitions) or [ReplicaStaticDefinition](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/ReplicaDefinition/#ReplicaStaticDefinition-relationshipTypeReplicaDefinitions)
|
|
51
51
|
* must be provided with at least one definition.
|
|
52
52
|
*/
|
|
53
53
|
export interface ReplicaNamedTypeDefinition {
|
|
@@ -1003,7 +1003,7 @@ export interface DomainOptions {
|
|
|
1003
1003
|
/**
|
|
1004
1004
|
* Add a domain to the knowledge graph service data model. This adds the domain to the service.
|
|
1005
1005
|
* To assign the domain to a property on a named type use
|
|
1006
|
-
* [executeUpdateGraphProperty()](
|
|
1006
|
+
* [executeUpdateGraphProperty()](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraphService/#executeUpdateGraphProperty).
|
|
1007
1007
|
*
|
|
1008
1008
|
* @param graph - The [knowledge graph](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/KnowledgeGraph/) associated with the service.
|
|
1009
1009
|
* @param domain - The [domain](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Domain/) to add to the graph.
|
|
@@ -1047,7 +1047,7 @@ export function executeUpdateDomain(graph: KnowledgeGraph, updatedDomain: RangeD
|
|
|
1047
1047
|
|
|
1048
1048
|
/**
|
|
1049
1049
|
* Delete a domain from a knowledge graph service. To delete a domain it must not be associated with any named type property in the graph.
|
|
1050
|
-
* To remove a domain from a named type property use [executeUpdateGraphProperty()](
|
|
1050
|
+
* To remove a domain from a named type property use [executeUpdateGraphProperty()](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraphService/#executeUpdateGraphProperty).
|
|
1051
1051
|
*
|
|
1052
1052
|
* @param graph - The [knowledge graph](https://developers.arcgis.com/javascript/latest/references/core/rest/knowledgeGraph/KnowledgeGraph/).
|
|
1053
1053
|
* @param domainName - The name of the [domain](https://developers.arcgis.com/javascript/latest/references/core/layers/support/Domain/) to delete
|
|
@@ -7,14 +7,11 @@ import type { PointProperties } from "../../geometry/Point.js";
|
|
|
7
7
|
import type { MultipointProperties } from "../../geometry/Multipoint.js";
|
|
8
8
|
import type { ExtentProperties } from "../../geometry/Extent.js";
|
|
9
9
|
|
|
10
|
-
/**
|
|
11
|
-
* @internal
|
|
12
|
-
* @since 5.1
|
|
13
|
-
*/
|
|
10
|
+
/** @since 5.2 */
|
|
14
11
|
export interface OutDistanceProperties extends Partial<Pick<OutDistance, "order" | "outDistanceUnit" | "returnDistance">> {
|
|
15
12
|
/**
|
|
16
|
-
* Geometry used as the distance
|
|
17
|
-
*
|
|
13
|
+
* Geometry used as the reference for measuring distance. Distances are measured from each feature to this geometry.
|
|
14
|
+
* If not specified, distances are measured from the [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry).
|
|
18
15
|
*
|
|
19
16
|
* @since 5.2
|
|
20
17
|
*/
|
|
@@ -23,12 +20,12 @@ export interface OutDistanceProperties extends Partial<Pick<OutDistance, "order"
|
|
|
23
20
|
|
|
24
21
|
/**
|
|
25
22
|
* Defines the [outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance) parameter on a [Query](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/) and specifies whether to return the distance
|
|
26
|
-
* of each feature
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
23
|
+
* of each feature in the query result. It can also specify the [order](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#order) in which features are returned based on distance.
|
|
24
|
+
* Distance values are returned only when the `outDistance` is specified and its [OutDistance.returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) property is `true`.
|
|
25
|
+
* The distance values are included in the [Graphic.distance](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#distance) property of each feature.
|
|
26
|
+
*
|
|
27
|
+
* Distance values are measured from [referenceGeometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#referenceGeometry) when specified; otherwise, they are measured
|
|
28
|
+
* from [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry).
|
|
32
29
|
*
|
|
33
30
|
* > [!WARNING]
|
|
34
31
|
* >
|
|
@@ -37,29 +34,33 @@ export interface OutDistanceProperties extends Partial<Pick<OutDistance, "order"
|
|
|
37
34
|
* > Supported only on a service-backed [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) where the [supportsOutDistance](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities) capability
|
|
38
35
|
* > is `true`.
|
|
39
36
|
*
|
|
40
|
-
* @
|
|
41
|
-
* @
|
|
37
|
+
* @since 5.2
|
|
38
|
+
* @see [Query.outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance)
|
|
39
|
+
* @see [Graphic.distance](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#distance)
|
|
42
40
|
*/
|
|
43
41
|
export default class OutDistance extends OutDistanceSuperclass {
|
|
44
42
|
constructor(properties?: OutDistanceProperties);
|
|
45
43
|
/**
|
|
46
44
|
* Indicates whether to return features sorted by distance.
|
|
47
|
-
* "ascending" returns the nearest features first while "descending" returns farthest
|
|
45
|
+
* The `"ascending"` option returns the nearest features first while the `"descending"` option returns farthest
|
|
48
46
|
* features first, and null indicates there should be no distance-based ordering.
|
|
47
|
+
* A `null` value indicates that there should be no distance-based ordering.
|
|
49
48
|
*
|
|
50
49
|
* @since 5.2
|
|
51
50
|
*/
|
|
52
51
|
order?: "ascending" | "descending" | null;
|
|
53
52
|
/**
|
|
54
|
-
* The distance unit
|
|
53
|
+
* The distance unit used for the returned distance values. This property applies only when
|
|
55
54
|
* [returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) is `true`.
|
|
55
|
+
* If omitted, the unit is determined from the [Query.outSpatialReference](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outSpatialReference).
|
|
56
|
+
* If no output spatial reference is specified, the service's spatial reference unit is used.
|
|
56
57
|
*
|
|
57
58
|
* @since 5.2
|
|
58
59
|
*/
|
|
59
60
|
outDistanceUnit?: "feet" | "miles" | "nautical-miles" | "us-nautical-miles" | "meters" | "kilometers" | null;
|
|
60
61
|
/**
|
|
61
|
-
* Geometry used as the distance
|
|
62
|
-
*
|
|
62
|
+
* Geometry used as the reference for measuring distance. Distances are measured from each feature to this geometry.
|
|
63
|
+
* If not specified, distances are measured from the [Query.geometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#geometry).
|
|
63
64
|
*
|
|
64
65
|
* @since 5.2
|
|
65
66
|
*/
|
package/rest/support/Query.d.ts
CHANGED
|
@@ -39,12 +39,27 @@ export interface QueryProperties extends Partial<Pick<Query, "aggregateIds" | "c
|
|
|
39
39
|
*/
|
|
40
40
|
historicMoment?: (Date | number | string) | null;
|
|
41
41
|
/**
|
|
42
|
-
* Specifies whether to return the distance of each feature
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
42
|
+
* Specifies whether to return the distance of each feature in the query result. It can also specify the order in which features are
|
|
43
|
+
* returned based on distance. Distance values are returned only when the `outDistance` is specified and its
|
|
44
|
+
* [OutDistance.returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) property is `true`. The distance values are included
|
|
45
|
+
* in the [Graphic.distance](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#distance) property of each feature.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```js
|
|
49
|
+
* // Find hotels within 10 miles of the airport and order them by
|
|
50
|
+
* // their distance from the convention center.
|
|
51
|
+
* const query = new Query({
|
|
52
|
+
* geometry: airportLocation,
|
|
53
|
+
* distance: 10,
|
|
54
|
+
* units: "miles",
|
|
55
|
+
* outDistance: new OutDistance({
|
|
56
|
+
* returnDistance: true,
|
|
57
|
+
* order: "ascending",
|
|
58
|
+
* referenceGeometry: conventionCenterLocation,
|
|
59
|
+
* outDistanceUnit: "miles"
|
|
60
|
+
* })
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
48
63
|
*
|
|
49
64
|
* > [!WARNING]
|
|
50
65
|
* >
|
|
@@ -52,9 +67,9 @@ export interface QueryProperties extends Partial<Pick<Query, "aggregateIds" | "c
|
|
|
52
67
|
* >
|
|
53
68
|
* > Supported only on a service-backed [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) where the [supportsOutDistance](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities) capability
|
|
54
69
|
* > is `true`.
|
|
55
|
-
*
|
|
56
|
-
* @
|
|
57
|
-
* @
|
|
70
|
+
* @since 5.2
|
|
71
|
+
* @see [OutDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/)
|
|
72
|
+
* @see [Graphic.distance](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#distance)
|
|
58
73
|
*/
|
|
59
74
|
outDistance?: OutDistanceProperties | null;
|
|
60
75
|
/**
|
|
@@ -440,8 +455,6 @@ export default class Query extends JSONSupport {
|
|
|
440
455
|
*
|
|
441
456
|
* If querying a feature service, the [supportsQueryWithDistance](https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/)
|
|
442
457
|
* capability must be `true`.
|
|
443
|
-
*
|
|
444
|
-
* @see [Query.outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance)
|
|
445
458
|
*/
|
|
446
459
|
accessor distance: number | null | undefined;
|
|
447
460
|
/** Specifies the geodatabase version to display for feature service queries. */
|
|
@@ -610,12 +623,27 @@ export default class Query extends JSONSupport {
|
|
|
610
623
|
*/
|
|
611
624
|
accessor orderByFields: string[] | null | undefined;
|
|
612
625
|
/**
|
|
613
|
-
* Specifies whether to return the distance of each feature
|
|
614
|
-
*
|
|
615
|
-
*
|
|
616
|
-
*
|
|
617
|
-
*
|
|
618
|
-
*
|
|
626
|
+
* Specifies whether to return the distance of each feature in the query result. It can also specify the order in which features are
|
|
627
|
+
* returned based on distance. Distance values are returned only when the `outDistance` is specified and its
|
|
628
|
+
* [OutDistance.returnDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/#returnDistance) property is `true`. The distance values are included
|
|
629
|
+
* in the [Graphic.distance](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#distance) property of each feature.
|
|
630
|
+
*
|
|
631
|
+
* @example
|
|
632
|
+
* ```js
|
|
633
|
+
* // Find hotels within 10 miles of the airport and order them by
|
|
634
|
+
* // their distance from the convention center.
|
|
635
|
+
* const query = new Query({
|
|
636
|
+
* geometry: airportLocation,
|
|
637
|
+
* distance: 10,
|
|
638
|
+
* units: "miles",
|
|
639
|
+
* outDistance: new OutDistance({
|
|
640
|
+
* returnDistance: true,
|
|
641
|
+
* order: "ascending",
|
|
642
|
+
* referenceGeometry: conventionCenterLocation,
|
|
643
|
+
* outDistanceUnit: "miles"
|
|
644
|
+
* })
|
|
645
|
+
* });
|
|
646
|
+
* ```
|
|
619
647
|
*
|
|
620
648
|
* > [!WARNING]
|
|
621
649
|
* >
|
|
@@ -623,9 +651,9 @@ export default class Query extends JSONSupport {
|
|
|
623
651
|
* >
|
|
624
652
|
* > Supported only on a service-backed [FeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/FeatureLayer/) where the [supportsOutDistance](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities) capability
|
|
625
653
|
* > is `true`.
|
|
626
|
-
*
|
|
627
|
-
* @
|
|
628
|
-
* @
|
|
654
|
+
* @since 5.2
|
|
655
|
+
* @see [OutDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/OutDistance/)
|
|
656
|
+
* @see [Graphic.distance](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#distance)
|
|
629
657
|
*/
|
|
630
658
|
get outDistance(): OutDistance | null | undefined;
|
|
631
659
|
set outDistance(value: OutDistanceProperties | null | undefined);
|
|
@@ -876,7 +904,7 @@ export default class Query extends JSONSupport {
|
|
|
876
904
|
* When `true` output geometry will include curves. If `false`, curves (if any) will be converted to
|
|
877
905
|
* densified polylines or polygons.
|
|
878
906
|
*
|
|
879
|
-
* This option only applies when [returnGeometry](
|
|
907
|
+
* This option only applies when [returnGeometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnGeometry) is set to `true` and the output geometry is
|
|
880
908
|
* non-quantized polylines or polygons.
|
|
881
909
|
*
|
|
882
910
|
* @since 5.0
|
|
@@ -120,7 +120,7 @@ export default class RelationshipQuery extends JSONSupport {
|
|
|
120
120
|
* When `true` output geometry will include curves. If `false`, curves (if any) will be converted to
|
|
121
121
|
* densified polylines or polygons.
|
|
122
122
|
*
|
|
123
|
-
* This option only applies when [returnGeometry](
|
|
123
|
+
* This option only applies when [returnGeometry](https://developers.arcgis.com/javascript/latest/references/core/rest/support/RelationshipQuery/#returnGeometry) is set to `true` and the output geometry is
|
|
124
124
|
* non-quantized polylines or polygons.
|
|
125
125
|
*
|
|
126
126
|
* @since 5.0
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../Color.js";import{fetchMessageBundle as t,substitute as n}from"../../../intl.js";import o from"../../../core/Collection.js";import i from"../../../core/Error.js";import{formatDate as r,convertDateFormatToIntlOptions as l}from"../../../intl/date.js";import{round as s}from"../../../renderers/support/numberUtils.js";import a from"../../../renderers/support/pointCloud/PointSizeSplatAlgorithm.js";import m from"../../heuristics/outline.js";import u from"../../statistics/classBreaks.js";import c from"../../statistics/summaryStatistics.js";import{getAgeExpressions as f}from"../../statistics/support/ageUtils.js";import{isAnyDateField as d,getBasemapId as p,defaultBasemapGroups as y,getBasemapGroup as w,defaultStatisticTypes as
|
|
2
|
+
import e from"../../../Color.js";import{fetchMessageBundle as t,substitute as n}from"../../../intl.js";import o from"../../../core/Collection.js";import i from"../../../core/Error.js";import{formatDate as r,convertDateFormatToIntlOptions as l}from"../../../intl/date.js";import{round as s}from"../../../renderers/support/numberUtils.js";import a from"../../../renderers/support/pointCloud/PointSizeSplatAlgorithm.js";import m from"../../heuristics/outline.js";import u from"../../statistics/classBreaks.js";import c from"../../statistics/summaryStatistics.js";import{getAgeExpressions as f}from"../../statistics/support/ageUtils.js";import{isAnyDateField as d,getBasemapId as p,defaultBasemapGroups as y,getBasemapGroup as w,getNormalizationType as h,defaultStatisticTypes as b}from"../../support/utils.js";import g from"../../../symbols/ExtrudeSymbol3DLayer.js";import D from"../../../symbols/FillSymbol3DLayer.js";import j from"../../../symbols/IconSymbol3DLayer.js";import S from"../../../symbols/LineSymbol3D.js";import v from"../../../symbols/LineSymbol3DLayer.js";import x from"../../../symbols/MeshSymbol3D.js";import z from"../../../symbols/ObjectSymbol3DLayer.js";import T from"../../../symbols/PathSymbol3DLayer.js";import U from"../../../symbols/PointSymbol3D.js";import L from"../../../symbols/PolygonSymbol3D.js";import V from"../../../symbols/SimpleFillSymbol.js";import k from"../../../symbols/SimpleLineSymbol.js";import F from"../../../symbols/SimpleMarkerSymbol.js";import I from"../../../symbols/edges/SketchEdges3D.js";import M from"../../../symbols/edges/SolidEdges3D.js";import{getTimeZoneFormattingOptions as C,shortTimeZoneName as Z}from"../../../time/timeZoneUtils.js";import{getBackgroundColorTheme as B}from"../../../views/support/colorUtils.js";const E=/^(\d+(\.\d+)?)\s*(%)$/i,P=new e([0,0,0,.4]),A=new Set(["hours","minutes","seconds"]),R=[...y.light,...y.dark];function Y(e,t,n,o){if("string"==typeof e){const t=n.getField(e);if(t&&d(t))return t.alias||t.name}else if("number"==typeof e||e instanceof Date){const i=null!=t&&A.has(t),s=l(i?"short-date-short-time":"short-date");if(o&&i){const t=n.layer,{timeZone:i}=C("preferredTimeZone"in t?t.preferredTimeZone:null,"datesInUnknownTimezone"in t&&t.datesInUnknownTimezone,o.timeZone,s,"date");return r(e,{...s,timeZone:i,timeZoneName:Z})}return r(e,s)}return e}function N(e,t,n){return e+t>0&&0>e-t&&n<0?0:e}function W(e,t,n,o){const{avg:i,stddev:r,min:l,max:s}=e,a=$(e,!!n,o??!0);let m=a?a[0]:l,u=a?a[1]:s;return a?{minDataValue:m,maxDataValue:u,defaultValuesUsed:!0}:("above"===t?m=N(i,r,l):"below"===t&&(u=N(i,r,l)),{minDataValue:m,maxDataValue:u,defaultValuesUsed:!1})}function $(e,t,n){let o,i;const r=q({statistics:e,isDate:t});return r.defaultValuesUsed?(o=r.min,i=r.max):!n||null!=e.avg&&e.stddev||(o=e.min,i=e.max),null!=o&&null!=i?[o,i]:null}function q(e){let t,n,o=e&&e.statistics;if(o||(o={}),null==o.min)if(e.isDate){const e=O();t=e[0],n=e[1]}else t=0,n=100;else if(o.min===o.max)if(e.isDate){const e=O(o.min);t=e[0],n=e[1]}else o.min<0?(t=2*o.min,n=0):o.min>0?(t=0,n=2*o.min):(t=0,n=100);return{min:null!=t?t:o.min,max:null!=n?n:o.max,defaultValuesUsed:null!=t||null!=n}}function O(e){const t=("number"==typeof e?new Date(e):new Date).getUTCFullYear();let n=Date.UTC(t,0,1,12,0,0,0),o=Date.UTC(t,11,31,12,0,0,0);return"number"==typeof e&&(e<n&&(n=e),e>o&&(o=e)),[n,o]}function _({minDataValue:e,maxDataValue:t,defaultValuesUsed:n},o,i,r=!0){return n||"above"===i||"below"===i?J(e,t,5):K(o,r)}function G(e,t){const{avg:n,stddev:o}=e,i=e.min,r=e.max;if(null==n||null==o){const[n,o]=$(e,t,!0);return J(n,o,5)}const l=N(n,o,i),a=r-l,m=l-i,u=Math.max(a,m);return s([l-u,l-u/2,l,u/2+l,l+u],{strictBounds:!0})}function H(e,t){const{min:n,max:o}=t,[i,r,l,a,m]=e,u=null!=n&&i<n,c=null!=o&&m>o;if(null==n||null==o||!u&&!c)return e;const f=u?n:i,d=c?o:m;return s([f,u?f+(l-f)/2:r,l,c?l+(d-l)/2:a,d],{strictBounds:!0})}function J(e,t,n){const o=(t-e)/(n-1),i=[e];for(let r=1;r<=n-2;r++)i.push(e+r*o);return i.push(t),s(i,{strictBounds:!0})}function K({min:e,max:t,avg:n,stddev:o},i=!0){if(null==e||null==t||null==n||null==o)return[];let r=n-o,l=n+o;r<e&&(r=e),l>t&&(l=t),i&&(n=r+(l-r)/2);let a=s([r,l],{strictBounds:!0});return r=a[0],l=a[1],a=[r,r+(n-r)/2,n,n+(l-n)/2,l],s(a,{strictBounds:!0})}function Q(e,t,n){switch(t){case"point":case"multipoint":return n?"noDataSize"in e?e.noDataSize:null:"size"in e?e.size:null;case"polyline":return n?"noDataWidth"in e?e.noDataWidth:null:"width"in e?e.width:null;case"polygon":return"size"in e?e.size:null;default:return}}function X(e,t,n){switch(t){case"point":case"multipoint":case"polygon":{if(!("outline"in e))return null;const t={color:e.outline.color,width:e.outline.width};if(null!=n&&t.color){const e=t.color.clone();e.a=n,t.color=e}return t}default:return}}function ee(e,t){const{type:n,size:i,color:r,outline:l}=t;let s;switch(e){case"point":case"multipoint":if("2d"===n)s=new F({color:r,size:i,outline:{color:l.color,width:l.width}});else if("3d-flat"===n)s=new U({symbolLayers:new o([new j({size:i,resource:{primitive:"circle"},material:{color:r},outline:{color:l.color,size:l.width}})])});else if(n?.includes("3d-volumetric")){const e="3d-volumetric-uniform"===n,l=new z({height:i,resource:{primitive:e?"sphere":"cylinder"},material:{color:r}});e||(l.width=t.widthAndDepth,l.depth=t.widthAndDepth),s=new U({symbolLayers:new o([l])})}break;case"polyline":"2d"===n?s=new k({color:r,width:i}):"3d-flat"===n?s=new S({symbolLayers:new o([new v({size:i,material:{color:r}})])}):"3d-volumetric"===n&&(s=new S({symbolLayers:new o([new T({width:"number"==typeof i?i:parseFloat(i),height:"number"==typeof i?i:parseFloat(i),material:{color:r}})])}));break;case"polygon":"2d"===n?s=new V({color:r,outline:{color:l.color,width:l.width}}):"3d-flat"===n?s=new L({symbolLayers:new o([new D({material:{color:r},outline:{color:l.color,size:l.width}})])}):"3d-volumetric"===n&&(s=new L({symbolLayers:new o([new g({size:i,material:{color:r}})])}));break;case"mesh":{const e=t.meshInfo?.colorMixMode,n=t.meshInfo?.edgesType;s=new x({symbolLayers:new o([new D({material:{color:r,colorMixMode:e||null},edges:"solid"===n?new M({color:P}):"sketch"===n?new I({color:P}):null})])});break}}return s}function te(e,t,n){const o=ne({layer:e,fields:t});if(o.length)return new i(n,"Unknown fields: "+o.join(", ")+". You can only use fields defined in the layer schema");const r=oe({layer:e,fields:t});return r.length?new i(n,"Unsupported fields: "+r.join(", ")+". You can only use fields that are accessible to the renderer i.e. FieldUsageInfo.supportsRenderer must be true"):void 0}function ne(e){const t=e.layer;return e.fields.filter(e=>!t.getField(e))}function oe(e){const t=e.layer;return e.fields.filter(e=>{const n=t.getFieldUsageInfo(e);return!n||!n.supportsRenderer})}async function ie(e,t){const n={layer:e.layer,view:e.view,filter:e.filter,signal:e.signal},[o,i]=await Promise.all([u(e).catch(ce),t?m(n).catch(ce):null]),r=$({min:o?.minValue,max:o?.maxValue,avg:null,stddev:null},!1,!1),l=h(e);return{result:r?await u({...e,normalizationType:l,classificationMethod:"equal-interval",numClasses:1,analyzeData:!1,minValue:r[0],maxValue:r[1],normalizationTotal:"percent-of-total"===l?e.normalizationTotal??r[0]+r[1]:void 0}):o,defaultValuesUsed:!!r,outlineResult:i}}function re(e){return c({outStatisticTypes:b,...e})}function le(e,t){let{minSize:n,maxSize:o}=e;if("height"===t){n=((o-n)/2+n)/(2*2.3),o*=2}return{minSize:n,maxSize:o}}function se(e){return E.test(e)}function ae(e){if(null==e)return;const t=e.match(E),n=Number(t[1]);return"%"===t[3]?new a({scaleFactor:n/100}):void 0}function me(e,t,n,o){e.startTime=t instanceof Date?t.getTime():t,e.endTime=n instanceof Date?n.getTime():n,e.units=o,e.field="string"==typeof t?t:"string"==typeof n?n:null}async function ue(e,t){let n=null,o=null;if(!e&&!t)return{basemapId:n,basemapTheme:o};if(t&&(o=await B(t),e||(e=t.map?.basemap)),e&&(n=p(e,R,!1),n&&!o)){const e=w(n);null!=e&&(o=e)}return!n&&o&&(n="dark"===o?"dark-gray":"gray"),{basemapId:n,basemapTheme:o}}function ce(e){const t=e.name?.toLowerCase();if(!t||t?.includes(":insufficient-info")||t?.includes(":insufficient-data"))return null;throw e}async function fe(e,o){const{layer:i,startTime:r,endTime:l,view:s}=e,a=f({layer:i,startTime:r,endTime:l,unit:o}).valueExpression,m=await t("esri/smartMapping/t9n/smartMapping");return{valueExpression:a,title:n(m[`ageInfo_${o}`],{unit:o,startTime:Y(r,o,i,s),endTime:Y(l,o,i,s)})}}export{H as clampAboveAndBelowStopValues,_ as createDataValues,J as createDefaultStopValues,K as createStopValues,G as createStopValuesForAboveBelow,ee as createSymbol,ce as errorCallback,Y as formatDate,N as getBaseValueForAboveBelow,ue as getBasemapInfo,ie as getClassBreaks,W as getDataRange,$ as getDefaultDataRange,ae as getPointSizeAlgorithm,le as getSizeRangeForAxis,re as getSummaryStatistics,X as getSymbolOutlineFromScheme,Q as getSymbolSizeFromScheme,fe as getTitleAndExpressionForAgeRenderer,se as isValidPointSize,me as updateAgeRendererAuthoringInfoVV,te as verifyBasicFieldValidity};
|
package/support/revision.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const
|
|
2
|
+
const a="20260918",c="e24c3d27d1f54209f4a92566c14af7742b9e7a5a";export{a as buildDate,c as revision};
|
package/symbols/LineSymbol3D.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import o from"../core/Collection.js";import{clone as r}from"../core/lang.js";import{property as t,subclass as s}from"../core/accessorSupport/decorators.js";import i from"./LineSymbol3DLayer.js";import l from"./PathSymbol3DLayer.js";import y from"./Symbol3D.js";import{enumeration as
|
|
2
|
+
import{__decorate as e}from"tslib";import o from"../core/Collection.js";import{clone as r}from"../core/lang.js";import{property as t,subclass as s}from"../core/accessorSupport/decorators.js";import i from"./LineSymbol3DLayer.js";import l from"./PathSymbol3DLayer.js";import y from"./Symbol3D.js";import{enumeration as p}from"../core/accessorSupport/decorators/enumeration.js";var m;const n=o.ofType({base:null,key:"type",typeMap:{line:i,path:l}}),a=o.ofType({base:null,key:"type",typeMap:{line:i,path:l}});let b=m=class extends y{constructor(e){super(e),this.symbolLayers=new n,this.worldSized=!1,this.type="line-3d"}clone(){return new m({styleOrigin:r(this.styleOrigin),symbolLayers:r(this.symbolLayers),thumbnail:r(this.thumbnail),worldSized:this.worldSized})}static fromSimpleLineSymbol(e){return new m({symbolLayers:new o([i.fromSimpleLineSymbol(e)])})}};e([t({type:n,json:{type:a}})],b.prototype,"symbolLayers",void 0),e([t({type:Boolean,nonNullable:!0,json:{write:!0,default:!1}})],b.prototype,"worldSized",void 0),e([p({LineSymbol3D:"line-3d"},{readOnly:!0})],b.prototype,"type",void 0),b=m=e([s("esri.symbols.LineSymbol3D")],b);export{b as default};
|
package/symbols/cim/types.d.ts
CHANGED
|
@@ -2600,6 +2600,38 @@ export interface CIMPointSymbol extends CIMMultiLayerSymbol {
|
|
|
2600
2600
|
* @since 5.0
|
|
2601
2601
|
*/
|
|
2602
2602
|
animations?: CIMSymbolAnimation[];
|
|
2603
|
+
/**
|
|
2604
|
+
* The size of the halo around the symbol. Use with the `haloSymbol` property to define the halo's appearance.
|
|
2605
|
+
*
|
|
2606
|
+
* @since 5.2
|
|
2607
|
+
*/
|
|
2608
|
+
haloSize?: number;
|
|
2609
|
+
/**
|
|
2610
|
+
* The symbol used for the halo around the point symbol. Use with the `haloSize` property to define the halo's appearance.
|
|
2611
|
+
*
|
|
2612
|
+
* @since 5.2
|
|
2613
|
+
* @example
|
|
2614
|
+
* ```js
|
|
2615
|
+
* {
|
|
2616
|
+
* type: "CIMPointSymbol",
|
|
2617
|
+
* symbolLayers: [...],
|
|
2618
|
+
* haloSize: 2,
|
|
2619
|
+
* haloSymbol: {
|
|
2620
|
+
* type: "CIMPolygonSymbol",
|
|
2621
|
+
* symbolLayers: [
|
|
2622
|
+
* {
|
|
2623
|
+
* type: "CIMSolidFill",
|
|
2624
|
+
* enable: true,
|
|
2625
|
+
* color: [0, 169, 230, 255],
|
|
2626
|
+
* },
|
|
2627
|
+
* ],
|
|
2628
|
+
* },
|
|
2629
|
+
* scaleX: 1,
|
|
2630
|
+
* angleAlignment: "Display"
|
|
2631
|
+
* }
|
|
2632
|
+
* ```
|
|
2633
|
+
*/
|
|
2634
|
+
haloSymbol?: CIMPolygonSymbol;
|
|
2603
2635
|
/**
|
|
2604
2636
|
* The primitive name of the symbol. Used when setting a [CIMPrimitiveOverride](https://developers.arcgis.com/javascript/latest/references/core/symbols/cim/types/#CIMPrimitiveOverride).
|
|
2605
2637
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as r}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as t,subclass as s}from"../../core/accessorSupport/decorators.js";let p=class extends(e(o)){constructor(r){super(r)}};r([t({type:["style","template","image"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],p.prototype,"type",void 0),p=r([s("esri.symbols.patterns.LinePattern3D")],p);export{p as default};
|
|
2
|
+
import{__decorate as r}from"tslib";import{ClonableMixin as e}from"../../core/Clonable.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as t,subclass as s}from"../../core/accessorSupport/decorators.js";let p=class extends(e(o)){constructor(r){super(r)}};r([t({type:["style","template","image"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0,isRequired:!0}}})],p.prototype,"type",void 0),p=r([s("esri.symbols.patterns.LinePattern3D")],p);export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as o}from"tslib";import{strict as t}from"../../core/jsonMap.js";import{property as s,subclass as
|
|
2
|
+
import{__decorate as o}from"tslib";import{strict as t}from"../../core/jsonMap.js";import{property as s,subclass as d}from"../../core/accessorSupport/decorators.js";import r from"./LinePattern3D.js";import{lineStyles as e}from"./lineStyles.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";const h=t()({dash:"dash","dash-dot":"dash-dot","dash-dot-dot":"long-dash-dot-dot",dot:"dot","long-dash":"long-dash","long-dash-dot":"long-dash-dot",null:"none","short-dash":"short-dash","short-dash-dot":"short-dash-dot","short-dash-dot-dot":"short-dash-dot-dot","short-dot":"short-dot",solid:"solid"});let i=class extends r{constructor(o){super(o),this.type="style",this.style="solid"}};o([s({type:["style"]})],i.prototype,"type",void 0),o([a(h),s({type:e,json:{write:{isRequired:!0}}})],i.prototype,"style",void 0),i=o([d("esri.symbols.patterns.LineStylePattern3D")],i);export{i as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{property as t,subclass as s}from"../../core/accessorSupport/decorators.js";import{normalizeDashPatternTemplate as a}from"../cim/dashUtils.js";import o from"./LinePattern3D.js";let
|
|
2
|
+
import{__decorate as e}from"tslib";import{property as t,subclass as s}from"../../core/accessorSupport/decorators.js";import{normalizeDashPatternTemplate as a}from"../cim/dashUtils.js";import o from"./LinePattern3D.js";let r=class extends o{constructor(e){super(e),this.type="template",this.dashTemplate=[]}get normalizedDashTemplate(){const{dashTemplate:e,hidesLine:t}=a(this.dashTemplate);return{dashTemplate:e.map(e=>Math.abs(e)),hidesLine:t}}};e([t({type:["template"]})],r.prototype,"type",void 0),e([t({type:[Number],nonNullable:!0,json:{write:{isRequired:!0}}})],r.prototype,"dashTemplate",void 0),e([t()],r.prototype,"normalizedDashTemplate",null),r=e([s("esri.symbols.patterns.LineTemplatePattern3D")],r);const p=r;export{p as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import
|
|
2
|
+
import t from"./LinePattern3D.js";import e from"./LineStylePattern3D.js";import p from"./LineTemplatePattern3D.js";import r from"./Pattern3D.js";import s from"./StylePattern3D.js";const y={types:{key:"type",base:r,typeMap:{style:s}},json:{write:!0}},o={types:{key:"type",base:t,typeMap:{style:e,template:p}},json:{write:!0}},a={types:{key:"type",base:t,typeMap:{style:e}},json:{write:!0}};export{o as symbol3dLinePatternProperty,a as symbol3dOutlineLinePatternProperty,y as symbol3dPatternProperty};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../../core/has.js";import{OverrideHelper as e}from"../../../../../symbols/cim/OverrideHelper.js";import{hasRichTextFormattingTags as t}from"../../../../../symbols/cim/richTextUtils.js";import{FeatureMatcher as r}from"./Matcher.js";import{createDebugWriters as s}from"../../../layers/support/annodime/debugUtils.js";import i from"../../../layers/support/annodime/DimensionInfo.js";import{dimensionSymbols as o}from"../../../layers/support/annodime/dimensionSymbols.js";import{getFontForCIMTextSymbol as n}from"../../../layers/support/annodime/dimensionUtils.js";import{createDimensionMatcherFeatureInfo as m,mixFeature as a}from"../../../layers/support/annodime/MatcherGeometryOverride.js";import{createTileObjectId as c}from"../../../layers/support/annodime/TileObjectId.js";class h extends r{constructor(e,t){super(),this._context=e,this._schema=t,this._meshWriters=new Map,this._dimensionInfos=new Map,this._matcherGeometryOverrides=new Map}static async fromDimensionSchema(e,t){return new h(e,t)}hasArcadeDependency(){return!1}doMatch(e,t,r){return this._meshWriters.get(c(r,e.getObjectId()))}async fetchResources(e,t,r,
|
|
2
|
+
import has from"../../../../../core/has.js";import{OverrideHelper as e}from"../../../../../symbols/cim/OverrideHelper.js";import{hasRichTextFormattingTags as t}from"../../../../../symbols/cim/richTextUtils.js";import{FeatureMatcher as r}from"./Matcher.js";import{createDebugWriters as s}from"../../../layers/support/annodime/debugUtils.js";import i from"../../../layers/support/annodime/DimensionInfo.js";import{dimensionSymbols as o}from"../../../layers/support/annodime/dimensionSymbols.js";import{getFontForCIMTextSymbol as n}from"../../../layers/support/annodime/dimensionUtils.js";import{createDimensionMatcherFeatureInfo as m,mixFeature as a}from"../../../layers/support/annodime/MatcherGeometryOverride.js";import{createTileObjectId as c}from"../../../layers/support/annodime/TileObjectId.js";class h extends r{constructor(e,t){super(),this._context=e,this._schema=t,this._meshWriters=new Map,this._dimensionInfos=new Map,this._matcherGeometryOverrides=new Map}static async fromDimensionSchema(e,t){return new h(e,t)}hasArcadeDependency(){return!1}doMatch(e,t,r){return this._meshWriters.get(c(r,e.getObjectId()))}async fetchResources(e,t,r,o){this._meshWriters.clear(),this._dimensionInfos.clear(),this._matcherGeometryOverrides.clear();const n=t.metadata.outSpatialReference,h=t.metadata.attributeSpatialReference??t.metadata.spatialReference??n,l=t.getCursor();for(;l.next();){const r=m(l);if(!r)continue;const y=a(l,r);if(!y)continue;const p=c(o,l.getObjectId()),d=this._readStyleId(l),u=this._getStyle(d);if(!u){let r=this._meshWriters.get(p);r||(r=await s(this._context,e,t.geometryType),this._meshWriters.set(p,r));continue}const f=await i.create(u,y,n,h);await this._cacheGlyphs(f,y,e),this._dimensionInfos.set(p,f),this._matcherGeometryOverrides.set(p,r.geometryOverride);let _=this._meshWriters.get(p);_||(_=await this._createGroup(u,l,y,e,t.geometryType),this._meshWriters.set(p,_))}}async _createGroup(e,t,r,i,n){const m=o.processDimensionStyle(e),[a,c,h,l,y]=await Promise.all([this._createMeshesForSymbol(m.beginDimensionLineSymbol,m.primitiveOverrides,t,r,i),this._createMeshesForSymbol(m.endDimensionLineSymbol,m.primitiveOverrides,t,r,i),this._createMeshesForSymbol(m.beginExtensionLineSymbol,m.primitiveOverrides,t,r,i),this._createMeshesForSymbol(m.endExtensionLineSymbol,m.primitiveOverrides,t,r,i),this._createMeshesForSymbol(m.textSymbol,m.primitiveOverrides,t,r,i)]),p=await this._context.createMeshWriters([...a,...c,...h,...l,...y]);if(has("esri-2d-annotation-dimension-debug")){const e=await s(this._context,i,n);return e.length?[...p,...e]:p}return p}async _createMeshesForSymbol(t,r,s,i,o){if(!t)return[];const n=await e.resolveSymbolOverrides({type:"CIMSymbolReference",primitiveOverrides:r,symbol:t},i,s.metadata.outSpatialReference,null,s.geometryType);if(!n)return[];const m=await o.fetchMeshResourceImmediate({type:"mesh-request",symbolReference:{type:"CIMSymbolReference",symbol:n}});return m?.meshes??[]}_readStyleId(e){return parseInt(`${e.readAttribute("STYLEID")}`,10)}_getStyle(e){return this._schema.styleCollection.find(t=>(t.iD??0)===e)}async _cacheGlyphs(e,r,s){const i=e.getTextString(r);if(!i)return;const o=await s.fetchResourceImmediate({type:"cim-rasterization-info",resource:{type:"text",textString:i||"",font:n(e.textSymbol),symbol:e.textSymbol,supportsRichText:t(i)}});"glyphs"!==o?.type&&"rich-glyphs"!==o?.type||e.setTextResource(o)}cleanup(e,t,r){const s=t.getObjectId(),i=c(r,s);this._meshWriters.delete(i),this._dimensionInfos.delete(i),this._matcherGeometryOverrides.delete(i)}getAnalyzedGraphic(e){return this._dimensionInfos.get(e)||null}getMatcherGeometryOverride(e){return this._matcherGeometryOverrides.get(e)??null}}export{h as DimensionMatcher};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import has from"../../../../core/has.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{r as e}from"../../../../chunks/rbush.js";import s from"../../../../geometry/Point.js";import{create as i,
|
|
2
|
+
import has from"../../../../core/has.js";import{pt2px as t}from"../../../../core/screenUtils.js";import{r as e}from"../../../../chunks/rbush.js";import s from"../../../../geometry/Point.js";import{create as i,fromValues as o,intersects as n,copy as r}from"../../../../geometry/support/aaBoundingRect.js";import{normalizeMapX as m}from"../../../../geometry/support/normalizeUtils.js";import{getInfo as l}from"../../../../geometry/support/spatialReferenceUtils.js";import{HittestDrawHelper as a}from"../../../../symbols/cim/CIMSymbolDrawHelper.js";import{CIMSymbolInflatedSizeHelper as h}from"../../../../symbols/cim/CIMSymbolHelper.js";import{hittestToleranceSmallSymbol as c,hittestToleranceMobile as u,hittestToleranceDesktop as p}from"../../engine/webgl/definitions.js";import{GraphicStoreItem as d}from"./GraphicStoreItem.js";import{pixelBuffer as f}from"./graphicsUtils.js";import{GraphicUpdateMessage as y}from"./GraphicUpdateMessage.js";import{getMapPointsFromScreen as _,getBbox as b,createHittestQuery as I}from"../../support/hitTestUtils.js";const g=1e-5;function x(t,e){return e.zOrder-t.zOrder}class w{constructor(t,e,s,i,o){this._items=new Map,this._boundsDirty=!1,this._outSpatialReference=t,this._cimResourceManager=e,this._hittestDrawHelper=new a(e),this._tileInfoView=s,this._store=o;const n=s.getClosestInfoForScale(i);this._resolution=this._tileInfoView.getTileResolution(n.level)}destroy(){this._hittestDrawHelper.destroy()}items(){return this._items.values()}getItem(t){return this._items.get(t)}async update(t,e,s){const i=[],o=[],n=[],r=new Set,m=[];let l=0;const a=new Set;for(const h of t.items){const t=h.uid;if(a.has(t))continue;a.add(t),l++;const n=this._items.get(t),c=e(h);if(r.add(t),n){const t=n.update(h,c,l),e=n.updateDensificationResolution(this._resolution);t&&m.push(this._updateItem(n,s)),(t||e)&&o.push(n);continue}const u=this._store.createDisplayIdForObjectId(t),p=d.fromGraphic(h,c,l,u);p.updateDensificationResolution(this._resolution),m.push(this._updateItem(p,s)),this._items.set(p.objectId,p),i.push(p)}for(const[h,c]of this._items.entries())r.has(h)||(this._store.releaseDisplayIdForObjectId(h),this._items.delete(h),n.push(c));return await Promise.all(m),this._index=null,new y(i,o,n)}updateLevel(t){if(this._resolution===t)return!1;this._index=null,this._boundsDirty=!0,this._resolution=t;for(const e of this.items())if(e.hasCurvedGeoemtry)return!0;return!1}hitTest(t,e,r,l){let a=i(),h=i();const d=I(e,null);if(!d)return console.warn("Unexpected hittest input:",e),[];let y=0,g=_(t,d.input);if(g=g.map(t=>new s(m(t.x,this._tileInfoView.spatialReference),t.y,this._tileInfoView.spatialReference)),"rect"===d.hittestType||"polygon"===d.hittestType){const{xmin:t,ymin:e,xmax:s,ymax:i}=b([g.map(t=>[t.x,t.y])]);a=o(t,e,s,i),h=a}else if("point"===d.hittestType){const t=has("esri-mobile"),e=t?u:p,s=e+(t?0:c),i=g[0].x,n=g[0].y,m=r*window.devicePixelRatio*s;a=o(i-m,n-m,i+m,n+m);const l=r*window.devicePixelRatio*e,d=o(i-l,n-l,i+l,n+l),_=.5*r*(s+f);h=o(i-_,n-_,i+_,n+_),y=d[2]-d[0]}const w=this._searchIndex(h[0],h[1],h[2],h[3]);if(!w||0===w.length)return[];const j=[],R=i(),S=i();for(const s of w){if(!s.visible)continue;const{geometryBounds:t,symbolResource:e}=s;this._getSymbolBounds(R,e,t,S,l),S[3]=S[2]=S[1]=S[0]=0,n(R,a)&&j.push(s)}if(0===j.length)return[];const B=this._hittestDrawHelper,D=[];for(const s of j){const{projectedGeometry:t,symbolResource:e}=s;if(!e)continue;const{textInfo:i,symbolInfo:o}=e,n=o.cimSymbol,m=o.linearCIM.some(t=>"alignment"in t&&0===t.alignment),a={hittestType:d.hittestType,textInfo:i,mapRotation:l,resolution:r,searchDist:y,isScreenAligned:m};B.hitTest(g,n.symbol,t,a)&&D.push(s)}return D.sort(x),D.map(t=>t.objectId)}queryItems(t){return 0===this._items.size?[]:this._searchForItems(t)}clear(){this._items.clear(),this._index=null}async _updateItem(t,e){await t.projectAndNormalize(this._outSpatialReference),await e(t);const{size:s}=t;s[0]=s[1]=s[2]=s[3]=0,this._getSymbolBounds(t.symbolBounds,t.symbolResource,t.geometryBounds,t.size,0)}_searchIndex(t,s,i,o){return this._boundsDirty&&(this._items.forEach(t=>this._getSymbolBounds(t.symbolBounds,t.symbolResource,t.geometryBounds,t.size,0)),this._boundsDirty=!1),this._index||(this._index=e(9,t=>({minX:t.symbolBounds[0],minY:t.symbolBounds[1],maxX:t.symbolBounds[2],maxY:t.symbolBounds[3]})),this._index.load(Array.from(this._items.values()))),this._index.search({minX:t,minY:s,maxX:i,maxY:o})}_searchForItems(t){const e=this._tileInfoView.spatialReference,s=t.bounds,o=l(e);if(o&&e.isWrappable){const[e,n]=o.valid,r=Math.abs(s[2]-n)<g,m=Math.abs(s[0]-e)<g;if((!r||!m)&&(r||m)){const o=t.resolution;let m;m=i(r?[e,s[1],e+o*f,s[3]]:[n-o*f,s[1],n,s[3]]);const l=this._searchIndex(s[0],s[1],s[2],s[3]),a=this._searchIndex(m[0],m[1],m[2],m[3]);return[...new Set([...l,...a])]}}return this._searchIndex(s[0],s[1],s[2],s[3])}_getSymbolBounds(e,s,o,n,m){if(!s||!s.symbolInfo.linearCIM)return null;if(e||(e=i()),r(e,o),!n||0===n[0]&&0===n[1]&&0===n[2]&&0===n[3]){const{textInfo:e,symbolInfo:i}=s,o=i.cimSymbol;n||(n=[0,0,0,0]);const r=h.getSymbolInflateSize(n,o.symbol,this._cimResourceManager,m,e);n[0]=t(r[0]),n[1]=t(r[1]),n[2]=t(r[2]),n[3]=t(r[3])}const l=this._resolution,a=h.safeSize(n);return e[0]-=a*l,e[1]-=a*l,e[2]+=a*l,e[3]+=a*l,e}}export{w as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import i from"../../../../../core/Error.js";import n from"../../../../../core/Logger.js";import{convertUnit as e,unitFromUnitWkid as t,getUnitString as s}from"../../../../../core/units.js";import{dist as o,set as h,subtract as r,len as l,scale as m,equals as _}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as d,create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isPolygon as g}from"../../../../../geometry/support/jsonTypeUtils.js";import u from"../../../../../layers/support/FieldsIndex.js";import{createRendererExpression as x}from"../../../../../support/ArcadeExpression.js";import{fromCIMHorizontalAlignment as c,fromCIMVerticalAlignment as P,fromCIMFontDecoration as p}from"../../../../../symbols/cim/utils.js";import b from"../../../arcade/callExpressionWithFeature.js";import{magicLabelLineHeight as f}from"../../../engine/webgl/definitions.js";import y from"../../../engine/webgl/Rect.js";import{shapeTextResource as D}from"../../../engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as L,getLineWidth as S}from"../../graphics/graphicsUtils.js";import{initializeDimensionStyleDefaults as M}from"./dimensionStyleDefaults.js";import{normalizeExtensionAngle as T,DimensionRealFieldName as w,queryPointOnLine as k,angleFromXAxis as E,capDimensionExtensionAngle as R,intersectLinesByPointsAndAngles as A,projectLinearDimensionPoints as v,measureMarkerSymbolSize as F,translateRect as N,scaleRect as B,rotatePoint as j,rectsOverlap as I,rectsOverlapOnAxis as O}from"./dimensionUtils.js";import{getAttributeValue as z}from"./utils.js";class U{static async create(i,n,e){const t=new U(i,e);return await t.initialize(n,e),t}constructor(i,n){if(this._dimensionStyle=i,this._spatialReference=n,this._textString=null,this._displayExtLines=!0,this._systemLength=0,this._dimensionAngleRad=0,this._dimensionLength=0,this._dimensionDirection=null,this._textSize=null,this._textLength=null,this._extAngleRad=Math.PI/2,this._dimensionType=0,this._compiledExpression=null,this._fieldsIndex=null,this._textResource=null,this._beginBaselinePoint=null,this._endBaselinePoint=null,this._dimensionLinePoint=null,this._beginDimensionPoint=null,this._endDimensionPoint=null,this._beginMarkerLength=0,this._endMarkerLength=0,this._textPoint=null,this._dimensionPolyline=null,this._dimensionExtensionLines=null,this._hasTextPoint=!1,this._doMarkersFit=!0,this._dimensionIsEvaluated=!1,null==i)throw new Error("dimension syle must be defined!");M(i)}async initialize(e,t){if(!this._dimensionStyle)return;const{attributes:s}=e;if("Expression"===(this._dimensionStyle.textOption??"None")){const{expression:s,expressionParserName:o}=this._dimensionStyle;s&&o&&"arcade"===o.toLowerCase()?(this._compiledExpression=await x(s,t),this._fieldsIndex=X(e)):n.getLogger("esri.layers.DimensionFeatureLayer").warn(new i("dimension-layer:unsupported-expression","Only Arcade expressions are supported",{expressionType:o,expression:s}))}this._extAngleRad=T(z(w.extAngle,s)),this._dimensionType=1===Number(z(w.dimType,s))?1:0,this._systemLength=Number(z("__SYSTEM_LENGTH__",s));const{geometry:o}=e;if(o&&!g(o))throw new i("dimension-layer","processed geometry must be a valid 'polygon'.");const h=o?.rings[0];if(!h||h.length<3)throw new i("dimension-layer","processed geometry must have at least 3 points.");this._hasTextPoint=null!=h[3]&&0!==h[3][0]&&0!==h[3][1]&&void 0!==h[3][0]&&void 0!==h[3][1],this._hasTextPoint&&(this._textPoint=h[3]);const r=this._dimensionStyle.textSymbol;s.__DIMENSION_ANGLE__+=r?.angle??0}getTextString(i){return null==this._textString&&(this._textString=this._getDimensionText(i)),this._textString}get textSymbol(){return this._dimensionStyle.textSymbol??null}setTextResource(i){this._textResource=i??null}get beginBaselinePoint(){return this._beginBaselinePoint}get endBaselinePoint(){return this._endBaselinePoint}get beginDimensionPoint(){return this._beginDimensionPoint}get endDimensionPoint(){return this._endDimensionPoint}get textPoint(){return this._textPoint}get dimensionLine(){return this._dimensionPolyline}get extensionLines(){return this._displayExtLines?this._dimensionExtensionLines:null}evaluateWithGeometry(i,n){this._dimensionIsEvaluated||(this._computeDimensionLineInfo(i,n),this._evaluateDefaultPlacement(n),this._updateExtensionLines(n),this._updateTextPoint(n),this._offsetTextPoint(n),this._dimensionIsEvaluated=!0)}_updateTextPoint(i){if(this._hasTextPoint)return;const{textFit:n}=this._dimensionStyle;if(!this._doMarkersFit){if("None"===n||null==this._textLength)return;if(this._textLength>this._dimensionLength){const i=this._textLength/2;"MoveBegin"===n?(this._textPoint=k(this._beginDimensionPoint,this._endDimensionPoint,-(i+this._beginMarkerLength/2)),this._extendDimensionLineForMovedText("begin",this._beginMarkerLength/2+this._textLength)):"MoveEnd"===n&&(this._textPoint=k(this._endDimensionPoint,this._beginDimensionPoint,-(i+this._endMarkerLength/2)),this._extendDimensionLineForMovedText("end",this._endMarkerLength/2+this._textLength))}}}_extendDimensionLineForMovedText(i,n){if(this._dimensionPolyline?.length)if("begin"===i){const i=k(this._beginDimensionPoint,this._endDimensionPoint,-n);this._dimensionPolyline[0]=[i,this._beginDimensionPoint]}else{const i=k(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+n);this._dimensionPolyline[1]=[i,this._endDimensionPoint]}}_offsetTextPoint(i){if(this._hasTextPoint)return;const n=this._textPoint;if(!n)return;const e=.5*this._textSize*i,t=-e*this._dimensionDirection[1],s=e*this._dimensionDirection[0];n[0]+=t,n[1]+=s}_updateExtensionLines(i){if(!(this._displayExtLines&&this._beginDimensionPoint&&this._dimensionLinePoint&&this._endDimensionPoint))return;const{extensionLineOvershot:n,extensionLineOffset:e}=this._dimensionStyle;let t=this._dimensionLinePoint,s=this._endDimensionPoint;null==n||isNaN(n)||0===n||(t=k(this._dimensionLinePoint,this._beginBaselinePoint,-n*i),s=k(this._endDimensionPoint,this._endBaselinePoint,-n*i));let h=this._beginBaselinePoint,r=this._endBaselinePoint;if(null!=e&&!isNaN(e)&&0!==e){const i=o(t,this._beginBaselinePoint),n=o(s,this._endBaselinePoint);h=k(t,this._beginBaselinePoint,i-e),r=k(s,this._endBaselinePoint,n-e)}this._dimensionExtensionLines=[[t,h],[s,r]]}_computeDimensionLineInfo(n,e){if(!n||!g(n)||n.rings[0].length<3)throw new i("DimensionLayerView: bad geometry","Dimension cann't be applied to an empty geometry!");const t=n.rings[0],s=d(t[0][0],t[0][1]),o=d(t[1][0],t[1][1]),_=d(t[2][0],t[2][1]);this._beginBaselinePoint=h(a(),s[0],s[1]),this._endBaselinePoint=h(a(),o[0],o[1]),this._dimensionLinePoint=_,1===this._dimensionType?this._computeLinearDimensionPoints(s,o,_):this._computeAlignedDimensionPoints(s,o,_);const u=this._beginDimensionPoint,x=this._endDimensionPoint;if(!u||!x)throw new i("DimensionLayerView: bad geometry","Failed to construct the dimension line!");this._dimensionDirection=r(a(),x,u),this._dimensionAngleRad=E(this._dimensionDirection),this._dimensionLength=l(this._dimensionDirection),this._dimensionDirection=m(this._dimensionDirection,this._dimensionDirection,1/this._dimensionLength),this._hasTextPoint||(this._textPoint=k(u,x,this._dimensionLength/2))}_computeAlignedDimensionPoints(n,e,t){const s=R(this._extAngleRad);if(_(n,t))return this._beginDimensionPoint=h(a(),n[0],n[1]),this._endDimensionPoint=h(a(),e[0],e[1]),void(this._displayExtLines=!1);const o=E([e[0]-n[0],e[1]-n[1]]),r=A(t,o,e,o+s);if(!r)throw new i("DimensionLayerView: bad geometry","Failed to construct dimension extension lines!");this._beginDimensionPoint=h(a(),t[0],t[1]),this._endDimensionPoint=h(a(),r[0],r[1])}_computeLinearDimensionPoints(i,n,e){const t=v(i,n,e,this._extAngleRad);if(!t)return this._beginDimensionPoint=h(a(),i[0],i[1]),this._endDimensionPoint=h(a(),n[0],n[1]),void(this._displayExtLines=!1);this._beginDimensionPoint=t.beginDimensionPoint,this._endDimensionPoint=t.endDimensionPoint}_evaluateDefaultPlacement(i){const{beginMarkerSymbol:n,endMarkerSymbol:e}=this._dimensionStyle,t=F(n,this._dimensionAngleRad),s=F(e,this._dimensionAngleRad+Math.PI),o=F(n,0),h=F(e,Math.PI);this._measureDimensionText(this._textString||"",this._textPoint,i),this._beginMarkerLength=i*(o?.width??0),this._endMarkerLength=i*(h?.width??0);const r=t&&this._beginDimensionPoint?N(B(t,i),this._beginDimensionPoint[0],this._beginDimensionPoint[1]):null,l=s&&this._endDimensionPoint?N(B(s,i),this._endDimensionPoint[0],this._endDimensionPoint[1]):null;if(this._doMarkersFit=this._checkMarkerFit(r,l,i),this._doMarkersFit){const i=k(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength/2);this._dimensionPolyline=[[i,this._beginDimensionPoint],[i,this._endDimensionPoint]]}else{const i=k(this._beginDimensionPoint,this._endDimensionPoint,-2*this._beginMarkerLength),n=k(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+2*this._endMarkerLength);this._dimensionPolyline=[[i,this._beginDimensionPoint],[n,this._endDimensionPoint]]}}_checkMarkerFit(i,n,e){if(!i||!n)return!1;const{markerFit:t,markerOption:s,markerFitTolerance:o}=this._dimensionStyle;if("None"===t)return!0;let h=!0;const r=(i,n)=>I(i,n)||O(i,n,this._dimensionDirection);if("Tolerance"===t)o*e>=this._dimensionLength&&(h=!1);else{if(this._hasTextPoint&&"Both"!==s)return!0;if(this._hasTextPoint&&"Both"===s)r(i,n)&&(h=!1);else{h=this._beginMarkerLength+this._endMarkerLength+(this._textLength??0)<=this._dimensionLength}}return h}_measureDimensionText(i,n,e){if(null==this._textString||null==n||null==this._textResource)return null;const t=this._dimensionStyle.textSymbol;if(!t)return null;const s=c(t.horizontalAlignment),o=P(t.verticalAlignment),h=p(t),r=L(t.height||10);this._textSize="glyphs"===this._textResource.type?r:Math.max(r,...this._textResource.runs.map(i=>L(i.fontSize||0)));const l=!0,m=t.angle||0,_="glyphs"===this._textResource.type?this._textResource.sdfSize:this._textResource.runs[0]?.glyphs.sdfSize;if(!_)return null;const d=r/_,a=S(t.lineWidth),g=Math.max(.25,Math.min(r||1,4)),u=f*g,x=D(this._textResource,{scale:d,angle:m,xOffset:0,yOffset:0,horizontalAlignment:s,verticalAlignment:o,decoration:h,lineHeight:u,lineHeightRatio:g,useCIMAngleBehavior:l,maxLineWidth:a,hasBackground:!1}),b=n;if(!b)return null;const M=e,T=[x.bounds.blX,x.bounds.trY],w=[x.bounds.trX,x.bounds.trY],k=[x.bounds.blX,x.bounds.blY],E=[x.bounds.trX,x.bounds.blY];T[0]-=x.bounds.x,T[1]-=x.bounds.y,w[0]-=x.bounds.x,w[1]-=x.bounds.y,k[0]-=x.bounds.x,k[1]-=x.bounds.y,E[0]-=x.bounds.x,E[1]-=x.bounds.y,T[0]*=M,T[1]*=M,w[0]*=M,w[1]*=M,k[0]*=M,k[1]*=M,E[0]*=M,E[1]*=M,this._textLength=1.1*(Math.max(T[0],w[0],k[0],E[0])-Math.min(T[0],w[0],k[0],E[0])),this._dimensionAngleRad&&(j(T,this._dimensionAngleRad),j(w,this._dimensionAngleRad),j(k,this._dimensionAngleRad),j(E,this._dimensionAngleRad)),T[0]+=b[0],T[1]+=b[1],w[0]+=b[0],w[1]+=b[1],k[0]+=b[0],k[1]+=b[1],E[0]+=b[0],E[1]+=b[1];const R=Math.min(T[0],w[0],k[0],E[0]),A=Math.min(T[1],w[1],k[1],E[1]),v=Math.max(T[0],w[0],k[0],E[0]),F=Math.max(T[1],w[1],k[1],E[1]);return new y(R,A,1.1*(v-R),1.1*(F-A))}_getDimensionText(i){const{attributes:n}=i;let e=null;const t=1===Number(z(w.useCustomLength,n));e=Number(z(t?w.customLength:w.dimLength,n)),(0===e||isNaN(e)||null==e)&&(e=this._systemLength);let s=this._getDimensionString(e,i);return"number"==typeof s&&(s=s.toString()),n.__COMPUTED_TEXT_STRING__=s,s||""}_getDimensionString(i,n){const{displayUnits:t,displayPrecision:s,prefix:o,suffix:h,textOption:r}=this._dimensionStyle;if("None"===r)return null;if("Expression"===r&&this._compiledExpression&&n)return b(this._compiledExpression,n,{},"esriGeometryPolyline",this._fieldsIndex);if(t){const n=G(this._spatialReference),s=G(t);n&&s&&(i=e(i,n,s))}let l=(i=null==s||isNaN(s)?parseFloat(i.toString()):parseFloat(i.toFixed(s))).toString();return"Suffix"===r&&(o&&(l=`${o} ${l}`),h&&(l=`${l} ${h}`)),l}}function G(i){return"object"!=typeof i||null==i?null:"uwkid"in i&&"number"==typeof i.uwkid?t(i.uwkid):s(i)}function X(i){const{attributes:n}=i,e=Object.keys(w).map(i=>({name:i,alias:i,type:"string"==typeof n[i]?"esriFieldTypeString":"esriFieldTypeDouble"}));return new u(e)}export{U as default};
|
|
2
|
+
import{convert as i,toLengthUnit as n,getSpatialReferenceUnit as e}from"../../../../../arcade/geometry/unitConversion.js";import t from"../../../../../core/Error.js";import s from"../../../../../core/Logger.js";import{dist as o,set as r,subtract as h,len as l,scale as m,equals as _}from"../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as d,create as a}from"../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{isPolygon as u}from"../../../../../geometry/support/jsonTypeUtils.js";import g from"../../../../../layers/support/FieldsIndex.js";import{createRendererExpression as c}from"../../../../../support/ArcadeExpression.js";import{fromCIMHorizontalAlignment as x,fromCIMVerticalAlignment as P,fromCIMFontDecoration as p}from"../../../../../symbols/cim/utils.js";import f from"../../../arcade/callExpressionWithFeature.js";import{magicLabelLineHeight as b}from"../../../engine/webgl/definitions.js";import y from"../../../engine/webgl/Rect.js";import{shapeTextResource as D}from"../../../engine/webgl/mesh/templates/shapingUtils.js";import{roundPtToWholePixel as L,getLineWidth as S}from"../../graphics/graphicsUtils.js";import{initializeDimensionStyleDefaults as M}from"./dimensionStyleDefaults.js";import{normalizeExtensionAngle as T,DimensionRealFieldName as w,queryPointOnLine as k,angleFromXAxis as E,capDimensionExtensionAngle as R,intersectLinesByPointsAndAngles as v,projectLinearDimensionPoints as A,measureMarkerSymbolSize as F,translateRect as N,scaleRect as B,rotatePoint as j,rectsOverlap as I,rectsOverlapOnAxis as O}from"./dimensionUtils.js";import{getAttributeValue as z}from"./utils.js";class U{static async create(i,n,e,t=e){const s=new U(i,e,t);return await s.initialize(n,e),s}constructor(i,n,e){if(this._dimensionStyle=i,this._viewSpatialReference=n,this._sourceSpatialReference=e,this._textString=null,this._displayExtLines=!0,this._systemLength=0,this._dimensionAngleRad=0,this._dimensionLength=0,this._dimensionDirection=null,this._textSize=null,this._textLength=null,this._extAngleRad=Math.PI/2,this._dimensionType=0,this._compiledExpression=null,this._fieldsIndex=null,this._textResource=null,this._beginBaselinePoint=null,this._endBaselinePoint=null,this._dimensionLinePoint=null,this._beginDimensionPoint=null,this._endDimensionPoint=null,this._beginMarkerLength=0,this._endMarkerLength=0,this._textPoint=null,this._dimensionPolyline=null,this._dimensionExtensionLines=null,this._hasTextPoint=!1,this._doMarkersFit=!0,this._dimensionIsEvaluated=!1,null==i)throw new Error("dimension syle must be defined!");M(i)}async initialize(i,n){if(!this._dimensionStyle)return;const{attributes:e}=i;if("Expression"===(this._dimensionStyle.textOption??"None")){const{expression:e,expressionParserName:o}=this._dimensionStyle;e&&o&&"arcade"===o.toLowerCase()?(this._compiledExpression=await c(e,n),this._fieldsIndex=Y(i)):s.getLogger("esri.layers.DimensionFeatureLayer").warn(new t("dimension-layer:unsupported-expression","Only Arcade expressions are supported",{expressionType:o,expression:e}))}this._extAngleRad=T(z(w.extAngle,e)),this._dimensionType=1===Number(z(w.dimType,e))?1:0,this._systemLength=Number(z("__SYSTEM_LENGTH__",e));const{geometry:o}=i;if(o&&!u(o))throw new t("dimension-layer","processed geometry must be a valid 'polygon'.");const r=o?.rings[0];if(!r||r.length<3)throw new t("dimension-layer","processed geometry must have at least 3 points.");this._hasTextPoint=null!=r[3]&&0!==r[3][0]&&0!==r[3][1]&&void 0!==r[3][0]&&void 0!==r[3][1],this._hasTextPoint&&(this._textPoint=r[3]);const h=this._dimensionStyle.textSymbol;e.__DIMENSION_ANGLE__+=h?.angle??0}getTextString(i){return null==this._textString&&(this._textString=this._getDimensionText(i)),this._textString}get textSymbol(){return this._dimensionStyle.textSymbol??null}setTextResource(i){this._textResource=i??null}get beginBaselinePoint(){return this._beginBaselinePoint}get endBaselinePoint(){return this._endBaselinePoint}get beginDimensionPoint(){return this._beginDimensionPoint}get endDimensionPoint(){return this._endDimensionPoint}get textPoint(){return this._textPoint}get dimensionLine(){return this._dimensionPolyline}get extensionLines(){return this._displayExtLines?this._dimensionExtensionLines:null}evaluateWithGeometry(i,n){this._dimensionIsEvaluated||(this._computeDimensionLineInfo(i,n),this._evaluateDefaultPlacement(n),this._updateExtensionLines(n),this._updateTextPoint(n),this._offsetTextPoint(n),this._dimensionIsEvaluated=!0)}_updateTextPoint(i){if(this._hasTextPoint)return;const{textFit:n}=this._dimensionStyle;if(!this._doMarkersFit){if("None"===n||null==this._textLength)return;if(this._textLength>this._dimensionLength){const i=this._textLength/2;"MoveBegin"===n?(this._textPoint=k(this._beginDimensionPoint,this._endDimensionPoint,-(i+this._beginMarkerLength/2)),this._extendDimensionLineForMovedText("begin",this._beginMarkerLength/2+this._textLength)):"MoveEnd"===n&&(this._textPoint=k(this._endDimensionPoint,this._beginDimensionPoint,-(i+this._endMarkerLength/2)),this._extendDimensionLineForMovedText("end",this._endMarkerLength/2+this._textLength))}}}_extendDimensionLineForMovedText(i,n){if(this._dimensionPolyline?.length)if("begin"===i){const i=k(this._beginDimensionPoint,this._endDimensionPoint,-n);this._dimensionPolyline[0]=[i,this._beginDimensionPoint]}else{const i=k(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+n);this._dimensionPolyline[1]=[i,this._endDimensionPoint]}}_offsetTextPoint(i){if(this._hasTextPoint)return;const n=this._textPoint;if(!n)return;const e=.5*this._textSize*i,t=-e*this._dimensionDirection[1],s=e*this._dimensionDirection[0];n[0]+=t,n[1]+=s}_updateExtensionLines(i){if(!(this._displayExtLines&&this._beginDimensionPoint&&this._dimensionLinePoint&&this._endDimensionPoint))return;const{extensionLineOvershot:n,extensionLineOffset:e}=this._dimensionStyle;let t=this._dimensionLinePoint,s=this._endDimensionPoint;null==n||isNaN(n)||0===n||(t=k(this._dimensionLinePoint,this._beginBaselinePoint,-n*i),s=k(this._endDimensionPoint,this._endBaselinePoint,-n*i));let r=this._beginBaselinePoint,h=this._endBaselinePoint;if(null!=e&&!isNaN(e)&&0!==e){const i=o(t,this._beginBaselinePoint),n=o(s,this._endBaselinePoint);r=k(t,this._beginBaselinePoint,i-e),h=k(s,this._endBaselinePoint,n-e)}this._dimensionExtensionLines=[[t,r],[s,h]]}_computeDimensionLineInfo(i,n){if(!i||!u(i)||i.rings[0].length<3)throw new t("DimensionLayerView: bad geometry","Dimension cann't be applied to an empty geometry!");const e=i.rings[0],s=d(e[0][0],e[0][1]),o=d(e[1][0],e[1][1]),_=d(e[2][0],e[2][1]);this._beginBaselinePoint=r(a(),s[0],s[1]),this._endBaselinePoint=r(a(),o[0],o[1]),this._dimensionLinePoint=_,1===this._dimensionType?this._computeLinearDimensionPoints(s,o,_):this._computeAlignedDimensionPoints(s,o,_);const g=this._beginDimensionPoint,c=this._endDimensionPoint;if(!g||!c)throw new t("DimensionLayerView: bad geometry","Failed to construct the dimension line!");this._dimensionDirection=h(a(),c,g),this._dimensionAngleRad=E(this._dimensionDirection),this._dimensionLength=l(this._dimensionDirection),this._dimensionDirection=m(this._dimensionDirection,this._dimensionDirection,1/this._dimensionLength),this._hasTextPoint||(this._textPoint=k(g,c,this._dimensionLength/2))}_computeAlignedDimensionPoints(i,n,e){const s=R(this._extAngleRad);if(_(i,e))return this._beginDimensionPoint=r(a(),i[0],i[1]),this._endDimensionPoint=r(a(),n[0],n[1]),void(this._displayExtLines=!1);const o=E([n[0]-i[0],n[1]-i[1]]),h=v(e,o,n,o+s);if(!h)throw new t("DimensionLayerView: bad geometry","Failed to construct dimension extension lines!");this._beginDimensionPoint=r(a(),e[0],e[1]),this._endDimensionPoint=r(a(),h[0],h[1])}_computeLinearDimensionPoints(i,n,e){const t=A(i,n,e,this._extAngleRad);if(!t)return this._beginDimensionPoint=r(a(),i[0],i[1]),this._endDimensionPoint=r(a(),n[0],n[1]),void(this._displayExtLines=!1);this._beginDimensionPoint=t.beginDimensionPoint,this._endDimensionPoint=t.endDimensionPoint}_evaluateDefaultPlacement(i){const{beginMarkerSymbol:n,endMarkerSymbol:e}=this._dimensionStyle,t=F(n,this._dimensionAngleRad),s=F(e,this._dimensionAngleRad+Math.PI),o=F(n,0),r=F(e,Math.PI);this._measureDimensionText(this._textString||"",this._textPoint,i),this._beginMarkerLength=i*(o?.width??0),this._endMarkerLength=i*(r?.width??0);const h=t&&this._beginDimensionPoint?N(B(t,i),this._beginDimensionPoint[0],this._beginDimensionPoint[1]):null,l=s&&this._endDimensionPoint?N(B(s,i),this._endDimensionPoint[0],this._endDimensionPoint[1]):null;if(this._doMarkersFit=this._checkMarkerFit(h,l,i),this._doMarkersFit){const i=k(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength/2);this._dimensionPolyline=[[i,this._beginDimensionPoint],[i,this._endDimensionPoint]]}else{const i=k(this._beginDimensionPoint,this._endDimensionPoint,-2*this._beginMarkerLength),n=k(this._beginDimensionPoint,this._endDimensionPoint,this._dimensionLength+2*this._endMarkerLength);this._dimensionPolyline=[[i,this._beginDimensionPoint],[n,this._endDimensionPoint]]}}_checkMarkerFit(i,n,e){if(!i||!n)return!1;const{markerFit:t,markerOption:s,markerFitTolerance:o}=this._dimensionStyle;if("None"===t)return!0;let r=!0;const h=(i,n)=>I(i,n)||O(i,n,this._dimensionDirection);if("Tolerance"===t)o*e>=this._dimensionLength&&(r=!1);else{if(this._hasTextPoint&&"Both"!==s)return!0;if(this._hasTextPoint&&"Both"===s)h(i,n)&&(r=!1);else{r=this._beginMarkerLength+this._endMarkerLength+(this._textLength??0)<=this._dimensionLength}}return r}_measureDimensionText(i,n,e){if(null==this._textString||null==n||null==this._textResource)return null;const t=this._dimensionStyle.textSymbol;if(!t)return null;const s=x(t.horizontalAlignment),o=P(t.verticalAlignment),r=p(t),h=L(t.height||10);this._textSize="glyphs"===this._textResource.type?h:Math.max(h,...this._textResource.runs.map(i=>L(i.fontSize||0)));const l=!0,m=t.angle||0,_="glyphs"===this._textResource.type?this._textResource.sdfSize:this._textResource.runs[0]?.glyphs.sdfSize;if(!_)return null;const d=h/_,a=S(t.lineWidth),u=Math.max(.25,Math.min(h||1,4)),g=b*u,c=D(this._textResource,{scale:d,angle:m,xOffset:0,yOffset:0,horizontalAlignment:s,verticalAlignment:o,decoration:r,lineHeight:g,lineHeightRatio:u,useCIMAngleBehavior:l,maxLineWidth:a,hasBackground:!1}),f=n;if(!f)return null;const M=e,T=[c.bounds.blX,c.bounds.trY],w=[c.bounds.trX,c.bounds.trY],k=[c.bounds.blX,c.bounds.blY],E=[c.bounds.trX,c.bounds.blY];T[0]-=c.bounds.x,T[1]-=c.bounds.y,w[0]-=c.bounds.x,w[1]-=c.bounds.y,k[0]-=c.bounds.x,k[1]-=c.bounds.y,E[0]-=c.bounds.x,E[1]-=c.bounds.y,T[0]*=M,T[1]*=M,w[0]*=M,w[1]*=M,k[0]*=M,k[1]*=M,E[0]*=M,E[1]*=M,this._textLength=1.1*(Math.max(T[0],w[0],k[0],E[0])-Math.min(T[0],w[0],k[0],E[0])),this._dimensionAngleRad&&(j(T,this._dimensionAngleRad),j(w,this._dimensionAngleRad),j(k,this._dimensionAngleRad),j(E,this._dimensionAngleRad)),T[0]+=f[0],T[1]+=f[1],w[0]+=f[0],w[1]+=f[1],k[0]+=f[0],k[1]+=f[1],E[0]+=f[0],E[1]+=f[1];const R=Math.min(T[0],w[0],k[0],E[0]),v=Math.min(T[1],w[1],k[1],E[1]),A=Math.max(T[0],w[0],k[0],E[0]),F=Math.max(T[1],w[1],k[1],E[1]);return new y(R,v,1.1*(A-R),1.1*(F-v))}_getDimensionText(i){const{attributes:n}=i;let e=null,t=this._sourceSpatialReference;const s=1===Number(z(w.useCustomLength,n));e=Number(z(s?w.customLength:w.dimLength,n)),(0===e||isNaN(e)||null==e)&&(e=this._systemLength,t=this._viewSpatialReference);let o=this._getDimensionString(e,t,i);return"number"==typeof o&&(o=o.toString()),n.__COMPUTED_TEXT_STRING__=o,o||""}_getDimensionString(n,e,t){const{displayUnits:s,displayPrecision:o,prefix:r,suffix:h,textOption:l}=this._dimensionStyle;if("None"===l)return null;if("Expression"===l&&this._compiledExpression&&t)return f(this._compiledExpression,t,{},"esriGeometryPolyline",this._fieldsIndex);if(s){const t=C(e),o=C(s);t&&o&&(n=i(t,o,n))}let m=(n=null==o||isNaN(o)?parseFloat(n.toString()):parseFloat(n.toFixed(o))).toString();return"Suffix"===l&&(r&&(m=`${r} ${m}`),h&&(m=`${m} ${h}`)),m}}function C(i){return"object"!=typeof i||null==i?null:G(i)?X(n(i.uwkid)):X(e(i))}function G(i){return"uwkid"in i&&"number"==typeof i.uwkid}function X(i){return"linear"===i?.type?{...i,type:"linear"}:null}function Y(i){const{attributes:n}=i,e=Object.keys(w).map(i=>({name:i,alias:i,type:"string"==typeof n[i]?"esriFieldTypeString":"esriFieldTypeDouble"}));return new g(e)}export{U as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{polygonContainsPoint as t,extentContainsPoint as e,ringsContainsCoords as o}from"../../../geometry/support/contains.js";const r=t=>parseFloat(t)/100;function n(t,e,o){const n="string"==typeof t.left?r(t.left)*e:t.left??0,m="string"==typeof t.right?r(t.right)*e:t.right??0,y="string"==typeof t.top?r(t.top)*o:t.top??0,a="string"==typeof t.bottom?r(t.bottom)*o:t.bottom??0,i=y;return{xmin:n,xmax:Math.max(e-m,n),ymin:i,ymax:Math.max(o-a,y)}}function m(r,m,y,a){switch(m.type){case"rect":{const{width:t,height:e}=r,{xmin:o,xmax:a,ymin:i,ymax:p}=n(m,t,e),{x:g,y:s}=y;return g>o&&g<a&&s>i&&s<p}case"path":return 0===m.path.length||!Array.isArray(m.path[0][0])||o(m.path,[y.x,y.y]);case"geometry":return null==m.geometry||("polygon"===m.geometry.type?t(m.geometry,a):e(m.geometry,a))}}export{m as clipContainsPoint,n as createScreenExtent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../Graphic.js";import{isSome as t}from"../../../core/arrayUtils.js";import{isIterable as r}from"../../../core/iteratorUtils.js";import{isScreenPolygon as i,isScreenRect as n,isScreenPoint as
|
|
2
|
+
import e from"../../../Graphic.js";import{isSome as t}from"../../../core/arrayUtils.js";import{isIterable as r}from"../../../core/iteratorUtils.js";import{isScreenPolygon as i,isScreenRect as n,isScreenPoint as o,createScreenPoint as a,clipRectToView as s,createScreenRect as l}from"../../../core/screenUtils.js";import p from"../../../geometry/Point.js";import{fromValues as c}from"../../../geometry/support/aaBoundingRect.js";import{targetIntersectsPolygon as f}from"../../../geometry/support/intersectsBase.js";import{clipPolygonToExtent as u}from"../../../geometry/support/polygonExtentClipping.js";import{calculateArea2D as y}from"../../../layers/raster/functions/rasterProjectionHelper.js";import{clipContainsPoint as m,createScreenExtent as h}from"./clippingUtils.js";import{isSupportedScreenPointEvent as d,createScreenPointFromSupportedEvent as g}from"../../support/screenUtils.js";function x(e,t){if(i(e))return{hittestType:"polygon",polygonMesh:null,input:e,options:t};if(n(e)){return{hittestType:"rect",input:e,options:t}}return o(e)?{hittestType:"point",input:e,options:t}:null}async function w(e,r,o){const a=!d(r)&&n(r),l=!d(r)&&i(r),c=a||l,f=a?s(r,e.width,e.height):d(r)?g(e,r):r,u=i(f)?f.length<3||f.some(({x:e,y:t})=>isNaN(e)||isNaN(t)):isNaN(f.x)||isNaN(f.y);let y=new p;if(c||(y=e.toMap(f)),!e.ready||u)return{screenPoint:null,results:[]};let m=new Set;const h=new Set;let x=!1,w=null,L=null;o?.include?j(o.include,M(e,e=>{m.add(e),V(e,e=>h.add(e))},(e,t)=>{h.add(e),m.add(t)},e=>{w||(w=new Set),w.add(e)},e=>m.add(e),()=>x=!0)):(x=!0,m=new Set(e.allLayerViews),m.forEach(e=>{V(e,e=>h.add(e))})),o?.exclude&&j(o.exclude,M(e,e=>{m.delete(e),V(e,e=>h.delete(e))},e=>h.delete(e),e=>{L||(L=new Set),L.add(e)}));const P=e.allLayerViews.filter(e=>!e.suspended&&m.has(e)).reverse(),S=x?e.graphicsView.hitTest(e,f).map(e=>({type:"graphic",graphic:e,layer:null,mapPoint:c?null:y})):[],T=Array.from(P).flatMap(t=>b(e,t,f).map(e=>t.hitTest(y,e,o)));let U=[...S,...await Promise.all(T)].filter(t).flat().filter(t);U=U.filter(e=>"graphic"!==e.type||"subtype-group"!==e.layer?.type||h.has(e.graphic.layer));const E=new Set;return U=U.filter(e=>{if("graphic"!==e.type||!e.graphic)return!0;const t=N(e.graphic);return!E.has(t)&&(E.add(t),!0)}),w&&(U=U.filter(e=>!("graphic"in e)||!e.graphic||w?.has(N(e.graphic)))),L&&(U=U.filter(e=>!("graphic"in e)||!e.graphic||!L?.has(N(e.graphic)))),{screenPoint:c?null:f,results:U}}function M(t,r,i,n,o,a){return s=>{if(s instanceof e){if(s.layer===t)a?.();else{const e=t.allLayerViews.find(e=>e.layer===s.layer);e&&o?.(e)}n(N(s))}else if("layer"in s&&"element"in s);else if("subtype-sublayer"===s.type){const e=t.allLayerViews.find(e=>e.layer===s.parent);e&&i(s,e)}else{const e=t.allLayerViews.find(e=>e.layer===s);e&&r(e)}}}function j(e,t){if(e)if(r(e))for(const i of e)if(r(i))for(const e of i)t(e);else t(i);else t(e)}function N(e){const t=e.getObjectId();return t?`${e.layer?.uid??e.sourceLayer?.uid??"MapView"}/${t}`:`"MapView/${e.uid}`}function V(e,t){const r=e.layer;"subtype-group"===r?.type&&r.sublayers.forEach(e=>{t(e)})}function b(e,t,r){const{clips:s}=t;if(!s.length)return[r];if(o(r)){const t=e.toMap(r);return s.some(i=>m(e,i,r,t))?[r]:[]}if(s.some(e=>"rect"!==e.type))return[r];const p=s.filter(e=>"rect"===e.type),d=T(r),g=[];for(const o of p){const{xmin:t,xmax:s,ymin:p,ymax:m}=h(o,e.width,e.height);if(f(d,[[[t,p],[t,m],[s,m],[s,p],[t,p]]])){const e=u(d,c(t,p,s,m));if(!(y([e.map(e=>[e[0],e[1]])])>0))continue;if(n(r)){const t=S(e.map(e=>[e]));g.push(l(t.xmin,t.ymin,t.xmax-t.xmin,t.ymax-t.ymin))}else i(r)&&g.push(e.map(e=>a(e[0],e[1])))}}return g}function L(e,t){if(i(t))return t.map(t=>e.toMap(t));if(n(t)){const r=t;return[e.toMap(a(r.x,r.y)),e.toMap(a(r.x,r.y+r.height)),e.toMap(a(r.x+r.width,r.y+r.height)),e.toMap(a(r.x+r.width,r.y))]}return[e.toMap(t)]}function P(e){return i(e)?"polygon":n(e)?"rect":o(e)?"point":null}function S(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(const o of e)for(const[e,a]of o)t=Math.min(t,e),r=Math.min(r,a),i=Math.max(i,e),n=Math.max(n,a);return{xmin:t,ymin:r,xmax:i,ymax:n}}function T(e){let t=[];if(n(e)){const{x:r,y:i,width:n,height:o}=e;t=[[r,i],[r+n,i],[r+n,i+o],[r,i+o]]}else i(e)?t=e.map(e=>[e.x,e.y]):o(e)&&(t=[[e.x,e.y]]);return t}export{x as createHittestQuery,S as getBbox,P as getHittestType,b as getLayerViewHitTargets,L as getMapPointsFromScreen,w as hitTest,T as screenTargetToPointArray};
|