@arcgis/core
Version:
ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API
6 lines (5 loc) • 1.95 kB
JavaScript
/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
*/
import{fromValues as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{setDehydratedPoint as t,makeDehydratedPoint as e}from"../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as o,absoluteHeightElevationInfo as r,getConvertedElevationFromVector as u,getConvertedElevationFromXYZ as i}from"../../../support/elevationInfoUtils.js";var l;function f(n,t,e){return c(n,t,e)}function c(t=0,e=0,o=0){return n(t,e,o)}function a(n){return n}function s(n){return n}function d(t,e,o){return a(n(t,e,o))}function v(n){const[t,e,o]=n;return n.length>3?[t,e,o,n[3]]:[t,e,o]}function p(n){return n[3]=((n.length>3?n[3]:void 0)??l.NONE)|l.TARGET,n}function m(n){return Boolean(((n.length>3?n[3]:void 0)??l.NONE)&l.TARGET)}function N(n,t,{coordinateHelper:e,elevationInfo:o},r){return n?E(e.vectorToDehydratedPoint(n,g),t,o,r):null}function E(n,t,e,u=c()){return u[0]=n.x,u[1]=n.y,u[2]=n.z??0,null==t||("2d"===t.type?u[2]=0:u[2]=o(t,n,e,r)??0),u}function T(n,o,r){return r?(t(r,n[0],n[1],n[2],o),r):e(n[0],n[1],n[2],o)}function h(n,o,{z:i,m:l},f,c){const{spatialReference:a,elevationInfo:s}=f;let d;if(null==i&&null==l)d=void 0;else if(null==o||"2d"===o.type)d=i??void 0;else{d=u(o,n,a,r,s)??0}const[v,p]=n;return c?t(c,v,p,d,a):c=e(v,p,d,a),null!=l&&(c.m=l,c.hasM=!0),c}function y(n,t,e,o,u=c()){const[f,a]=n;return u[0]=f,u[1]=a,n.length>3&&(u[3]=n[3]??l.NONE),"3d"!==e?.type?(u[2]=t.value,u):(u[2]=i(e,f,a,t.value,o,t.elevationInfo,r)??0,u)}!function(n){n[n.NONE=0]="NONE",n[n.TARGET=1]="TARGET"}(l||(l={}));const g=e(0,0,0,null);export{s as asVec2,v as clone,f as create,c as createWritable,N as fromAnyMapPoint,E as fromPoint,d as fromValues,a as fromVec3,m as isTarget,p as markAsTarget,T as toDehydratedPoint,h as toElevationAlignedDehydratedPoint,y as withSelfSnappingZ};