chunk-QRRIN2JN.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import {
  2. l
  3. } from "./chunk-ICWTATWH.js";
  4. import {
  5. y4 as y2
  6. } from "./chunk-2Z2TG5CU.js";
  7. import {
  8. s3 as s
  9. } from "./chunk-E5O6P5I2.js";
  10. import {
  11. t,
  12. y
  13. } from "./chunk-SPWQ3AWG.js";
  14. import {
  15. r
  16. } from "./chunk-YXWMMD76.js";
  17. // node_modules/@arcgis/core/webdoc/support/writeUtils.js
  18. var l2 = /* @__PURE__ */ new Set(["bing-maps", "imagery", "imagery-tile", "map-image", "open-street-map", "tile", "unknown", "unsupported", "vector-tile", "web-tile", "wms", "wmts"]);
  19. var a = /* @__PURE__ */ new Set(["csv", "feature", "geo-rss", "geojson", "group", "imagery", "imagery-tile", "kml", "map-image", "map-notes", "ogc-feature", "route", "subtype-group", "tile", "unknown", "unsupported", "vector-tile", "web-tile", "wfs", "wms", "wmts"]);
  20. function m(e) {
  21. return "basemap" === e.layerContainerType ? l2 : "operational-layers" === e.layerContainerType ? a : null;
  22. }
  23. function c(e, t2) {
  24. if (t2.restrictedWebMapWriting) {
  25. const r2 = m(t2);
  26. return !r(r2) || r2.has(e.type) && !l(e);
  27. }
  28. return true;
  29. }
  30. function u(e, t2) {
  31. if (l(e)) {
  32. const n = t("featureCollection.layers", t2), i = n && n[0] && n[0].layerDefinition;
  33. i && d(e, i);
  34. } else if ("stream" === e.type) {
  35. d(e, t2.layerDefinition = t2.layerDefinition || {});
  36. } else
  37. "group" !== e.type && d(e, t2);
  38. }
  39. function d(e, t2) {
  40. "maxScale" in e && (t2.maxScale = y2(e.maxScale)), "minScale" in e && (t2.minScale = y2(e.minScale));
  41. }
  42. function f(e, t2) {
  43. if (u(e, t2), "blendMode" in e && (t2.blendMode = e.blendMode, "normal" === t2.blendMode && delete t2.blendMode), t2.opacity = y2(e.opacity), t2.title = e.title || "Layer", t2.visibility = e.visible, "legendEnabled" in e && "wmts" !== e.type)
  44. if (l(e)) {
  45. const n = t2.featureCollection;
  46. n && (n.showLegend = e.legendEnabled);
  47. } else
  48. t2.showLegend = e.legendEnabled;
  49. }
  50. function y3(r2, i, o) {
  51. if (!("write" in r2) || !r2.write)
  52. return o && o.messages && o.messages.push(new s("layer:unsupported", `Layers (${r2.title}, ${r2.id}) of type '${r2.declaredClass}' cannot be persisted`, { layer: r2 })), null;
  53. if (c(r2, o)) {
  54. const e = {};
  55. return r2.write(e, o) ? e : null;
  56. }
  57. return r(i) && f(r2, i = y(i)), i;
  58. }
  59. export {
  60. y3 as y
  61. };
  62. //# sourceMappingURL=chunk-QRRIN2JN.js.map