Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

11 lines
4.0 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define(["exports","../core/unitUtils","../symbols/support/unitConversionUtils"],function(d,r,B){function t(a,b){return b?.mode?b.mode:(a?l:m).mode}function u(a,b){return null!=b?b:a?l:m}function n(a,b){return t(null!=a?a.hasZ:!1,b)}function v(a){const b=w(a);a=n(a.geometry,b);const c=null!=b&&"on-the-ground"!==a?x(b):0;return{mode:a,offset:c,featureExpressionInfo:b?.featureExpressionInfo}}function y(a){return"0"===a?.featureExpressionInfo?.expression}function p(a){if(!a||"on-the-ground"===a.mode)return!1;
a=a?.featureExpressionInfo?a.featureExpressionInfo.expression:null;return!(!a||"0"===a)}function w(a){return a.layer&&"elevationInfo"in a.layer?a.layer.elevationInfo:null}function k(a,b){if(!a?.offset)return 0;const {offset:c,unit:e}=a;if("decimal-degrees"===e)return 0;a="unknown"!==e&&e?e:"meters";return(b=r.verticalLengthUnitFromSpatialReference(b))?r.convertUnit(c,a,b):0}function q(a,b,c,e,f,h,g=null){if(null!=h){var z=null!=g?g.mode:"absolute-height";if("on-the-ground"===z)return 0;({absoluteZ:h}=
A(b,c,e,f,a,h));a:{g=k(g,f);switch(z){case "absolute-height":a=h-g;break a;case "relative-to-ground":a=h-((a.elevationProvider.getElevation(b,c,e,f,"ground")??0)+g);break a;case "relative-to-scene":a=h-((a.elevationProvider.getElevation(b,c,e,f,"scene")??0)+g);break a}a=void 0}return a}}function A(a,b,c,e,f,h){const g=k(h,e);switch(h.mode){case "absolute-height":return{absoluteZ:c+g,elevation:0};case "on-the-ground":return c=f.elevationProvider.getElevation(a,b,0,e,"ground")??0,{absoluteZ:c,elevation:c};
case "relative-to-ground":return a=f.elevationProvider.getElevation(a,b,c,e,"ground")??0,{absoluteZ:c+a+g,elevation:a};case "relative-to-scene":return a=f.elevationProvider.getElevation(a,b,c,e,"scene")??0,{absoluteZ:c+a+g,elevation:a}}}function x(a){return(a?.offset??0)*B.getMetersPerUnit(a?.unit)}const l={mode:"absolute-height",offset:0},m={mode:"on-the-ground",offset:null};d.absoluteHeightElevationInfo=l;d.elevationContextAffectsAlignment=function(a,b){if(null==b)return!1;({mode:b}=b);return null!=
b&&("scene"===a&&"relative-to-scene"===b||"ground"===a&&"absolute-height"!==b)};d.elevationModeRequiredMessage=function(a,b,c){return c&&c.mode!==b?`${a} only support ${b} elevation mode`:null};d.elevationModeUnsupportedMessage=function(a,b,c){return c?.mode===b?`${a} do not support ${b} elevation mode`:null};d.featureExpressionInfoIsZero=y;d.featureExpressionUnsupportedMessage=function(a,b){return null!=b?.featureExpressionInfo&&"0"!==b.featureExpressionInfo.expression?`${a} do not support featureExpressionInfo`:
null};d.getConvertedElevation=function(a,b,c,e=null){return q(a,b.x,b.y,b.hasZ?b.z:0,b.spatialReference,c,e)};d.getConvertedElevationFromVector=function(a,b,c,e,f=null){return q(a,b[0],b[1],2<b.length?b[2]:0,c,e,f)};d.getConvertedElevationFromXYZ=q;d.getEffectiveElevationInfo=u;d.getEffectiveElevationMode=t;d.getElevationOffset=k;d.getElevationOffsetInMeters=x;d.getGeometryEffectiveElevationInfo=function(a,b){return u(null!=a?!!a.hasZ:!1,b)};d.getGeometryEffectiveElevationMode=n;d.getGraphicEffectiveElevationInfo=
v;d.getGraphicEffectiveElevationMode=function(a){const b=w(a);return n(a.geometry,b)};d.getZForElevationMode=function(a,b,c){if(c?.mode){var e=a.hasZ?a.z:0,f=k(c,a.spatialReference);switch(c.mode){case "absolute-height":return e-f;case "on-the-ground":return 0;case "relative-to-ground":return a=(b.elevationProvider.getElevation(a.x,a.y,e,a.spatialReference,"ground")??0)+f,e-a;case "relative-to-scene":return a=(b.elevationProvider.getElevation(a.x,a.y,e,a.spatialReference,"scene")??0)+f,e-a}}};d.hasEffectiveFeatureExpressionInfo=
p;d.hasFeatureExpressionInfo=function(a){return p(a)||y(a)};d.hasGraphicFeatureExpressionInfo=function(a){return p(v(a))};d.logInvalidElevationInfoWarning=function(a,b){b&&a.warn(".elevationInfo\x3d",b)};d.onTheGroundElevationInfo=m;d.zValueInAbsoluteHeightMode=A;Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});