123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- import {
- e
- } from "./chunk-7IKYLNB5.js";
- import {
- c,
- t
- } from "./chunk-VBNMTM7L.js";
- import "./chunk-522WBHUO.js";
- import {
- F,
- a
- } from "./chunk-WNCU6BFU.js";
- import "./chunk-N2663GRX.js";
- import "./chunk-XNLG7T2T.js";
- import "./chunk-IR4PV7VK.js";
- import {
- U
- } from "./chunk-VNFRAYHO.js";
- import "./chunk-R5IG2D6H.js";
- import "./chunk-VBRY5KJM.js";
- import "./chunk-ECW2QABR.js";
- import "./chunk-GCDJLKH4.js";
- import "./chunk-MRJEICT6.js";
- import "./chunk-Y3WMVFTW.js";
- import "./chunk-SAS7RONY.js";
- import "./chunk-WSRBH7BF.js";
- import "./chunk-IHXECKQQ.js";
- import "./chunk-ULGDPLM2.js";
- import {
- s3 as s
- } from "./chunk-EMJ4ZSM2.js";
- import "./chunk-IKP3YN53.js";
- import {
- r
- } from "./chunk-GZT4BVFP.js";
- import "./chunk-A5ICIBVI.js";
- // node_modules/@arcgis/core/symbols/support/symbolLayerUtils.js
- var c2 = a2();
- function a2() {
- return new e(50);
- }
- function m() {
- c2 = a2();
- }
- function y(e2, o) {
- if (e2.type === "icon")
- return l(e2, o);
- if (e2.type === "object")
- return b(e2, o);
- throw new s("symbol3d:unsupported-symbol-layer", "computeLayerSize only works with symbol layers of type Icon and Object");
- }
- async function f(e2, o) {
- if (e2.type === "icon")
- return p(e2, o);
- if (e2.type === "object")
- return d(e2, o);
- throw new s("symbol3d:unsupported-symbol-layer", "computeLayerSize only works with symbol layers of type Icon and Object");
- }
- async function l(e2, o) {
- if (e2.resource.href)
- return h(e2.resource.href).then((e3) => [e3.width, e3.height]);
- if (e2.resource.primitive)
- return r(o) ? [o, o] : [256, 256];
- throw new s("symbol3d:invalid-symbol-layer", "symbol layers of type Icon must have either an href or a primitive resource");
- }
- function p(e2, r2) {
- return l(e2, r2).then((r3) => {
- if (e2.size == null)
- return r3;
- const o = r3[0] / r3[1];
- return o > 1 ? [e2.size, e2.size / o] : [e2.size * o, e2.size];
- });
- }
- function h(r2) {
- return U(r2, { responseType: "image" }).then((e2) => e2.data);
- }
- function b(e2, r2) {
- return w(e2, r2).then((e3) => F(e3));
- }
- async function d(e2, r2) {
- const o = await b(e2, r2);
- return t(o, e2);
- }
- async function w(e2, o) {
- if (!e2.isPrimitive) {
- const r2 = e2.resource.href, o2 = c2.get(r2);
- if (o2 !== void 0)
- return o2;
- const t2 = await import("./objectResourceUtils-OTLKPTOD.js"), n2 = await t2.fetch(r2, { disableTextures: true });
- return c2.put(r2, n2.referenceBoundingBox), n2.referenceBoundingBox;
- }
- let n = null;
- if (e2.resource && e2.resource.primitive && (n = a(c(e2.resource.primitive)), r(o)))
- for (let r2 = 0; r2 < n.length; r2++)
- n[r2] *= o;
- return n ? Promise.resolve(n) : Promise.reject(new s("symbol:invalid-resource", "The symbol does not have a valid resource"));
- }
- export {
- m as clearBoundingBoxCache,
- l as computeIconLayerResourceSize,
- y as computeLayerResourceSize,
- f as computeLayerSize,
- b as computeObjectLayerResourceSize
- };
- //# sourceMappingURL=symbolLayerUtils-JYVFC7K4.js.map
|