UNPKG

@arcgis/core

Version:

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

6 lines (5 loc) 1.06 kB
/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. */ import{floatEqualAbsolute as n}from"../../core/mathUtils.js";import{getMetersPerUnitForSR as t,inchesPerMeter as r}from"../../core/unitUtils.js";const e=96;function i(n,i){const u=i||n.extent,o=n.width,c=t(u?.spatialReference);return u&&o?u.width/o*c*r*e:0}function u(n,i){return n/(t(i)*r*e)}function o(n){return n/(r*e)}function c(n,i){return n*(t(i)*r*e)}function f(n,t){const r=n.extent,e=n.width-(n.padding?n.padding.left+n.padding.right:0),i=u(t,r.spatialReference);return r.clone().expand(i*e/r.width)}function d(n,t,r){return I(n,t)&&a(n,r)}function I(t,r){return 0===r||n(t,r)||t<r}function a(t,r){return 0===r||n(t,r)||t>r}function p(t,r){if(n(t,r))return 0;return(t||Number.POSITIVE_INFINITY)>(r||Number.POSITIVE_INFINITY)?1:-1}export{p as compareMinScale,f as getExtentForScale,u as getResolutionForScale,o as getResolutionInMetersForScale,i as getScale,c as getScaleForResolution,d as isInScaleRange};