UNPKG

@arcgis/core

Version:

ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API

1 lines 3.05 kB
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[7243],{37243:(e,n,t)=>{t.r(n),t.d(n,{registerFunctions:()=>c});var r=t(85935),s=t(78502),i=t(78878),a=t(54784),l=t(85978),u=t(71163);function o(e){return async(n,t,o)=>{if((0,i.D)(o,2,2,n,t),null===(o=(0,i.E)(o))[0]&&null===o[1])return!1;if((0,i.p)(o[0])){if((0,i.l)(o[1]))return new a.A({parentfeatureset:o[0],relation:e,relationGeom:o[1]});if(null===o[1])return new l.A({parentfeatureset:o[0]});throw new r.D$(n,r.TX.InvalidParameter,t)}if((0,i.l)(o[0])){if((0,i.l)(o[1])){switch(e){case"esriSpatialRelEnvelopeIntersects":{const e=(0,s.Yc)(o[0]),n=(0,s.Yc)(o[1]);return null!=e&&null!=n&&(0,u.C)("intersects",[e.toJSON(),n.toJSON()])}case"esriSpatialRelIntersects":return(0,u.C)("intersects",[o[0].toJSON(),o[1].toJSON()]);case"esriSpatialRelContains":return(0,u.C)("contains",[o[0].toJSON(),o[1].toJSON()]);case"esriSpatialRelOverlaps":return(0,u.C)("overlaps",[o[0].toJSON(),o[1].toJSON()]);case"esriSpatialRelWithin":return(0,u.C)("within",[o[0].toJSON(),o[1].toJSON()]);case"esriSpatialRelTouches":return(0,u.C)("touches",[o[0].toJSON(),o[1].toJSON()]);case"esriSpatialRelCrosses":return(0,u.C)("crosses",[o[0].toJSON(),o[1].toJSON()])}throw new r.D$(n,r.TX.InvalidParameter,t)}if((0,i.p)(o[1]))return new a.A({parentfeatureset:o[1],relation:e,relationGeom:o[0]});if(null===o[1])return!1;throw new r.D$(n,r.TX.InvalidParameter,t)}if(null===o[0]){if((0,i.p)(o[1]))return new l.A({parentfeatureset:o[1]});if((0,i.l)(o[1])||null===o[1])return!1}throw new r.D$(n,r.TX.InvalidParameter,t)}}function c(e){"async"===e.mode&&(e.functions.intersects=function(n,t){return e.standardFunctionAsync(n,t,o("esriSpatialRelIntersects"))},e.functions.envelopeintersects=function(n,t){return e.standardFunctionAsync(n,t,o("esriSpatialRelEnvelopeIntersects"))},e.signatures.push({name:"envelopeintersects",min:2,max:2}),e.functions.contains=function(n,t){return e.standardFunctionAsync(n,t,o("esriSpatialRelContains"))},e.functions.overlaps=function(n,t){return e.standardFunctionAsync(n,t,o("esriSpatialRelOverlaps"))},e.functions.within=function(n,t){return e.standardFunctionAsync(n,t,o("esriSpatialRelWithin"))},e.functions.touches=function(n,t){return e.standardFunctionAsync(n,t,o("esriSpatialRelTouches"))},e.functions.crosses=function(n,t){return e.standardFunctionAsync(n,t,o("esriSpatialRelCrosses"))},e.functions.relate=function(n,t){return e.standardFunctionAsync(n,t,(async(e,s,a)=>{if(a=(0,i.E)(a),(0,i.D)(a,3,3,n,t),(0,i.l)(a[0])&&(0,i.l)(a[1]))return(0,u.C)("relate",[a[0].toJSON(),a[1].toJSON(),(0,i.f)(a[2])]);if((0,i.l)(a[0])&&null===a[1])return!1;if((0,i.l)(a[1])&&null===a[0])return!1;if((0,i.p)(a[0])&&null===a[1])return new l.A({parentfeatureset:a[0]});if((0,i.p)(a[1])&&null===a[0])return new l.A({parentfeatureset:a[1]});if((0,i.p)(a[0])&&(0,i.l)(a[1]))return a[0].relate(a[1],(0,i.f)(a[2]));if((0,i.p)(a[1])&&(0,i.l)(a[0]))return a[1].relate(a[0],(0,i.f)(a[2]));if(null===a[0]&&null===a[1])return!1;throw new r.D$(n,r.TX.InvalidParameter,t)}))})}}}]);