@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 895 B
JavaScript
import{isNone as e}from"../../../../../core/maybe.js";import r from"../../../../../geometry/Circle.js";import{getGraphicEffectiveElevationMode as t,hasGraphicFeatureExpressionInfo as o}from"../../../../../support/elevationInfoUtils.js";import{SupportedGraphicResult as n}from"../isSupportedGraphicUtils.js";function l(e){return u(e).result}function m(e){return u(e).geometry}function u(l){if("graphics"!==l.layer?.type)return{result:n.GRAPHICS_LAYER_MISSING,geometry:null};if(e(l.geometry))return{result:n.GEOMETRY_MISSING,geometry:null};return"on-the-ground"!==t(l)&&o(l)?{result:n.ELEVATION_MODE_UNSUPPORTED,geometry:null}:"point"!==l.geometry.type&&"polyline"!==l.geometry.type&&("polygon"!==l.geometry.type||l.geometry instanceof r)?{result:n.GEOMETRY_TYPE_UNSUPPORTED,geometry:null}:{result:n.SUPPORTED,geometry:l.geometry}}export{m as geometryOfSupportedGraphic,l as isSupportedGraphic};