@arcgis/core 5.2.0-next.114 → 5.2.0-next.115
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Graphic.d.ts +5 -3
- package/applications/Urban/LineImagePattern3D.js +1 -1
- package/arcgisGlobal.d.ts +1 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/02f94f9d704f03ddb5c6.js +1 -0
- package/assets/esri/core/workers/chunks/{c517e732cab41093b2e0.js → 0312c40d94b248ad71e3.js} +1 -1
- package/assets/esri/core/workers/chunks/0463c807b37f01bbc35c.js +1 -0
- package/assets/esri/core/workers/chunks/0ff13f7a18b0123d253e.js +1 -0
- package/assets/esri/core/workers/chunks/2e0fd0536408053ac6f5.js +1 -0
- package/assets/esri/core/workers/chunks/{6b264006b96cbf93d8ed.js → 48d3da636be15581fd7d.js} +1 -1
- package/assets/esri/core/workers/chunks/515fe302743c0b46f7e0.js +1 -0
- package/assets/esri/core/workers/chunks/{982a396bd4fffa62e911.js → 526cc64ae46dec3fbeda.js} +1 -1
- package/assets/esri/core/workers/chunks/{d13cf2e8b24e978ea77c.js → 7243d5721bb6a7329055.js} +1 -1
- package/assets/esri/core/workers/chunks/{785206da3962ba23de16.js → 84b89c523d3e16a5ee46.js} +1 -1
- package/assets/esri/core/workers/chunks/{484b3e2a220c440ccbb4.js → 9b92c41907e2da80c288.js} +1 -1
- package/assets/esri/core/workers/chunks/{4d2553219ffd223b0e90.js → a774006be107e449bc29.js} +1 -1
- package/assets/esri/core/workers/chunks/b45ebb1b64ee7314375e.js +1 -0
- package/assets/esri/core/workers/chunks/{e0f417992889a6c41095.js → baa8bce361a2677533ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{96ebf76661b12128ddd5.js → be4de7111bc21bc69de1.js} +1 -1
- package/assets/esri/core/workers/chunks/{e164acd876bbd42ed658.js → f18ee2eaa96d103627a6.js} +1 -1
- package/chunks/RibbonLine.glsl.js +63 -58
- package/config.js +1 -1
- package/core/screenUtils.js +1 -1
- package/core/units.js +1 -1
- package/graphic/getGraphicOriginTitle.d.ts +10 -0
- package/graphic/getGraphicOriginTitle.js +2 -0
- package/kernel.js +1 -1
- package/layers/MapNotesLayer.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/Field.js +1 -1
- package/layers/support/TimeSeriesInfo.d.ts +1 -1
- package/layers/support/featurePopupQueryUtils.js +1 -1
- package/layers/support/timeSeriesUtils.js +1 -1
- package/layers/support/types.d.ts +1 -1
- package/layers/types.d.ts +1 -2
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/rest/support/OutDistance.d.ts +19 -18
- package/rest/support/Query.d.ts +48 -18
- package/smartMapping/renderers/support/utils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/patterns/LinePattern3D.js +1 -1
- package/symbols/patterns/LineStylePattern3D.js +1 -1
- package/symbols/patterns/LineTemplatePattern3D.js +1 -1
- package/symbols/patterns/utils.js +1 -1
- package/views/2d/engine/webgl/util/DimensionMatcher.js +1 -1
- package/views/2d/layers/graphics/GraphicStore.js +1 -1
- package/views/2d/layers/support/annodime/DimensionInfo.js +1 -1
- package/views/2d/support/clippingUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/webgl-engine/lib/AttributeView.js +2 -0
- package/views/3d/webgl-engine/lib/attributeViewUtils.js +2 -0
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterialBaseInstance.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/PopupView.d.ts +64 -2
- package/views/View2D.js +1 -1
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/views/layers/support/MapServiceLayerViewHelper.js +1 -1
- package/widgets/BasemapLayerList/BasemapLayerListViewModel.js +1 -1
- package/widgets/BasemapLayerList.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +2 -1
- package/widgets/CatalogLayerList/CatalogLayerListViewModel.js +1 -1
- package/widgets/CatalogLayerList/CatalogLayerListVisibleElements.d.ts +5 -1
- package/widgets/CatalogLayerList/types.d.ts +12 -1
- package/widgets/CatalogLayerList.d.ts +2 -1
- package/widgets/CatalogLayerList.js +1 -1
- package/widgets/LayerList.js +1 -1
- package/widgets/TableList/ListItem.d.ts +2 -0
- package/widgets/TableList/ListItemPanel.d.ts +4 -0
- package/widgets/TableList/TableListViewModel.d.ts +4 -0
- package/widgets/TableList/TableListViewModel.js +1 -1
- package/widgets/TableList/TableListVisibleElements.d.ts +6 -1
- package/widgets/TableList/types.d.ts +12 -1
- package/widgets/TableList.d.ts +3 -0
- package/widgets/TableList.js +1 -1
- package/assets/esri/core/workers/chunks/078ed48eb055dd213ee6.js +0 -1
- package/assets/esri/core/workers/chunks/1004e77593dfa506cd5d.js +0 -1
- package/assets/esri/core/workers/chunks/510a190a6f0a60ae38c3.js +0 -1
- package/assets/esri/core/workers/chunks/cd0f5cd0fefe7f49e3d8.js +0 -1
- package/assets/esri/core/workers/chunks/e6fb7b93cf73b05b1079.js +0 -1
- package/assets/esri/core/workers/chunks/f86ea5cf4814b458d50b.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{getMetersPerUnitForSR as n}from"../../../core/units.js";import o from"../../../geometry/Extent.js";import{P as i,a as r,b as s,c as a,d as l}from"../../../chunks/pe.js";import c from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{projectWithoutEngine as u}from"../../../geometry/projectionUtils.js";import x from"../../../geometry/SpatialReference.js";import{getInfo as m}from"../../../geometry/support/spatialReferenceUtils.js";function p(){if(!j)throw new t("rasterprojectionhelper-project","projection operator is not loaded")}const h=(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],x=2*o;let m=0,p=!1,h=[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>m&&(m=r+s,h=[r,s]),x&&m>x){p=!0;break}}if(p)break}return h},g={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},y=32,d=4,w=d,M=new Map,R=new Map,S=500,P=39.37,b=96;let E,G,k,j=!1;async function T(){return E||(E=Promise.withResolvers(),G=await(import("../../../geometry/operators/projectOperator.js")),k=await(import("../../../geometry/operators/support/geographicTransformationUtils.js")),G.projectIsLoaded()||await G.projectLoad(),k.isLoaded()||await k.load(),j=!0,E.resolve()),E.promise}function N(e,t,n){if(p(),n){const n=G.projectExecute(e,t);return k.getTransformation(t,e.spatialReference,n)}return k.getTransformation(e.spatialReference,t,e)}function v(e,t,n,i){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;p();const s=n.center,a=new o({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=G.projectExecute(a,t,{geographicTransformation:i}),c=Z(t);return null==l||null!=c&&l.width>=c?C(e,r,t):{x:l.width,y:l.height}}function C(e,t,o){const i=n(t)/n(o);return{x:e.x*i,y:e.y*i}}function _(e,o,i){const{spatialReference:r}=i;if(!r||!o||r.equals(o))return e;if(r.isGeographic&&o.isGeographic)return C(e,r,o);if(p(),!j)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*n(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const u=256,x=s*u/2,m=a*u/2,{x:h,y:g}=i.center,y=[];for(let t=0;t<=u;t++)y.push([h-x,g-m+t*a]);for(let t=1;t<=u;t++)y.push([h-x+t*s,g+m]);for(let t=1;t<=u;t++)y.push([h+x,g+m-t*a]);for(let t=1;t<u;t++)y.push([h+x-t*s,g-m]);y.push(y[0]);const d=new f({rings:[y],spatialReference:r}),w=G.projectExecute(d,o);if(!w)return C(e,r,o);const M=w.extent,R=Z(o);if(null==M||null!=R&&M.width>=R)return C(e,r,o);const S=pe(w.rings),P=s*a*u*u,b=Math.sqrt(S/P)/c,E={x:M.width/c/u,y:M.height/c/u},k={x:s*b,y:a*b},T=E.x*E.y;return Math.abs(T-k.x*k.y)/T<.1?E:k}function z(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*n(t)*b*P}function L(e,t){const{pixelSize:n,extent:o}=e;return z(_(n,t,o),t)}function I(e,t=.01){return n(e)?t/n(e):0}function W(e,t,n,o=!0){const i=e.spatialReference;if(i.equals(t))return e;p();const r=G.projectExecute(e,t,{geographicTransformation:n});return o&&r?(O([e],[r],i,t),r):r}function O(e,t,n,o){const i=$(n,!0),r=$(o,!0),s=I(n,S),a=I(o,S);if(s&&null!=i&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:o}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(o-i[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(o-i[1])<s&&(n.x+=r[1]-r[0])}}function A(e){const{inSR:t,outSR:n,preferPE:o}=e;if(t.equals(n)){const{points:t}=J(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return Y(e);if(o){if(t.isGeographic)return q(e);if(null!=B(t))return q(e)}return F(e)}function F(e){const{points:t}=J(e,null),{inSR:n,outSR:o,datumTransformation:i}=e,r=t.map(e=>new c(e[0],e[1],n)),s=G.projectExecuteMany(r,o,{geographicTransformation:i});return i&&O(r,s,n,o),s.map(e=>e?[e.x,e.y]:[NaN,NaN])}function q(e){const{inSR:t,outSR:n,datumTransformation:o}=e,s=B(t),{points:c,mask:f}=J(e,s);if(!t.isGeographic){const e=t.wkid?i.coordsys(t.wkid):i.fromString(t.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.projToGeog(e,c.length,c)}if(null!=o&&o.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=c.map(([e])=>e>t?1:e<-t?-1:0)),o.steps.forEach(e=>{const t=e.wkid?i.geogtran(e.wkid):i.fromString(r.PE_TYPE_GEOGTRAN,e.wkt);l.geogToGeog(t,c.length,c,null,e.isInverse?r.PE_TRANSFORM_2_TO_1:r.PE_TRANSFORM_1_TO_2)}),e)for(let n=0;n<c.length;n++){const o=e[n],i=c[n][0],r=i>t?1:i<-t?-1:0;o&&r&&o!==r&&(c[n][0]=o>0?i+360:i-360)}}if(!n.isGeographic){const e=B(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];X(c,t);const o=n.wkid?i.coordsys(n.wkid):i.fromString(n.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,n.wkt2||n.wkt);a.geogToProj(o,c.length,c)}let u=c;if(f&&c.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(c[t++]):u.push([NaN,NaN])}return u}function Y(e){const{cols:t,rows:n,xres:o,yres:i,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:f}=e;r&&(l+=o/2,f-=i/2);const x=[],m=[],p=Math.max(t,n);for(let g=0;g<p;g++){const e=l+o*Math.min(t,g),r=f-i*Math.min(n,g),p=u(new c({x:e,y:r,spatialReference:s}),s,a);g<=t&&x.push(p.x),g<=n&&m.push(p.y)}const h=[];for(let c=0;c<t;c++)for(let e=0;e<n;e++)h.push([x[c],m[e]]);return h}function B(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),M.has(n)){const e=M.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.wkt2||e.wkt),s=U(o,I(e,1e-4)),a=U(o,0,!0);return M.set(n,{pcs:s,gcs:a}),t?a:s}function U(e,t=0,n=!1){const o=s.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!o||!i?.length)return null;let r=!1,a=i.find(e=>1===e.getInclusive()&&1===e.getKind());if(!a){if(a=i.find(e=>1===e.getInclusive()&&0===e.getKind()),!a)return null;r=!0}const l=n?0:(2===o.getNorthPoleLocation()?1:0)|(2===o.getSouthPoleLocation()?2:0),c=o.isPannableRectangle(),f=a.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:l};let u=0;const x=[];let[m,p]=f[0],[h,g]=f[0];for(let s=0,y=f.length;s<y;s++){u++,u===y&&(u=0);const[e,t]=f[s],[n,o]=f[u];if(o===t)x.push([e,n,t,o,2]);else{const i=(n-e)/(o-t||1e-4),r=e-i*t;t<o?x.push([i,r,t,o,0]):x.push([i,r,o,t,1])}m=m<e?m:e,p=p<t?p:t,h=h>e?h:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:c,vertices:f,coef:x,bbox:[m,p,h,g],poleLocation:l}}function J(e,t){const n=[],{cols:o,rows:i,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<o;e++)for(let t=0;t<i;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(o*i);if(t.isEnvelope){const{isPannable:e,bbox:[a,u,x,m]}=t;for(let t=0,p=0;t<o;t++){const o=l+r*t,h=e||o>=a&&o<=x;for(let e=0;e<i;e++,p++){const t=c-s*e;h&&t>=u&&t<=m&&(n.push([o,t]),f[p]=1)}}return{points:n,mask:f}}const u=t.coef,x=[];for(let m=0;m<i;m++){const e=c-s*m,t=[],n=[];for(let i=0;i<u.length;i++){const[o,r,s,a,l]=u[i];if(e===s&&s===a)t.push(o),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const i=o*e+r;t.push(i),n.push(l)}}let o=t;if(t.length>2){let e=2===n[0]?0:n[0],i=t[0];o=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(o.push(0===e?Math.min(i,t[r-1]):Math.max(i,t[r-1])),e=n[r],i=t[r]),r===n.length-1&&o.push(0===n[r]?Math.min(i,t[r]):Math.max(i,t[r])));o.sort((e,t)=>e-t)}else t[0]>t[1]&&(o=[t[1],t[0]]);x.push(o)}for(let m=0,p=0;m<o;m++){const e=l+r*m;for(let t=0;t<i;t++,p++){const o=c-s*t,i=x[t];if(2===i.length)e>=i[0]&&e<=i[1]&&(n.push([e,o]),f[p]=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&&(n.push([e,o]),f[p]=1)}}}return{points:n,mask:f}}function X(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 K(e,t){const n=Z(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??I(e[0].spatialReference),1===(e=e.filter(e=>e.width>t)).length)return e[0];let{xmin:i,xmax:r,ymin:s,ymax:a}=e[0];for(let o=1;o<e.length;o++){const t=e[o];r=t.xmax+n*o,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new o({xmin:i,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function D(t,n,i=null,r=!0){const s=t.spatialReference;if(s.equals(n)||!n)return t;const a=te(t),l=Z(s,!0),c=Z(n);if(0===a||null==l||null==c){const e=V(t,n,i,r);if(e&&null==l&&null!=c&&Math.abs(e.width-c)<I(n)&&G.projectIsLoaded()){const o=B(s);if(null!=o&&0===o.poleLocation&&t.width<(o.bbox[2]-o.bbox[0])/2)return Q(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>I(s)){const{xmin:e,xmax:n}=t;for(let i=0;i<=a;i++){const r=0===i?e:-l/2,c=i===a?n-l*i:l/2;f[i]=new o({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}const u=f.map(e=>V(e,n,i,r)).filter(e);return 0===u.length?null:K(u)}function H(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:o,ymax:i,spatialReference:r}=e;e=new f({rings:[[[t,i],[o,i],[o,n],[t,n],[t,i]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(p(),G.projectExecute(e,t,{geographicTransformation:n}))}function Q(e,t){const n=Z(t);if(null==n)return null;let{xmin:i,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new f({spatialReference:l,rings:[[[i,r],[s,r],[s,a],[i,a],[i,r]]]}),u=G.projectExecute(c,t);if(2!==u.rings.length||!u.rings[0].length||!u.rings[1].length)return null;const{rings:x}=u,m=I(l),p=new o({spatialReference:t});for(let o=0;o<2;o++){i=s=x[o][0][0],r=a=x[o][0][1];for(let e=0;e<x[o].length;e++)i=i>x[o][e][0]?x[o][e][0]:i,s=s<x[o][e][0]?x[o][e][0]:s,r=r>x[o][e][1]?x[o][e][1]:r,a=a<x[o][e][1]?x[o][e][1]:a;if(0===o)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-n/2)<m)p.xmin=i,p.xmax=p.xmax+n;else{if(!(Math.abs(i+n/2)<m))return null;p.xmax=s+n}}return p}function V(e,t,n,o=!0,i=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;p();const s=G.projectExecute(e,t,{geographicTransformation:n});if(i&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!o||!s)return s;const a=$(r,!0),l=$(t,!0);if(null==a||null==l)return s;const f=I(r,.001),u=I(r,S),x=I(t,.001);if(Math.abs(s.xmin-l[0])<x&&Math.abs(s.xmax-l[1])<x){const o=Math.abs(e.xmin-a[0]),i=Math.abs(a[1]-e.xmax);if(o<f&&i>u){s.xmin=l[0];const o=[];o.push(new c(e.xmax,e.ymin,r)),o.push(new c(e.xmax,(e.ymin+e.ymax)/2,r)),o.push(new c(e.xmax,e.ymax,r));const i=o.map(e=>W(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmax=Math.max.apply(null,i)}if(i<f&&o>u){s.xmax=l[1];const o=[];o.push(new c(e.xmin,e.ymin,r)),o.push(new c(e.xmin,(e.ymin+e.ymax)/2,r)),o.push(new c(e.xmin,e.ymax,r));const i=o.map(e=>W(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmin=Math.min.apply(null,i)}}else{const e=I(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function Z(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*g[e.wkid]||null}function $(e,t=!1){if(e.isGeographic)return[-180,180];const n=Z(e,t);return n?[-n/2,n/2]:null}function ee(e,t,n,o){let i=(e-t)/n;return i-Math.floor(i)!==0?i=Math.floor(i):o&&(i-=1),i}function te(e,t=!1){const n=Z(e.spatialReference);if(null==n)return 0;const o=t?0:-(n/2),i=I(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<i?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<i?-n/2:e.xmin;return ee(r,o,n,!0)-ee(s,o,n,!1)}function ne(e){const t=e.storageInfo.origin.x,n=Z(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const o=n/2,{nativePixelSize:i,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=i.x;const u=[],x=null!=e.transform&&"gcs-shift"===e.transform.type,m=t+(x?0:o),p=x?n-t:o-t;for(let h=0;h<=a;h++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)===0?e:Math.ceil(e),o=p/f/l,i=o-Math.floor(o)===0?o:Math.ceil(o),r=Math.floor(m/f/l),a=Math.round(m/f)%l,x=(l-Math.round(p/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:i,leftMargin:a,rightPadding:x,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:o,pyramidsInfo:u,hasGCSSShiftTransform:x}}function oe(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(R.has(t))n=R.get(t);else{n=(e.wkid?i.coordsys(e.wkid):i.fromString(r.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),R.set(t,n)}return new x({wkid:n})}function ie(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[y,y],o=re(e),i={cols:o.size[0]+1,rows:o.size[1]+1};const r=o.outofBoundPointCount>0&&o.outofBoundPointCount<o.offsets.length/2;let s=o.outofBoundPointCount===o.offsets.length/2||t&&r?[0,0]:h(o.offsets,i,n,w);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>w)&&(l.isGeographic||B(l),n=[d,d],o=re({...e,spacing:n}),i={cols:o.size[0]+1,rows:o.size[1]+1},s=h(o.offsets,i,n,w)),o.error=s,n[0]>1&&(o.coefficients=se(o.offsets,i,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)o.gcsGrid={offsets:o.offsets,coefficients:o.coefficients,spacing:n};else{const t=B(l);if(null!=t&&!t.isEnvelope){const t=oe(l),s=D(e.projectedExtent,t),{offsets:a}=re({...e,srcBufferExtent:s,spacing:n}),c=se(a,i,r);o.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return o}function re(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:o,datumTransformation:i,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference;p();const{xmin:l,ymin:f,xmax:u,ymax:x}=t,m=Z(a),h=null!=m&&(e.hasWrapAround||"gcs-shift"===r?.type),g=e.spacing||[y,y],w=g[0]*o.x,M=g[1]*o.y,R=1===g[0],P=Math.ceil((u-l)/w-.1/g[0])+(R?0:1),b=Math.ceil((x-f)/M-.1/g[1])+(R?0:1),E=A({cols:P,rows:b,xmin:l,ymax:x,xres:w,yres:M,inSR:s,outSR:a,datumTransformation:i,preferPE:g[0]<=d,usePixelCenter:R}),G=[];let k,j=0;const T=R?-1:NaN,{xmin:N,xmax:v,ymax:C,width:_,height:z}=n,L=I(a,S),W=null!=m&&N>0&&v>m/2,O=B(s),F=null!=O&&O.poleLocation>0;for(let p=0;p<P;p++){const e=[];for(let t=0;t<b;t++){let n=E[p*b+t];if(h&&n[0]>v&&n[0]>m/2-L?n[0]-=m:h&&0===p&&n[0]<0&&W&&!r&&(n[0]+=m),!n||isNaN(n[0])||isNaN(n[1]))G.push(T),G.push(T),e.push(null),j++;else{if(r){const e=r.inverseTransform(new c({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),p>0&&h&&k[t]&&n[0]<k[t][0]&&(n[0]+=m,F&&n[0]>v&&n[0]>m&&(n[0]-=m)),G.push((n[0]-N)/_),G.push((C-n[1])/z)}}k=e}return{offsets:G,error:null,coefficients:null,outofBoundPointCount:j,spacing:g,size:R?[P,b]:[P-1,b-1]}}function se(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],x=e[n+3];n+=2*i;const m=e[n],p=e[n+1],h=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++]*h;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*x+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*m+a[y++]*h;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*p+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function ae(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:K(n,t)}function le(e){const{spatialReference:t}=e,n=m(t);if(!n)return e;const[i,r]=n.valid,s=r-i;let a=0;if(e.xmin<i){const t=i-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new o({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function ce(e,t,o){const{storageInfo:i,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=i,f="mixed"===i.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,i.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/f;if(null!=l&&l.length){const e=l[l.length-1],i=(e.x+e.y)/2,f=(r.x+r.y)/2;if(u<=f)s=0;else if(u>=i)s=l.length,a=u/i>8;else{let e,t=f;for(let n=1;n<=l.length;n++){if(e=(l[n-1].x+l[n-1].y)/2,u<=e){u===e?s=n:"down"===o?(s=n-1,a=u/t>8):s="up"===o||u-t>e-u||u/t>2?n:n-1;break}t=e}}const x=0===s?r:l[s-1];if(a){Math.min(x.x,x.y)*n(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new c({x:x.x,y:x.y,spatialReference:t.spatialReference}),excessiveReading:a}}const x=Math.log(e.x/r.x)/Math.LN2,m=Math.log(e.y/r.y)/Math.LN2,p=t.storageInfo.maximumPyramidLevel||0;s="down"===o?Math.floor(Math.min(x,m)):"up"===o?Math.ceil(Math.max(x,m)):Math.round((x+m)/2),s<0?s=0:s>p&&(a=s>p+3,s=p);const h=2**s;return{pyramidLevel:s,pyramidResolution:new c({x:h*t.nativePixelSize.x,y:h*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function fe(e,t,n=!1){const{pixelSize:o,extent:i}=e,r=N(i,t,!1),s=D(ae(i,(o.x+o.y)/16),t,r);return!s||n||0===te(s)?s:V(i,t,r)}function ue(e,t,n){const o=n?.tileSize??512,i=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,pixelSize:a}=e,l=_(a,t,s);if(null==l)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const c=(l.x+l.y)/2,f=z(c,t),u=256/o,x=t.isGeographic?295828763.7958547*u:591657527.591555*u,m=(t.isGeographic?.703125:156543.03392800014)*u;let p="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const h=fe(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(x/2/f)/Math.LN2));if(!p&&h&&i&&(t.isGeographic||t.isWebMercator)){const n=Z(t);if(p=te(h)>0||null!=n&&h.width>n/4,!p&&null!=n){let t=-1;if(g<3)t=2**g*c*o;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:i=2}=e.storageInfo;t=i**n*c*o}const i=Math.ceil(n/t);p=1===i||2===i&&n/2-h.xmax<t}}let y,d=f;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(p){d=x;const n=xe(e,t);y={x:n.x*m,y:n.y*m}}else{y={x:a.x,y:a.y};let e=0;for(;d<x*(w/2)&&e<g;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,x)/Math.min(d,x)<=w&&(d=x)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,f)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*a.x;let t=S.findIndex(t=>t.x>=a.x-e&&t.x<=a.x+e);t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex(t=>t.x<=a.x+e),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:l,scales:R,srcResolutions:S,isCustomTilingScheme:!p}}function xe(e,t){if(t.isWGS84||t.isWebMercator){const n=t.isGeographic?1341104507446289e-21:.29858214164761665,o=t.isGeographic?4326:3857,i=fe(e,new x({wkid:o}),!0),r=_({x:n,y:n},e.spatialReference,i);return{x:r.x/n,y:r.y/n}}const n=_(e.pixelSize,t,e.extent),o=(n.x+n.y)/2;return{x:e.pixelSize.x/o,y:e.pixelSize.y/o}}function me(e,t){const{spatialReference:n,lods:o}=t,{x:i,y:r}=xe(e,n);return o.map(({resolution:e})=>({x:e*i,y:e*r}))}function pe(e){let t=0;for(const n of e){const e=n.length;let o=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)o+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=o/2}return Math.abs(t)}export{ue as computeProjectedScales,xe as computeSrcResolutionRatio,me as computeSrcResolutions,y as defaultGridSpacing,w as defaultProjectionToleranceInPixels,N as getDefaultDatumTransformationForDataset,A as getProjectedGridPoints,ie as getProjectionOffsetGrid,ne as getRasterDatasetAlignmentInfo,L as getSourceScale,Z as getWorldWidth,te as getWorldWrapCount,T as load,d as minimumGridSpacing,fe as projectDatasetExtent,_ as projectDatasetResolution,D as projectExtent,W as projectPoint,H as projectPolygon,v as projectResolution,le as shiftExtent,ae as snapExtent,ce as snapPyramid};
|
|
2
|
+
import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{getMetersPerUnitForSR as n}from"../../../core/units.js";import o from"../../../geometry/Extent.js";import{P as i,a as r,b as s,c as a,d as l}from"../../../chunks/pe.js";import c from"../../../geometry/Point.js";import f from"../../../geometry/Polygon.js";import{projectWithoutEngine as u}from"../../../geometry/projectionUtils.js";import x from"../../../geometry/SpatialReference.js";import{getInfo as m}from"../../../geometry/support/spatialReferenceUtils.js";function p(){if(!j)throw new t("rasterprojectionhelper-project","projection operator is not loaded")}const h=(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],x=2*o;let m=0,p=!1,h=[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>m&&(m=r+s,h=[r,s]),x&&m>x){p=!0;break}}if(p)break}return h},g={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},y=32,d=4,w=d,M=new Map,R=new Map,S=500,P=39.37,b=96;let E,G,k,j=!1;async function T(){return E||(E=Promise.withResolvers(),G=await(import("../../../geometry/operators/projectOperator.js")),k=await(import("../../../geometry/operators/support/geographicTransformationUtils.js")),G.projectIsLoaded()||await G.projectLoad(),k.isLoaded()||await k.load(),j=!0,E.resolve()),E.promise}function N(e,t,n){if(p(),n){const n=G.projectExecute(e,t);return k.getTransformation(t,e.spatialReference,n)}return k.getTransformation(e.spatialReference,t,e)}function v(e,t,n,i){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;p();const s=n.center,a=new o({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=G.projectExecute(a,t,{geographicTransformation:i}),c=Z(t);return null==l||null!=c&&l.width>=c?C(e,r,t):{x:l.width,y:l.height}}function C(e,t,o){const i=n(t)/n(o);return{x:e.x*i,y:e.y*i}}function _(e,o,i){const{spatialReference:r}=i;if(!r||!o||r.equals(o))return e;if(r.isGeographic&&o.isGeographic)return C(e,r,o);if(p(),!j)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*n(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const u=256,x=s*u/2,m=a*u/2,{x:h,y:g}=i.center,y=[];for(let t=0;t<=u;t++)y.push([h-x,g-m+t*a]);for(let t=1;t<=u;t++)y.push([h-x+t*s,g+m]);for(let t=1;t<=u;t++)y.push([h+x,g+m-t*a]);for(let t=1;t<u;t++)y.push([h+x-t*s,g-m]);y.push(y[0]);const d=new f({rings:[y],spatialReference:r}),w=G.projectExecute(d,o);if(!w)return C(e,r,o);const M=w.extent,R=Z(o);if(null==M||null!=R&&M.width>=R)return C(e,r,o);const S=pe(w.rings),P=s*a*u*u,b=Math.sqrt(S/P)/c,E={x:M.width/c/u,y:M.height/c/u},k={x:s*b,y:a*b},T=E.x*E.y;return Math.abs(T-k.x*k.y)/T<.1?E:k}function z(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*n(t)*b*P}function L(e,t){const{pixelSize:n,extent:o}=e;return z(_(n,t,o),t)}function I(e,t=.01){return n(e)?t/n(e):0}function W(e,t,n,o=!0){const i=e.spatialReference;if(i.equals(t))return e;p();const r=G.projectExecute(e,t,{geographicTransformation:n});return o&&r?(O([e],[r],i,t),r):r}function O(e,t,n,o){const i=$(n,!0),r=$(o,!0),s=I(n,S),a=I(o,S);if(s&&null!=i&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:o}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(o-i[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(o-i[1])<s&&(n.x+=r[1]-r[0])}}function A(e){const{inSR:t,outSR:n,preferPE:o}=e;if(t.equals(n)){const{points:t}=J(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return Y(e);if(o){if(t.isGeographic)return q(e);if(null!=B(t))return q(e)}return F(e)}function F(e){const{points:t}=J(e,null),{inSR:n,outSR:o,datumTransformation:i}=e,r=t.map(e=>new c(e[0],e[1],n)),s=G.projectExecuteMany(r,o,{geographicTransformation:i});return i&&O(r,s,n,o),s.map(e=>e?[e.x,e.y]:[NaN,NaN])}function q(e){const{inSR:t,outSR:n,datumTransformation:o}=e,s=B(t),{points:c,mask:f}=J(e,s);if(!t.isGeographic){const e=t.wkid?i.coordsys(t.wkid):i.fromString(t.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.projToGeog(e,c.length,c)}if(null!=o&&o.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=c.map(([e])=>e>t?1:e<-t?-1:0)),o.steps.forEach(e=>{const t=e.wkid?i.geogtran(e.wkid):i.fromString(r.PE_TYPE_GEOGTRAN,e.wkt);l.geogToGeog(t,c.length,c,null,e.isInverse?r.PE_TRANSFORM_2_TO_1:r.PE_TRANSFORM_1_TO_2)}),e)for(let n=0;n<c.length;n++){const o=e[n],i=c[n][0],r=i>t?1:i<-t?-1:0;o&&r&&o!==r&&(c[n][0]=o>0?i+360:i-360)}}if(!n.isGeographic){const e=B(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];X(c,t);const o=n.wkid?i.coordsys(n.wkid):i.fromString(n.isGeographic?r.PE_TYPE_GEOGCS:r.PE_TYPE_PROJCS,n.wkt2||n.wkt);a.geogToProj(o,c.length,c)}let u=c;if(f&&c.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(c[t++]):u.push([NaN,NaN])}return u}function Y(e){const{cols:t,rows:n,xres:o,yres:i,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:f}=e;r&&(l+=o/2,f-=i/2);const x=[],m=[],p=Math.max(t,n);for(let g=0;g<p;g++){const e=l+o*Math.min(t,g),r=f-i*Math.min(n,g),p=u(new c({x:e,y:r,spatialReference:s}),s,a);g<=t&&x.push(p.x),g<=n&&m.push(p.y)}const h=[];for(let c=0;c<t;c++)for(let e=0;e<n;e++)h.push([x[c],m[e]]);return h}function B(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),M.has(n)){const e=M.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.wkt2||e.wkt),s=U(o,I(e,1e-4)),a=U(o,0,!0);return M.set(n,{pcs:s,gcs:a}),t?a:s}function U(e,t=0,n=!1){const o=s.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!o||!i?.length)return null;let r=!1,a=i.find(e=>1===e.getInclusive()&&1===e.getKind());if(!a){if(a=i.find(e=>1===e.getInclusive()&&0===e.getKind()),!a)return null;r=!0}const l=n?0:(2===o.getNorthPoleLocation()?1:0)|(2===o.getSouthPoleLocation()?2:0),c=o.isPannableRectangle(),f=a.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:l};let u=0;const x=[];let[m,p]=f[0],[h,g]=f[0];for(let s=0,y=f.length;s<y;s++){u++,u===y&&(u=0);const[e,t]=f[s],[n,o]=f[u];if(o===t)x.push([e,n,t,o,2]);else{const i=(n-e)/(o-t||1e-4),r=e-i*t;t<o?x.push([i,r,t,o,0]):x.push([i,r,o,t,1])}m=m<e?m:e,p=p<t?p:t,h=h>e?h:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:c,vertices:f,coef:x,bbox:[m,p,h,g],poleLocation:l}}function J(e,t){const n=[],{cols:o,rows:i,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<o;e++)for(let t=0;t<i;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(o*i);if(t.isEnvelope){const{isPannable:e,bbox:[a,u,x,m]}=t;for(let t=0,p=0;t<o;t++){const o=l+r*t,h=e||o>=a&&o<=x;for(let e=0;e<i;e++,p++){const t=c-s*e;h&&t>=u&&t<=m&&(n.push([o,t]),f[p]=1)}}return{points:n,mask:f}}const u=t.coef,x=[];for(let m=0;m<i;m++){const e=c-s*m,t=[],n=[];for(let i=0;i<u.length;i++){const[o,r,s,a,l]=u[i];if(e===s&&s===a)t.push(o),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const i=o*e+r;t.push(i),n.push(l)}}let o=t;if(t.length>2){let e=2===n[0]?0:n[0],i=t[0];o=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(o.push(0===e?Math.min(i,t[r-1]):Math.max(i,t[r-1])),e=n[r],i=t[r]),r===n.length-1&&o.push(0===n[r]?Math.min(i,t[r]):Math.max(i,t[r])));o.sort((e,t)=>e-t)}else t[0]>t[1]&&(o=[t[1],t[0]]);x.push(o)}for(let m=0,p=0;m<o;m++){const e=l+r*m;for(let t=0;t<i;t++,p++){const o=c-s*t,i=x[t];if(2===i.length)e>=i[0]&&e<=i[1]&&(n.push([e,o]),f[p]=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&&(n.push([e,o]),f[p]=1)}}}return{points:n,mask:f}}function X(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 K(e,t){const n=Z(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??I(e[0].spatialReference),1===(e=e.filter(e=>e.width>t)).length)return e[0];let{xmin:i,xmax:r,ymin:s,ymax:a}=e[0];for(let o=1;o<e.length;o++){const t=e[o];r=t.xmax+n*o,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new o({xmin:i,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function D(t,n,i=null,r=!0){const s=t.spatialReference;if(s.equals(n)||!n)return t;const a=te(t),l=Z(s,!0),c=Z(n);if(0===a||null==l||null==c){const e=V(t,n,i,r);if(e&&null==l&&null!=c&&Math.abs(e.width-c)<I(n)&&G.projectIsLoaded()){const o=B(s);if(null!=o&&0===o.poleLocation&&t.width<(o.bbox[2]-o.bbox[0])/2)return Q(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>I(s)){const{xmin:e,xmax:n}=t;for(let i=0;i<=a;i++){const r=0===i?e:-l/2,c=i===a?n-l*i:l/2;f[i]=new o({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}const u=f.map(e=>V(e,n,i,r)).filter(e);return 0===u.length?null:K(u)}function H(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:o,ymax:i,spatialReference:r}=e;e=new f({rings:[[[t,i],[o,i],[o,n],[t,n],[t,i]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(p(),G.projectExecute(e,t,{geographicTransformation:n}))}function Q(e,t){const n=Z(t);if(null==n)return null;let{xmin:i,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new f({spatialReference:l,rings:[[[i,r],[s,r],[s,a],[i,a],[i,r]]]}),u=G.projectExecute(c,t);if(2!==u.rings.length||!u.rings[0].length||!u.rings[1].length)return null;const{rings:x}=u,m=I(l),p=new o({spatialReference:t});for(let o=0;o<2;o++){i=s=x[o][0][0],r=a=x[o][0][1];for(let e=0;e<x[o].length;e++)i=i>x[o][e][0]?x[o][e][0]:i,s=s<x[o][e][0]?x[o][e][0]:s,r=r>x[o][e][1]?x[o][e][1]:r,a=a<x[o][e][1]?x[o][e][1]:a;if(0===o)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-n/2)<m)p.xmin=i,p.xmax=p.xmax+n;else{if(!(Math.abs(i+n/2)<m))return null;p.xmax=s+n}}return p}function V(e,t,n,o=!0,i=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;p();const s=G.projectExecute(e,t,{geographicTransformation:n});if(i&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!o||!s)return s;const a=$(r,!0),l=$(t,!0);if(null==a||null==l)return s;const f=I(r,.001),u=I(r,S),x=I(t,.001);if(Math.abs(s.xmin-l[0])<x&&Math.abs(s.xmax-l[1])<x){const o=Math.abs(e.xmin-a[0]),i=Math.abs(a[1]-e.xmax);if(o<f&&i>u){s.xmin=l[0];const o=[];o.push(new c(e.xmax,e.ymin,r)),o.push(new c(e.xmax,(e.ymin+e.ymax)/2,r)),o.push(new c(e.xmax,e.ymax,r));const i=o.map(e=>W(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmax=Math.max.apply(null,i)}if(i<f&&o>u){s.xmax=l[1];const o=[];o.push(new c(e.xmin,e.ymin,r)),o.push(new c(e.xmin,(e.ymin+e.ymax)/2,r)),o.push(new c(e.xmin,e.ymax,r));const i=o.map(e=>W(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);s.xmin=Math.min.apply(null,i)}}else{const e=I(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function Z(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*g[e.wkid]||null}function $(e,t=!1){if(e.isGeographic)return[-180,180];const n=Z(e,t);return n?[-n/2,n/2]:null}function ee(e,t,n,o){let i=(e-t)/n;return i-Math.floor(i)!==0?i=Math.floor(i):o&&(i-=1),i}function te(e,t=!1){const n=Z(e.spatialReference);if(null==n)return 0;const o=t?0:-(n/2),i=I(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<i?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<i?-n/2:e.xmin;return ee(r,o,n,!0)-ee(s,o,n,!1)}function ne(e){const t=e.storageInfo.origin.x,n=Z(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const o=n/2,{nativePixelSize:i,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=i.x;const u=[],x=null!=e.transform&&"gcs-shift"===e.transform.type,m=t+(x?0:o),p=x?n-t:o-t;for(let h=0;h<=a;h++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)===0?e:Math.ceil(e),o=p/f/l,i=o-Math.floor(o)===0?o:Math.ceil(o),r=Math.floor(m/f/l),a=Math.round(m/f)%l,x=(l-Math.round(p/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:i,leftMargin:a,rightPadding:x,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:o,pyramidsInfo:u,hasGCSSShiftTransform:x}}function oe(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(R.has(t))n=R.get(t);else{n=(e.wkid?i.coordsys(e.wkid):i.fromString(r.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),R.set(t,n)}return new x({wkid:n})}function ie(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[y,y],o=re(e),i={cols:o.size[0]+1,rows:o.size[1]+1};const r=o.outofBoundPointCount>0&&o.outofBoundPointCount<o.offsets.length/2;let s=o.outofBoundPointCount===o.offsets.length/2||t&&r?[0,0]:h(o.offsets,i,n,w);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>w)&&(l.isGeographic||B(l),n=[d,d],o=re({...e,spacing:n}),i={cols:o.size[0]+1,rows:o.size[1]+1},s=h(o.offsets,i,n,w)),o.error=s,n[0]>1&&(o.coefficients=se(o.offsets,i,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)o.gcsGrid={offsets:o.offsets,coefficients:o.coefficients,spacing:n};else{const t=B(l);if(null!=t&&!t.isEnvelope){const t=oe(l),s=D(e.projectedExtent,t),{offsets:a}=re({...e,srcBufferExtent:s,spacing:n}),c=se(a,i,r);o.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return o}function re(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:o,datumTransformation:i,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference;p();const{xmin:l,ymin:f,xmax:u,ymax:x}=t,m=Z(a),h=null!=m&&(e.hasWrapAround||"gcs-shift"===r?.type),g=e.spacing||[y,y],w=g[0]*o.x,M=g[1]*o.y,R=1===g[0],P=Math.ceil((u-l)/w-.1/g[0])+(R?0:1),b=Math.ceil((x-f)/M-.1/g[1])+(R?0:1),E=A({cols:P,rows:b,xmin:l,ymax:x,xres:w,yres:M,inSR:s,outSR:a,datumTransformation:i,preferPE:g[0]<=d,usePixelCenter:R}),G=[];let k,j=0;const T=R?-1:NaN,{xmin:N,xmax:v,ymax:C,width:_,height:z}=n,L=I(a,S),W=null!=m&&N>0&&v>m/2,O=B(s),F=null!=O&&O.poleLocation>0;for(let p=0;p<P;p++){const e=[];for(let t=0;t<b;t++){let n=E[p*b+t];if(h&&n[0]>v&&n[0]>m/2-L?n[0]-=m:h&&0===p&&n[0]<0&&W&&!r&&(n[0]+=m),!n||isNaN(n[0])||isNaN(n[1]))G.push(T),G.push(T),e.push(null),j++;else{if(r){const e=r.inverseTransform(new c({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),p>0&&h&&k[t]&&n[0]<k[t][0]&&(n[0]+=m,F&&n[0]>v&&n[0]>m&&(n[0]-=m)),G.push((n[0]-N)/_),G.push((C-n[1])/z)}}k=e}return{offsets:G,error:null,coefficients:null,outofBoundPointCount:j,spacing:g,size:R?[P,b]:[P-1,b-1]}}function se(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],x=e[n+3];n+=2*i;const m=e[n],p=e[n+1],h=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++]*h;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*x+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*m+a[y++]*h;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*p+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function ae(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:K(n,t)}function le(e){const{spatialReference:t}=e,n=m(t);if(!n)return e;const[i,r]=n.valid,s=r-i;let a=0;if(e.xmin<i){const t=i-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new o({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function ce(e,t,o){const{storageInfo:i,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=i,f="mixed"===i.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,i.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/f;if(null!=l&&l.length){const e=l[l.length-1],i=(e.x+e.y)/2,f=(r.x+r.y)/2;if(u<=f)s=0;else if(u>=i)s=l.length,a=u/i>8;else{let e,t=f;for(let n=1;n<=l.length;n++){if(e=(l[n-1].x+l[n-1].y)/2,u<=e){u===e?s=n:"down"===o?(s=n-1,a=u/t>8):s="up"===o||u-t>e-u||u/t>2?n:n-1;break}t=e}}const x=0===s?r:l[s-1];if(a){Math.min(x.x,x.y)*n(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new c({x:x.x,y:x.y,spatialReference:t.spatialReference}),excessiveReading:a}}const x=Math.log(e.x/r.x)/Math.LN2,m=Math.log(e.y/r.y)/Math.LN2,p=t.storageInfo.maximumPyramidLevel||0;s="down"===o?Math.floor(Math.min(x,m)):"up"===o?Math.ceil(Math.max(x,m)):Math.round((x+m)/2),s<0?s=0:s>p&&(a=s>p+3,s=p);const h=2**s;return{pyramidLevel:s,pyramidResolution:new c({x:h*t.nativePixelSize.x,y:h*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function fe(e,t,n=!1){const{pixelSize:o,extent:i}=e,r=N(i,t,!1),s=D(ae(i,(o.x+o.y)/16),t,r);return!s||n||0===te(s)?s:V(i,t,r)}function ue(e,t,n){const o=n?.tileSize??512,i=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,pixelSize:a}=e,l=_(a,t,s);if(null==l)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const c=(l.x+l.y)/2,f=z(c,t),u=256/o,x=t.isGeographic?295828763.7958547*u:591657527.591555*u,m=(t.isGeographic?.703125:156543.03392800014)*u;let p="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const h=fe(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(x/2/f)/Math.LN2));if(!p&&h&&i&&(t.isGeographic||t.isWebMercator)){const n=Z(t);if(p=te(h)>0||null!=n&&h.width>n/4,!p&&null!=n){let t=-1;if(g<3)t=2**g*c*o;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:i=2}=e.storageInfo;t=i**n*c*o}const i=Math.ceil(n/t);p=1===i||2===i&&n/2-h.xmax<t}}let y,d=f;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(p){d=x;const n=xe(e,t);y={x:n.x*m,y:n.y*m}}else{y={x:a.x,y:a.y};let e=0;for(;d<x*(w/2)&&e<g;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,x)/Math.min(d,x)<=w&&(d=x)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,f)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*a.x;let t=S.findIndex(t=>t.x>=a.x-e&&t.x<=a.x+e);t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex(t=>t.x<=a.x+e),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:l,scales:R,srcResolutions:S,isCustomTilingScheme:!p}}function xe(e,t){if(t.isWGS84||t.isWebMercator){const n=t.isGeographic?1341104507446289e-21:.29858214164761665,o=t.isGeographic?4326:3857,i=fe(e,new x({wkid:o}),!0),r=_({x:n,y:n},e.spatialReference,i);return{x:r.x/n,y:r.y/n}}const n=_(e.pixelSize,t,e.extent),o=(n.x+n.y)/2;return{x:e.pixelSize.x/o,y:e.pixelSize.y/o}}function me(e,t){const{spatialReference:n,lods:o}=t,{x:i,y:r}=xe(e,n);return o.map(({resolution:e})=>({x:e*i,y:e*r}))}function pe(e){let t=0;for(const n of e){const e=n.length;let o=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)o+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=o/2}return Math.abs(t)}export{pe as calculateArea2D,ue as computeProjectedScales,xe as computeSrcResolutionRatio,me as computeSrcResolutions,y as defaultGridSpacing,w as defaultProjectionToleranceInPixels,N as getDefaultDatumTransformationForDataset,A as getProjectedGridPoints,ie as getProjectionOffsetGrid,ne as getRasterDatasetAlignmentInfo,L as getSourceScale,Z as getWorldWidth,te as getWorldWrapCount,T as load,d as minimumGridSpacing,fe as projectDatasetExtent,_ as projectDatasetResolution,D as projectExtent,W as projectPoint,H as projectPolygon,v as projectResolution,le as shiftExtent,ae as snapExtent,ce as snapPyramid};
|
package/layers/support/Field.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as
|
|
2
|
+
import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as r}from"../../core/JSONSupport.js";import{property as o,subclass as i}from"../../core/accessorSupport/decorators.js";import{Integer as n}from"../../core/accessorSupport/ensureType.js";import{fromJSON as l,types as a}from"./domains.js";import{kebabDict as s}from"./fieldType.js";import{reader as p}from"../../core/accessorSupport/decorators/reader.js";import{enumeration as d}from"../../core/accessorSupport/decorators/enumeration.js";var u;const c=new t({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",marginOfError:"margin-of-error",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier",url:"url"});let m=class extends r{static{u=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(o){}return r?.value??null}readValueType(e,{description:t}){let r=null;try{r=t?JSON.parse(t):null}catch(o){}return r?c.fromJSON(r.fieldValueType):null}clone(){return new u({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};e([o({type:String,json:{write:!0}})],m.prototype,"alias",void 0),e([o({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),e([o()],m.prototype,"description",void 0),e([p("description")],m.prototype,"readDescription",null),e([o({types:a,json:{read:{reader:l},write:!0}})],m.prototype,"domain",void 0),e([o({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([o({type:n,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],m.prototype,"length",void 0),e([o({type:String,json:{write:!0}})],m.prototype,"name",void 0),e([o({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),e([d(s)],m.prototype,"type",void 0),e([o()],m.prototype,"valueType",void 0),e([p("valueType",["description"])],m.prototype,"readValueType",null),e([o({type:Boolean,json:{read:!1}})],m.prototype,"visible",void 0),m=u=e([i("esri.layers.support.Field")],m);export{m as default};
|
|
@@ -127,7 +127,7 @@ export default class TimeSeriesInfo extends TimeSeriesInfoSuperclass {
|
|
|
127
127
|
* series included `temperature_Jan2020`, `temperature_Jan2021`, `temperature_Jan2022`, etc. the time value unit
|
|
128
128
|
* would be `month` to reflect each field's relevance over a singular month.
|
|
129
129
|
*/
|
|
130
|
-
accessor timeValueUnits: "
|
|
130
|
+
accessor timeValueUnits: "seconds" | "minutes" | "hours" | "days" | "weeks" | "months" | "years" | "decades" | "centuries" | null | undefined;
|
|
131
131
|
/**
|
|
132
132
|
* The title of the time series configuration. This is a user-friendly name that can be used in the UI of
|
|
133
133
|
* client applications to refer to the specific time series.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{sqlIn as e}from"../../core/sql.js";import{unpackFieldNames as t,featureHasFields as
|
|
2
|
+
import{sqlIn as e}from"../../core/sql.js";import{unpackFieldNames as t,featureHasFields as i}from"./fieldUtils.js";import{loadArcade as o}from"../../support/loadArcade.js";async function r(o,r,s,n){const u=new Array(r.length),l=new Map,c=new Map,a=t(o.fieldsIndex,s.outFields),d=!0===o.capabilities?.operations?.supportsQuery&&null!=o.queryFeatures,f=n?.hasRequiredFields??i;for(let e=0;e<r.length;e++){const t=r[e];if(d&&!t.isAggregate){if(s.returnGeometry||!f(t,a)){const i=t.getObjectId();if(null!=i){l.set(i,{graphic:t,index:e});continue}const o=t.getGlobalId();if(null!=o){c.set(o,{graphic:t,index:e});continue}}u[e]=t}else u[e]=t}if(!d||!o.queryFeatures||0===l.size&&0===c.size)return u.filter(Boolean);const p=[],y=(e,t)=>{t&&(e.outFields??=[],e.outFields.includes(t)||e.outFields.push(t))};if(l.size>0){const e=s.clone();y(e,o.objectIdField),"uniqueIdFields"in o&&o.uniqueIdFields?.length&&(e.outFields??=[],e.outFields.push(...o.uniqueIdFields)),e.objectIds=Array.from(l.keys()),p.push({type:"object-id",query:e,map:l})}const g="globalIdField"in o?o.globalIdField:null;if(null!=g&&c.size>0){const t=s.clone();y(t,g);const i=Array.from(c.keys());t.where=e(g,i),p.push({type:"global-id",query:t,map:c})}const b=n?.updateSourceAttributes??!1;for(const{type:e,query:t,map:i}of p)try{const r=await o.queryFeatures(t,n);r.exceededTransferLimit&&n?.onExceededTransferLimit?.(Array.from(i.values(),({graphic:e})=>e));for(const t of r.features){const o="object-id"===e?t.getObjectId():t.getGlobalId();if(null==o)continue;const r=i.get(o);if(!r)continue;const{graphic:s,index:n}=r;if(b&&t.attributes){s.attributes??={};for(const e of a)e in t.attributes&&(s.attributes[e]=t.attributes[e])}const{geometry:l,origin:c}=s;t.geometry||=l,t.origin=c,u[n]=t}}catch{}return u.filter(Boolean)}async function s(e){if(e.expressionInfos?.length||Array.isArray(e.content)&&e.content.some(e=>"expression"===e.type))return o()}export{r as fetchFeaturePopupFeatures,s as loadFeaturePopupArcadeModules};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function e(e){const t=e.fieldTimeMappings??[],n=e.timeValueUnits??"years",a=t.map(({fieldName:e,timeValue:r})=>` "${r}", $feature.${e},`);return`var timeFormat = "${r(n)}";\n\nvar hasCurrentStart = HasValue($view, ["timeProperties", "currentStart"]);\nvar hasCurrentEnd = HasValue($view, ["timeProperties", "currentEnd"]);\n\nvar hasCurrentTime = hasCurrentStart || hasCurrentEnd;\n\nif (!hasCurrentTime) {\n return $feature.${t[0].fieldName};\n}\n\nvar currentTime = DefaultValue($view.timeProperties.currentEnd, $view.timeProperties.currentStart);\nvar formattedCurrentTime = Text(currentTime, timeFormat);\n\nvar result = Decode(formattedCurrentTime,\n${a.join("\n")}\n null\n);\n\nreturn result;`}function r(e){switch(e){case"years":default:return"Y";case"months":return"Y-M";case"days":return"Y-M-D";case"hours":case"minutes":return"Y-M-D-H-mm";case"seconds":return"Y-M-D-H-mm-ss"}}export{e as createTimeSeriesExpression,r as getArcadeTimeFormatString};
|
|
2
|
+
function e(e){const t=e.fieldTimeMappings??[],n=e.timeValueUnits??"years",a=t.map(({fieldName:e,timeValue:r})=>` "${r}", $feature.${e},`);return`var timeFormat = "${r(n)}";\n\nvar hasCurrentStart = HasValue($view, ["timeProperties", "currentStart"]);\nvar hasCurrentEnd = HasValue($view, ["timeProperties", "currentEnd"]);\n\nvar hasCurrentTime = hasCurrentStart || hasCurrentEnd;\n\nif (!hasCurrentTime) {\n return $feature.${t[0].fieldName};\n}\n\nvar currentTime = DefaultValue($view.timeProperties.currentEnd, $view.timeProperties.currentStart);\nvar formattedCurrentTime = Text(currentTime, timeFormat);\n\nvar result = Decode(formattedCurrentTime,\n${a.join("\n")}\n null\n);\n\nreturn result;`}function r(e){switch(e){case"centuries":case"decades":case"years":default:return"Y";case"months":return"Y-M";case"weeks":case"days":return"Y-M-D";case"hours":case"minutes":return"Y-M-D-H-mm";case"seconds":return"Y-M-D-H-mm-ss"}}export{e as createTimeSeriesExpression,r as getArcadeTimeFormatString};
|
|
@@ -27,7 +27,7 @@ export type FieldType = "small-integer" | "integer" | "single" | "double" | "lon
|
|
|
27
27
|
*
|
|
28
28
|
* @since 5.0
|
|
29
29
|
*/
|
|
30
|
-
export type FieldValueType = "binary" | "coordinate" | "count-or-amount" | "currency" | "date-and-time" | "description" | "email-address" | "location-or-place-name" | "measurement" | "name-or-title" | "none" | "ordered-or-ranked" | "percentage-or-ratio" | "phone-number" | "type-or-category" | "unique-identifier" | "url";
|
|
30
|
+
export type FieldValueType = "binary" | "coordinate" | "count-or-amount" | "currency" | "date-and-time" | "description" | "email-address" | "location-or-place-name" | "margin-of-error" | "measurement" | "name-or-title" | "none" | "ordered-or-ranked" | "percentage-or-ratio" | "phone-number" | "type-or-category" | "unique-identifier" | "url";
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Supported field formatting types.
|
package/layers/types.d.ts
CHANGED
|
@@ -434,8 +434,7 @@ export interface QueryCapabilities {
|
|
|
434
434
|
* Indicates if the layer's query operation supports returning distance values of each feature in the query result using
|
|
435
435
|
* the [Query.outDistance](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#outDistance) property.
|
|
436
436
|
*
|
|
437
|
-
* @
|
|
438
|
-
* @since 5.1
|
|
437
|
+
* @since 5.2
|
|
439
438
|
*/
|
|
440
439
|
supportsOutDistance: boolean;
|
|
441
440
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.115",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.6",
|
|
23
|
-
"@arcgis/toolkit": "5.2.0-next.
|
|
23
|
+
"@arcgis/toolkit": "5.2.0-next.115",
|
|
24
24
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
25
25
|
"@esri/calcite-components": "^5.2.0-next.73",
|
|
26
26
|
"@vaadin/grid": "~25.2.11",
|