@doegis/core
Version:
DOE GIS API
3 lines (1 loc) • 2.48 kB
JavaScript
var e,t;function r(t){switch(t){case"left":return e.Left;case"right":return e.Right;case"center":return e.Center}}function n(e){switch(e){case"top":return t.Top;case"middle":return t.Center;case"baseline":return t.Baseline;case"bottom":return t.Bottom}}function a(r){switch(r){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[e.Right,t.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[e.Center,t.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[e.Left,t.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[e.Right,t.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[e.Center,t.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[e.Left,t.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[e.Right,t.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[e.Center,t.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[e.Left,t.Top];default:return console.debug(`Found invalid placement type ${r}`),[e.Center,t.Center]}}function c(t){switch(t){case e.Right:return-1;case e.Center:return 0;case e.Left:return 1;default:return console.debug(`Found invalid horizontal alignment ${t}`),0}}function o(e){switch(e){case t.Top:return 1;case t.Center:return 0;case t.Bottom:case t.Baseline:return-1;default:return console.debug(`Found invalid vertical alignment ${e}`),0}}function s(t){switch(t){case"left":return e.Left;case"right":return e.Right;case"center":return e.Center}}function i(e){switch(e){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}!function(e){e[e.Left=-1]="Left",e[e.Center=0]="Center",e[e.Right=1]="Right"}(e||(e={})),function(e){e[e.Top=1]="Top",e[e.Center=0]="Center",e[e.Bottom=-1]="Bottom",e[e.Baseline=2]="Baseline"}(t||(t={}));export{e as HAlign,t as VAlign,a as getAlignmentFromPlacement,s as getJustification,r as getXAnchorDirection,c as getXDirection,n as getYAnchorDirection,o as getYDirection,i as isMapAligned};