@arcgis/core 4.26.0-next.20230119 → 4.26.0-next.20230121
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/arcade/ArcadeDate.js +1 -1
- package/arcade/Feature.js +1 -1
- package/arcade/featureset/support/shared.js +1 -1
- package/arcade/featureset/support/sqlUtils.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade/lib/arcade-parser.js +1 -1
- package/arcade/lib/parser.js +1 -1
- package/arcade/lib/scanner.js +1 -1
- package/arcade/lib/types.js +1 -1
- package/arcade/validation/arcadeValidator.js +1 -1
- package/arcade/validation/diagnosticMessages.js +1 -1
- package/arcade/validation/languageKeywords.js +5 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{e6c6e3c9750829ec82c1.js → 09ac51aeb0f6fe16aa30.js} +1 -1
- package/assets/esri/core/workers/chunks/293594192932f0e00ecf.js +1 -0
- package/assets/esri/core/workers/chunks/4f4064eabbbc4a66f95a.js +1 -0
- package/assets/esri/core/workers/chunks/{0417369a1d563a6280ff.js → 63706a04e173000994db.js} +1 -1
- package/assets/esri/core/workers/chunks/6a90b1d73d5941ebb112.js +1 -0
- package/assets/esri/core/workers/chunks/{0c242aa92ab4f0c996db.js → 70f1fe5f36bc4abff2d2.js} +1 -1
- package/assets/esri/core/workers/chunks/96d4c50f74a9c0dcdb66.js +1 -0
- package/assets/esri/core/workers/chunks/b26a671d3523b8a48404.js +1 -0
- package/assets/esri/core/workers/chunks/{5dfed65b615b33588488.js → db96a2dc1879b4944cb8.js} +1 -1
- package/assets/esri/core/workers/chunks/fcf033c581f58d006cf6.js +1 -0
- package/assets/esri/core/workers/chunks/{5e872adb3a5e84c49865.js → fde8827bd7f1a97a6db3.js} +1 -1
- package/assets/esri/themes/base/widgets/_Editor.scss +9 -14
- 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/languageUtils.js +1 -1
- package/core/scheduling.js +1 -1
- package/interfaces.d.ts +24 -12
- package/layers/StreamLayer.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/controllers/StreamController.js +1 -1
- package/layers/graphics/data/StreamFeatureManager.js +1 -1
- package/layers/graphics/sources/connections/GeoEventConnection.js +1 -1
- package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
- package/layers/support/FeatureReductionBinning.js +1 -1
- package/layers/support/FeatureReductionCluster.js +1 -1
- package/layers/support/StreamConnection.js +1 -1
- package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
- package/layers/support/rasterFormats/pixelRangeUtils.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/2d/interactive/editingTools/ControlPointsTransformTool.js +1 -1
- package/views/2d/interactive/editingTools/MediaTransformToolsWrapper.js +1 -1
- package/views/2d/interactive/editingTools/TransformTool.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/StreamLayerView2D.js +1 -1
- package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
- package/views/2d/layers/features/schemaUtils.js +1 -1
- package/views/2d/layers/features/sources/GeoEventSource.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/support/FeatureLayerProxy.js +1 -1
- package/views/3d/environment/EnvironmentRenderer.js +1 -1
- package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
- package/views/3d/layers/DynamicLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/I3SMeshViewLabeler.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudWorker.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/StreamLayerView3D.js +1 -1
- package/views/3d/layers/TileLayerView3D.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/layers/i3s/I3SLodHandling.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
- package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
- package/views/3d/layers/i3s/PointCloudRendererUtil.js +1 -1
- package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
- package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
- package/views/3d/layers/support/I3STreeDebugger.js +1 -1
- package/views/3d/layers/support/SceneLayerViewRequiredFields.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceReflections.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/PopupView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/interactive/SegmentLabels.js +1 -1
- package/views/layers/ImageryLayerView.js +1 -1
- package/views/layers/SceneLayerView.js +1 -1
- package/views/layers/StreamLayerView.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/Fullscreen/FullscreenViewModel.js +1 -1
- package/widgets/Home/HomeViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0efee8d9fc5632346cb4.js +0 -1
- package/assets/esri/core/workers/chunks/10e715aa4ac96d7dd1b4.js +0 -1
- package/assets/esri/core/workers/chunks/2dfb17fa5b6a5d239942.js +0 -1
- package/assets/esri/core/workers/chunks/2e3962506c353b562a88.js +0 -1
- package/assets/esri/core/workers/chunks/7320e6d8f207399bc8f1.js +0 -1
- package/assets/esri/core/workers/chunks/a194f90ffe13b3d448b0.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../request.js";import r from"../../../../core/Error.js";import s from"../../../../core/Logger.js";import{isSome as o,isNone as i,unwrapOr as n,get as a}from"../../../../core/maybe.js";import{createResolver as c}from"../../../../core/promiseUtils.js";import{addQueryParameters as u}from"../../../../core/urlUtils.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{WebSocketConnection as l}from"./WebSocketConnection.js";import{executeQuery as f}from"../../../../rest/query/operations/query.js";import h from"../../../../rest/support/Query.js";import{fromJSON as g}from"../../../../geometry/support/jsonUtils.js";import y from"../../../../geometry/SpatialReference.js";const m=1e4,p={maxQueryDepth:5,maxRecordCountFactor:3};let _=class extends l{constructor(e){super({...p,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||s.getLogger(this.declaredClass).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:o}=this._config;this.destroyed||this._setFilter(r,o)}_onMessage(e){let
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../request.js";import r from"../../../../core/Error.js";import s from"../../../../core/Logger.js";import{isSome as o,isNone as i,unwrapOr as n,get as a}from"../../../../core/maybe.js";import{createResolver as c}from"../../../../core/promiseUtils.js";import{addQueryParameters as u}from"../../../../core/urlUtils.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import"../../../../core/has.js";import{subclass as d}from"../../../../core/accessorSupport/decorators/subclass.js";import{WebSocketConnection as l}from"./WebSocketConnection.js";import{executeQuery as f}from"../../../../rest/query/operations/query.js";import h from"../../../../rest/support/Query.js";import{fromJSON as g}from"../../../../geometry/support/jsonUtils.js";import y from"../../../../geometry/SpatialReference.js";const m=1e4,p={maxQueryDepth:5,maxRecordCountFactor:3};let _=class extends l{constructor(e){super({...p,...e}),this._buddyServicesQuery=null,this._relatedFeatures=null}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||s.getLogger(this.declaredClass).warn("GeoEvent service was configured without a TrackIdField. This may result in certain functionality being disabled. The purgeOptions.maxObservations property will have no effect.");const t=this._fetchWebSocketUrl(e.streamUrls,this._config.spatialReference);this._buddyServicesQuery||(this._buddyServicesQuery=this._queryBuddyServices()),await this._buddyServicesQuery,await this._tryCreateWebSocket(t);const{filter:r,outFields:o}=this._config;this.destroyed||this._setFilter(r,o)}_onMessage(e){if("attributes"in e){let i;try{i=this._enrich(e),o(this._featureZScaler)&&this._featureZScaler(i.geometry)}catch(t){return void s.getLogger(this.declaredClass).error(new r("geoevent-connection","Failed to parse message",t))}this.onFeature(i)}else this.onMessage(e)}async _fetchServiceDefinition(e){const r={f:"json",...this._config.customParameters},s=t(e.path,{query:r,responseType:"json"}),o=(await s).data;return this._serviceDefinition=o,o}_fetchWebSocketUrl(e,t){const r=e[0],{urls:s,token:o}=r,i=this._inferWebSocketBaseUrl(s);return u(`${i}/subscribe`,{outSR:""+t.wkid,token:o})}_inferWebSocketBaseUrl(e){if(1===e.length)return e[0];for(const t of e)if(t.includes("wss"))return t;return s.getLogger(this.declaredClass).error(new r("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const o=this._websocket;if(i(o)||i(e)&&i(t))return;const n=JSON.stringify({filter:this._serializeFilter(e,t)});let a=!1;const u=c(),d=()=>{a||(this.destroyed||this._websocket!==o||s.getLogger(this.declaredClass).error(new r("geoevent-connection","Server timed out when setting filter")),u.reject())},l=e=>{const t=JSON.parse(e.data);t.filter&&(t.error&&(s.getLogger(this.declaredClass).error(new r("geoevent-connection","Failed to set service filter",t.error)),this._set("errorString",`Could not set service filter - ${t.error}`),u.reject(t.error)),o.onmessage=this._onMessage.bind(this),a=!0,u.resolve())};return o.onmessage=l,o.send(n),setTimeout(d,m),u.promise}_serializeFilter(e,t){const n={};if(i(e)&&i(t))return n;if(o(e)&&e.geometry)try{const t=g(e.geometry);if("extent"!==t.type)throw new r(`Expected extent but found type ${t.type}`);n.geometry=JSON.stringify(t.shiftCentralMeridian())}catch(a){s.getLogger(this.declaredClass).error(new r("geoevent-connection","Encountered an error when setting connection geometryDefinition",a))}return o(e)&&e.where&&"1 = 1"!==e.where&&(n.where=e.where),o(t)&&(n.outFields=t.join(",")),n}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,o=e.attributes[t],i=this._relatedFeatures.get(o);if(!i)return s.getLogger(this.declaredClass).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:n,geometry:a}=i;for(const r in n)e.attributes[r]=n[r];return a&&(e.geometry=a),e.geometry||e.centroid||s.getLogger(this.declaredClass).error(new r("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),s=this._queryArchive(t);await r;const o=await s;if(!o)return;for(const i of o.features)this.onFeature(this._enrich(i))}catch(e){s.getLogger(this.declaredClass).error(new r("geoevent-connection","Encountered an error when querying buddy services",{error:e}))}}async _queryRelatedFeatures(e){if(!e)return;const t=await this._queryBuddy(e.featuresUrl);this._addRelatedFeatures(t)}async _queryArchive(e){if(e)return this._queryBuddy(e.featuresUrl)}async _queryBuddy(e){const t=new((await import("../../../FeatureLayer.js")).default)({url:e}),{capabilities:r}=await t.load(),s=r.query.supportsMaxRecordCountFactor,o=r.query.supportsPagination,i=r.query.supportsCentroid,c=this._config.maxRecordCountFactor,u=t.capabilities.query.maxRecordCount,d=s?u*c:u,l=new h;if(l.outFields=n(this._config.outFields,["*"]),l.where=n(a(this._config.filter,"where"),"1=1"),l.returnGeometry=!0,l.returnExceededLimitFeatures=!0,l.outSpatialReference=y.fromJSON(this._config.spatialReference),i&&(l.returnCentroid=!0),s&&(l.maxRecordCountFactor=c),o)return l.num=d,t.destroy(),this._queryPages(e,l);const g=await f(e,l,this._config.sourceSpatialReference);return t.destroy(),g.data}async _queryPages(e,t,r=[],s=0){t.start=o(t.num)?s*t.num:null;const{data:i}=await f(e,t,this._config.sourceSpatialReference);return i.exceededTransferLimit&&s<(this._config.maxQueryDepth??0)?(i.features.forEach((e=>r.push(e))),this._queryPages(e,t,r,s+1)):(r.forEach((e=>i.features.push(e))),i)}_addRelatedFeatures(e){const t=new Map,r=e.features,s=this._serviceDefinition.relatedFeatures.joinField;for(const o of r){const e=o.attributes[s];t.set(e,o)}this._relatedFeatures=t}};_=e([d("esri.layers.graphics.sources.connections.GeoEventConnection")],_);const w=_;export{w 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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Error.js";import o from"../../../../core/Logger.js";import{isSome as s,isNone as r}from"../../../../core/maybe.js";import{after as n,createResolver as
|
|
5
|
+
import{_ as e}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Error.js";import o from"../../../../core/Logger.js";import{isSome as s,isNone as r}from"../../../../core/maybe.js";import{after as n,createResolver as i}from"../../../../core/promiseUtils.js";import{addQueryParameters as c}from"../../../../core/urlUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{getGeometryZScaler as d}from"../../../../geometry/support/zscale.js";import h from"../../../support/StreamConnection.js";var g;!function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"}(g||(g={}));let p=class extends h{constructor(e){super(),this._outstandingMessages=[],this.errorString=null;const{geometryType:t,spatialReference:o,sourceSpatialReference:s}=e;this._config=e,this._featureZScaler=d(t,s,o),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){super.destroy(),s(this._websocket)&&(this._websocket.onopen=null,this._websocket.onclose=null,this._websocket.onerror=null,this._websocket.onmessage=null,this._websocket.close()),this._websocket=null}get connectionStatus(){if(r(this._websocket))return"disconnected";switch(this._websocket.readyState){case g.CONNECTING:case g.OPEN:return"connected";case g.CLOSING:case g.CLOSED:return"disconnected"}}sendMessage(e){r(this._websocket)?this._outstandingMessages.push(e):this._websocket.send(JSON.stringify(e))}receiveMessage(e){this._onMessage(e)}async _tryCreateWebSocket(e=this._config.source.path,s=1e3,r=0){try{if(this.destroyed)return;const t=c(e,this._config.customParameters??{});this._websocket=await this._createWebSocket(t),this.notifyChange("connectionStatus")}catch(i){const c=s/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(o.getLogger(this.declaredClass).error(new t("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(o.getLogger(this.declaredClass).error(new t("websocket-connection",`Failed to connect. Attempting to reconnect in ${c}s`,i)),await n(s),this._tryCreateWebSocket(e,Math.min(1.5*s,1e3*this._config.maxReconnectionInterval),r+1))}}_createWebSocket(e){return new Promise(((s,r)=>{const n=new WebSocket(e);n.onopen=()=>{if(n.onopen=null,this.destroyed)return n.onclose=null,void n.close();n.onclose=e=>this._onClose(e),n.onerror=e=>this._onError(e),n.onmessage=e=>{try{const t=JSON.parse(e.data);this._onMessage(t)}catch(s){return void o.getLogger(this.declaredClass).error(new t("websocket-connection","Failed to parse message, invalid JSON",{error:s}))}},s(n)},n.onclose=e=>{n.onopen=n.onclose=null,r(e)}}))}async _handshake(e=1e4){const s=this._websocket;if(r(s))return;const n=i(),c=s.onmessage,{filter:a,outFields:l,spatialReference:d}=this._config;return n.timeout(e),s.onmessage=e=>{let r=null;try{r=JSON.parse(e.data)}catch(i){}r&&"object"==typeof r||(o.getLogger(this.declaredClass).error(new t("websocket-connection","Protocol violation. Handshake failed - malformed message",e.data)),n.reject(),this.destroy()),r.spatialReference?.wkid!==d?.wkid&&(o.getLogger(this.declaredClass).error(new t("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${d.wkid}`,e.data)),n.reject(),this.destroy()),"json"!==r.format&&(o.getLogger(this.declaredClass).error(new t("websocket-connection","Protocol violation. Handshake failed - format is not set",e.data)),n.reject(),this.destroy()),a&&r.filter!==a&&o.getLogger(this.declaredClass).error(new t("websocket-connection","Tried to set filter, but server doesn't support it")),l&&r.outFields!==l&&o.getLogger(this.declaredClass).error(new t("websocket-connection","Tried to set outFields, but server doesn't support it")),s.onmessage=c;for(const t of this._outstandingMessages)s.send(JSON.stringify(t));this._outstandingMessages=[],n.resolve()},s.send(JSON.stringify({filter:a,outFields:l,format:"json",spatialReference:{wkid:d.wkid}})),n.promise}_onMessage(e){if(this.onMessage(e),"type"in e&&"featureResult"===e.type)for(const t of e.features)s(this._featureZScaler)&&this._featureZScaler(t.geometry),this.onFeature(t)}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),o.getLogger(this.declaredClass).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),1e3!==e.code&&o.getLogger(this.declaredClass).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};e([a()],p.prototype,"connectionStatus",null),e([a()],p.prototype,"errorString",void 0),p=e([l("esri.layers.graphics.sources.connections.WebSocketConnection")],p);export{p as WebSocketConnection};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import o from"../../renderers/SimpleRenderer.js";import t from"../../renderers/UniqueValueRenderer.js";import{read as s}from"../../renderers/support/jsonUtils.js";import{rendererTypes as i}from"../../renderers/support/types.js";import{symbolTypesRenderer as p}from"../../symbols.js";import{clone as n}from"../../core/lang.js";import{setDeepValue as l}from"../../core/object.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{enumeration as d}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as m}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{writer as
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import o from"../../renderers/SimpleRenderer.js";import t from"../../renderers/UniqueValueRenderer.js";import{read as s}from"../../renderers/support/jsonUtils.js";import{rendererTypes as i}from"../../renderers/support/types.js";import{symbolTypesRenderer as p}from"../../symbols.js";import{clone as n}from"../../core/lang.js";import{setDeepValue as l}from"../../core/object.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{enumeration as d}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as m}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import{writer as c}from"../../core/accessorSupport/decorators/writer.js";import{createTypeReader as f}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import y from"./AggregateField.js";import{labelsVisible as b,popupEnabled as j}from"./commonProperties.js";import{FeatureReduction as g}from"./FeatureReduction.js";import h from"./LabelClass.js";var v;const S=f({types:p}),w="esri.layers.support.FeatureReductionBinning";let I=v=class extends g{constructor(e){super(e),this.type="binning",this.binType="geohash",this.fixedBinLevel=3,this.labelingInfo=null,this.labelsVisible=!0,this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.fields=[],this.renderer=null}writeFields(e,r,o){const t=e.filter((e=>"avg_angle"!==e.statisticType)).map((e=>e.toJSON()));l(o,t,r)}readRenderer(e,r,i){const p=r.drawingInfo?.renderer;return p?s(p,r,i)??void 0:r.defaultSymbol?r.types&&r.types.length?new t({defaultSymbol:S(r.defaultSymbol,r,i),field:r.typeIdField,uniqueValueInfos:r.types.map((e=>({id:e.id,symbol:S(e.symbol,e,i)})))}):new o({symbol:S(r.defaultSymbol,r,i)}):null}clone(){return new v({fields:n(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:n(this.labelingInfo),labelsVisible:this.labelsVisible,maxScale:this.maxScale,popupEnabled:this.popupEnabled,popupTemplate:n(this.popupTemplate),renderer:n(this.renderer)})}};e([d({binning:"binning"})],I.prototype,"type",void 0),e([d({geohash:"geohash"})],I.prototype,"binType",void 0),e([a({type:Number,range:{min:1,max:9},json:{write:!0}})],I.prototype,"fixedBinLevel",void 0),e([a({type:[h],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],I.prototype,"labelingInfo",void 0),e([a(b)],I.prototype,"labelsVisible",void 0),e([a({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],I.prototype,"maxScale",void 0),e([a(j)],I.prototype,"popupEnabled",void 0),e([a({type:r,json:{name:"popupInfo",write:!0}})],I.prototype,"popupTemplate",void 0),e([a({type:[y],json:{write:!0}})],I.prototype,"fields",void 0),e([c("fields")],I.prototype,"writeFields",null),e([a({types:i,json:{write:{target:"drawingInfo.renderer"}}})],I.prototype,"renderer",void 0),e([m("renderer",["drawingInfo.renderer"])],I.prototype,"readRenderer",null),I=v=e([u(w)],I);const x=I;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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import r from"../../PopupTemplate.js";import"../../renderers/ClassBreaksRenderer.js";import"../../renderers/DictionaryRenderer.js";import"../../renderers/DotDensityRenderer.js";import"../../renderers/HeatmapRenderer.js";import"../../renderers/PieChartRenderer.js";import"../../renderers/Renderer.js";import t from"../../renderers/SimpleRenderer.js";import o from"../../renderers/UniqueValueRenderer.js";import{read as s}from"../../renderers/support/jsonUtils.js";import{rendererTypes as i}from"../../renderers/support/types.js";import{symbolTypesRenderer as p,symbolTypesCluster as l}from"../../symbols.js";import{JSONSupport as n}from"../../core/JSONSupport.js";import{clone as a}from"../../core/lang.js";import{setDeepValue as d}from"../../core/object.js";import{toPt as u}from"../../core/screenUtils.js";import{property as m}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import{reader as c}from"../../core/accessorSupport/decorators/reader.js";import{subclass as y}from"../../core/accessorSupport/decorators/subclass.js";import{writer as f}from"../../core/accessorSupport/decorators/writer.js";import{createTypeReader as b}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import j from"./AggregateField.js";import{popupEnabled as h,labelsVisible as S}from"./commonProperties.js";import g from"./LabelClass.js";var w;const I=b({types:p}),v="esri.layers.support.FeatureReductionCluster";function x(e){return"simple"===e.type&&!e.visualVariables?.length}let R=w=class extends n{constructor(e){super(e),this.type="cluster",this.clusterRadius=u("80px"),this.clusterMinSize=u("12px"),this.clusterMaxSize=u("50px"),this.maxScale=0,this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=null}readRenderer(e,r,i){const p=r.drawingInfo?.renderer;return p?.authoringInfo?.isAutoGenerated?null:p?x(p)?null:s(p,r,i)??void 0:r.defaultSymbol?r.types&&r.types.length?new o({defaultSymbol:I(r.defaultSymbol,r,i),field:r.typeIdField,uniqueValueInfos:r.types.map((e=>({id:e.id,symbol:I(e.symbol,e,i)})))}):new t({symbol:I(r.defaultSymbol,r,i)}):null}readSymbol(e,r,t){const o=r.drawingInfo?.renderer;if(o?.authoringInfo?.isAutoGenerated)return null;if(o&&x(o)){return s(o,r,t)?.symbol}return null}writeSymbol(e,r,o,s){const i=this.renderer?.authoringInfo?.isAutoGenerated;if(!this.renderer||i){const o=new t({symbol:e});r.drawingInfo={renderer:o.write({},s)}}}writeFields(e,r,t){const o=e.filter((e=>"avg_angle"!==e.statisticType)).map((e=>e.toJSON()));d(t,o,r)}readFields(e,r,t){return e.filter((e=>!e.isAutoGenerated)).map((e=>j.fromJSON(e)))}clone(){return new w({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:a(this.labelingInfo),labelsVisible:this.labelsVisible,fields:a(this.fields),maxScale:this.maxScale,renderer:a(this.renderer),symbol:a(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:a(this.popupTemplate)})}};e([m({type:["cluster"],readOnly:!0,json:{write:!0}})],R.prototype,"type",void 0),e([m({type:Number,cast:e=>"auto"===e?e:u(e),json:{write:!0}})],R.prototype,"clusterRadius",void 0),e([m({type:Number,cast:u,json:{write:!0}})],R.prototype,"clusterMinSize",void 0),e([m({type:Number,cast:u,json:{write:!0}})],R.prototype,"clusterMaxSize",void 0),e([m({type:Number,json:{default:0,name:"visibilityInfo.maxScale"}})],R.prototype,"maxScale",void 0),e([m(h)],R.prototype,"popupEnabled",void 0),e([m({type:r,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],R.prototype,"popupTemplate",void 0),e([m({types:i,json:{write:{target:"drawingInfo.renderer"}}})],R.prototype,"renderer",void 0),e([c("renderer",["drawingInfo.renderer"])],R.prototype,"readRenderer",null),e([m({types:l})],R.prototype,"symbol",void 0),e([c("symbol",["drawingInfo.renderer"])],R.prototype,"readSymbol",null),e([f("symbol")],R.prototype,"writeSymbol",null),e([m({type:[g],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],R.prototype,"labelingInfo",void 0),e([m(S)],R.prototype,"labelsVisible",void 0),e([m({type:[j],json:{write:!0}})],R.prototype,"fields",void 0),e([f("fields")],R.prototype,"writeFields",null),e([c("fields")],R.prototype,"readFields",null),R=w=e([y(v)],R);const z=R;export{z 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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as r}from"../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as r}from"../../chunks/tslib.es6.js";import e from"../../core/Error.js";import o from"../../core/Evented.js";import{property as t}from"../../core/accessorSupport/decorators/property.js";import"../../core/accessorSupport/ensureType.js";import"../../core/arrayUtils.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";let c=class extends o.EventedAccessor{destroy(){this.emit("destroy")}get connectionError(){return this.errorString?new e("stream-connection",this.errorString):null}onFeature(r){this.emit("data-received",r)}onMessage(r){this.emit("message-received",r)}};r([t({readOnly:!0})],c.prototype,"connectionError",null),c=r([s("esri.layers.support.StreamConnection")],c);const n=c;export{n 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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import{isNone as i,assertIsSome as s,isSome as r,unwrap as a}from"../../../core/maybe.js";import{urlToObject as l}from"../../../core/urlUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../RasterInfo.js";import m from"../RasterStorageInfo.js";import{readServiceTileInfo as h}from"../serviceTileInfoProperty.js";import
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import{isNone as i,assertIsSome as s,isSome as r,unwrap as a}from"../../../core/maybe.js";import{urlToObject as l}from"../../../core/urlUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/accessorSupport/ensureType.js";import"../../../core/arrayUtils.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../RasterInfo.js";import m from"../RasterStorageInfo.js";import{readServiceTileInfo as h}from"../serviceTileInfoProperty.js";import u from"../TileInfo.js";import{TilemapCache as f}from"../TilemapCache.js";import p from"./BaseRaster.js";import{setValidBoundary as y}from"../rasterFunctions/pixelUtils.js";import d from"../rasterTransforms/GCSShiftTransform.js";import{fetchServiceRasterInfo as x}from"../../../rest/imageService/fetchRasterInfo.js";import g from"../../../geometry/SpatialReference.js";import v from"../../../geometry/Point.js";import S from"../../../geometry/Extent.js";let I=class extends p{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(e){await this.init();const r=e&&e.signal,a=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:r});a.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const o=a.data;if(this.sourceJSON=o,!o)throw new t("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!o.tileInfo)throw new t("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const n=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=o.cacheType,null==this.tileType&&(n.includes(o.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===o.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=o.name?.slice(o.name.indexOf("/")+1)??"";const c=await this._fetchRasterInfo({signal:r});if(i(c))throw new t("image-server-raster:open","cannot initialize image service");const p="Map"===this.tileType?h(o.tileInfo,o):u.fromJSON(o.tileInfo);s(p);const[y,d]=this._computeMinMaxLOD(c,p),{extent:x,pixelSize:g}=c,v=.5/c.width*g.x,S=Math.max(g.x,g.y),{lods:I}=p;("Map"!==this.tileType&&0!==o.maxScale||Math.abs(g.x-g.y)>v||!I.some((e=>Math.abs(e.resolution-S)<v)))&&(g.x=g.y=y.resolution,c.width=Math.ceil((x.xmax-x.xmin)/g.x-.1),c.height=Math.ceil((x.ymax-x.ymin)/g.y-.1));const w=y.level-d.level,[j,T]=p.size,b=[],M=[];I.forEach(((e,t)=>{e.level>=d.level&&e.level<=y.level&&b.push({x:e.resolution,y:e.resolution}),t<I.length-1&&M.push(Math.round(10*e.resolution/I[t+1].resolution)/10)})),b.sort(((e,t)=>e.x-t.x));const _=this.computeBlockBoundary(x,j,T,p.origin,b,w),R=b.length>1?b.slice(1):null;let z;o.transposeInfo&&(z={tileSize:[o.transposeInfo.rows,o.transposeInfo.cols],packetSize:c.keyProperties?._yxs.PacketSize??0});const P=M.length<=1||M.length>=3&&M.slice(0,M.length-1).every((e=>e===M[0]))?M[0]??2:Math.round(10/(d.resolution/y.resolution)**(-1/w))/10;if(c.storageInfo=new m({blockWidth:p.size[0],blockHeight:p.size[1],pyramidBlockWidth:p.size[0],pyramidBlockHeight:p.size[1],pyramidResolutions:R,pyramidScalingFactor:P,compression:p.format,origin:p.origin,firstPyramidLevel:1,maximumPyramidLevel:w,tileInfo:p,transposeInfo:z,blockBoundary:_}),this._fixGCSShift(c),this._set("rasterInfo",c),o.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:c.storageInfo.tileInfo,parsedUrl:l(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new f({layer:e})}}async fetchRawTile(e,t,i,s={}){const{storageInfo:l,extent:o}=this.rasterInfo,{transposeInfo:n}=l,c=r(n)&&!!s.transposedVariableName;if(this._slices&&!c&&null==s.sliceId)return null;const m=c?0:l.maximumPyramidLevel-e+this._levelOffset,h=`${this.url}/tile/${m}/${t}/${i}`,u=this._slices?c?{variable:s.transposedVariableName}:{sliceId:s.sliceId||0}:null,{data:f}=await this.request(h,{query:u,responseType:"array-buffer",signal:s.signal});if(!f)return null;const p=c?n.tileSize:l.tileInfo.size,d=await this.decodePixelBlock(f,{width:p[0],height:p[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:c,noDataValue:a(this.rasterInfo.noDataValue)});if(null==d)return null;const x=l.blockBoundary[e];if("jpg"!==l.compression||i>x.minCol&&i<x.maxCol&&t>x.minRow&&t<x.maxRow)return d;const{origin:g,blockWidth:v,blockHeight:S}=l,{x:I,y:w}=this.getPyramidPixelSize(e),j=Math.round((o.xmin-g.x)/I)%v,T=Math.round((o.xmax-g.x)/I)%v||v,b=Math.round((g.y-o.ymax)/w)%S,M=Math.round((g.y-o.ymin)/w)%S||S,_=i===x.minCol?j:0,R=t===x.minRow?b:0,z=i===x.maxCol?T:v,P=t===x.maxRow?M:S;return y(d,{x:_,y:R},{width:z-_,height:P-R}),d}getSliceIndex(e){if(!this._slices||i(e)||0===e.length)return null;const t=e;for(let i=0;i<this._slices.length;i++){const e=this._slices[i].multidimensionalDefinition;if(e.length===t.length&&!e.some((e=>{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));if(!i)return!0;return(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return i}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),r=await Promise.all([i,s]);return r[0]&&r[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,a(t.datumTransformation));if(null===i)return null;let s=0;const{maximumPyramidLevel:r}=this.rasterInfo.storageInfo;let l=r-s+this._levelOffset;const o=i.srcLocation;for(;l>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(l,i.row,i.col,t))break}catch{}if(l--,s++,i=this.identifyPixelLocation(o,s,a(t.datumTransformation)),null===i)return null}return-1===l||null==i?null:s}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),s=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),r=g.fromJSON(t.spatialReference||e.spatialReference),a=new v({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:r});return new c({width:i,height:s,bandCount:3,extent:S.fromJSON(e),spatialReference:r,pixelSize:a,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,s=x(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),r=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then((e=>e.data&&e.data.slices)).catch((()=>null)):null,a=await Promise.all([s,r]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new d,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,s=.5/e.width*i.x,{lods:r}=t,a=t.lodAt(Math.max.apply(null,r.map((e=>e.level)))),l=t.lodAt(Math.min.apply(null,r.map((e=>e.level)))),{tileType:o}=this;if("Map"===o)return this._levelOffset=r[0].level,[a,l];if("Raster"===o){return[r.find((e=>e.resolution===i.x))??a,l]}const{minScale:n,maxScale:c}=this.sourceJSON;let m=a;c>0&&(m=r.find((e=>Math.abs(e.scale-c)<s)),m||(m=r.filter((e=>e.scale>c)).sort(((e,t)=>e.scale>t.scale?1:-1))[0]??a));let h=l;return n>0&&(h=r.find((e=>Math.abs(e.scale-n)<s))??l,this._levelOffset=h.level-l.level),[m,h]}};e([o({type:String,json:{write:!0}})],I.prototype,"datasetFormat",void 0),e([o()],I.prototype,"tileType",void 0),I=e([n("esri.layers.support.rasterDatasets.ImageServerRaster")],I);const w=I;export{w 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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const t=9999999e31,e=2e-7,n={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function s(t){return n[t]??[-34028234663852886e22,34028234663852886e22]}function u(n,u,a){if(n.depthCount&&n.depthCount>1)return;const{pixels:i,statistics:l,pixelType:o}=n,r=i[0].length,f=n.bandMasks??[],c=n.mask??new Uint8Array(r).fill(255),b="f32"===o||"f64"===o,m=s(o);let h=!1;for(let s=0;s<i.length;s++){const n="number"==typeof u?u:u[s];if(null==n)continue;const p=l?.[s].minValue??m[0],N=l?.[s].maxValue??m[1];if(p>n
|
|
5
|
+
const t=9999999e31,e=2e-7,n={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34028234663852886e22,34028234663852886e22],f64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function s(t){return n[t]??[-34028234663852886e22,34028234663852886e22]}function u(n,u,a){if(n.depthCount&&n.depthCount>1)return;const{pixels:i,statistics:l,pixelType:o}=n,r=i[0].length,f=n.bandMasks??[],c=n.mask??new Uint8Array(r).fill(255),b="f32"===o||"f64"===o,m=s(o);let h=!1;for(let s=0;s<i.length;s++){const n="number"==typeof u?u:u[s];if(null==n)continue;const p=l?.[s].minValue??m[0],N=l?.[s].maxValue??m[1];if(p>n+Number.EPSILON||N<n-Number.EPSILON)continue;const M=f[s]||new Uint8Array(r).fill(255),d=i[s],A=a?.customFloatTolerance;if(b&&0!==A){let s=A;s||(s=Math.abs(n)>=t?e*Math.abs(n):"f32"===o?2**-23:Number.EPSILON);for(let t=0;t<d.length;t++)M[t]&&Math.abs(d[t]-n)<s&&(d[t]=0,M[t]=0,c[t]=0,h=!0)}else for(let t=0;t<d.length;t++)M[t]&&d[t]===n&&(d[t]=0,M[t]=0,c[t]=0,h=!0);f[s]=M}h&&(n.bandMasks=f,n.mask=c),h&&"updateStatistics"in n&&n.updateStatistics()}export{u as convertNoDataToMask,s as getPixelValueRange};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../../geometry.js";import e from"../../../core/Error.js";import{isNone as t,isSome as n}from"../../../core/maybe.js";import{getMetersPerUnitForSR as o}from"../../../core/unitUtils.js";import{e as i,f as r,g as s,h as a,j as l}from"../../../chunks/pe.js";import{canProjectWithoutEngine as c,isLoaded as f,load as u,getTransformation as m,project as h}from"../../../geometry/projection.js";import x from"../../../geometry/Extent.js";import p from"../../../geometry/Point.js";import g from"../../../geometry/Polygon.js";import y from"../../../geometry/SpatialReference.js";var d;function M(e,t,n){return!c(e,t,n)}function w(t,n,o){const i=M(t,n,o);if(i&&!f())throw new e("rasterprojectionhelper-project","projection engine is not loaded");return i}!function(e){e[e.None=0]="None",e[e.North=1]="North",e[e.South=2]="South",e[e.Both=3]="Both"}(d||(d={}));const R=(e,t,n,o=0)=>{if(1===n[0])return[0,0];let i=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(i=i>e[g]?e[g]:i,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-i)/l/n[0],u=(a-s)/c/n[1],m=2*o;let h=0,x=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,o=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,i=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((o-e[n+2*c+2])/f),s=Math.abs((i-e[n+2*c+3])/u);if(r+s>h&&(h=r+s,p=[r,s]),m&&h>m){x=!0;break}}if(x)break}return p},P={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},S=32,b=4,G=b,N=new Map,E=new Map,k=500;async function T(){f()||await u()}function v(e,t,n){if(!w(e.spatialReference,t))return null;return n?m(t,e.spatialReference,e):m(e.spatialReference,t,e)}function C(e,i,r,s=null){const a=e.spatialReference;if(a.equals(i))return e;w(a,i,s);const l=r.center,c=new x({xmin:l.x-e.x/2,xmax:l.x+e.x/2,ymin:l.y-e.y/2,ymax:l.y+e.y/2,spatialReference:a}),f=h(c,i,s),u=U(i);let m;if(t(f)||n(u)&&f.width>=u){const t=o(a)/o(i);m={x:e.x*t,y:e.y*t}}else m={x:f.width,y:f.height};return m}function _(e,t=.01){return o(e)?t/o(e):0}function j(e,t,n=null,o=!0){const i=e.spatialReference;if(i.equals(t))return e;w(i,t,n);const r=h(e,t,n);return o&&r?(z([e],[r],i,t),r):r}function z(e,t,o,i){const r=D(o,!0),s=D(i,!0),a=_(o,k),l=_(i,k);if(a&&n(r)&&n(s))for(let n=0;n<e.length;n++){const o=t[n];if(!o)continue;const{x:i}=e[n],{x:c}=o;c>=s[1]-l&&Math.abs(i-r[0])<a?o.x-=s[1]-s[0]:c<=s[0]+l&&Math.abs(i-r[1])<a&&(o.x+=s[1]-s[0])}}function W(e){const{inSR:t,outSR:o,datumTransformation:i,preferPE:r}=e;if(t.equals(o)){const{points:t}=Y(e,null);return t}if(t.isWebMercator&&o.isWGS84||t.isWGS84&&o.isWebMercator)return A(e);if(w(t,o,i)&&r){if(t.isGeographic)return O(e);const o=B(t);if(n(o))return O(e)}return L(e)}function L(e){const{points:t}=Y(e,null),{inSR:n,outSR:o,datumTransformation:i}=e,r=t.map((e=>new p(e[0],e[1],n))),s=h(r,o,i);return i&&z(r,s,n,o),s.map((e=>e?[e.x,e.y]:[NaN,NaN]))}function O(e){const{inSR:t,outSR:o,datumTransformation:l}=e,c=B(t),{points:f,mask:u}=Y(e,c);if(!t.isGeographic){const e=t.wkid?i.coordsys(t.wkid):i.fromString(t.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,t.wkt);s.projToGeog(e,f.length,f)}if(n(l)&&l.steps.length){let e;const t=179.9955;if(o.isGeographic&&(e=f.map((([e])=>e>t?1:e<-t?-1:0))),l.steps.forEach((e=>{const t=e.wkid?i.geogtran(e.wkid):i.fromString(r.PE_TYPE_GEOGTRAN,e.wkt);a.geogToGeog(t,f.length,f,null,e.isInverse?r.PE_TRANSFORM_2_TO_1:r.PE_TRANSFORM_1_TO_2)})),e)for(let n=0;n<f.length;n++){const o=e[n],i=f[n][0],r=i>t?1:i<-t?-1:0;o&&r&&o!==r&&(f[n][0]=o>0?i+360:i-360)}}if(!o.isGeographic){const e=B(o,!0),t=n(e)&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];F(f,t);const a=o.wkid?i.coordsys(o.wkid):i.fromString(o.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,o.wkt);s.geogToProj(a,f.length,f)}let m=f;if(u&&f.length!==u.length){m=[];for(let e=0,t=0;e<u.length;e++)u[e]?m.push(f[t++]):m.push([NaN,NaN])}return m}function A(e){const{cols:t,rows:n,xres:o,yres:i,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:c}=e;r&&(l+=o/2,c-=i/2);const f=[],u=[],m=Math.max(t,n);for(let g=0;g<m;g++){const e=l+o*Math.min(t,g),r=c-i*Math.min(n,g),m=h(new p({x:e,y:r,spatialReference:s}),a);g<=t&&f.push(m.x),g<=n&&u.push(m.y)}const x=[];for(let h=0;h<t;h++)for(let e=0;e<n;e++)x.push([f[h],u[e]]);return x}function B(e,t=!1){let n=e.wkid||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),N.has(n)){const e=N.get(n);return t?e?.gcs:e?.pcs}const o=e.wkid?i.coordsys(e.wkid):i.fromString(e.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,e.wkt),s=I(o,_(e,1e-4)),a=I(o,0,!0);return N.set(n,{pcs:s,gcs:a}),t?a:s}function I(e,t=0,n=!1){const o=l.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!o||!i?.length)return null;let r=!1,s=i.find((e=>1===e.getInclusive()&&1===e.getKind()));if(!s){if(s=i.find((e=>1===e.getInclusive()&&0===e.getKind())),!s)return null;r=!0}const a=n?0:(2===o.getNorthPoleLocation()?1:0)|(2===o.getSouthPoleLocation()?2:0),c=o.isPannableRectangle(),f=s.getCoord();if(r)return{isEnvelope:r,isPannable:c,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:a};let u=0;const m=[];let[h,x]=f[0],[p,g]=f[0];for(let l=0,y=f.length;l<y;l++){u++,u===y&&(u=0);const[e,t]=f[l],[n,o]=f[u];if(o===t)m.push([e,n,t,o,2]);else{const i=(n-e)/(o-t||1e-4),r=e-i*t;t<o?m.push([i,r,t,o,0]):m.push([i,r,o,t,1])}h=h<e?h:e,x=x<t?x:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:c,vertices:f,coef:m,bbox:[h,x,p,g],poleLocation:a}}function Y(e,n){const o=[],{cols:i,rows:r,xres:s,yres:a,usePixelCenter:l}=e;let{xmin:c,ymax:f}=e;if(l&&(c+=s/2,f-=a/2),t(n)){for(let e=0;e<i;e++)for(let t=0;t<r;t++)o.push([c+s*e,f-a*t]);return{points:o}}const u=new Uint8Array(i*r);if(n.isEnvelope){const{bbox:[e,t,l,m]}=n;for(let h=0,x=0;h<i;h++){const i=c+s*h,p=n.isPannable||i>=e&&i<=l;for(let e=0;e<r;e++,x++){const n=f-a*e;p&&n>=t&&n<=m&&(o.push([i,n]),u[x]=1)}}return{points:o,mask:u}}const m=n.coef,h=[];for(let t=0;t<r;t++){const e=f-a*t,n=[],o=[];for(let t=0;t<m.length;t++){const[i,r,s,a,l]=m[t];if(e===s&&s===a)n.push(i),n.push(r),o.push(2),o.push(2);else if(e>=s&&e<=a){const t=i*e+r;n.push(t),o.push(l)}}let i=n;if(n.length>2){let e=2===o[0]?0:o[0],t=n[0];i=[];for(let r=1;r<o.length;r++)2===o[r]&&r!==o.length-1||(o[r]!==e&&(i.push(0===e?Math.min(t,n[r-1]):Math.max(t,n[r-1])),e=o[r],t=n[r]),r===o.length-1&&i.push(0===o[r]?Math.min(t,n[r]):Math.max(t,n[r])));i.sort(((e,t)=>e-t))}else n[0]>n[1]&&(i=[n[1],n[0]]);h.push(i)}for(let t=0,x=0;t<i;t++){const e=c+s*t;for(let t=0;t<r;t++,x++){const n=f-a*t,i=h[t];if(2===i.length)e>=i[0]&&e<=i[1]&&(o.push([e,n]),u[x]=1);else if(i.length>2){let t=!1;for(let n=0;n<i.length;n+=2)if(e>=i[n]&&e<=i[n+1]){t=!0;break}t&&(o.push([e,n]),u[x]=1)}}}return{points:o,mask:u}}function F(e,t){const[n,o]=t;for(let i=0;i<e.length;i++){const t=e[i][1];(t<n||t>o)&&(e[i]=[NaN,NaN])}}function q(e){const n=U(e[0].spatialReference);if(e.length<2||t(n))return e[0];let{xmin:o,xmax:i,ymin:r,ymax:s}=e[0];for(let t=1;t<e.length;t++){const o=e[t];i=o.xmax+n*t,r=Math.min(r,o.ymin),s=Math.max(s,o.ymax)}return new x({xmin:o,xmax:i,ymin:r,ymax:s,spatialReference:e[0].spatialReference})}function J(e,o,i=null,r=!0){const s=e.spatialReference;if(s.equals(o))return e;const a=Q(e),l=U(s,!0),c=U(o);if(0===a||t(l)||t(c)){const a=K(e,o,i,r);if(t(l)&&n(c)&&Math.abs(a.width-c)<_(o)&&f()){const t=B(s);if(n(t)&&t.poleLocation===d.None&&e.width<(t.bbox[2]-t.bbox[0])/2)return X(e,o)||a}return a}const u=e.clone().normalize();if(1===u.length&&e.xmax<l&&e.xmax-l/2>_(s)){const{xmin:t,xmax:n}=e;for(let o=0;o<=a;o++){const i=0===o?t:-l/2,r=o===a?n-l*o:l/2;u[o]=new x({xmin:i,xmax:r,ymin:e.ymin,ymax:e.ymax,spatialReference:s})}}return q(u.map((e=>K(e,o,i,r))).filter(n))}function X(e,n){const o=U(n);if(t(o))return null;let{xmin:i,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new g({spatialReference:l,rings:[[[i,r],[s,r],[s,a],[i,a],[i,r]]]}),f=h(c,n);if(2!==f.rings.length||!f.rings[0].length||!f.rings[1].length)return null;const{rings:u}=f,m=_(l),p=new x({spatialReference:n});for(let t=0;t<2;t++){i=s=u[t][0][0],r=a=u[t][0][1];for(let e=0;e<u[t].length;e++)i=i>u[t][e][0]?u[t][e][0]:i,s=s<u[t][e][0]?u[t][e][0]:s,r=r>u[t][e][1]?u[t][e][1]:r,a=a<u[t][e][1]?u[t][e][1]:a;if(0===t)p.ymin=r,p.ymax=a,p.xmin=i,p.xmax=s;else if(p.ymin=Math.min(p.ymin,r),p.ymax=Math.max(p.ymax,a),Math.abs(s-o/2)<m)p.xmin=i,p.xmax=p.xmax+o;else{if(!(Math.abs(i+o/2)<m))return null;p.xmax=s+o}}return p}function K(e,n,o=null,i=!0,r=!0){const s=e.spatialReference;if(s.equals(n)||!n)return e;w(s,n,o);const a=h(e,n,o);if(r&&n.isWebMercator&&a&&(a.ymax=Math.min(20037508.342787,a.ymax),a.ymin=Math.max(-20037508.342787,a.ymin),a.ymin>=a.ymax))return null;if(!i||!a)return a;const l=D(s,!0),c=D(n,!0);if(t(l)||t(c))return a;const f=_(s,.001),u=_(s,k),m=_(n,.001);if(Math.abs(a.xmin-c[0])<m&&Math.abs(a.xmax-c[1])<m){const t=Math.abs(e.xmin-l[0]),i=Math.abs(l[1]-e.xmax);if(t<f&&i>u){a.xmin=c[0];const t=[];t.push(new p(e.xmax,e.ymin,s)),t.push(new p(e.xmax,(e.ymin+e.ymax)/2,s)),t.push(new p(e.xmax,e.ymax,s));const i=t.map((e=>j(e,n,o))).filter((e=>!isNaN(e?.x))).map((e=>e.x));a.xmax=Math.max.apply(null,i)}if(i<f&&t>u){a.xmax=c[1];const t=[];t.push(new p(e.xmin,e.ymin,s)),t.push(new p(e.xmin,(e.ymin+e.ymax)/2,s)),t.push(new p(e.xmin,e.ymax,s));const i=t.map((e=>j(e,n,o))).filter((e=>!isNaN(e?.x))).map((e=>e.x));a.xmin=Math.min.apply(null,i)}}else{const e=_(n,.001);Math.abs(a.xmin-c[0])<e&&(a.xmin=c[0]),Math.abs(a.xmax-c[1])<e&&(a.xmax=c[1])}return a}function U(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*P[e.wkid]||null}function D(e,t=!1){if(e.isGeographic)return[-180,180];const o=U(e,t);return n(o)?[-o/2,o/2]:null}function H(e,t,n,o){let i=(e-t)/n;return i-Math.floor(i)!=0?i=Math.floor(i):o&&(i-=1),i}function Q(e,n=!1){const o=U(e.spatialReference);if(t(o))return 0;const i=n?0:-(o/2),r=_(e.spatialReference),s=!n&&Math.abs(e.xmax-o/2)<r?o/2:e.xmax,a=!n&&Math.abs(e.xmin+o/2)<r?-o/2:e.xmin;return H(s,i,o,!0)-H(a,i,o,!1)}function V(e){const o=e.storageInfo.origin.x,i=U(e.spatialReference,!0);if(t(i))return{originX:o,halfWorldWidth:null,pyramidsInfo:null};const r=i/2,{nativePixelSize:s,storageInfo:a,extent:l}=e,{maximumPyramidLevel:c,blockWidth:f,pyramidScalingFactor:u}=a;let m=s.x;const h=[],x=n(e.transform)&&"gcs-shift"===e.transform.type,p=o+(x?0:r),g=x?i-o:r-o;for(let t=0;t<=c;t++){const e=(l.xmax-o)/m/f,t=e-Math.floor(e)==0?e:Math.ceil(e),n=g/m/f,i=n-Math.floor(n)==0?n:Math.ceil(n),r=Math.floor(p/m/f),s=Math.round(p/m)%f,a=(f-Math.round(g/m)%f)%f;h.push({resolutionX:m,blockWidth:f,datsetColumnCount:t,worldColumnCountFromOrigin:i,leftMargin:s,rightPadding:a,originColumnOffset:r}),m*=u}return{originX:o,halfWorldWidth:r,pyramidsInfo:h,hasGCSSShiftTransform:x}}function Z(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt);let n;if(E.has(t))n=E.get(t);else{n=(e.wkid?i.coordsys(e.wkid):i.fromString(r.PE_TYPE_PROJCS,e.wkt)).getGeogcs().getCode(),E.set(t,n)}return new y({wkid:n})}function $(e){const t=e.isAdaptive&&null==e.spacing;let o=e.spacing||[S,S],i=ee(e),r={cols:i.size[0]+1,rows:i.size[1]+1};const s=i.outofBoundPointCount>0&&i.outofBoundPointCount<i.offsets.length/2;let a=i.outofBoundPointCount===i.offsets.length/2||t&&s?[0,0]:R(i.offsets,r,o,G);const l=(a[0]+a[1])/2,c=e.projectedExtent.spatialReference,f=e.srcBufferExtent.spatialReference;if(t&&(s||l>G)){M(c,f,e.datumTransformation)&&(c.isGeographic||n(B(c))),o=[b,b],i=ee({...e,spacing:o}),r={cols:i.size[0]+1,rows:i.size[1]+1},a=R(i.offsets,r,o,G)}if(i.error=a,o[0]>1&&(i.coefficients=te(i.offsets,r,s)),e.includeGCSGrid&&!c.isGeographic&&!c.isWebMercator)if(f.isGeographic)i.gcsGrid={offsets:i.offsets,coefficients:i.coefficients,spacing:o};else{const t=B(c);if(n(t)&&!t.isEnvelope){const t=Z(c),n=J(e.projectedExtent,t),{offsets:a}=ee({...e,srcBufferExtent:n,spacing:o}),l=te(a,r,s);i.gcsGrid={offsets:a,coefficients:l,spacing:o}}}return i}function ee(e){const{projectedExtent:t,srcBufferExtent:o,pixelSize:i,datumTransformation:r,rasterTransform:s}=e,a=t.spatialReference,l=o.spatialReference,c=w(a,l),{xmin:f,ymin:u,xmax:m,ymax:h}=t,x=U(l),g=n(x)&&(e.hasWrapAround||"gcs-shift"===s?.type),y=e.spacing||[S,S],d=y[0]*i.x,M=y[1]*i.y,R=1===y[0],P=Math.ceil((m-f)/d-.1/y[0])+(R?0:1),G=Math.ceil((h-u)/M-.1/y[1])+(R?0:1),N=W({cols:P,rows:G,xmin:f,ymax:h,xres:d,yres:M,inSR:a,outSR:l,datumTransformation:r,preferPE:y[0]<=b,usePixelCenter:R}),E=[];let T,v=0;const C=R?-1:NaN,{xmin:j,xmax:z,ymax:L,width:O,height:A}=o,I=_(l,k),Y=n(x)&&j>0&&z>x/2;let F=!1;if(c){const e=B(a);F=n(e)&&e.poleLocation>0}for(let n=0;n<P;n++){const e=[];for(let t=0;t<G;t++){let o=N[n*G+t];if(g&&o[0]>z&&o[0]>x/2-I?o[0]-=x:g&&0===n&&o[0]<0&&Y&&!s&&(o[0]+=x),!o||isNaN(o[0])||isNaN(o[1]))E.push(C),E.push(C),e.push(null),v++;else{if(s){const e=s.inverseTransform(new p({x:o[0],y:o[1],spatialReference:l}));o=[e.x,e.y]}e.push(o),n>0&&g&&T[t]&&o[0]<T[t][0]&&(o[0]+=x,F&&o[0]>z&&o[0]>x&&(o[0]-=x)),E.push((o[0]-j)/O),E.push((L-o[1])/A)}}T=e}return{offsets:E,error:null,coefficients:null,outofBoundPointCount:v,spacing:y,size:R?[P,G]:[P-1,G-1]}}function te(e,t,n){const{cols:o,rows:i}=t,r=new Float32Array((o-1)*(i-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<o-1;l++){for(let t=0;t<i-1;t++){let n=l*i*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],m=e[n+3];n+=2*i;const h=e[n],x=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(o-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*m+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*h+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*x+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function ne(e){const t=e.clone().normalize();return 1===t.length?t[0]:q(t)}function oe(e,t,i){const{storageInfo:r,pixelSize:s}=t;let a=0,l=!1;const{pyramidResolutions:c}=r;if(n(c)&&c.length){const n=(e.x+e.y)/2,r=c[c.length-1],f=(r.x+r.y)/2,u=(s.x+s.y)/2;if(n<=u)a=0;else if(n>=f)a=c.length,l=n/f>8;else{let e,t=u;for(let o=1;o<=c.length;o++){if(e=(c[o-1].x+c[o-1].y)/2,n<=e){n===e?a=o:"down"===i?(a=o-1,l=n/t>8):a="up"===i||n-t>e-n||n/t>2?o:o-1;break}t=e}}const m=0===a?s:c[a-1];if(l){Math.min(m.x,m.y)*o(t.spatialReference)>19567&&(l=!1)}return{pyramidLevel:a,pyramidResolution:new p({x:m.x,y:m.y,spatialReference:t.spatialReference}),excessiveReading:l}}const f=Math.log(e.x/s.x)/Math.LN2,u=Math.log(e.y/s.y)/Math.LN2,m=t.storageInfo.maximumPyramidLevel||0;a="down"===i?Math.floor(Math.min(f,u)):"up"===i?Math.ceil(Math.max(f,u)):Math.round((f+u)/2),a<0?a=0:a>m&&(l=a>m+3,a=m);const h=2**a;return{pyramidLevel:a,pyramidResolution:new p({x:h*t.nativePixelSize.x,y:h*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:l}}function ie(e,t,i=512,r=!0){const{extent:s,spatialReference:a,pixelSize:l}=e,c=C(new p({x:l.x,y:l.y,spatialReference:a}),t,s);if(null==c)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const f=(c.x+c.y)/2,u=o(t),m=f*u*96*39.37,h=t.isGeographic?256/i*295828763.7958547:256/i*591657527.591555;let x="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const g=J(s,t),y=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(h/2/m)/Math.LN2));if(!x&&r&&(t.isGeographic||t.isWebMercator)&&(x=g.xmin*g.xmax<0,!x&&y<3)){const e=U(t);if(n(e)){const t=2**y*f*i,n=Math.ceil(e/t);x=1===n||2===n&&e/2-g.xmax<t}}let d,M=m;const w=1.001;if(x){M=h;const e=t.isGeographic?1341104507446289e-21:.29858214164761665,n=e*(96*u*39.37),o=t.isGeographic?4326:3857;d=C(new p({x:e,y:e,spatialReference:{wkid:o}}),a,g),d.x*=M/n,d.y*=M/n}else{d={x:l.x,y:l.y};let e=0;for(;M<h*(w/2)&&e<y;)e++,M*=2,d.x*=2,d.y*=2;Math.max(M,h)/Math.min(M,h)<=w&&(M=h)}const R=[M],P=[{x:d.x,y:d.y}],S=70.5310735,b=Math.min(S,m)/w;for(;M>=b;)M/=2,d.x/=2,d.y/=2,R.push(M),P.push({x:d.x,y:d.y});return{projectedPixelSize:c,scales:R,srcResolutions:P,isCustomTilingScheme:!x}}export{ie as computeProjectedScales,S as defaultGridSpacing,G as defaultProjectionToleranceInPixels,v as getDefaultDatumTransformationForDataset,W as getProjectedGridPoints,$ as getProjectionOffsetGrid,V as getRasterDatasetAlignmentInfo,U as getWorldWidth,Q as getWorldWrapCount,T as load,b as minimumGridSpacing,J as projectExtent,j as projectPoint,C as projectResolution,M as requirePE,ne as snapExtent,oe as snapPyramid};
|
|
5
|
+
import"../../../geometry.js";import e from"../../../core/Error.js";import{isNone as t,isSome as n}from"../../../core/maybe.js";import{getMetersPerUnitForSR as o}from"../../../core/unitUtils.js";import{e as i,f as r,g as s,h as a,j as l}from"../../../chunks/pe.js";import{canProjectWithoutEngine as c,isLoaded as f,load as u,getTransformation as m,project as h}from"../../../geometry/projection.js";import x from"../../../geometry/Extent.js";import p from"../../../geometry/Point.js";import g from"../../../geometry/Polygon.js";import y from"../../../geometry/SpatialReference.js";var d;function M(e,t,n){return!c(e,t,n)}function w(t,n,o){const i=M(t,n,o);if(i&&!f())throw new e("rasterprojectionhelper-project","projection engine is not loaded");return i}!function(e){e[e.None=0]="None",e[e.North=1]="North",e[e.South=2]="South",e[e.Both=3]="Both"}(d||(d={}));const R=(e,t,n,o=0)=>{if(1===n[0])return[0,0];let i=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(i=i>e[g]?e[g]:i,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-i)/l/n[0],u=(a-s)/c/n[1],m=2*o;let h=0,x=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,o=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,i=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((o-e[n+2*c+2])/f),s=Math.abs((i-e[n+2*c+3])/u);if(r+s>h&&(h=r+s,p=[r,s]),m&&h>m){x=!0;break}}if(x)break}return p},P={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},S=32,b=4,G=b,N=new Map,E=new Map,k=500;async function T(){f()||await u()}function v(e,t,n){if(!w(e.spatialReference,t))return null;return n?m(t,e.spatialReference,e):m(e.spatialReference,t,e)}function C(e,i,r,s=null){const a=e.spatialReference;if(a.equals(i))return e;w(a,i,s);const l=r.center,c=new x({xmin:l.x-e.x/2,xmax:l.x+e.x/2,ymin:l.y-e.y/2,ymax:l.y+e.y/2,spatialReference:a}),f=h(c,i,s),u=U(i);let m;if(t(f)||n(u)&&f.width>=u){const t=o(a)/o(i);m={x:e.x*t,y:e.y*t}}else m={x:f.width,y:f.height};return m}function _(e,t=.01){return o(e)?t/o(e):0}function j(e,t,n=null,o=!0){const i=e.spatialReference;if(i.equals(t))return e;w(i,t,n);const r=h(e,t,n);return o&&r?(z([e],[r],i,t),r):r}function z(e,t,o,i){const r=D(o,!0),s=D(i,!0),a=_(o,k),l=_(i,k);if(a&&n(r)&&n(s))for(let n=0;n<e.length;n++){const o=t[n];if(!o)continue;const{x:i}=e[n],{x:c}=o;c>=s[1]-l&&Math.abs(i-r[0])<a?o.x-=s[1]-s[0]:c<=s[0]+l&&Math.abs(i-r[1])<a&&(o.x+=s[1]-s[0])}}function W(e){const{inSR:t,outSR:o,datumTransformation:i,preferPE:r}=e;if(t.equals(o)){const{points:t}=F(e,null);return t}if(t.isWebMercator&&o.isWGS84||t.isWGS84&&o.isWebMercator)return I(e);if(w(t,o,i)&&r){if(t.isGeographic)return O(e);const o=A(t);if(n(o))return O(e)}return L(e)}function L(e){const{points:t}=F(e,null),{inSR:n,outSR:o,datumTransformation:i}=e,r=t.map((e=>new p(e[0],e[1],n))),s=h(r,o,i);return i&&z(r,s,n,o),s.map((e=>e?[e.x,e.y]:[NaN,NaN]))}function O(e){const{inSR:t,outSR:o,datumTransformation:l}=e,c=A(t),{points:f,mask:u}=F(e,c);if(!t.isGeographic){const e=t.wkid?i.coordsys(t.wkid):i.fromString(t.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,t.wkt);s.projToGeog(e,f.length,f)}if(n(l)&&l.steps.length){let e;const t=179.9955;if(o.isGeographic&&(e=f.map((([e])=>e>t?1:e<-t?-1:0))),l.steps.forEach((e=>{const t=e.wkid?i.geogtran(e.wkid):i.fromString(r.PE_TYPE_GEOGTRAN,e.wkt);a.geogToGeog(t,f.length,f,null,e.isInverse?r.PE_TRANSFORM_2_TO_1:r.PE_TRANSFORM_1_TO_2)})),e)for(let n=0;n<f.length;n++){const o=e[n],i=f[n][0],r=i>t?1:i<-t?-1:0;o&&r&&o!==r&&(f[n][0]=o>0?i+360:i-360)}}if(!o.isGeographic){const e=A(o,!0),t=n(e)&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];Y(f,t);const a=o.wkid?i.coordsys(o.wkid):i.fromString(o.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,o.wkt);s.geogToProj(a,f.length,f)}let m=f;if(u&&f.length!==u.length){m=[];for(let e=0,t=0;e<u.length;e++)u[e]?m.push(f[t++]):m.push([NaN,NaN])}return m}function I(e){const{cols:t,rows:n,xres:o,yres:i,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:c}=e;r&&(l+=o/2,c-=i/2);const f=[],u=[],m=Math.max(t,n);for(let g=0;g<m;g++){const e=l+o*Math.min(t,g),r=c-i*Math.min(n,g),m=h(new p({x:e,y:r,spatialReference:s}),a);g<=t&&f.push(m.x),g<=n&&u.push(m.y)}const x=[];for(let h=0;h<t;h++)for(let e=0;e<n;e++)x.push([f[h],u[e]]);return x}function A(e,t=!1){let n=e.wkid||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),N.has(n)){const e=N.get(n);return t?e?.gcs:e?.pcs}const o=e.wkid?i.coordsys(e.wkid):i.fromString(e.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,e.wkt),s=B(o,_(e,1e-4)),a=B(o,0,!0);return N.set(n,{pcs:s,gcs:a}),t?a:s}function B(e,t=0,n=!1){const o=l.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!o||!i?.length)return null;let r=!1,s=i.find((e=>1===e.getInclusive()&&1===e.getKind()));if(!s){if(s=i.find((e=>1===e.getInclusive()&&0===e.getKind())),!s)return null;r=!0}const a=n?0:(2===o.getNorthPoleLocation()?1:0)|(2===o.getSouthPoleLocation()?2:0),c=o.isPannableRectangle(),f=s.getCoord();if(r)return{isEnvelope:r,isPannable:c,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:a};let u=0;const m=[];let[h,x]=f[0],[p,g]=f[0];for(let l=0,y=f.length;l<y;l++){u++,u===y&&(u=0);const[e,t]=f[l],[n,o]=f[u];if(o===t)m.push([e,n,t,o,2]);else{const i=(n-e)/(o-t||1e-4),r=e-i*t;t<o?m.push([i,r,t,o,0]):m.push([i,r,o,t,1])}h=h<e?h:e,x=x<t?x:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:c,vertices:f,coef:m,bbox:[h,x,p,g],poleLocation:a}}function F(e,n){const o=[],{cols:i,rows:r,xres:s,yres:a,usePixelCenter:l}=e;let{xmin:c,ymax:f}=e;if(l&&(c+=s/2,f-=a/2),t(n)){for(let e=0;e<i;e++)for(let t=0;t<r;t++)o.push([c+s*e,f-a*t]);return{points:o}}const u=new Uint8Array(i*r);if(n.isEnvelope){const{bbox:[e,t,l,m]}=n;for(let h=0,x=0;h<i;h++){const i=c+s*h,p=n.isPannable||i>=e&&i<=l;for(let e=0;e<r;e++,x++){const n=f-a*e;p&&n>=t&&n<=m&&(o.push([i,n]),u[x]=1)}}return{points:o,mask:u}}const m=n.coef,h=[];for(let t=0;t<r;t++){const e=f-a*t,n=[],o=[];for(let t=0;t<m.length;t++){const[i,r,s,a,l]=m[t];if(e===s&&s===a)n.push(i),n.push(r),o.push(2),o.push(2);else if(e>=s&&e<=a){const t=i*e+r;n.push(t),o.push(l)}}let i=n;if(n.length>2){let e=2===o[0]?0:o[0],t=n[0];i=[];for(let r=1;r<o.length;r++)2===o[r]&&r!==o.length-1||(o[r]!==e&&(i.push(0===e?Math.min(t,n[r-1]):Math.max(t,n[r-1])),e=o[r],t=n[r]),r===o.length-1&&i.push(0===o[r]?Math.min(t,n[r]):Math.max(t,n[r])));i.sort(((e,t)=>e-t))}else n[0]>n[1]&&(i=[n[1],n[0]]);h.push(i)}for(let t=0,x=0;t<i;t++){const e=c+s*t;for(let t=0;t<r;t++,x++){const n=f-a*t,i=h[t];if(2===i.length)e>=i[0]&&e<=i[1]&&(o.push([e,n]),u[x]=1);else if(i.length>2){let t=!1;for(let n=0;n<i.length;n+=2)if(e>=i[n]&&e<=i[n+1]){t=!0;break}t&&(o.push([e,n]),u[x]=1)}}}return{points:o,mask:u}}function Y(e,t){const[n,o]=t;for(let i=0;i<e.length;i++){const t=e[i][1];(t<n||t>o)&&(e[i]=[NaN,NaN])}}function q(e){const n=U(e[0].spatialReference);if(e.length<2||t(n))return e[0];let{xmin:o,xmax:i,ymin:r,ymax:s}=e[0];for(let t=1;t<e.length;t++){const o=e[t];i=o.xmax+n*t,r=Math.min(r,o.ymin),s=Math.max(s,o.ymax)}return new x({xmin:o,xmax:i,ymin:r,ymax:s,spatialReference:e[0].spatialReference})}function J(e,o,i=null,r=!0){const s=e.spatialReference;if(s.equals(o))return e;const a=Q(e),l=U(s,!0),c=U(o);if(0===a||t(l)||t(c)){const a=K(e,o,i,r);if(t(l)&&n(c)&&Math.abs(a.width-c)<_(o)&&f()){const t=A(s);if(n(t)&&t.poleLocation===d.None&&e.width<(t.bbox[2]-t.bbox[0])/2)return X(e,o)||a}return a}const u=e.clone().normalize();if(1===u.length&&e.xmax<l&&e.xmax-l/2>_(s)){const{xmin:t,xmax:n}=e;for(let o=0;o<=a;o++){const i=0===o?t:-l/2,r=o===a?n-l*o:l/2;u[o]=new x({xmin:i,xmax:r,ymin:e.ymin,ymax:e.ymax,spatialReference:s})}}return q(u.map((e=>K(e,o,i,r))).filter(n))}function X(e,n){const o=U(n);if(t(o))return null;let{xmin:i,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new g({spatialReference:l,rings:[[[i,r],[s,r],[s,a],[i,a],[i,r]]]}),f=h(c,n);if(2!==f.rings.length||!f.rings[0].length||!f.rings[1].length)return null;const{rings:u}=f,m=_(l),p=new x({spatialReference:n});for(let t=0;t<2;t++){i=s=u[t][0][0],r=a=u[t][0][1];for(let e=0;e<u[t].length;e++)i=i>u[t][e][0]?u[t][e][0]:i,s=s<u[t][e][0]?u[t][e][0]:s,r=r>u[t][e][1]?u[t][e][1]:r,a=a<u[t][e][1]?u[t][e][1]:a;if(0===t)p.ymin=r,p.ymax=a,p.xmin=i,p.xmax=s;else if(p.ymin=Math.min(p.ymin,r),p.ymax=Math.max(p.ymax,a),Math.abs(s-o/2)<m)p.xmin=i,p.xmax=p.xmax+o;else{if(!(Math.abs(i+o/2)<m))return null;p.xmax=s+o}}return p}function K(e,n,o=null,i=!0,r=!0){const s=e.spatialReference;if(s.equals(n)||!n)return e;w(s,n,o);const a=h(e,n,o);if(r&&n.isWebMercator&&a&&(a.ymax=Math.min(20037508.342787,a.ymax),a.ymin=Math.max(-20037508.342787,a.ymin),a.ymin>=a.ymax))return null;if(!i||!a)return a;const l=D(s,!0),c=D(n,!0);if(t(l)||t(c))return a;const f=_(s,.001),u=_(s,k),m=_(n,.001);if(Math.abs(a.xmin-c[0])<m&&Math.abs(a.xmax-c[1])<m){const t=Math.abs(e.xmin-l[0]),i=Math.abs(l[1]-e.xmax);if(t<f&&i>u){a.xmin=c[0];const t=[];t.push(new p(e.xmax,e.ymin,s)),t.push(new p(e.xmax,(e.ymin+e.ymax)/2,s)),t.push(new p(e.xmax,e.ymax,s));const i=t.map((e=>j(e,n,o))).filter((e=>!isNaN(e?.x))).map((e=>e.x));a.xmax=Math.max.apply(null,i)}if(i<f&&t>u){a.xmax=c[1];const t=[];t.push(new p(e.xmin,e.ymin,s)),t.push(new p(e.xmin,(e.ymin+e.ymax)/2,s)),t.push(new p(e.xmin,e.ymax,s));const i=t.map((e=>j(e,n,o))).filter((e=>!isNaN(e?.x))).map((e=>e.x));a.xmin=Math.min.apply(null,i)}}else{const e=_(n,.001);Math.abs(a.xmin-c[0])<e&&(a.xmin=c[0]),Math.abs(a.xmax-c[1])<e&&(a.xmax=c[1])}return a}function U(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*P[e.wkid]||null}function D(e,t=!1){if(e.isGeographic)return[-180,180];const o=U(e,t);return n(o)?[-o/2,o/2]:null}function H(e,t,n,o){let i=(e-t)/n;return i-Math.floor(i)!=0?i=Math.floor(i):o&&(i-=1),i}function Q(e,n=!1){const o=U(e.spatialReference);if(t(o))return 0;const i=n?0:-(o/2),r=_(e.spatialReference),s=!n&&Math.abs(e.xmax-o/2)<r?o/2:e.xmax,a=!n&&Math.abs(e.xmin+o/2)<r?-o/2:e.xmin;return H(s,i,o,!0)-H(a,i,o,!1)}function V(e){const o=e.storageInfo.origin.x,i=U(e.spatialReference,!0);if(t(i))return{originX:o,halfWorldWidth:null,pyramidsInfo:null};const r=i/2,{nativePixelSize:s,storageInfo:a,extent:l}=e,{maximumPyramidLevel:c,blockWidth:f,pyramidScalingFactor:u}=a;let m=s.x;const h=[],x=n(e.transform)&&"gcs-shift"===e.transform.type,p=o+(x?0:r),g=x?i-o:r-o;for(let t=0;t<=c;t++){const e=(l.xmax-o)/m/f,t=e-Math.floor(e)==0?e:Math.ceil(e),n=g/m/f,i=n-Math.floor(n)==0?n:Math.ceil(n),r=Math.floor(p/m/f),s=Math.round(p/m)%f,a=(f-Math.round(g/m)%f)%f;h.push({resolutionX:m,blockWidth:f,datsetColumnCount:t,worldColumnCountFromOrigin:i,leftMargin:s,rightPadding:a,originColumnOffset:r}),m*=u}return{originX:o,halfWorldWidth:r,pyramidsInfo:h,hasGCSSShiftTransform:x}}function Z(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt);let n;if(E.has(t))n=E.get(t);else{n=(e.wkid?i.coordsys(e.wkid):i.fromString(r.PE_TYPE_PROJCS,e.wkt)).getGeogcs().getCode(),E.set(t,n)}return new y({wkid:n})}function $(e){const t=e.isAdaptive&&null==e.spacing;let o=e.spacing||[S,S],i=ee(e),r={cols:i.size[0]+1,rows:i.size[1]+1};const s=i.outofBoundPointCount>0&&i.outofBoundPointCount<i.offsets.length/2;let a=i.outofBoundPointCount===i.offsets.length/2||t&&s?[0,0]:R(i.offsets,r,o,G);const l=(a[0]+a[1])/2,c=e.projectedExtent.spatialReference,f=e.srcBufferExtent.spatialReference;if(t&&(s||l>G)){M(c,f,e.datumTransformation)&&(c.isGeographic||n(A(c))),o=[b,b],i=ee({...e,spacing:o}),r={cols:i.size[0]+1,rows:i.size[1]+1},a=R(i.offsets,r,o,G)}if(i.error=a,o[0]>1&&(i.coefficients=te(i.offsets,r,s)),e.includeGCSGrid&&!c.isGeographic&&!c.isWebMercator)if(f.isGeographic)i.gcsGrid={offsets:i.offsets,coefficients:i.coefficients,spacing:o};else{const t=A(c);if(n(t)&&!t.isEnvelope){const t=Z(c),n=J(e.projectedExtent,t),{offsets:a}=ee({...e,srcBufferExtent:n,spacing:o}),l=te(a,r,s);i.gcsGrid={offsets:a,coefficients:l,spacing:o}}}return i}function ee(e){const{projectedExtent:t,srcBufferExtent:o,pixelSize:i,datumTransformation:r,rasterTransform:s}=e,a=t.spatialReference,l=o.spatialReference,c=w(a,l),{xmin:f,ymin:u,xmax:m,ymax:h}=t,x=U(l),g=n(x)&&(e.hasWrapAround||"gcs-shift"===s?.type),y=e.spacing||[S,S],d=y[0]*i.x,M=y[1]*i.y,R=1===y[0],P=Math.ceil((m-f)/d-.1/y[0])+(R?0:1),G=Math.ceil((h-u)/M-.1/y[1])+(R?0:1),N=W({cols:P,rows:G,xmin:f,ymax:h,xres:d,yres:M,inSR:a,outSR:l,datumTransformation:r,preferPE:y[0]<=b,usePixelCenter:R}),E=[];let T,v=0;const C=R?-1:NaN,{xmin:j,xmax:z,ymax:L,width:O,height:I}=o,B=_(l,k),F=n(x)&&j>0&&z>x/2;let Y=!1;if(c){const e=A(a);Y=n(e)&&e.poleLocation>0}for(let n=0;n<P;n++){const e=[];for(let t=0;t<G;t++){let o=N[n*G+t];if(g&&o[0]>z&&o[0]>x/2-B?o[0]-=x:g&&0===n&&o[0]<0&&F&&!s&&(o[0]+=x),!o||isNaN(o[0])||isNaN(o[1]))E.push(C),E.push(C),e.push(null),v++;else{if(s){const e=s.inverseTransform(new p({x:o[0],y:o[1],spatialReference:l}));o=[e.x,e.y]}e.push(o),n>0&&g&&T[t]&&o[0]<T[t][0]&&(o[0]+=x,Y&&o[0]>z&&o[0]>x&&(o[0]-=x)),E.push((o[0]-j)/O),E.push((L-o[1])/I)}}T=e}return{offsets:E,error:null,coefficients:null,outofBoundPointCount:v,spacing:y,size:R?[P,G]:[P-1,G-1]}}function te(e,t,n){const{cols:o,rows:i}=t,r=new Float32Array((o-1)*(i-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<o-1;l++){for(let t=0;t<i-1;t++){let n=l*i*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],m=e[n+3];n+=2*i;const h=e[n],x=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(o-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*m+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*h+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*x+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function ne(e){const t=e.clone().normalize();return 1===t.length?t[0]:q(t)}function oe(e,t,i){const{storageInfo:r,pixelSize:s}=t;let a=0,l=!1;const{pyramidResolutions:c}=r;if(n(c)&&c.length){const n=(e.x+e.y)/2,r=c[c.length-1],f=(r.x+r.y)/2,u=(s.x+s.y)/2;if(n<=u)a=0;else if(n>=f)a=c.length,l=n/f>8;else{let e,t=u;for(let o=1;o<=c.length;o++){if(e=(c[o-1].x+c[o-1].y)/2,n<=e){n===e?a=o:"down"===i?(a=o-1,l=n/t>8):a="up"===i||n-t>e-n||n/t>2?o:o-1;break}t=e}}const m=0===a?s:c[a-1];if(l){Math.min(m.x,m.y)*o(t.spatialReference)>19567&&(l=!1)}return{pyramidLevel:a,pyramidResolution:new p({x:m.x,y:m.y,spatialReference:t.spatialReference}),excessiveReading:l}}const f=Math.log(e.x/s.x)/Math.LN2,u=Math.log(e.y/s.y)/Math.LN2,m=t.storageInfo.maximumPyramidLevel||0;a="down"===i?Math.floor(Math.min(f,u)):"up"===i?Math.ceil(Math.max(f,u)):Math.round((f+u)/2),a<0?a=0:a>m&&(l=a>m+3,a=m);const h=2**a;return{pyramidLevel:a,pyramidResolution:new p({x:h*t.nativePixelSize.x,y:h*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:l}}function ie(e,t,i=512,r=!0){const{extent:s,spatialReference:a,pixelSize:l}=e,c=C(new p({x:l.x,y:l.y,spatialReference:a}),t,s);if(null==c)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const f=(c.x+c.y)/2,u=o(t),m=f*u*96*39.37,h=t.isGeographic?256/i*295828763.7958547:256/i*591657527.591555;let x="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const g=J(s,t),y=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(h/2/m)/Math.LN2));if(!x&&r&&(t.isGeographic||t.isWebMercator)&&(x=g.xmin*g.xmax<0,!x&&y<3)){const e=U(t);if(n(e)){const t=2**y*f*i,n=Math.ceil(e/t);x=1===n||2===n&&e/2-g.xmax<t}}let d,M=m;const w=1.001,R=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(x){M=h;const e=t.isGeographic?1341104507446289e-21:.29858214164761665,n=e*(96*u*39.37),o=t.isGeographic?4326:3857;d=C(new p({x:e,y:e,spatialReference:{wkid:o}}),a,g),d.x*=M/n,d.y*=M/n}else{d={x:l.x,y:l.y};let e=0;for(;M<h*(w/2)&&e<y;)e++,M*=R,d.x*=R,d.y*=R;Math.max(M,h)/Math.min(M,h)<=w&&(M=h)}const P=[M],S=[{x:d.x,y:d.y}],b=70.5310735,G=Math.min(b,m)/w;for(;M>=G;)M/=R,d.x/=R,d.y/=R,P.push(M),S.push({x:d.x,y:d.y});return{projectedPixelSize:c,scales:P,srcResolutions:S,isCustomTilingScheme:!x}}export{ie as computeProjectedScales,S as defaultGridSpacing,G as defaultProjectionToleranceInPixels,v as getDefaultDatumTransformationForDataset,W as getProjectedGridPoints,$ as getProjectionOffsetGrid,V as getRasterDatasetAlignmentInfo,U as getWorldWidth,Q as getWorldWrapCount,T as load,b as minimumGridSpacing,J as projectExtent,j as projectPoint,C as projectResolution,M as requirePE,ne as snapExtent,oe as snapPyramid};
|
package/package.json
CHANGED
package/support/revision.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.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const e="20230121",a="6bae8af07d02a7e0737e2e890c40e48b0d4b0216";export{e as buildDate,a as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../../chunks/tslib.es6.js";import
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import o from"../../../../Color.js";import e from"../../../../Graphic.js";import"../../../../symbols.js";import{getAccentColor as i}from"../../../../core/analysisThemeUtils.js";import{isNone as r,unwrap as s,destroyMaybe as n}from"../../../../core/maybe.js";import{watch as a}from"../../../../core/reactiveUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{project as l}from"../../../../geometry/projection.js";import{isValid as p}from"../../../../geometry/support/spatialReferenceUtils.js";import d from"../../../../layers/GraphicsLayer.js";import{applyCIMSymbolColor as m}from"../../../../symbols/support/cimSymbolUtils.js";import{ViewingMode as y}from"../../../ViewingMode.js";import{DragManipulation as _}from"./manipulations/DragManipulation.js";import{InteractiveToolBase as f}from"../../../interactive/InteractiveToolBase.js";import{EditGeometryOperations as u}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as g}from"../../../interactive/editGeometry/interfaces.js";import P from"../../../../symbols/CIMSymbol.js";const S={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",shift:"Shift"},v=1,k=10,b=new o("#009AF2");let G=class extends f{constructor(t){super(t),this._factor=1,this._initialControlPoints=null,this._graphicsLayer=new d({internal:!0,listMode:"hide",visible:!1,effect:"drop-shadow(0px, 0px, 3px)"}),this._undoStack=[],this._redoStack=[],this._sharedUndoStack=[],this._sharedRedoStack=[],this.activeHandle=0}initialize(){const{view:t,mediaElement:o}=this;if(r(o.georeference))return;const n=o.georeference;"control-points"!==n.type||r(n.coords)||(this._georeference=n,this._initialControlPoints=s(this._georeference.controlPoints),this._controlPointEditGeometryOperations=s(this._georeference.controlPoints).map((({mapPoint:o})=>u.fromGeometry(l(o,t.spatialReference),y.Local))),this._controlPointGraphics=this._controlPointEditGeometryOperations.map(((t,o)=>new e({symbol:new P({data:{type:"CIMSymbolReference",symbol:{type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,colorLocked:!0,anchorPoint:{x:0,y:-15.75},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:9,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:84.3,ymax:84.3},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[83.2,32.5],[84.3,40.7],[83.8,48.9],[81.7,56.9],[78.1,64.3],[73,70.9],[66.9,76.4],[59.7,80.5],[51.9,83.2],[43.7,84.3],[35.4,83.8],[27.4,81.7],[20,78],[13.4,73],[7.9,66.8],[3.8,59.7],[1.1,51.9],[0,43.7],[.5,35.4],[2.6,27.4],[6.3,20],[11.3,13.4],[17.5,7.9],[24.7,3.8],[32.5,1.1],[39.8,.1],[47.1,.3],[54.3,1.8],[61.1,4.5],[67.4,8.4],[72.9,13.3],[77.4,19.1],[80.9,25.5],[83.2,32.5]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[255,255,255,255]}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[84.3,0],[84.3,84.3],[0,84.3],[0,0]]]}},rotation:0},{type:"CIMVectorMarker",enable:!0,anchorPoint:{x:0,y:-11.25},anchorPointUnits:"Absolute",dominantSizeAxis3D:"Y",size:22.5,billboardMode3D:"FaceNearPlane",frame:{xmin:0,ymin:0,xmax:197.7,ymax:294.7},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[98.9,0],[119.4,23.2],[139.4,49.3],[156.8,75.2],[171.2,100.8],[182.4,125.3],[190.6,148.8],[195.7,171.4],[197.7,192.9],[197.7,195.8],[197.7,200.3],[197.6,202.5],[197.5,204.8],[197.3,207.1],[197,209.4],[196.7,211.7],[196.4,214.1],[196,216.4],[195.5,218.7],[195,221.1],[194.4,223.4],[193.7,225.8],[193,228.1],[192.2,230.5],[191.4,232.8],[190.5,235.1],[189.5,237.5],[188.5,239.7],[187.4,242],[186.2,244.3],[185,246.5],[183.7,248.7],[182.4,250.9],[181,253.1],[179.5,255.2],[178,257.3],[176.4,259.4],[174.7,261.4],[173.1,263.3],[171.3,265.3],[169.5,267.2],[167.7,269],[165.8,270.8],[163.9,272.5],[161.9,274.2],[159.9,275.8],[157.8,277.4],[155.7,278.9],[153.6,280.4],[151.4,281.7],[149.2,283.1],[147,284.4],[144.8,285.6],[142.5,286.7],[140.3,287.8],[138,288.8],[135.7,289.8],[133.4,290.7],[131,291.5],[128.7,292.3],[126.4,293],[124,293.6],[121.7,294.2],[119.4,294.7],[117,295.2],[114.7,295.6],[112.4,296],[110.1,296.3],[107.8,296.5],[105.5,296.7],[103.3,296.8],[101.1,296.9],[98.8,296.9],[83.1,295.7],[67.8,292],[53.3,285.9],[39.9,277.5],[28.1,267.2],[18,255.1],[10,241.5],[4.2,226.9],[.9,211.5],[0,195.8],[.1,192.9],[2.1,171.4],[7.2,148.8],[15.4,125.3],[26.6,100.8],[41,75.2],[58.4,49.3],[78.4,23.2],[98.9,0]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:o===this.activeHandle?b.toArray():i().toArray()}]}}],scaleSymbolsProportionally:!0,respectFrame:!0,clippingPath:{type:"CIMClippingPath",clippingType:"Intersect",path:{rings:[[[0,0],[197.7,0],[197.7,294.7],[0,294.7],[0,0]]]}},rotation:0}],haloSize:1,scaleX:1,angleAlignment:"Display",angle:0}}}),geometry:t.data.geometry}))),this._graphicsLayer.graphics.addMany([...this._controlPointGraphics]),this._controlPointManipulations=this._controlPointGraphics.map((o=>new _({tool:this,view:t,graphic:o}))),this.addHandles([...this._controlPointManipulations.map(((t,o)=>t.createDragPipeline(this._getInfo.bind(this,o),((t,e)=>{"start"===t.action&&(this._undoStack.push(o),this._redoStack=[],this._sharedUndoStack.push({tool:this,operation:e}),this._sharedRedoStack.length=0),this.updateGraphics()})))),a((()=>this.view.scale),(()=>this.active?this.updateGraphics():null))]),this._controlPointManipulations.forEach(((t,o)=>{const e=t=>{this.addHandles([t.events.on(["click","grab-changed"],(t=>this.updateActiveHandle(o)))])};t.forEachManipulator(e)})),this.addHandles([t.on("key-down",(o=>{t.activeTool===this&&(o.key!==S.shift||o.repeat||(this._factor=k,o.stopPropagation()),o.key===S.up&&(this._move(0,this._factor),o.stopPropagation()),o.key===S.down&&(this._move(0,-this._factor),o.stopPropagation()),o.key===S.left&&(this._move(-this._factor,0),o.stopPropagation()),o.key===S.right&&(this._move(this._factor,0),o.stopPropagation()))})),t.on("key-up",(o=>{t.activeTool===this&&o.key===S.shift&&(this._factor=v,o.stopPropagation())}))]),t.map.addMany([this._graphicsLayer]),t.focus(),this.visible=!1,this.finishToolCreation())}destroy(){const{map:t}=this.view;this._controlPointManipulations.forEach((t=>t.destroy())),this._controlPointEditGeometryOperations.forEach((t=>t.destroy())),t.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=n(this._graphicsLayer),this._georeference=null,this._controlPointGraphics=null,this._controlPointManipulations=null,this._graphicsLayer=null,this._controlPointEditGeometryOperations=null,this._undoStack=null,this._redoStack=null,this._initialControlPoints=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _hasValidSpatialReference(){return p(this.view.spatialReference)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){const t=this._undoStack[this._undoStack.length-1];return null!=t&&this._controlPointEditGeometryOperations[t].canUndo}canRedo(){const t=this._redoStack[this._redoStack.length-1];return null!=t&&this._controlPointEditGeometryOperations[t].canRedo}undo(){if(this._undoStack.length>0){const t=this._undoStack.pop();this._controlPointEditGeometryOperations[t].undo(),this.updateGraphics(),this._redoStack.push(t)}}redo(){if(this._redoStack.length>0){const t=this._redoStack.pop();this._controlPointEditGeometryOperations[t].redo(),this.updateGraphics(),this._undoStack.push(t)}}refresh(){const{mediaElement:t}=this;if(r(t.georeference))return;const o=t.georeference;"control-points"!==o.type||r(o.coords)||(this._georeference=o,s(this._georeference.controlPoints).forEach((({mapPoint:t},o)=>{const e=this._controlPointEditGeometryOperations[o],i=e.data.components[0].vertices[0];e.setVertexPosition(i,e.data.coordinateHelper.pointToVector(t))})),this.updateGraphics())}reset(){this._georeference.controlPoints=this._initialControlPoints,this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const t=this._georeference,o=s(t.controlPoints),e=s(o[0].mapPoint).spatialReference,i=this._hasValidSpatialReference;this._georeference.controlPoints=this._controlPointEditGeometryOperations.map(((r,n)=>{const a=r.data.geometry;return this._controlPointGraphics[n].geometry=a,{mapPoint:l(a,e),sourcePoint:i?s(o[n]).sourcePoint:t.toSource(a)}}))}updateActiveHandle(t){if(this.activeHandle===t)return;const o=s(this._controlPointGraphics[this.activeHandle].symbol).clone();m(o,i()),this._controlPointGraphics[this.activeHandle].symbol=o;const e=s(this._controlPointGraphics[t].symbol).clone();m(e,b),this._controlPointGraphics[t].symbol=e,this.activeHandle=t}setSharedUndoStack(t){this._sharedUndoStack=t}setSharedRedoStack(t){this._sharedRedoStack=t}_getInfo(t){return{editGeometryOperations:this._controlPointEditGeometryOperations[t],constraints:this._hasValidSpatialReference?null:{xmin:0,ymin:0,xmax:this._georeference.width,ymax:this._georeference.height}}}_move(t,o){const e=this._controlPointEditGeometryOperations[this.activeHandle],i=[];for(const s of e.data.components)i.push(...s.vertices);const r=e.moveVertices(i,t*this.view.resolution,o*this.view.resolution,0,g.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}};t([c()],G.prototype,"_hasValidSpatialReference",null),t([c()],G.prototype,"activeHandle",void 0),t([c({constructOnly:!0,nonNullable:!0})],G.prototype,"mediaElement",void 0),t([c({constructOnly:!0})],G.prototype,"view",void 0),G=t([h("esri.views.2d.interactive.editingTools.ControlPointsTransformTool")],G);export{G as ControlPointsTransformTool,S as KEYS};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as o}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{unwrap as e}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{ControlPointsTransformTool as i}from"./ControlPointsTransformTool.js";import{TransformTool as n}from"./TransformTool.js";const d={redo:"r",undo:"z"
|
|
5
|
+
import{_ as o}from"../../../../chunks/tslib.es6.js";import t from"../../../../core/Accessor.js";import{unwrap as e}from"../../../../core/maybe.js";import{watch as s}from"../../../../core/reactiveUtils.js";import{property as r}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{ControlPointsTransformTool as i}from"./ControlPointsTransformTool.js";import{TransformTool as n}from"./TransformTool.js";const d={redo:"r",undo:"z"};let l=class extends t{constructor(o){super(o),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=[],this._sharedRedoStack=[],this.activeHandle=0}initialize(){const{view:o,mediaElement:t,preserveAspectRatio:r,snapRotation:a,advancedMode:l}=this;this._transformTool=new n({target:t,view:o,preserveAspectRatio:r,snapRotation:a}),this._controlPointsTransformTool=new i({mediaElement:t,view:o}),this._advancedModeTransformTool=new i({mediaElement:l.mediaElement,view:l.view}),this._transformTool.setSharedUndoStack(this._sharedUndoStack),this._transformTool.setSharedRedoStack(this._sharedRedoStack),this._controlPointsTransformTool.setSharedUndoStack(this._sharedUndoStack),this._controlPointsTransformTool.setSharedRedoStack(this._sharedRedoStack),this._advancedModeTransformTool.setSharedUndoStack(this._sharedUndoStack),this._advancedModeTransformTool.setSharedRedoStack(this._sharedRedoStack);const c=e(t.georeference),h=e(l.mediaElement.georeference);l.view.tools.addMany([this._advancedModeTransformTool]),"controlPoints"in h&&"controlPoints"in c&&this.addHandles([l.view.on("key-down",(o=>{o.key===d.undo&&this.canUndo()&&(this.undo(),o.stopPropagation()),o.key===d.redo&&this.canRedo()&&(this.redo(),o.stopPropagation())})),s((()=>h.controlPoints),(o=>{c.controlPoints=e(o).map((({sourcePoint:o},t)=>({sourcePoint:o,mapPoint:e(c.controlPoints)[t].mapPoint}))),this._activeTool?.refresh()})),s((()=>this._controlPointsTransformTool.activeHandle),(o=>{this._advancedModeTransformTool.updateActiveHandle(o),this.activeHandle=o})),s((()=>this._advancedModeTransformTool.activeHandle),(o=>{this._controlPointsTransformTool.updateActiveHandle(o),this.activeHandle=o}))]),this.addHandles([o.on("key-down",(o=>{o.key===d.undo&&this.canUndo()&&(this.undo(),o.stopPropagation()),o.key===d.redo&&this.canRedo()&&(this.redo(),o.stopPropagation())}))]),o.tools.addMany([this._transformTool,this._controlPointsTransformTool]),o.activeTool=this._transformTool,this._activeTool=this._transformTool,o.focus()}destroy(){this._transformTool?.destroy(),this._controlPointsTransformTool?.destroy(),this._transformTool=null,this._controlPointsTransformTool=null,this._advancedModeTransformTool=null,this._activeTool=null,this._sharedUndoStack=null,this._sharedRedoStack=null}canUndo(){return this._sharedUndoStack.length>0}canRedo(){return this._sharedRedoStack.length>0}undo(){if(this._sharedUndoStack.length>0){const{tool:o,operation:t}=this._sharedUndoStack.pop();o!==this._activeTool&&o.refresh(),t.undo(),o.updateGraphics(),this._sharedRedoStack.push({tool:o,operation:t}),this._activeTool!==o&&this._activeTool?.refresh()}}redo(){if(this._sharedRedoStack.length>0){const{tool:o,operation:t}=this._sharedRedoStack.pop();o!==this._activeTool&&o.refresh(),t.apply(),o.updateGraphics(),this._sharedUndoStack.push({tool:o,operation:t}),this._activeTool!==o&&this._activeTool?.refresh()}}refresh(){this._activeTool.refresh()}reset(){this._activeTool.reset(),this._advancedModeTransformTool.reset()}async enableAdvancedMode(){this.view.activeTool=this._controlPointsTransformTool,this._activeTool=this._controlPointsTransformTool,this._activeTool.refresh(),await this.advancedMode.view.when(),this.advancedMode.view.activeTool=this._advancedModeTransformTool,this._controlPointsTransformTool.mediaElement.opacity=.25}disableAdvancedMode(){this.view.activeTool=this._transformTool,this._activeTool=this._transformTool,this._activeTool.refresh(),this.advancedMode.view.activeTool=null,this._controlPointsTransformTool.mediaElement.opacity=1}};o([r()],l.prototype,"activeHandle",void 0),o([r({constructOnly:!0})],l.prototype,"advancedMode",void 0),o([r()],l.prototype,"preserveAspectRatio",void 0),o([r()],l.prototype,"snapRotation",void 0),o([r({constructOnly:!0,nonNullable:!0})],l.prototype,"mediaElement",void 0),o([r({constructOnly:!0})],l.prototype,"view",void 0),l=o([a("esri.views.2d.interactive.editingTools.MediaTransformToolsWrapper")],l);export{d as KEYS,l as MediaTransformToolsWrapper};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.26/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import t from"../../../../Graphic.js";import"../../../../symbols.js";import{getAccentColor as i,getContrastColor as s}from"../../../../core/analysisThemeUtils.js";import{unwrap as r,isSome as o,destroyMaybe as a}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as l}from"../../../../core/unitUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as h}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as p,f as m}from"../../../../chunks/vec2.js";import{a as _}from"../../../../chunks/vec2f64.js";import{g as d,l as u,n as y,a as g,h as f,b as v}from"../../../../chunks/vec3.js";import{c as G}from"../../../../chunks/vec3f64.js";import{project as b}from"../../../../geometry/projection.js";import{a as R,c as w}from"../../../../chunks/boundedPlane.js";import{equals as j}from"../../../../geometry/support/spatialReferenceUtils.js";import C from"../../../../layers/GraphicsLayer.js";import{ViewingMode as k}from"../../../ViewingMode.js";import{DragManipulation as A}from"./manipulations/DragManipulation.js";import{RotateManipulation as P}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as M}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as S,SnapRotation as D}from"./manipulations/utils.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";import{EditGeometry as U}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as T}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{calculateOrientedBounds as B}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as L}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as O}from"../../../support/screenUtils.js";import E from"../../../../symbols/SimpleFillSymbol.js";import H from"../../../../symbols/SimpleMarkerSymbol.js";import I from"../../../../geometry/Polygon.js";import V from"../../../../geometry/Point.js";const z=80,q=10,F=30,N=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]];let J=class extends x{constructor(e){super(e),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=R(),this._displayPlaneCache=R(),this._mainAxisCache=_(),this._rotationHandleCache=G(),this._cornerA=G(),this._cornerB=G(),this._cornerC=G(),this._cornerD=G(),this._avgAB=G(),this._avgBC=G(),this._avgCD=G(),this._avgDA=G(),this._preserveAspectRatio=new S,this._snapRotation=new D,this._graphicsLayer=new C({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[]}initialize(){const{view:e,target:a}=this;if("georeference"in a){const e=r(a.georeference);this._graphic=new t({geometry:r(e.coords)}),this._initialControlPoints="control-points"===e.type?e.controlPoints:null}else this._graphic=a,this._initialGeometry=r(a.geometry);const l=this._graphic.geometry;this._editGeometryOperations=T.fromGeometry(b(l,e.spatialReference),k.Local),this._backgroundGraphic=new t({symbol:new E({color:"transparent",outline:{type:"simple-line",color:i(),width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new t({symbol:new H({color:s(),outline:{type:"simple-line",color:i(),width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((e=>new t({symbol:new H({size:6,style:"square",color:s(),outline:{type:"simple-line",color:i(),width:1}}),geometry:e}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new A({tool:this,view:e,graphic:this._graphic}),this._rotateManipulation=new P({tool:this,view:e,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((t,i)=>new M({tool:this,view:e,graphic:t,direction:N[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((e=>e.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),n((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),e.on("click",(async t=>{if(null!=e.activeTool&&e.activeTool!==this)return;const i=O(t),s=[];e.map.allLayers.forEach((e=>{"vector-tile"!==e.type&&"imagery"!==e.type||s.push(e)}));const r=await this.view.hitTest(i,{exclude:s}),n=r.results;if(0===n.length)e.activeTool=null;else{const t=L(r.results),i="georeference"in a,s=n.map((e=>"media"===e.type?e.element:null)).filter(Boolean),l=[...this._graphicsLayer.graphics,i?null:a].filter(Boolean);i&&s.includes(a)||o(t)&&l.includes(t.graphic)?null==e.activeTool&&(e.activeTool=this):e.activeTool=null}}))]);const c=e=>{let t=1;this.addHandles(e.events.on("grab-changed",(e=>{"georeference"in a&&("start"===e.action?(t=a.opacity,a.opacity=.5*t):"end"===e.action&&(a.opacity=t))})))};this._dragManipulation.forEachManipulator(c),this._rotateManipulation.forEachManipulator(c),this._scaleManipulations.forEach((e=>e.forEachManipulator(c))),e.map.addMany([this._graphicsLayer]),e.focus(),this.visible=!1,this.finishToolCreation()}destroy(){const{map:e}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((e=>e.destroy())),this._editGeometryOperations.destroy(),e.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=a(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const e=this._graphic.geometry;if(!o(e))return null;const t=this._editGeometryOperations.data,i=t.components[0].edges[0],s=p(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);m(s,s);let r=z*this.view.resolution;const a=this.view.spatialReference;return j(a,e.spatialReference)&&(r*=l(a)/l(e.spatialReference)),B(s,t,r,this._planeCache)}get _displayPlane(){const e=this._plane;if(!e)return null;const t=this._displayPlaneCache;w(e,t);const i=q*this.view.resolution;return d(t.basis1,t.basis1,1+i/u(t.basis1)),d(t.basis2,t.basis2,1+i/u(t.basis2)),t}get _backgroundGraphicGeometry(){const e=this._displayPlane;if(!e)return null;const t=this.view.spatialReference;return this._updateDisplayPlaneConrers(e),new I({spatialReference:t,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const e=this._plane;if(!e)return null;const t=this._rotationHandleCache;return y(t,e.basis1),d(t,t,F*this.view.resolution),g(t,t,e.origin),g(t,t,e.basis1),new V({x:t[0],y:t[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const e=this._displayPlane;if(!e)return[];const t=this.view.spatialReference;this._updateDisplayPlaneConrers(e);const{_cornerA:i,_cornerB:s,_cornerC:r,_cornerD:o}=this,a=f(this._avgAB,i,s,.5),n=f(this._avgBC,s,r,.5),l=f(this._avgCD,r,o,.5),c=f(this._avgDA,o,i,.5);return[new V({x:i[0],y:i[1],spatialReference:t}),new V({x:s[0],y:s[1],spatialReference:t}),new V({x:r[0],y:r[1],spatialReference:t}),new V({x:o[0],y:o[1],spatialReference:t}),new V({x:a[0],y:a[1],spatialReference:t}),new V({x:n[0],y:n[1],spatialReference:t}),new V({x:l[0],y:l[1],spatialReference:t}),new V({x:c[0],y:c[1],spatialReference:t})]}get preserveAspectRatio(){return this._preserveAspectRatio.enabled}set preserveAspectRatio(e){this._preserveAspectRatio.enabled=e,this._set("preserveAspectRatio",e)}get snapRotation(){return this._snapRotation.enabled}set snapRotation(e){this._snapRotation.enabled=e,this._set("snapRotation",e)}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:e,target:t}=this,i="georeference"in t?r(r(t.georeference).coords):t.geometry,s=this._editGeometryOperations,o=s.data.components[0].vertices,a=U.fromGeometry(b(i,e.spatialReference),k.Local).components[0].vertices;o.forEach(((e,t)=>{s.setVertexPosition(e,a[t].pos)})),this.updateGraphics()}reset(){const{target:e}=this;if("georeference"in e){const t=r(e.georeference);"control-points"===t.type&&(t.controlPoints=this._initialControlPoints)}else e.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const e=this._editGeometryOperations.data.geometry;if("georeference"in this.target){r(this.target.georeference).coords=e}this._graphic.geometry=e,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((e,t)=>{this._scaleGraphics[t].geometry=e}))}setSharedUndoStack(e){this._sharedUndoStack=e}setSharedRedoStack(e){this._sharedRedoStack=e}_updateDisplayPlaneConrers(e){const{basis1:t,basis2:i,origin:s}=e,r=this._cornerA;g(r,s,t),g(r,r,i);const o=this._cornerB;g(o,s,t),v(o,o,i);const a=this._cornerC;v(a,s,t),v(a,a,i);const n=this._cornerD;v(n,s,t),g(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(e,t){"start"===e.action&&(this._sharedUndoStack.push({tool:this,operation:t}),this._sharedRedoStack.length=0),this.updateGraphics()}};e([c()],J.prototype,"_plane",null),e([c()],J.prototype,"_backgroundGraphicGeometry",null),e([c()],J.prototype,"_rotateGraphicGeometry",null),e([c()],J.prototype,"_scaleGraphicGeometries",null),e([c()],J.prototype,"preserveAspectRatio",null),e([c()],J.prototype,"snapRotation",null),e([c({constructOnly:!0,nonNullable:!0})],J.prototype,"target",void 0),e([c({constructOnly:!0})],J.prototype,"view",void 0),J=e([h("esri.views.2d.interactive.editingTools.TransformTool")],J);export{J as TransformTool};
|
|
5
|
+
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../geometry.js";import e from"../../../../Graphic.js";import"../../../../symbols.js";import{getAccentColor as i,getContrastColor as s}from"../../../../core/analysisThemeUtils.js";import{unwrap as o,isSome as r,destroyMaybe as a}from"../../../../core/maybe.js";import{watch as n}from"../../../../core/reactiveUtils.js";import{getMetersPerUnitForSR as h}from"../../../../core/unitUtils.js";import{property as c}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as l}from"../../../../core/accessorSupport/decorators/subclass.js";import{a as p,f as _}from"../../../../chunks/vec2.js";import{a as m,U as d}from"../../../../chunks/vec2f64.js";import{g as u,l as y,n as g,a as f,h as v,b as G}from"../../../../chunks/vec3.js";import{c as w}from"../../../../chunks/vec3f64.js";import{project as R}from"../../../../geometry/projection.js";import{a as b,c as k}from"../../../../chunks/boundedPlane.js";import{equals as j}from"../../../../geometry/support/spatialReferenceUtils.js";import P from"../../../../layers/GraphicsLayer.js";import{ViewingMode as A}from"../../../ViewingMode.js";import{DragManipulation as C}from"./manipulations/DragManipulation.js";import{RotateManipulation as S}from"./manipulations/RotateManipulation.js";import{ScaleManipulation as M}from"./manipulations/ScaleManipulation.js";import{PreserveAspectRatio as U,SnapRotation as D}from"./manipulations/utils.js";import{InteractiveToolBase as x}from"../../../interactive/InteractiveToolBase.js";import{EditGeometry as T}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as E}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{AccumulationBehaviour as L}from"../../../interactive/editGeometry/interfaces.js";import{AccumulationType as O}from"../../../interactive/editGeometry/operations/UpdateVertices.js";import{calculateOrientedBounds as B}from"../../../interactive/editGeometry/support/editPlaneUtils.js";import{findFirstGraphicHit as H}from"../../../support/hitTestSelectUtils.js";import{createScreenPointFromEvent as V}from"../../../support/screenUtils.js";import I from"../../../../symbols/SimpleFillSymbol.js";import N from"../../../../symbols/SimpleMarkerSymbol.js";import z from"../../../../geometry/Polygon.js";import W from"../../../../geometry/Point.js";const q={up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",plus:"+",minus:"-",shift:"Shift"},F=80,J=10,K=30,Q=[[1,1],[1,-1],[-1,-1],[-1,1],[1,0],[0,-1],[-1,0],[0,1]],X=1,Y=10;let Z=class extends x{constructor(t){super(t),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._planeCache=b(),this._displayPlaneCache=b(),this._mainAxisCache=m(),this._rotationHandleCache=w(),this._cornerA=w(),this._cornerB=w(),this._cornerC=w(),this._cornerD=w(),this._avgAB=w(),this._avgBC=w(),this._avgCD=w(),this._avgDA=w(),this._preserveAspectRatio=new U,this._snapRotation=new D,this._graphicsLayer=new P({internal:!0,listMode:"hide",visible:!1}),this._sharedUndoStack=[],this._sharedRedoStack=[],this._factor=1,this.preserveAspectRatio=null,this.snapRotation=null}initialize(){const{view:t,target:a}=this;if("georeference"in a){const t=o(a.georeference);this._graphic=new e({geometry:o(t.coords)}),this._initialControlPoints="control-points"===t.type?t.controlPoints:null}else this._graphic=a,this._initialGeometry=o(a.geometry);const h=this._graphic.geometry;this._editGeometryOperations=E.fromGeometry(R(h,t.spatialReference),A.Local),this._backgroundGraphic=new e({symbol:new I({color:"transparent",outline:{type:"simple-line",color:i(),width:2}}),geometry:this._backgroundGraphicGeometry}),this._rotateGraphic=new e({symbol:new N({color:s(),outline:{type:"simple-line",color:i(),width:1}}),geometry:this._rotateGraphicGeometry}),this._scaleGraphics=this._scaleGraphicGeometries.map((t=>new e({symbol:new N({size:6,style:"square",color:s(),outline:{type:"simple-line",color:i(),width:1}}),geometry:t}))),this._graphicsLayer.graphics.addMany([this._backgroundGraphic,this._rotateGraphic,...this._scaleGraphics]),this._dragManipulation=new C({tool:this,view:t,graphic:this._graphic}),this._rotateManipulation=new S({tool:this,view:t,graphic:this._rotateGraphic,snapRotation:this._snapRotation}),this._scaleManipulations=this._scaleGraphics.map(((e,i)=>new M({tool:this,view:t,graphic:e,direction:Q[i],preserveAspectRatio:this._preserveAspectRatio}))),this.addHandles([this._dragManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),this._rotateManipulation.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)),...this._scaleManipulations.map((t=>t.createDragPipeline(this._getInfo.bind(this),this._updateGraphics.bind(this)))),n((()=>this.view.scale),(()=>this.active?this.updateGraphics():null)),t.on("click",(async e=>{if(null!=t.activeTool&&t.activeTool!==this)return;const i=V(e),s=[];t.map.allLayers.forEach((t=>{"vector-tile"!==t.type&&"imagery"!==t.type||s.push(t)}));const o=await this.view.hitTest(i,{exclude:s}),n=o.results;if(0===n.length)t.activeTool=null;else{const e=H(o.results),i="georeference"in a,s=n.map((t=>"media"===t.type?t.element:null)).filter(Boolean),h=[...this._graphicsLayer.graphics,i?null:a].filter(Boolean);i&&s.includes(a)||r(e)&&h.includes(e.graphic)?null==t.activeTool&&(t.activeTool=this):t.activeTool=null}}))]);const c=t=>{let e=1;this.addHandles(t.events.on("grab-changed",(t=>{"georeference"in a&&("start"===t.action?(e=a.opacity,a.opacity=.5*e):"end"===t.action&&(a.opacity=e))})))};this._dragManipulation.forEachManipulator(c),this._rotateManipulation.forEachManipulator(c),this._scaleManipulations.forEach((t=>t.forEachManipulator(c))),this.addHandles([t.on("key-down",(e=>{t.activeTool===this&&(e.key!==q.shift||e.repeat||(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._factor=Y,e.stopPropagation()),e.key===q.plus&&(this._scale(this._factor),e.stopPropagation()),e.key===q.minus&&(this._scale(-this._factor),e.stopPropagation()),e.key===q.up&&(this._move(0,this._factor),e.stopPropagation()),e.key===q.down&&(this._move(0,-this._factor),e.stopPropagation()),e.key===q.left&&(this._move(-this._factor,0),e.stopPropagation()),e.key===q.right&&(this._move(this._factor,0),e.stopPropagation()))})),t.on("key-up",(e=>{t.activeTool===this&&e.key===q.shift&&(null==this.preserveAspectRatio&&(this._preserveAspectRatio.enabled=!this._preserveAspectRatio.enabled),null==this.snapRotation&&(this._snapRotation.enabled=!this._snapRotation.enabled),this._factor=X,e.stopPropagation())}))]),t.map.addMany([this._graphicsLayer]),t.focus(),this.visible=!1,this.finishToolCreation()}destroy(){const{map:t}=this.view;this._dragManipulation.destroy(),this._rotateManipulation.destroy(),this._scaleManipulations.forEach((t=>t.destroy())),this._editGeometryOperations.destroy(),t.removeMany([this._graphicsLayer]),this._graphicsLayer.removeAll(),this._graphicsLayer=a(this._graphicsLayer),this._initialControlPoints=null,this._initialGeometry=null,this._graphic=null,this._preserveAspectRatio=null,this._snapRotation=null,this._planeCache=null,this._displayPlaneCache=null,this._rotationHandleCache=null,this._mainAxisCache=null,this._cornerA=null,this._cornerB=null,this._cornerC=null,this._cornerD=null,this._avgAB=null,this._avgBC=null,this._avgCD=null,this._avgDA=null,this._sharedUndoStack=null,this._sharedRedoStack=null}get _plane(){const t=this._graphic.geometry;if(!r(t))return null;const e=this._editGeometryOperations.data,i=e.components[0].edges[0],s=p(this._mainAxisCache,i.leftVertex.pos,i.rightVertex.pos);_(s,s);let o=F*this.view.resolution;const a=this.view.spatialReference;return j(a,t.spatialReference)&&(o*=h(a)/h(t.spatialReference)),B(s,e,o,this._planeCache)}get _displayPlane(){const t=this._plane;if(!t)return null;const e=this._displayPlaneCache;k(t,e);const i=J*this.view.resolution;return u(e.basis1,e.basis1,1+i/y(e.basis1)),u(e.basis2,e.basis2,1+i/y(e.basis2)),e}get _backgroundGraphicGeometry(){const t=this._displayPlane;if(!t)return null;const e=this.view.spatialReference;return this._updateDisplayPlaneConrers(t),new z({spatialReference:e,rings:[[this._cornerA,this._cornerB,this._cornerC,this._cornerD,this._cornerA]]})}get _rotateGraphicGeometry(){const t=this._plane;if(!t)return null;const e=this._rotationHandleCache;return g(e,t.basis1),u(e,e,K*this.view.resolution),f(e,e,t.origin),f(e,e,t.basis1),new W({x:e[0],y:e[1],spatialReference:this.view.spatialReference})}get _scaleGraphicGeometries(){const t=this._displayPlane;if(!t)return[];const e=this.view.spatialReference;this._updateDisplayPlaneConrers(t);const{_cornerA:i,_cornerB:s,_cornerC:o,_cornerD:r}=this,a=v(this._avgAB,i,s,.5),n=v(this._avgBC,s,o,.5),h=v(this._avgCD,o,r,.5),c=v(this._avgDA,r,i,.5);return[new W({x:i[0],y:i[1],spatialReference:e}),new W({x:s[0],y:s[1],spatialReference:e}),new W({x:o[0],y:o[1],spatialReference:e}),new W({x:r[0],y:r[1],spatialReference:e}),new W({x:a[0],y:a[1],spatialReference:e}),new W({x:n[0],y:n[1],spatialReference:e}),new W({x:h[0],y:h[1],spatialReference:e}),new W({x:c[0],y:c[1],spatialReference:e})]}onActivate(){this.visible=!0}onDeactivate(){this.visible=!1}onShow(){this._graphicsLayer.visible=!0}onHide(){this._graphicsLayer.visible=!1}canUndo(){return this._editGeometryOperations.canUndo}canRedo(){return this._editGeometryOperations.canRedo}undo(){this._editGeometryOperations.undo(),this.updateGraphics()}redo(){this._editGeometryOperations.redo(),this.updateGraphics()}refresh(){const{view:t,target:e}=this,i="georeference"in e?o(o(e.georeference).coords):e.geometry,s=this._editGeometryOperations,r=s.data.components[0].vertices,a=T.fromGeometry(R(i,t.spatialReference),A.Local).components[0].vertices;r.forEach(((t,e)=>{s.setVertexPosition(t,a[e].pos)})),this.updateGraphics()}reset(){const{target:t}=this;if("georeference"in t){const e=o(t.georeference);"control-points"===e.type&&(e.controlPoints=this._initialControlPoints)}else t.geometry=this._initialGeometry;this.refresh(),this._sharedUndoStack.length=0,this._sharedRedoStack.length=0}updateGraphics(){const t=this._editGeometryOperations.data.geometry;if("georeference"in this.target){o(this.target.georeference).coords=t}this._graphic.geometry=t,this._backgroundGraphic.geometry=this._backgroundGraphicGeometry,this._rotateGraphic.geometry=this._rotateGraphicGeometry,this._scaleGraphicGeometries.forEach(((t,e)=>{this._scaleGraphics[e].geometry=t}))}setSharedUndoStack(t){this._sharedUndoStack=t}setSharedRedoStack(t){this._sharedRedoStack=t}_updateDisplayPlaneConrers(t){const{basis1:e,basis2:i,origin:s}=t,o=this._cornerA;f(o,s,e),f(o,o,i);const r=this._cornerB;f(r,s,e),G(r,r,i);const a=this._cornerC;G(a,s,e),G(a,a,i);const n=this._cornerD;G(n,s,e),f(n,n,i)}_getInfo(){return{editGeometryOperations:this._editGeometryOperations,plane:this._plane,displayPlane:this._displayPlane}}_updateGraphics(t,e){"start"===t.action&&(this._sharedUndoStack.push({tool:this,operation:e}),this._sharedRedoStack.length=0),this.updateGraphics()}_scale(t){const e=this._editGeometryOperations,i=[];for(const a of e.data.components)i.push(...a.vertices);const s=e.data.geometry.extent?.width,o=(s+t*this.view.resolution)/s,r=e.scaleVertices(i,this._plane.origin,d,o,o,L.NEW_STEP,O.REPLACE);this._sharedUndoStack.push({tool:this,operation:r}),this._sharedRedoStack.length=0,this.updateGraphics()}_move(t,e){const i=this._editGeometryOperations,s=[];for(const r of i.data.components)s.push(...r.vertices);const o=i.moveVertices(s,t*this.view.resolution,e*this.view.resolution,0,L.NEW_STEP);this._sharedUndoStack.push({tool:this,operation:o}),this._sharedRedoStack.length=0,this.updateGraphics()}};t([c()],Z.prototype,"_plane",null),t([c()],Z.prototype,"_backgroundGraphicGeometry",null),t([c()],Z.prototype,"_rotateGraphicGeometry",null),t([c()],Z.prototype,"_scaleGraphicGeometries",null),t([c()],Z.prototype,"preserveAspectRatio",void 0),t([c()],Z.prototype,"snapRotation",void 0),t([c({constructOnly:!0,nonNullable:!0})],Z.prototype,"target",void 0),t([c({constructOnly:!0})],Z.prototype,"view",void 0),Z=t([l("esri.views.2d.interactive.editingTools.TransformTool")],Z);export{q as KEYS,Z as TransformTool};
|