vue-openlayers-plugin 1.2.6 → 1.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/lib/{BasemapPanel-de2f80f7.mjs → BasemapPanel-ebe413da.mjs} +1 -1
  2. package/lib/{CoordinateLocationDialog-15b7aa45.mjs → CoordinateLocationDialog-ba72d9ea.mjs} +1 -1
  3. package/lib/{MapPrintDialog-2365b24f.mjs → FilterPanel-22070c3b.mjs} +1 -1
  4. package/lib/{FilterPanel-0d414bb8.mjs → LayerPanel-1398051d.mjs} +1 -1
  5. package/lib/{LayerPanel-f7fcc9a2.mjs → MapPrintDialog-d071ff8b.mjs} +1 -1
  6. package/lib/{MeasurementDialog-bbe0c78d.mjs → MeasurementDialog-e078d1c1.mjs} +1 -1
  7. package/lib/{MyMarkersDialog-8e8f081e.mjs → MyMarkersDialog-e0441cb0.mjs} +1 -1
  8. package/lib/{QuadCompareDialog-ffc425f1.mjs → QuadCompareDialog-b6315ab1.mjs} +1 -1
  9. package/lib/{RegionNavigationDialog-d43c4f64.mjs → RegionNavigationDialog-d533c521.mjs} +1 -1
  10. package/lib/{SplitCompareDialog-eb236ada.mjs → SplitCompareDialog-2d49fbc6.mjs} +1 -1
  11. package/lib/{SwipeCompareDialog-5640b36d.mjs → SwipeCompareDialog-50dfd6b1.mjs} +1 -1
  12. package/lib/{ViewBookmarksDialog-8c3c7c5a.mjs → ViewBookmarksDialog-8c3f5a5b.mjs} +1 -1
  13. package/lib/{index-01e0d980.mjs → index-b7a615a7.mjs} +220 -42
  14. package/lib/{index-c65930cf.mjs → index-ee2fa791.mjs} +1 -1
  15. package/lib/{index.es-08af44d0.mjs → index.es-dcd9031f.mjs} +1 -1
  16. package/lib/index.esm.js +1 -1
  17. package/lib/index.umd.js +206 -28
  18. package/lib/style.css +33 -26
  19. package/package.json +1 -1
  20. package/types/components/OlControlPanel.vue.d.ts +3 -1
  21. package/types/components/OlControlPanel.vue.d.ts.map +1 -1
  22. package/types/components/OlMap.vue.d.ts +3 -1
  23. package/types/components/OlMap.vue.d.ts.map +1 -1
  24. package/types/lowcode-entry.d.ts +5 -0
  25. package/types/lowcode-entry.d.ts.map +1 -1
  26. package/types/types/map.d.ts +20 -0
  27. package/types/types/map.d.ts.map +1 -1
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, inject, computed, ref, watch, onMounted, onUnmounted, openBlock, createBlock, unref, withCtx, createElementVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString } from "vue";
2
- import { r as resolveBasemapThumbnail, l as layerEventBus, X, b as _export_sfc } from "./index-01e0d980.mjs";
2
+ import { r as resolveBasemapThumbnail, l as layerEventBus, X, b as _export_sfc } from "./index-b7a615a7.mjs";
3
3
  import "@element-plus/icons-vue";
4
4
  import "ol";
5
5
  import "proj4";
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, inject, computed, ref, reactive, resolveComponent, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode } from "vue";
2
2
  import { Aim } from "@element-plus/icons-vue";
3
- import { X, T as TooltipHelper, b as _export_sfc } from "./index-01e0d980.mjs";
3
+ import { X, T as TooltipHelper, b as _export_sfc } from "./index-b7a615a7.mjs";
4
4
  import "ol";
5
5
  import "proj4";
6
6
  import "@supermapgis/iclient-ol";
@@ -1,4 +1,4 @@
1
- import { d as _sfc_main } from "./index-01e0d980.mjs";
1
+ import { j as _sfc_main } from "./index-b7a615a7.mjs";
2
2
  import "vue";
3
3
  import "@element-plus/icons-vue";
4
4
  import "ol";
@@ -1,4 +1,4 @@
1
- import { j as _sfc_main } from "./index-01e0d980.mjs";
1
+ import { e as _sfc_main } from "./index-b7a615a7.mjs";
2
2
  import "vue";
3
3
  import "@element-plus/icons-vue";
4
4
  import "ol";
@@ -1,4 +1,4 @@
1
- import { e as _sfc_main } from "./index-01e0d980.mjs";
1
+ import { d as _sfc_main } from "./index-b7a615a7.mjs";
2
2
  import "vue";
3
3
  import "@element-plus/icons-vue";
4
4
  import "ol";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, inject, computed, ref, watch, resolveComponent, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode, toDisplayString, createElementBlock, Fragment, renderList, normalizeClass } from "vue";
2
- import { X, f as formatMeasurementResult, b as _export_sfc } from "./index-01e0d980.mjs";
2
+ import { X, f as formatMeasurementResult, b as _export_sfc } from "./index-b7a615a7.mjs";
3
3
  import "@element-plus/icons-vue";
4
4
  import "ol";
5
5
  import "proj4";
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, inject, computed, ref, reactive, onUnmounted, watch, resolveComponent, openBlock, createElementBlock, Fragment, createVNode, unref, withCtx, createElementVNode, normalizeClass, createTextVNode, toDisplayString, renderList, createBlock, withModifiers, mergeProps } from "vue";
2
2
  import { Plus, FolderOpened, Download, Delete, Search, LocationFilled, Edit } from "@element-plus/icons-vue";
3
3
  import { ElMessageBox } from "element-plus";
4
- import { X, M as MarkerDrawingAdapter, h as fromLonLat, t as toLonLat } from "./index-01e0d980.mjs";
4
+ import { X, M as MarkerDrawingAdapter, h as fromLonLat, t as toLonLat } from "./index-b7a615a7.mjs";
5
5
  import "ol";
6
6
  import "proj4";
7
7
  import "@supermapgis/iclient-ol";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, inject, computed, shallowRef, reactive, watch, nextTick, onMounted, onUnmounted, resolveComponent, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, Fragment, renderList, createBlock, createCommentVNode } from "vue";
2
- import { k as layerFactory, i as getUid, m as defaults, X, n as TileLayer, I as ImageLayer, V as VectorTileLayer, H as HeatmapLayer, o as VectorLayer, L as LayerGroup, b as _export_sfc } from "./index-01e0d980.mjs";
2
+ import { k as layerFactory, i as getUid, m as defaults, X, n as TileLayer, I as ImageLayer, V as VectorTileLayer, H as HeatmapLayer, o as VectorLayer, L as LayerGroup, b as _export_sfc } from "./index-b7a615a7.mjs";
3
3
  import { u as useMap } from "./useMap-8e3a2de5.mjs";
4
4
  import { View, Map } from "ol";
5
5
  import "@element-plus/icons-vue";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, computed, ref, reactive, resolveComponent, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, normalizeClass } from "vue";
2
- import { X } from "./index-01e0d980.mjs";
2
+ import { X } from "./index-b7a615a7.mjs";
3
3
  import "@element-plus/icons-vue";
4
4
  import "ol";
5
5
  import "proj4";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, inject, computed, shallowRef, watch, nextTick, onMounted, onUnmounted, resolveComponent, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, Fragment, renderList, createBlock, createCommentVNode } from "vue";
2
- import { k as layerFactory, i as getUid, m as defaults, X, n as TileLayer, I as ImageLayer, V as VectorTileLayer, H as HeatmapLayer, o as VectorLayer, L as LayerGroup, b as _export_sfc } from "./index-01e0d980.mjs";
2
+ import { k as layerFactory, i as getUid, m as defaults, X, n as TileLayer, I as ImageLayer, V as VectorTileLayer, H as HeatmapLayer, o as VectorLayer, L as LayerGroup, b as _export_sfc } from "./index-b7a615a7.mjs";
3
3
  import { u as useMap } from "./useMap-8e3a2de5.mjs";
4
4
  import { View, Map } from "ol";
5
5
  import "@element-plus/icons-vue";
@@ -1,5 +1,5 @@
1
1
  import { defineComponent, ref, inject, computed, shallowRef, watch, nextTick, onMounted, onUnmounted, resolveComponent, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, normalizeClass, normalizeStyle, Fragment, renderList, createBlock, createCommentVNode } from "vue";
2
- import { k as layerFactory, i as getUid, m as defaults, X, n as TileLayer, I as ImageLayer, V as VectorTileLayer, H as HeatmapLayer, o as VectorLayer, L as LayerGroup, b as _export_sfc } from "./index-01e0d980.mjs";
2
+ import { k as layerFactory, i as getUid, m as defaults, X, n as TileLayer, I as ImageLayer, V as VectorTileLayer, H as HeatmapLayer, o as VectorLayer, L as LayerGroup, b as _export_sfc } from "./index-b7a615a7.mjs";
3
3
  import { u as useMap } from "./useMap-8e3a2de5.mjs";
4
4
  import { View, Map } from "ol";
5
5
  import { DCaret } from "@element-plus/icons-vue";
@@ -1,7 +1,7 @@
1
1
  import { defineComponent, inject, computed, ref, watch, reactive, resolveComponent, openBlock, createBlock, unref, withCtx, createElementVNode, createVNode, createTextVNode, createElementBlock, Fragment, renderList, withModifiers, toDisplayString, createCommentVNode } from "vue";
2
2
  import { Plus, Delete, Search, Camera, View, Edit, Location, ZoomIn } from "@element-plus/icons-vue";
3
3
  import { ElMessage, ElMessageBox } from "element-plus";
4
- import { X, t as toLonLat, h as fromLonLat, i as getUid } from "./index-01e0d980.mjs";
4
+ import { X, t as toLonLat, h as fromLonLat, i as getUid } from "./index-b7a615a7.mjs";
5
5
  import "ol";
6
6
  import "proj4";
7
7
  import "@supermapgis/iclient-ol";
@@ -5,11 +5,11 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import { defineComponent, ref, computed, watch, onMounted, openBlock, createElementBlock, normalizeClass, normalizeStyle as normalizeStyle$1, withModifiers, createElementVNode, createBlock, unref, withCtx, createTextVNode, createCommentVNode, renderSlot, nextTick, toDisplayString, onUnmounted, createVNode as createVNode$1, Fragment, renderList, h as h$3, createApp, inject, provide, isRef, resolveDirective, withDirectives, vShow, defineAsyncComponent, reactive, shallowRef, resolveComponent, resolveDynamicComponent, withKeys, useAttrs, useSlots, mergeProps, createSlots, normalizeProps, guardReactiveProps, watchEffect, Teleport } from "vue";
8
- import { MapLocation, Grid as Grid$6, Tools, Location, Guide, Flag, Printer, EditPen, Delete, Switch, DocumentCopy, Search, Loading, Clock, InfoFilled, Plus, Minus, RefreshLeft, RefreshRight, Right, FullScreen, Aim, Menu as Menu$2, View as View$4, Expand, Share, CircleCheck, FolderOpened, DataBoard, Setting, Download, Refresh, ZoomIn, ZoomOut, Document as Document$1, Position, Close } from "@element-plus/icons-vue";
8
+ import { MapLocation, Grid as Grid$6, Tools, Location, Guide, Flag, Printer, EditPen, Delete, Switch, DocumentCopy, Search, Loading, Clock, InfoFilled, Plus, Minus, RefreshLeft, RefreshRight, Right, FullScreen, Aim, Menu as Menu$2, View as View$4, Expand, Share, CircleCheck, Upload, FolderOpened, DataBoard, Setting, Download, Refresh, ZoomIn, ZoomOut, Document as Document$1, Position, Close } from "@element-plus/icons-vue";
9
9
  import { Feature as Feature$3, Map as Map$4 } from "ol";
10
10
  import proj4 from "proj4";
11
11
  import { TileSuperMapRest, Util as Util$3, GetFeaturesByGeometryParameters as GetFeaturesByGeometryParameters$1, FeatureService } from "@supermapgis/iclient-ol";
12
- import { ElButton, ElInput, ElIcon, ElPopover, ElTooltip, ElCheckbox, ElDialog } from "element-plus";
12
+ import { ElButton, ElInput, ElIcon, ElPopover, ElTooltip, ElCheckbox, ElMessage, ElDialog } from "element-plus";
13
13
  function _mergeNamespaces(n2, m2) {
14
14
  for (var i = 0; i < m2.length; i++) {
15
15
  const e8 = m2[i];
@@ -334697,7 +334697,7 @@ const _hoisted_11$a = {
334697
334697
  };
334698
334698
  const _hoisted_12$8 = ["onClick"];
334699
334699
  const _hoisted_13$8 = ["src", "alt"];
334700
- const _hoisted_14$5 = {
334700
+ const _hoisted_14$6 = {
334701
334701
  key: 3,
334702
334702
  class: "slideshow-controls"
334703
334703
  };
@@ -334913,7 +334913,7 @@ const _sfc_main$p = /* @__PURE__ */ defineComponent({
334913
334913
  ], 10, _hoisted_12$8);
334914
334914
  }), 128))
334915
334915
  ])) : createCommentVNode("", true),
334916
- _ctx.config.slideshow && imageList.value.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_14$5, [
334916
+ _ctx.config.slideshow && imageList.value.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_14$6, [
334917
334917
  createVNode$1(unref(ElButton), {
334918
334918
  class: normalizeClass(["slideshow-btn", { active: isSlideshow.value }]),
334919
334919
  type: isSlideshow.value ? "primary" : "default",
@@ -334994,7 +334994,7 @@ const _hoisted_12$7 = {
334994
334994
  class: "sort-indicator"
334995
334995
  };
334996
334996
  const _hoisted_13$7 = ["onClick"];
334997
- const _hoisted_14$4 = { key: 0 };
334997
+ const _hoisted_14$5 = { key: 0 };
334998
334998
  const _hoisted_15$3 = ["src", "alt"];
334999
334999
  const _hoisted_16$3 = { key: 1 };
335000
335000
  const _hoisted_17$3 = ["href"];
@@ -335277,7 +335277,7 @@ const _sfc_main$o = /* @__PURE__ */ defineComponent({
335277
335277
  return openBlock(), createElementBlock("td", {
335278
335278
  key: field.key
335279
335279
  }, [
335280
- field.type === "image" ? (openBlock(), createElementBlock("span", _hoisted_14$4, [
335280
+ field.type === "image" ? (openBlock(), createElementBlock("span", _hoisted_14$5, [
335281
335281
  createElementVNode("img", {
335282
335282
  src: getFieldValue(item, field.key || field.name),
335283
335283
  alt: field.label,
@@ -337437,19 +337437,19 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
337437
337437
  }
337438
337438
  });
337439
337439
  const defaultComponents = {
337440
- measurement: () => import("./MeasurementDialog-bbe0c78d.mjs"),
337441
- basemap: () => import("./BasemapPanel-de2f80f7.mjs"),
337442
- print: () => import("./MapPrintDialog-2365b24f.mjs"),
337443
- "layer-panel": () => import("./LayerPanel-f7fcc9a2.mjs"),
337444
- coordinate: () => import("./CoordinateLocationDialog-15b7aa45.mjs"),
337445
- "region-navigation": () => import("./RegionNavigationDialog-d43c4f64.mjs"),
337446
- "my-markers": () => import("./MyMarkersDialog-8e8f081e.mjs"),
337447
- "view-bookmarks": () => import("./ViewBookmarksDialog-8c3c7c5a.mjs"),
337448
- "map-drawing": () => import("./index-c65930cf.mjs"),
337449
- "filter-panel": () => import("./FilterPanel-0d414bb8.mjs"),
337450
- "swipe-compare": () => import("./SwipeCompareDialog-5640b36d.mjs"),
337451
- "split-compare": () => import("./SplitCompareDialog-eb236ada.mjs"),
337452
- "quad-compare": () => import("./QuadCompareDialog-ffc425f1.mjs")
337440
+ measurement: () => import("./MeasurementDialog-e078d1c1.mjs"),
337441
+ basemap: () => import("./BasemapPanel-ebe413da.mjs"),
337442
+ print: () => import("./MapPrintDialog-d071ff8b.mjs"),
337443
+ "layer-panel": () => import("./LayerPanel-1398051d.mjs"),
337444
+ coordinate: () => import("./CoordinateLocationDialog-ba72d9ea.mjs"),
337445
+ "region-navigation": () => import("./RegionNavigationDialog-d533c521.mjs"),
337446
+ "my-markers": () => import("./MyMarkersDialog-e0441cb0.mjs"),
337447
+ "view-bookmarks": () => import("./ViewBookmarksDialog-8c3f5a5b.mjs"),
337448
+ "map-drawing": () => import("./index-ee2fa791.mjs"),
337449
+ "filter-panel": () => import("./FilterPanel-22070c3b.mjs"),
337450
+ "swipe-compare": () => import("./SwipeCompareDialog-50dfd6b1.mjs"),
337451
+ "split-compare": () => import("./SplitCompareDialog-2d49fbc6.mjs"),
337452
+ "quad-compare": () => import("./QuadCompareDialog-b6315ab1.mjs")
337453
337453
  };
337454
337454
  const _DialogRegistry = class _DialogRegistry {
337455
337455
  constructor() {
@@ -338799,7 +338799,7 @@ const _hoisted_10$a = {
338799
338799
  const _hoisted_11$8 = { class: "result-count" };
338800
338800
  const _hoisted_12$6 = ["onClick"];
338801
338801
  const _hoisted_13$6 = { class: "item-content" };
338802
- const _hoisted_14$3 = ["innerHTML"];
338802
+ const _hoisted_14$4 = ["innerHTML"];
338803
338803
  const _hoisted_15$2 = ["innerHTML"];
338804
338804
  const _hoisted_16$2 = {
338805
338805
  key: 0,
@@ -339330,7 +339330,7 @@ const _sfc_main$l = /* @__PURE__ */ defineComponent({
339330
339330
  createElementVNode("div", {
339331
339331
  class: "item-name",
339332
339332
  innerHTML: highlightText(result.name, searchQuery.value)
339333
- }, null, 8, _hoisted_14$3),
339333
+ }, null, 8, _hoisted_14$4),
339334
339334
  createElementVNode("div", {
339335
339335
  class: "item-address",
339336
339336
  innerHTML: highlightText(result.address, searchQuery.value)
@@ -339518,17 +339518,21 @@ const _hoisted_8$9 = { class: "drawing-menu-panel-content" };
339518
339518
  const _hoisted_9$9 = { class: "drawing-tool-list" };
339519
339519
  const _hoisted_10$9 = {
339520
339520
  key: 0,
339521
- class: "drawing-menu-divider"
339521
+ class: "drawing-import-row"
339522
339522
  };
339523
339523
  const _hoisted_11$7 = {
339524
339524
  key: 1,
339525
- class: "drawing-toggle-row"
339525
+ class: "drawing-menu-divider"
339526
339526
  };
339527
339527
  const _hoisted_12$5 = {
339528
+ key: 2,
339529
+ class: "drawing-toggle-row"
339530
+ };
339531
+ const _hoisted_13$5 = {
339528
339532
  key: 7,
339529
339533
  class: "control-divider"
339530
339534
  };
339531
- const _hoisted_13$5 = {
339535
+ const _hoisted_14$3 = {
339532
339536
  key: 8,
339533
339537
  class: "control-section"
339534
339538
  };
@@ -339544,7 +339548,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
339544
339548
  bottomOffset: {},
339545
339549
  viewBookmarks: {}
339546
339550
  },
339547
- emits: ["drawing-complete", "drawing-clear"],
339551
+ emits: ["drawing-complete", "drawing-clear", "drawing-import"],
339548
339552
  setup(__props, { expose: __expose, emit: __emit }) {
339549
339553
  const props = __props;
339550
339554
  const emit = __emit;
@@ -339672,7 +339676,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
339672
339676
  return !!((tools == null ? void 0 : tools.viewBookmarks) || props.config.viewBookmarks);
339673
339677
  });
339674
339678
  const drawingControlConfig = computed(() => {
339675
- var _a2;
339679
+ var _a2, _b2, _c2, _d;
339676
339680
  const rawConfig = ((_a2 = props.config.tools) == null ? void 0 : _a2.drawing) ?? props.config.drawing;
339677
339681
  if (rawConfig === false) {
339678
339682
  return {
@@ -339680,8 +339684,15 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
339680
339684
  trigger: "hover",
339681
339685
  continuous: false,
339682
339686
  showContinuousToggle: true,
339687
+ showImportButton: false,
339688
+ importOptions: {
339689
+ clearBeforeImport: false,
339690
+ fitToImported: true,
339691
+ accept: ".json,.geojson"
339692
+ },
339683
339693
  tools: DEFAULT_DRAWING_TOOLS,
339684
- onDrawEnd: void 0
339694
+ onDrawEnd: void 0,
339695
+ onImportEnd: void 0
339685
339696
  };
339686
339697
  }
339687
339698
  if (rawConfig === true || rawConfig === void 0) {
@@ -339690,8 +339701,15 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
339690
339701
  trigger: "hover",
339691
339702
  continuous: false,
339692
339703
  showContinuousToggle: true,
339704
+ showImportButton: false,
339705
+ importOptions: {
339706
+ clearBeforeImport: false,
339707
+ fitToImported: true,
339708
+ accept: ".json,.geojson"
339709
+ },
339693
339710
  tools: DEFAULT_DRAWING_TOOLS,
339694
- onDrawEnd: void 0
339711
+ onDrawEnd: void 0,
339712
+ onImportEnd: void 0
339695
339713
  };
339696
339714
  }
339697
339715
  const config = rawConfig;
@@ -339703,8 +339721,15 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
339703
339721
  trigger: config.trigger || "hover",
339704
339722
  continuous: config.continuous ?? false,
339705
339723
  showContinuousToggle: config.showContinuousToggle !== false,
339724
+ showImportButton: config.showImportButton === true,
339725
+ importOptions: {
339726
+ clearBeforeImport: ((_b2 = config.importOptions) == null ? void 0 : _b2.clearBeforeImport) ?? false,
339727
+ fitToImported: ((_c2 = config.importOptions) == null ? void 0 : _c2.fitToImported) ?? true,
339728
+ accept: ((_d = config.importOptions) == null ? void 0 : _d.accept) || ".json,.geojson"
339729
+ },
339706
339730
  tools: tools.length > 0 ? Array.from(new Set(tools)) : DEFAULT_DRAWING_TOOLS,
339707
- onDrawEnd: config.onDrawEnd
339731
+ onDrawEnd: config.onDrawEnd,
339732
+ onImportEnd: config.onImportEnd
339708
339733
  };
339709
339734
  });
339710
339735
  const isDrawingEnabled = computed(() => drawingControlConfig.value.enabled);
@@ -339922,6 +339947,136 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
339922
339947
  source: "controls"
339923
339948
  };
339924
339949
  };
339950
+ const normalizeImportedGeoJSON = (rawData) => {
339951
+ if (typeof rawData === "string") {
339952
+ const trimmed = rawData.trim();
339953
+ if (!trimmed) {
339954
+ throw new Error("文件内容为空");
339955
+ }
339956
+ return normalizeImportedGeoJSON(
339957
+ JSON.parse(trimmed)
339958
+ );
339959
+ }
339960
+ if (!rawData || typeof rawData !== "object") {
339961
+ throw new Error("仅支持导入 GeoJSON 对象");
339962
+ }
339963
+ const geoJson = rawData;
339964
+ if (geoJson.type === "FeatureCollection" && Array.isArray(geoJson.features)) {
339965
+ return geoJson;
339966
+ }
339967
+ if (geoJson.type === "Feature") {
339968
+ return geoJson;
339969
+ }
339970
+ if ("coordinates" in geoJson && typeof geoJson.type === "string") {
339971
+ return geoJson;
339972
+ }
339973
+ throw new Error("文件不是有效的 GeoJSON 格式");
339974
+ };
339975
+ const collectImportedExtent = (geojson) => {
339976
+ var _a2;
339977
+ if (!currentMap.value)
339978
+ return null;
339979
+ try {
339980
+ const features2 = geoJsonFormat.readFeatures(geojson, {
339981
+ dataProjection: "EPSG:4326",
339982
+ featureProjection: currentMap.value.getView().getProjection()
339983
+ });
339984
+ if (!features2.length) {
339985
+ return null;
339986
+ }
339987
+ let extent3 = (_a2 = features2[0].getGeometry()) == null ? void 0 : _a2.getExtent();
339988
+ if (!extent3) {
339989
+ return null;
339990
+ }
339991
+ for (let i = 1; i < features2.length; i += 1) {
339992
+ const geometry = features2[i].getGeometry();
339993
+ if (!geometry)
339994
+ continue;
339995
+ const currentExtent = geometry.getExtent();
339996
+ extent3 = [
339997
+ Math.min(extent3[0], currentExtent[0]),
339998
+ Math.min(extent3[1], currentExtent[1]),
339999
+ Math.max(extent3[2], currentExtent[2]),
340000
+ Math.max(extent3[3], currentExtent[3])
340001
+ ];
340002
+ }
340003
+ return extent3;
340004
+ } catch (error2) {
340005
+ console.warn("解析导入图形范围失败:", error2);
340006
+ return null;
340007
+ }
340008
+ };
340009
+ const fitToImportedGeoJSON = (geojson) => {
340010
+ if (!currentMap.value)
340011
+ return;
340012
+ const extent3 = collectImportedExtent(geojson);
340013
+ if (!extent3)
340014
+ return;
340015
+ currentMap.value.getView().fit(extent3, {
340016
+ duration: 500,
340017
+ padding: [30, 30, 30, 30],
340018
+ maxZoom: 18
340019
+ });
340020
+ };
340021
+ const importDrawings = () => {
340022
+ var _a2;
340023
+ const drawingManager = (_a2 = mapManager == null ? void 0 : mapManager.value) == null ? void 0 : _a2.getDrawingManager();
340024
+ if (!drawingManager) {
340025
+ ElMessage.warning("绘制管理器未初始化");
340026
+ return;
340027
+ }
340028
+ const input = document.createElement("input");
340029
+ input.type = "file";
340030
+ input.accept = drawingControlConfig.value.importOptions.accept;
340031
+ input.onchange = (event) => {
340032
+ var _a3;
340033
+ const file = (_a3 = event.target.files) == null ? void 0 : _a3[0];
340034
+ if (!file) {
340035
+ return;
340036
+ }
340037
+ const reader = new FileReader();
340038
+ reader.onload = (loadEvent) => {
340039
+ var _a4, _b2, _c2;
340040
+ try {
340041
+ const parsedGeojson = normalizeImportedGeoJSON(
340042
+ ((_a4 = loadEvent.target) == null ? void 0 : _a4.result) ?? ""
340043
+ );
340044
+ if (drawingControlConfig.value.importOptions.clearBeforeImport) {
340045
+ drawingManager.clearAll();
340046
+ }
340047
+ const drawings = drawingManager.addGeoJSONData(parsedGeojson);
340048
+ if (!drawings.length) {
340049
+ ElMessage.warning("未识别到可导入的图形");
340050
+ return;
340051
+ }
340052
+ if (drawingControlConfig.value.importOptions.fitToImported) {
340053
+ fitToImportedGeoJSON(parsedGeojson);
340054
+ }
340055
+ const result = {
340056
+ fileName: file.name,
340057
+ importedCount: drawings.length,
340058
+ geojson: parsedGeojson,
340059
+ drawings: drawings.map((drawing) => buildDrawingResult(drawing)),
340060
+ source: "controls"
340061
+ };
340062
+ (_c2 = (_b2 = drawingControlConfig.value).onImportEnd) == null ? void 0 : _c2.call(_b2, result);
340063
+ emit("drawing-import", result);
340064
+ ElMessage.success(`成功导入 ${drawings.length} 个图形`);
340065
+ isDrawingMenuOpen.value = false;
340066
+ } catch (error2) {
340067
+ console.error("导入图形失败:", error2);
340068
+ ElMessage.error(
340069
+ error2 instanceof Error ? error2.message : "导入图形失败"
340070
+ );
340071
+ }
340072
+ };
340073
+ reader.onerror = () => {
340074
+ ElMessage.error("读取文件失败");
340075
+ };
340076
+ reader.readAsText(file);
340077
+ };
340078
+ input.click();
340079
+ };
339925
340080
  const cleanupDrawingListeners = () => {
339926
340081
  if (boundDrawingManager && boundDrawingEndHandler && boundModeChangeHandler) {
339927
340082
  boundDrawingManager.off("drawing-end", boundDrawingEndHandler);
@@ -340336,7 +340491,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
340336
340491
  ]),
340337
340492
  default: withCtx(() => [
340338
340493
  createElementVNode("div", _hoisted_8$9, [
340339
- _cache[5] || (_cache[5] = createElementVNode("div", { class: "drawing-menu-title" }, "快捷绘制", -1)),
340494
+ _cache[6] || (_cache[6] = createElementVNode("div", { class: "drawing-menu-title" }, "快捷绘制", -1)),
340340
340495
  createElementVNode("div", _hoisted_9$9, [
340341
340496
  (openBlock(true), createElementBlock(Fragment, null, renderList(drawingControlConfig.value.tools, (tool) => {
340342
340497
  return openBlock(), createBlock(unref(ElTooltip), {
@@ -340387,26 +340542,45 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
340387
340542
  }, 1032, ["content"]);
340388
340543
  }), 128))
340389
340544
  ]),
340390
- drawingControlConfig.value.showContinuousToggle || isDrawingActive.value ? (openBlock(), createElementBlock("div", _hoisted_10$9)) : createCommentVNode("", true),
340391
- drawingControlConfig.value.showContinuousToggle ? (openBlock(), createElementBlock("div", _hoisted_11$7, [
340545
+ drawingControlConfig.value.showImportButton ? (openBlock(), createElementBlock("div", _hoisted_10$9, [
340546
+ createVNode$1(unref(ElButton), {
340547
+ size: "small",
340548
+ text: "",
340549
+ class: "drawing-import-btn",
340550
+ onClick: importDrawings
340551
+ }, {
340552
+ default: withCtx(() => [
340553
+ createVNode$1(unref(ElIcon), null, {
340554
+ default: withCtx(() => [
340555
+ createVNode$1(unref(Upload))
340556
+ ]),
340557
+ _: 1
340558
+ }),
340559
+ _cache[3] || (_cache[3] = createElementVNode("span", null, "导入图形", -1))
340560
+ ]),
340561
+ _: 1
340562
+ })
340563
+ ])) : createCommentVNode("", true),
340564
+ drawingControlConfig.value.showContinuousToggle || isDrawingActive.value ? (openBlock(), createElementBlock("div", _hoisted_11$7)) : createCommentVNode("", true),
340565
+ drawingControlConfig.value.showContinuousToggle ? (openBlock(), createElementBlock("div", _hoisted_12$5, [
340392
340566
  createVNode$1(unref(ElCheckbox), {
340393
340567
  modelValue: continuousDrawing.value,
340394
340568
  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => continuousDrawing.value = $event)
340395
340569
  }, {
340396
- default: withCtx(() => [..._cache[3] || (_cache[3] = [
340570
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [
340397
340571
  createTextVNode(" 是否连续绘制 ", -1)
340398
340572
  ])]),
340399
340573
  _: 1
340400
340574
  }, 8, ["modelValue"])
340401
340575
  ])) : createCommentVNode("", true),
340402
340576
  isDrawingActive.value ? (openBlock(), createBlock(unref(ElButton), {
340403
- key: 2,
340577
+ key: 3,
340404
340578
  size: "small",
340405
340579
  text: "",
340406
340580
  class: "drawing-stop-btn",
340407
340581
  onClick: stopQuickDrawing
340408
340582
  }, {
340409
- default: withCtx(() => [..._cache[4] || (_cache[4] = [
340583
+ default: withCtx(() => [..._cache[5] || (_cache[5] = [
340410
340584
  createTextVNode(" 停止绘制 ", -1)
340411
340585
  ])]),
340412
340586
  _: 1
@@ -340416,8 +340590,8 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
340416
340590
  _: 1
340417
340591
  }, 8, ["placement", "trigger", "visible", "disabled"])
340418
340592
  ])) : createCommentVNode("", true),
340419
- (((_o2 = _ctx.config.tools) == null ? void 0 : _o2.clearAll) || _ctx.config.clearAll) && (hasOtherTools.value || isDrawingEnabled.value || ((_p = _ctx.config.tools) == null ? void 0 : _p.zoom) || _ctx.config.zoom || ((_q = _ctx.config.tools) == null ? void 0 : _q.rotate) || _ctx.config.rotate) ? (openBlock(), createElementBlock("div", _hoisted_12$5)) : createCommentVNode("", true),
340420
- ((_r2 = _ctx.config.tools) == null ? void 0 : _r2.clearAll) || _ctx.config.clearAll ? (openBlock(), createElementBlock("div", _hoisted_13$5, [
340593
+ (((_o2 = _ctx.config.tools) == null ? void 0 : _o2.clearAll) || _ctx.config.clearAll) && (hasOtherTools.value || isDrawingEnabled.value || ((_p = _ctx.config.tools) == null ? void 0 : _p.zoom) || _ctx.config.zoom || ((_q = _ctx.config.tools) == null ? void 0 : _q.rotate) || _ctx.config.rotate) ? (openBlock(), createElementBlock("div", _hoisted_13$5)) : createCommentVNode("", true),
340594
+ ((_r2 = _ctx.config.tools) == null ? void 0 : _r2.clearAll) || _ctx.config.clearAll ? (openBlock(), createElementBlock("div", _hoisted_14$3, [
340421
340595
  createVNode$1(unref(ElButton), {
340422
340596
  class: "control-btn",
340423
340597
  title: "清空绘制内容",
@@ -340441,7 +340615,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
340441
340615
  };
340442
340616
  }
340443
340617
  });
340444
- const OlControlPanel = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-2ee216d4"]]);
340618
+ const OlControlPanel = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-5317d890"]]);
340445
340619
  const _hoisted_1$i = {
340446
340620
  key: 0,
340447
340621
  class: "ol-legend-header"
@@ -353042,7 +353216,7 @@ function(t3) {
353042
353216
  */
353043
353217
  function(t3) {
353044
353218
  function e8() {
353045
- return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-08af44d0.mjs")).catch(function(t4) {
353219
+ return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-dcd9031f.mjs")).catch(function(t4) {
353046
353220
  return Promise.reject(new Error("Could not load canvg: " + t4));
353047
353221
  }).then(function(t4) {
353048
353222
  return t4.default ? t4.default : t4;
@@ -365779,7 +365953,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
365779
365953
  popupConfig: {},
365780
365954
  enableGeolocation: { type: Boolean, default: true }
365781
365955
  },
365782
- emits: ["map-ready", "map-click", "map-dblclick", "map-contextmenu", "map-move", "zoom-change", "feature-click", "tooltip-show", "tooltip-hide", "layer-change", "measurement-change", "measurement-start", "measurement-end", "measurement-result", "context-menu", "bookmark-action", "marker-action", "tool-action", "drawing-complete", "drawing-clear", "search", "search-select", "search-clear", "popup-show", "popup-hide", "popup-close"],
365956
+ emits: ["map-ready", "map-click", "map-dblclick", "map-contextmenu", "map-move", "zoom-change", "feature-click", "tooltip-show", "tooltip-hide", "layer-change", "measurement-change", "measurement-start", "measurement-end", "measurement-result", "context-menu", "bookmark-action", "marker-action", "tool-action", "drawing-complete", "drawing-clear", "drawing-import", "search", "search-select", "search-clear", "popup-show", "popup-hide", "popup-close"],
365783
365957
  setup(__props, { expose: __expose, emit: __emit }) {
365784
365958
  const currentLegends = ref([]);
365785
365959
  const currentLayers = ref([]);
@@ -366651,6 +366825,9 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
366651
366825
  const onDrawingClear = (event) => {
366652
366826
  emit("drawing-clear", event);
366653
366827
  };
366828
+ const onDrawingImport = (result) => {
366829
+ emit("drawing-import", result);
366830
+ };
366654
366831
  const onPrintAction = (data) => {
366655
366832
  console.log("打印操作:", data);
366656
366833
  switch (data.action) {
@@ -367339,7 +367516,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
367339
367516
  "bottom-offset": finalControlsConfig.value.bottomOffset,
367340
367517
  "view-bookmarks": props.viewBookmarks,
367341
367518
  onDrawingComplete,
367342
- onDrawingClear
367519
+ onDrawingClear,
367520
+ onDrawingImport
367343
367521
  }, {
367344
367522
  custom: withCtx(({ controls }) => [
367345
367523
  renderSlot(_ctx.$slots, "controls", {
@@ -367476,7 +367654,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
367476
367654
  };
367477
367655
  }
367478
367656
  });
367479
- const OlMap = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-610dbb17"]]);
367657
+ const OlMap = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-984651bc"]]);
367480
367658
  const Property = {
367481
367659
  ACCURACY: "accuracy",
367482
367660
  ACCURACY_GEOMETRY: "accuracyGeometry",
@@ -1,6 +1,6 @@
1
1
  import { inject, computed, ref, onMounted, resolveComponent, openBlock, createElementBlock, createVNode, withCtx, Fragment, renderList, createElementVNode, normalizeClass, toDisplayString, unref, createTextVNode, createCommentVNode, createBlock } from "vue";
2
2
  import { Close } from "@element-plus/icons-vue";
3
- import { b as _export_sfc, D as DrawingManager, X } from "./index-01e0d980.mjs";
3
+ import { b as _export_sfc, D as DrawingManager, X } from "./index-b7a615a7.mjs";
4
4
  import "ol";
5
5
  import "proj4";
6
6
  import "@supermapgis/iclient-ol";
@@ -1,4 +1,4 @@
1
- import { c as commonjsGlobal, g as getDefaultExportFromCjs, _ as _asyncToGenerator, a as _defineProperty } from "./index-01e0d980.mjs";
1
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs, _ as _asyncToGenerator, a as _defineProperty } from "./index-b7a615a7.mjs";
2
2
  import "vue";
3
3
  import "@element-plus/icons-vue";
4
4
  import "ol";
package/lib/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ad, a0, K, O, a4, D, aA, a9, ac, aF, aE, ak, al, aw, ax, Y, am, an, aD, aB, $, Z, ay, az, B, E, F, A, J, y, C, z, G, au, av, as, at, aq, ar, x, s, q, w, O as O2, p, u, v, ae, af, ai, aj, ao, ap, aG, N, ag, ah, U, ab, a1, a5, a8, Q, f, W, aa, a6, a2, a3, aC, P, a7, l, S, r, R } from "./index-01e0d980.mjs";
1
+ import { ad, a0, K, O, a4, D, aA, a9, ac, aF, aE, ak, al, aw, ax, Y, am, an, aD, aB, $, Z, ay, az, B, E, F, A, J, y, C, z, G, au, av, as, at, aq, ar, x, s, q, w, O as O2, p, u, v, ae, af, ai, aj, ao, ap, aG, N, ag, ah, U, ab, a1, a5, a8, Q, f, W, aa, a6, a2, a3, aC, P, a7, l, S, r, R } from "./index-b7a615a7.mjs";
2
2
  import "vue";
3
3
  import "@element-plus/icons-vue";
4
4
  import "ol";