123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- import {
- y
- } from "./chunk-QTOOFNRV.js";
- import {
- _,
- f,
- g,
- u,
- w,
- x
- } from "./chunk-7O56JPWQ.js";
- import {
- b
- } from "./chunk-27P5ZSC7.js";
- import {
- F,
- P
- } from "./chunk-EN7YGJWG.js";
- import {
- o as o2
- } from "./chunk-WEMIK25H.js";
- import {
- s
- } from "./chunk-PDKDCAAD.js";
- import {
- o
- } from "./chunk-ECW2QABR.js";
- import {
- r
- } from "./chunk-MRJEICT6.js";
- import {
- d,
- e,
- l3 as l,
- n2 as n
- } from "./chunk-Y3WMVFTW.js";
- import {
- m
- } from "./chunk-IKP3YN53.js";
- // node_modules/@arcgis/core/layers/support/LabelExpressionInfo.js
- var l2;
- var n2 = l2 = class extends l {
- constructor() {
- super(...arguments), this.expression = null, this.title = null, this.value = null;
- }
- readExpression(r2, e2) {
- return e2.value ? w(e2.value) : r2;
- }
- writeExpression(r2, e2, s2) {
- this.value != null && (r2 = w(this.value)), r2 != null && (e2[s2] = r2);
- }
- clone() {
- return new l2({ expression: this.expression, title: this.title, value: this.value });
- }
- };
- e([d({ type: String, json: { write: { writerEnsuresNonNull: true } } })], n2.prototype, "expression", void 0), e([o("expression", ["expression", "value"])], n2.prototype, "readExpression", null), e([r("expression")], n2.prototype, "writeExpression", null), e([d({ type: String, json: { write: true, origins: { "web-scene": { write: false } } } })], n2.prototype, "title", void 0), e([d({ json: { read: false, write: false } })], n2.prototype, "value", void 0), n2 = l2 = e([n("esri.layers.support.LabelExpressionInfo")], n2);
- var a = n2;
- // node_modules/@arcgis/core/layers/support/LabelClass.js
- var y2;
- var d2 = new s({ esriServerPointLabelPlacementAboveCenter: "above-center", esriServerPointLabelPlacementAboveLeft: "above-left", esriServerPointLabelPlacementAboveRight: "above-right", esriServerPointLabelPlacementBelowCenter: "below-center", esriServerPointLabelPlacementBelowLeft: "below-left", esriServerPointLabelPlacementBelowRight: "below-right", esriServerPointLabelPlacementCenterCenter: "center-center", esriServerPointLabelPlacementCenterLeft: "center-left", esriServerPointLabelPlacementCenterRight: "center-right", esriServerLinePlacementAboveAfter: "above-after", esriServerLinePlacementAboveAlong: "above-along", esriServerLinePlacementAboveBefore: "above-before", esriServerLinePlacementAboveStart: "above-start", esriServerLinePlacementAboveEnd: "above-end", esriServerLinePlacementBelowAfter: "below-after", esriServerLinePlacementBelowAlong: "below-along", esriServerLinePlacementBelowBefore: "below-before", esriServerLinePlacementBelowStart: "below-start", esriServerLinePlacementBelowEnd: "below-end", esriServerLinePlacementCenterAfter: "center-after", esriServerLinePlacementCenterAlong: "center-along", esriServerLinePlacementCenterBefore: "center-before", esriServerLinePlacementCenterStart: "center-start", esriServerLinePlacementCenterEnd: "center-end", esriServerPolygonPlacementAlwaysHorizontal: "always-horizontal" }, { ignoreUnknown: true });
- function x2(e2) {
- return !e2 || e2.origin !== "service" && !(e2.layer?.type === "map-image");
- }
- function L(e2) {
- return e2?.type === "map-image";
- }
- function P2(e2) {
- return !!L(e2) && !!e2.capabilities?.exportMap?.supportsArcadeExpressionForLabeling;
- }
- function g2(e2) {
- return x2(e2) || P2(e2.layer);
- }
- var E = y2 = class extends l {
- constructor(e2) {
- super(e2), this.type = "label", this.name = null, this.allowOverrun = false, this.deconflictionStrategy = "static", this.labelExpression = null, this.labelExpressionInfo = null, this.labelPlacement = null, this.labelPosition = "curved", this.maxScale = 0, this.minScale = 0, this.repeatLabel = true, this.repeatLabelDistance = null, this.symbol = y, this.useCodedValues = void 0, this.where = null;
- }
- static evaluateWhere(e2, r2) {
- const t = (e3, r3, t2) => {
- switch (r3) {
- case "=":
- return e3 == t2;
- case "<>":
- return e3 != t2;
- case ">":
- return e3 > t2;
- case ">=":
- return e3 >= t2;
- case "<":
- return e3 < t2;
- case "<=":
- return e3 <= t2;
- }
- return false;
- };
- try {
- if (e2 == null)
- return true;
- const o3 = e2.split(" ");
- if (o3.length === 3)
- return t(r2[o3[0]], o3[1], o3[2]);
- if (o3.length === 7) {
- const e3 = t(r2[o3[0]], o3[1], o3[2]), n3 = o3[3], s2 = t(r2[o3[4]], o3[5], o3[6]);
- switch (n3) {
- case "AND":
- return e3 && s2;
- case "OR":
- return e3 || s2;
- }
- }
- return false;
- } catch (o3) {
- console.log("Error.: can't parse = " + e2);
- }
- }
- readLabelExpression(e2, r2) {
- const t = r2.labelExpressionInfo;
- if (!t || !t.value && !t.expression)
- return e2;
- }
- writeLabelExpression(e2, r2, t) {
- if (this.labelExpressionInfo) {
- if (this.labelExpressionInfo.value != null)
- e2 = u(this.labelExpressionInfo.value);
- else if (this.labelExpressionInfo.expression != null) {
- const r3 = _(this.labelExpressionInfo.expression);
- r3 && (e2 = "[" + r3 + "]");
- }
- }
- e2 != null && (r2[t] = e2);
- }
- writeLabelExpressionInfo(e2, r2, t, o3) {
- if (e2 == null && this.labelExpression != null && x2(o3))
- e2 = new a({ expression: this.getLabelExpressionArcade() });
- else if (!e2)
- return;
- const n3 = e2.toJSON(o3);
- n3.expression && (r2[t] = n3);
- }
- writeMaxScale(e2, r2) {
- (e2 || this.minScale) && (r2.maxScale = e2);
- }
- writeMinScale(e2, r2) {
- (e2 || this.maxScale) && (r2.minScale = e2);
- }
- getLabelExpression() {
- return x(this);
- }
- getLabelExpressionArcade() {
- return f(this);
- }
- getLabelExpressionSingleField() {
- return g(this);
- }
- hash() {
- return JSON.stringify(this);
- }
- clone() {
- return new y2({ allowOverrun: this.allowOverrun, deconflictionStrategy: this.deconflictionStrategy, labelExpression: this.labelExpression, labelExpressionInfo: m(this.labelExpressionInfo), labelPosition: this.labelPosition, labelPlacement: this.labelPlacement, maxScale: this.maxScale, minScale: this.minScale, name: this.name, repeatLabel: this.repeatLabel, repeatLabelDistance: this.repeatLabelDistance, symbol: m(this.symbol), where: this.where, useCodedValues: this.useCodedValues });
- }
- };
- e([d({ type: String, json: { write: true } })], E.prototype, "name", void 0), e([d({ type: Boolean, json: { write: true, default: false, origins: { "web-scene": { write: false } } } })], E.prototype, "allowOverrun", void 0), e([d({ type: String, json: { write: true, default: "static", origins: { "web-scene": { write: false } } } })], E.prototype, "deconflictionStrategy", void 0), e([d({ type: String, json: { write: { overridePolicy(e2, r2, t) {
- return this.labelExpressionInfo && t?.origin === "service" && P2(t.layer) ? { enabled: false } : { allowNull: true };
- } } } })], E.prototype, "labelExpression", void 0), e([o("labelExpression")], E.prototype, "readLabelExpression", null), e([r("labelExpression")], E.prototype, "writeLabelExpression", null), e([d({ type: a, json: { write: { overridePolicy: (e2, r2, t) => g2(t) ? { allowNull: true } : { enabled: false } } } })], E.prototype, "labelExpressionInfo", void 0), e([r("labelExpressionInfo")], E.prototype, "writeLabelExpressionInfo", null), e([d({ type: d2.apiValues, json: { type: d2.jsonValues, read: d2.read, write: d2.write } })], E.prototype, "labelPlacement", void 0), e([d({ type: ["curved", "parallel"], json: { write: true, origins: { "web-map": { write: false }, "web-scene": { write: false }, "portal-item": { write: false } } } })], E.prototype, "labelPosition", void 0), e([d({ type: Number })], E.prototype, "maxScale", void 0), e([r("maxScale")], E.prototype, "writeMaxScale", null), e([d({ type: Number })], E.prototype, "minScale", void 0), e([r("minScale")], E.prototype, "writeMinScale", null), e([d({ type: Boolean, json: { write: true, origins: { "web-scene": { write: false }, "portal-item": { write: false } } } })], E.prototype, "repeatLabel", void 0), e([d({ type: Number, cast: o2, json: { write: true, origins: { "web-scene": { write: false } } } })], E.prototype, "repeatLabelDistance", void 0), e([d({ types: P, json: { origins: { "web-scene": { types: F, write: b, default: null } }, write: b, default: null } })], E.prototype, "symbol", void 0), e([d({ type: Boolean, json: { write: true } })], E.prototype, "useCodedValues", void 0), e([d({ type: String, json: { write: true } })], E.prototype, "where", void 0), E = y2 = e([n("esri.layers.support.LabelClass")], E);
- var j = E;
- export {
- j
- };
- //# sourceMappingURL=chunk-RQJNTZAL.js.map
|