UNPKG

@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
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. */ import{fromValues as n}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{makeDehydratedPoint as t,setDehydratedPoint as e}from"../../../layers/graphics/dehydratedPoint.js";import{getConvertedElevation as o,getConvertedElevationFromVector as r,getConvertedElevationFromXYZ as u,absoluteHeightElevationInfo 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,r=c()){return r[0]=n.x,r[1]=n.y,r[2]=n.z??0,null==t||("2d"===t.type?r[2]=0:r[2]=o(t,n,e,i)??0),r}function T(n,o,r){return r?(e(r,n[0],n[1],n[2],o),r):t(n[0],n[1],n[2],o)}function h(n,o,{z:u,m:l},f,c){const{spatialReference:a,elevationInfo:s}=f;let d;if(null==u&&null==l)d=void 0;else if(null==o||"2d"===o.type)d=u??void 0;else{d=r(o,n,a,i,s)??0}const[v,p]=n;return c?e(c,v,p,d,a):c=t(v,p,d,a),null!=l&&(c.m=l,c.hasM=!0),c}function y(n,t,e,o,r=c()){const[f,a]=n;return r[0]=f,r[1]=a,n.length>3&&(r[3]=n[3]??l.NONE),"3d"!==e?.type?(r[2]=t.value,r):(r[2]=u(e,f,a,t.value,o,t.elevationInfo,i)??0,r)}!function(n){n[n.NONE=0]="NONE",n[n.TARGET=1]="TARGET"}(l||(l={}));const g=t(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};