123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- import {
- Y
- } from "./chunk-54X4RLMR.js";
- import {
- f as f2
- } from "./chunk-ZIWBDWEW.js";
- import {
- E,
- S
- } from "./chunk-23ONSYIH.js";
- import {
- a,
- c
- } from "./chunk-ILP23N26.js";
- import {
- U,
- c as c2,
- d,
- j as j2,
- p
- } from "./chunk-UPD4MTCL.js";
- import {
- i
- } from "./chunk-65BYCSII.js";
- import {
- B
- } from "./chunk-4NKD334K.js";
- import {
- j
- } from "./chunk-VBRY5KJM.js";
- import {
- f
- } from "./chunk-ULGDPLM2.js";
- import {
- s3 as s
- } from "./chunk-EMJ4ZSM2.js";
- import {
- r
- } from "./chunk-GZT4BVFP.js";
- // node_modules/@arcgis/core/symbols/cim/ExpandedCIM.js
- var s2 = { marker: E.MARKER, fill: E.FILL, line: E.LINE, text: E.TEXT };
- var l = class {
- constructor(e, l3, n2, r2) {
- const c3 = { minScale: l3?.minScale, maxScale: l3?.maxScale }, m = i2(c3);
- this.layers = e, this.data = l3, this.hash = this._createHash() + m, this.rendererKey = n2;
- const o = { isOutline: false, placement: null, symbologyType: S.DEFAULT, vvFlags: n2 };
- for (const t of e) {
- const e2 = s2[t.type];
- o.isOutline = t.type === "line" && t.isOutline, t.materialKey = f2(e2, o), t.maxVVSize = r2, t.scaleInfo = c3, t.templateHash += m;
- }
- }
- get type() {
- return "expanded-cim";
- }
- _createHash() {
- let e = "";
- for (const t of this.layers)
- e += t.templateHash;
- return e;
- }
- };
- function i2(e) {
- return e.minScale || e.maxScale ? e.minScale + "-" + e.maxScale : "";
- }
- // node_modules/@arcgis/core/views/2d/layers/support/webStyleUtils.js
- async function u(t, r2, o) {
- if (!t.name)
- throw new s("style-symbol-reference-name-missing", "Missing name in style symbol reference");
- if (t.styleName && t.styleName === "Esri2DPointSymbolsStyle")
- return p2(t, o);
- try {
- return b(await c2(t, r2, o), t.name, r2, o);
- } catch (s3) {
- return f(s3), null;
- }
- }
- async function p2(t, r2) {
- const e = U.replace(/\{SymbolName\}/gi, t.name);
- try {
- const t2 = await j2(e, r2);
- return p(t2.data);
- } catch (o) {
- return f(o), null;
- }
- }
- async function b(a2, i4, u2, p3) {
- const b2 = a2.data, d2 = { portal: u2 && r(u2.portal) ? u2.portal : B.getDefault(), url: j(a2.baseUrl), origin: "portal-item" }, j3 = b2.items.find((t) => t.name === i4);
- if (!j3) {
- throw new s("symbolstyleutils:symbol-name-not-found", `The symbol name '${i4}' could not be found`, { symbolName: i4 });
- }
- let h = i(d(j3, "cimRef"), d2);
- c() && (h = a(h));
- try {
- const t = await j2(h, p3);
- return p(t.data);
- } catch (w) {
- return f(w), null;
- }
- }
- // node_modules/@arcgis/core/views/2d/layers/support/cimSymbolUtils.js
- var l2 = async (a2, r2, l3) => new l(await Y(a2.data, r2, l3), a2.data, a2.rendererKey, a2.maxVVSize);
- var n = async (e, t, r2, n2) => {
- if (!e)
- return null;
- if (e.type === "cim")
- return l2(e, t, r2);
- if (e.type === "web-style") {
- const i4 = { type: "cim", data: await u(e, null, n2), rendererKey: e.rendererKey, maxVVSize: e.maxVVSize };
- return l2(i4, t, r2);
- }
- return e;
- };
- function i3(e) {
- if (!e)
- return null;
- const { type: t, cim: a2, url: r2, materialHash: l3 } = e, n2 = { cim: a2, type: t, mosaicHash: l3, url: r2, size: null, dashTemplate: null, path: null, text: null, fontName: null, animatedSymbolProperties: null };
- switch (t) {
- case "marker":
- n2.size = e.size, n2.path = e.path, n2.animatedSymbolProperties = e.animatedSymbolProperties;
- break;
- case "line":
- n2.dashTemplate = e.dashTemplate;
- break;
- case "text":
- n2.text = e.text, n2.fontName = e.fontName;
- }
- return n2;
- }
- export {
- n,
- i3 as i
- };
- //# sourceMappingURL=chunk-DO6JJUZG.js.map
|