@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
3 lines (2 loc) • 2.56 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0.8/LICENSE.txt */
import{parseWhereClause as e}from"../../core/sql.js";import{load as r,project as t}from"../../geometry/projectionUtils.js";import o from"../../geometry/SpatialReference.js";import{e as s}from"../../chunks/containsOperator.js";import{e as n}from"../../chunks/crossesOperator.js";import{e as i}from"../../chunks/generalizeOperator.js";import{e as a}from"../../chunks/intersectsOperator.js";import{e as m}from"../../chunks/overlapsOperator.js";import{e as c}from"../../chunks/touchesOperator.js";import{e as p}from"../../chunks/withinOperator.js";import{getGeometryExtent as u}from"../../geometry/support/extentUtils.js";import{fromJSON as f}from"../../geometry/support/jsonUtils.js";import{quantizeGeometry as y}from"../../geometry/support/quantizationUtils.js";import{isGeographic as j,equals as G}from"../../geometry/support/spatialReferenceUtils.js";import{densifyCurvedGeometry as l}from"../../geometry/support/curves/densifyCurvedGeometry.js";import h from"../../layers/support/FieldsIndex.js";function g(){return{sql:{async createTestFeature(r,t){const o=await e(r,new h(t));return e=>o.testFeature(e)}},projection:{load:r,project:O},geometry:{isGeographic:j,quantize:(e,r)=>y(e,r),operations:{intersects(e,r,t,o){const{aGeometry:s,bGeometry:n}=d(e,r,t,o);return a(s,n)},contains(e,r,t,o){const{aGeometry:n,bGeometry:i}=d(e,r,t,o);return s(n,i)},overlaps(e,r,t,o){const{aGeometry:s,bGeometry:n}=d(e,r,t,o);return m(s,n)},crosses(e,r,t,o){const{aGeometry:s,bGeometry:i}=d(e,r,t,o);return n(s,i)},touches(e,r,t,o){const{aGeometry:s,bGeometry:n}=d(e,r,t,o);return c(s,n)},within(e,r,t,o){const{aGeometry:s,bGeometry:n}=d(e,r,t,o);return p(s,n)},generalize(e,r,t,o,s){if("number"==typeof s)throw new Error("maxDeviation can't be a number because the generalize operator requires a specific unit");const n=i(b(e,r),t,{removeDegenerateParts:o,unit:s});return n?.toJSON()},densifyCurves:e=>l(e)},extentFromGeometry:e=>u(e),extentFromGLB:async(e,r,t,o)=>{const{extentFromGLB:s}=await import("./setupServiceMocksMesh.js");return s(e,r,t,o)},nodeDataFromGLB:async(e,r,t,o)=>{const{nodeDataFromGLB:s}=await import("./setupServiceMocksMesh.js");return s(e,r,t,o)}}}}function b(e,r){const t=f(e);return t.spatialReference=r instanceof o?r:o.fromJSON(r),t}function O(e,r,t){return!e||G(r,t)?e:v(e,r,t)?.toJSON()}function v(e,r,s){if(e)return G(r,s)?b(e,r):t(b(e,r),o.fromJSON(s),{zConversionDisabled:!0})}function d(e,r,t,o){return{aGeometry:b(e,r),bGeometry:v(t,o,r)}}export{g as getServiceMockDependencies};