12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import {
- A,
- _,
- f
- } from "./chunk-3WXSWAUV.js";
- import {
- E,
- S
- } from "./chunk-EQNT4A7P.js";
- // node_modules/@arcgis/core/views/2d/layers/features/createSymbolSchema.js
- function l(e) {
- var _a;
- if ("line-marker" === e.type) {
- return { type: "line-marker", color: (_a = e.color) == null ? void 0 : _a.toJSON(), placement: e.placement, style: e.style };
- }
- return e.constructor.fromJSON(e.toJSON()).toJSON();
- }
- function s(e) {
- return A(e);
- }
- function o(e, a, t = false) {
- if (!e)
- return null;
- switch (e.type) {
- case "simple-fill":
- case "picture-fill":
- return c(e, a, t);
- case "simple-marker":
- case "picture-marker":
- return h(e, a, t);
- case "simple-line":
- return m(e, a, t);
- case "text":
- return y(e, a, t);
- case "label":
- return i(e, a, t);
- case "cim":
- return { type: "cim", rendererKey: a.vvFlags, data: e.data, maxVVSize: a.maxVVSize };
- case "CIMSymbolReference":
- return { type: "cim", rendererKey: a.vvFlags, data: e, maxVVSize: a.maxVVSize };
- case "web-style":
- return { ...l(e), type: "web-style", hash: e.hash(), rendererKey: a.vvFlags, maxVVSize: a.maxVVSize };
- default:
- throw new Error(`symbol not supported ${e.type}`);
- }
- }
- function i(a, r, n) {
- const l2 = a.toJSON(), o2 = f(E.LABEL, { ...r, placement: l2.labelPlacement });
- return { materialKey: n ? s(o2) : o2, hash: a.hash(), ...l2, labelPlacement: l2.labelPlacement };
- }
- function c(a, n, o2) {
- const i2 = f(E.FILL, n), c2 = o2 ? s(i2) : i2, m2 = a.clone(), h2 = m2.outline, y2 = _(n.symbologyType);
- y2 || (m2.outline = null);
- const u = { materialKey: c2, hash: m2.hash(), ...l(m2) };
- if (y2)
- return u;
- const p = [];
- if (p.push(u), h2) {
- const a2 = f(E.LINE, { ...n, isOutline: true }), r = { materialKey: o2 ? s(a2) : a2, hash: h2.hash(), ...l(h2) };
- p.push(r);
- }
- return { type: "composite-symbol", layers: p, hash: p.reduce((e, a2) => a2.hash + e, "") };
- }
- function m(n, o2, i2) {
- var _a;
- const c2 = _(o2.symbologyType) ? S.DEFAULT : o2.symbologyType, m2 = f(E.LINE, { ...o2, symbologyType: c2 }), h2 = i2 ? s(m2) : m2, y2 = n.clone(), u = y2.marker;
- y2.marker = null;
- const p = [];
- if (p.push({ materialKey: h2, hash: y2.hash(), ...l(y2) }), u) {
- const a = f(E.MARKER, o2), r = i2 ? s(a) : a;
- u.color = (_a = u.color) != null ? _a : y2.color, p.push({ materialKey: r, hash: u.hash(), lineWidth: y2.width, ...l(u) });
- }
- return { type: "composite-symbol", layers: p, hash: p.reduce((e, a) => a.hash + e, "") };
- }
- function h(a, r, n) {
- const o2 = f(E.MARKER, r), i2 = n ? s(o2) : o2, c2 = l(a);
- return { materialKey: i2, hash: a.hash(), ...c2, angle: a.angle, maxVVSize: r.maxVVSize };
- }
- function y(a, r, n) {
- const o2 = f(E.TEXT, r), i2 = n ? s(o2) : o2, c2 = l(a);
- return { materialKey: i2, hash: a.hash(), ...c2, angle: a.angle, maxVVSize: r.maxVVSize };
- }
- export {
- o
- };
- //# sourceMappingURL=chunk-ST53DRNI.js.map
|