vue-openlayers-plugin 1.1.13 → 1.1.14

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 (36) hide show
  1. package/README.md +209 -0
  2. package/lib/{BasemapPanel-a8d7373d.mjs → BasemapPanel-d022a31a.mjs} +1 -1
  3. package/lib/{CoordinateLocationDialog-274aff1a.mjs → CoordinateLocationDialog-6cdf239b.mjs} +1 -1
  4. package/lib/{MapPrintDialog-97054260.mjs → FilterPanel-de00b336.mjs} +1 -1
  5. package/lib/{FilterPanel-ccdaaac3.mjs → LayerPanel-1a0456a4.mjs} +1 -1
  6. package/lib/{LayerPanel-c716b7cc.mjs → MapPrintDialog-c65f685b.mjs} +1 -1
  7. package/lib/{MeasurementDialog-7c08ba58.mjs → MeasurementDialog-44599074.mjs} +1 -1
  8. package/lib/{MyMarkersDialog-89bd594e.mjs → MyMarkersDialog-dd288574.mjs} +1 -1
  9. package/lib/{QuadCompareDialog-78dd2cf6.mjs → QuadCompareDialog-2cd17881.mjs} +1 -1
  10. package/lib/{RegionNavigationDialog-4b7b4e5f.mjs → RegionNavigationDialog-b1cdc5f9.mjs} +1 -1
  11. package/lib/{SplitCompareDialog-b51b55c1.mjs → SplitCompareDialog-6dd0fb71.mjs} +1 -1
  12. package/lib/{SwipeCompareDialog-2b89b65e.mjs → SwipeCompareDialog-dfae0afd.mjs} +1 -1
  13. package/lib/{ViewBookmarksDialog-7ee33d4e.mjs → ViewBookmarksDialog-2a6bc942.mjs} +1 -1
  14. package/lib/{index-3699244d.mjs → index-199c60c9.mjs} +1 -1
  15. package/lib/{index-98c677b7.mjs → index-e868c4e2.mjs} +504 -48
  16. package/lib/{index.es-e3be4489.mjs → index.es-560c236e.mjs} +1 -1
  17. package/lib/index.esm.js +1 -1
  18. package/lib/index.umd.js +491 -35
  19. package/lib/style.css +5 -5
  20. package/package.json +1 -1
  21. package/types/components/OlDialogs/LayerPanel.vue.d.ts +188 -0
  22. package/types/components/OlDialogs/LayerPanel.vue.d.ts.map +1 -1
  23. package/types/components/OlMap.vue.d.ts +381 -0
  24. package/types/components/OlMap.vue.d.ts.map +1 -1
  25. package/types/components/OlMapContainer.vue.d.ts +1 -0
  26. package/types/components/OlMapContainer.vue.d.ts.map +1 -1
  27. package/types/core/LayerManager.d.ts +5 -0
  28. package/types/core/LayerManager.d.ts.map +1 -1
  29. package/types/core/layers/GeoJSONLayerHandler.d.ts +30 -2
  30. package/types/core/layers/GeoJSONLayerHandler.d.ts.map +1 -1
  31. package/types/core/layers/interfaces.d.ts +5 -0
  32. package/types/core/layers/interfaces.d.ts.map +1 -1
  33. package/types/lowcode-entry.d.ts +391 -0
  34. package/types/lowcode-entry.d.ts.map +1 -1
  35. package/types/types/map.d.ts +60 -0
  36. package/types/types/map.d.ts.map +1 -1
@@ -67657,13 +67657,17 @@ class GeoJSONLayerHandler extends BaseLayer2 {
67657
67657
  constructor(config, map2) {
67658
67658
  super(config);
67659
67659
  __publicField(this, "styleConfig");
67660
- // 新增:缓存启用的过滤器和原始要素集合
67661
- __publicField(this, "currentFilters", []);
67662
67660
  __publicField(this, "originalFeatures", []);
67661
+ __publicField(this, "vectorSource", null);
67662
+ __publicField(this, "refreshTimer", null);
67663
+ __publicField(this, "refreshDebounceTimer", null);
67664
+ __publicField(this, "moveEndListener", null);
67665
+ __publicField(this, "lastKnownZoom");
67666
+ __publicField(this, "isRefreshing", false);
67663
67667
  if (map2)
67664
67668
  this.setMap(map2);
67665
67669
  }
67666
- createLayer() {
67670
+ async createLayer() {
67667
67671
  var _a2, _b2, _c2;
67668
67672
  const vectorSource = this.createVectorSource();
67669
67673
  const declutterOpt = (_c2 = (_b2 = (_a2 = this.config) == null ? void 0 : _a2.config) == null ? void 0 : _b2.vector) == null ? void 0 : _c2.declutter;
@@ -67671,42 +67675,379 @@ class GeoJSONLayerHandler extends BaseLayer2 {
67671
67675
  className: this.config.className,
67672
67676
  source: vectorSource,
67673
67677
  style: this.createStyleFunction(),
67674
- // 默认关闭 declutter;如需避免标签重叠,可在 config.vector.declutter 设为 true
67675
67678
  declutter: declutterOpt !== void 0 ? !!declutterOpt : false
67676
67679
  });
67680
+ this.vectorSource = vectorSource;
67681
+ await this.initializeSource();
67682
+ this.setupRefreshBehavior();
67677
67683
  return vectorLayer;
67678
67684
  }
67679
67685
  /**
67680
67686
  * 创建矢量数据源
67681
67687
  */
67682
67688
  createVectorSource() {
67683
- var _a2;
67684
67689
  this.registerCustomProjection();
67690
+ return new VectorSource$1();
67691
+ }
67692
+ getGeoJSONConfig() {
67693
+ var _a2;
67694
+ const nestedConfig = this.config.geojsonConfig || ((_a2 = this.config.config) == null ? void 0 : _a2.geojson);
67695
+ const requestConfig = {
67696
+ url: this.config.url,
67697
+ method: this.config.method,
67698
+ headers: this.config.headers,
67699
+ params: this.config.params,
67700
+ body: this.config.body,
67701
+ dataPath: this.config.dataPath,
67702
+ ...(nestedConfig == null ? void 0 : nestedConfig.request) || {}
67703
+ };
67704
+ return {
67705
+ data: (nestedConfig == null ? void 0 : nestedConfig.data) ?? this.config.data,
67706
+ dataPath: (nestedConfig == null ? void 0 : nestedConfig.dataPath) ?? this.config.dataPath,
67707
+ clearOnError: (nestedConfig == null ? void 0 : nestedConfig.clearOnError) ?? false,
67708
+ refresh: nestedConfig == null ? void 0 : nestedConfig.refresh,
67709
+ request: requestConfig.url || (nestedConfig == null ? void 0 : nestedConfig.request) ? requestConfig : void 0
67710
+ };
67711
+ }
67712
+ getDataProjection() {
67713
+ return this.config.projection || "EPSG:4326";
67714
+ }
67715
+ getMapProjection() {
67716
+ var _a2;
67717
+ return ((_a2 = this.map) == null ? void 0 : _a2.getView().getProjection().getCode()) || "EPSG:4326";
67718
+ }
67719
+ async initializeSource() {
67720
+ var _a2;
67721
+ const source = this.getVectorSource();
67722
+ if (!source)
67723
+ return;
67724
+ const geojsonConfig = this.getGeoJSONConfig();
67725
+ if (geojsonConfig.data) {
67726
+ this.applyGeoJSONData(geojsonConfig.data);
67727
+ return;
67728
+ }
67729
+ if (((_a2 = geojsonConfig.request) == null ? void 0 : _a2.url) || this.config.url) {
67730
+ await this.refresh();
67731
+ return;
67732
+ }
67733
+ source.clear();
67734
+ this.originalFeatures = [];
67735
+ }
67736
+ getVectorSource() {
67737
+ if (this.vectorSource) {
67738
+ return this.vectorSource;
67739
+ }
67740
+ if (!this.layer) {
67741
+ return null;
67742
+ }
67743
+ const source = this.layer.getSource();
67744
+ this.vectorSource = source || null;
67745
+ return this.vectorSource;
67746
+ }
67747
+ applyGeoJSONData(data) {
67748
+ const source = this.getVectorSource();
67749
+ if (!source)
67750
+ return;
67751
+ const features2 = this.readFeaturesFromData(data);
67752
+ source.clear();
67753
+ source.addFeatures(features2);
67754
+ this.originalFeatures = [...features2];
67755
+ if (this.getEnabledFilters().length > 0) {
67756
+ this.applyFilters();
67757
+ }
67758
+ }
67759
+ readFeaturesFromData(data) {
67685
67760
  const format2 = new GeoJSON$2();
67686
- const mapProjection = ((_a2 = this.map) == null ? void 0 : _a2.getView().getProjection().getCode()) || "EPSG:4326";
67687
- const dataProjection = this.config.projection || "EPSG:4326";
67688
- if (this.config.data) {
67689
- const features2 = format2.readFeatures(this.config.data, {
67690
- dataProjection,
67691
- featureProjection: mapProjection
67692
- });
67693
- this.originalFeatures = features2;
67694
- return new VectorSource$1({ features: features2 });
67695
- } else if (this.config.url) {
67696
- const source = new VectorSource$1({
67697
- url: this.config.url,
67698
- format: new GeoJSON$2({
67699
- dataProjection,
67700
- featureProjection: mapProjection
67701
- })
67702
- });
67703
- source.on("featuresloadend", () => {
67704
- this.originalFeatures = source.getFeatures();
67761
+ return format2.readFeatures(this.normalizeGeoJSONData(data), {
67762
+ dataProjection: this.getDataProjection(),
67763
+ featureProjection: this.getMapProjection()
67764
+ });
67765
+ }
67766
+ normalizeGeoJSONData(data) {
67767
+ if (typeof data === "string") {
67768
+ const trimmed = data.trim();
67769
+ if (!trimmed) {
67770
+ return { type: "FeatureCollection", features: [] };
67771
+ }
67772
+ try {
67773
+ return this.normalizeGeoJSONData(JSON.parse(trimmed));
67774
+ } catch (error2) {
67775
+ throw new Error("GeoJSON 字符串解析失败");
67776
+ }
67777
+ }
67778
+ if (Array.isArray(data)) {
67779
+ return {
67780
+ type: "FeatureCollection",
67781
+ features: data
67782
+ };
67783
+ }
67784
+ if (!data || typeof data !== "object") {
67785
+ return {
67786
+ type: "FeatureCollection",
67787
+ features: []
67788
+ };
67789
+ }
67790
+ if (data.type === "FeatureCollection") {
67791
+ return data;
67792
+ }
67793
+ if (data.type === "Feature") {
67794
+ return {
67795
+ type: "FeatureCollection",
67796
+ features: [data]
67797
+ };
67798
+ }
67799
+ if (Array.isArray(data.features)) {
67800
+ return {
67801
+ type: "FeatureCollection",
67802
+ features: data.features
67803
+ };
67804
+ }
67805
+ return data;
67806
+ }
67807
+ getNestedValue(target, path2) {
67808
+ if (!path2) {
67809
+ return target;
67810
+ }
67811
+ const keys2 = path2.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean);
67812
+ return keys2.reduce(
67813
+ (current, key) => current !== null && current !== void 0 ? current[key] : void 0,
67814
+ target
67815
+ );
67816
+ }
67817
+ buildRequestContext(overrides) {
67818
+ const requestConfig = this.getGeoJSONConfig().request;
67819
+ return {
67820
+ config: this.config,
67821
+ params: {
67822
+ ...(requestConfig == null ? void 0 : requestConfig.params) || {},
67823
+ ...(overrides == null ? void 0 : overrides.params) || {}
67824
+ },
67825
+ body: (overrides == null ? void 0 : overrides.body) ?? (requestConfig == null ? void 0 : requestConfig.body),
67826
+ map: this.map || void 0
67827
+ };
67828
+ }
67829
+ buildExtentPayload(refreshConfig) {
67830
+ if (!(refreshConfig == null ? void 0 : refreshConfig.useExtent) || !this.map) {
67831
+ return {};
67832
+ }
67833
+ const size2 = this.map.getSize();
67834
+ if (!size2) {
67835
+ return {};
67836
+ }
67837
+ const view = this.map.getView();
67838
+ const sourceProjection = view.getProjection().getCode();
67839
+ const targetProjection = refreshConfig.extentProjection || this.getDataProjection();
67840
+ const rawExtent = view.calculateExtent(size2);
67841
+ const extent3 = sourceProjection === targetProjection ? rawExtent : transformExtent(rawExtent, sourceProjection, targetProjection);
67842
+ const extentValue = extent3.join(",");
67843
+ const extentParamName = refreshConfig.extentParamName || "bbox";
67844
+ if (refreshConfig.extentTarget === "body") {
67845
+ return {
67846
+ body: {
67847
+ [extentParamName]: extentValue
67848
+ }
67849
+ };
67850
+ }
67851
+ return {
67852
+ params: {
67853
+ [extentParamName]: extentValue
67854
+ }
67855
+ };
67856
+ }
67857
+ createRequestUrl(url, params, method) {
67858
+ const requestUrl = new URL(url, window.location.origin);
67859
+ Object.entries(params).forEach(([key, value]) => {
67860
+ if (value === void 0 || value === null || method !== "GET") {
67861
+ return;
67862
+ }
67863
+ if (Array.isArray(value)) {
67864
+ value.forEach(
67865
+ (item) => requestUrl.searchParams.append(key, String(item))
67866
+ );
67867
+ return;
67868
+ }
67869
+ requestUrl.searchParams.set(key, String(value));
67870
+ });
67871
+ return requestUrl.toString();
67872
+ }
67873
+ async refresh(overrides) {
67874
+ const geojsonConfig = this.getGeoJSONConfig();
67875
+ const requestConfig = geojsonConfig.request;
67876
+ if (!(requestConfig == null ? void 0 : requestConfig.url)) {
67877
+ if (geojsonConfig.data) {
67878
+ this.applyGeoJSONData(geojsonConfig.data);
67879
+ }
67880
+ return;
67881
+ }
67882
+ if (this.isRefreshing) {
67883
+ return;
67884
+ }
67885
+ this.isRefreshing = true;
67886
+ try {
67887
+ const refreshPayload = this.buildExtentPayload(geojsonConfig.refresh);
67888
+ const context = this.buildRequestContext({
67889
+ params: {
67890
+ ...refreshPayload.params || {},
67891
+ ...(overrides == null ? void 0 : overrides.params) || {}
67892
+ },
67893
+ body: typeof refreshPayload.body === "object" && !Array.isArray(refreshPayload.body) && typeof ((overrides == null ? void 0 : overrides.body) || requestConfig.body) === "object" && !Array.isArray((overrides == null ? void 0 : overrides.body) || requestConfig.body) ? {
67894
+ ...requestConfig.body,
67895
+ ...refreshPayload.body,
67896
+ ...overrides == null ? void 0 : overrides.body
67897
+ } : (overrides == null ? void 0 : overrides.body) ?? refreshPayload.body ?? requestConfig.body
67898
+ });
67899
+ let request = {
67900
+ url: requestConfig.url,
67901
+ method: requestConfig.method || "GET",
67902
+ headers: { ...requestConfig.headers || {} },
67903
+ params: { ...context.params },
67904
+ body: context.body
67905
+ };
67906
+ if (requestConfig.requestInterceptor) {
67907
+ const intercepted = await requestConfig.requestInterceptor(
67908
+ request,
67909
+ context
67910
+ );
67911
+ request = {
67912
+ ...request,
67913
+ ...intercepted || {},
67914
+ headers: {
67915
+ ...request.headers,
67916
+ ...(intercepted == null ? void 0 : intercepted.headers) || {}
67917
+ },
67918
+ params: {
67919
+ ...request.params,
67920
+ ...(intercepted == null ? void 0 : intercepted.params) || {}
67921
+ }
67922
+ };
67923
+ }
67924
+ const requestUrl = this.createRequestUrl(
67925
+ request.url,
67926
+ request.params,
67927
+ request.method
67928
+ );
67929
+ const response = await fetch(requestUrl, {
67930
+ method: request.method,
67931
+ headers: {
67932
+ "Content-Type": request.method === "GET" ? void 0 : "application/json;charset=UTF-8",
67933
+ ...request.headers
67934
+ },
67935
+ body: request.method === "GET" || request.body === void 0 ? void 0 : typeof request.body === "string" ? request.body : JSON.stringify(request.body)
67705
67936
  });
67706
- return source;
67707
- } else {
67708
- return new VectorSource$1();
67937
+ if (!response.ok) {
67938
+ throw new Error(`GeoJSON 请求失败: ${response.status}`);
67939
+ }
67940
+ let responseData;
67941
+ const contentType = response.headers.get("content-type") || "";
67942
+ if (contentType.includes("application/json")) {
67943
+ responseData = await response.json();
67944
+ } else {
67945
+ responseData = await response.text();
67946
+ }
67947
+ if (requestConfig.responseInterceptor) {
67948
+ responseData = await requestConfig.responseInterceptor(
67949
+ responseData,
67950
+ context
67951
+ );
67952
+ }
67953
+ if (requestConfig.responseParser) {
67954
+ responseData = await requestConfig.responseParser(
67955
+ responseData,
67956
+ context
67957
+ );
67958
+ } else {
67959
+ responseData = this.getNestedValue(
67960
+ responseData,
67961
+ requestConfig.dataPath || geojsonConfig.dataPath
67962
+ );
67963
+ }
67964
+ this.applyGeoJSONData(responseData);
67965
+ } catch (error2) {
67966
+ if (geojsonConfig.clearOnError) {
67967
+ const source = this.getVectorSource();
67968
+ source == null ? void 0 : source.clear();
67969
+ this.originalFeatures = [];
67970
+ }
67971
+ throw error2;
67972
+ } finally {
67973
+ this.isRefreshing = false;
67974
+ }
67975
+ }
67976
+ updateRequestParams(params) {
67977
+ var _a2;
67978
+ const currentGeoJSONConfig = this.getGeoJSONConfig();
67979
+ this.config.geojsonConfig = {
67980
+ ...currentGeoJSONConfig,
67981
+ request: {
67982
+ ...currentGeoJSONConfig.request || {},
67983
+ params: {
67984
+ ...((_a2 = currentGeoJSONConfig.request) == null ? void 0 : _a2.params) || {},
67985
+ ...params
67986
+ }
67987
+ }
67988
+ };
67989
+ void this.refresh();
67990
+ }
67991
+ scheduleRefresh() {
67992
+ const refreshConfig = this.getGeoJSONConfig().refresh;
67993
+ const debounce2 = (refreshConfig == null ? void 0 : refreshConfig.debounce) ?? 300;
67994
+ if (this.refreshDebounceTimer) {
67995
+ clearTimeout(this.refreshDebounceTimer);
67996
+ }
67997
+ this.refreshDebounceTimer = setTimeout(() => {
67998
+ void this.refresh();
67999
+ }, debounce2);
68000
+ }
68001
+ setupRefreshBehavior() {
68002
+ this.clearRefreshBehavior();
68003
+ const refreshConfig = this.getGeoJSONConfig().refresh;
68004
+ if (!refreshConfig) {
68005
+ return;
68006
+ }
68007
+ const enabled = refreshConfig.enabled ?? true;
68008
+ if (!enabled) {
68009
+ return;
67709
68010
  }
68011
+ if (refreshConfig.interval && refreshConfig.interval > 0) {
68012
+ this.refreshTimer = setInterval(() => {
68013
+ void this.refresh();
68014
+ }, refreshConfig.interval);
68015
+ }
68016
+ if (this.map && (refreshConfig.onMoveEnd || refreshConfig.onZoomEnd)) {
68017
+ this.lastKnownZoom = this.map.getView().getZoom();
68018
+ this.moveEndListener = () => {
68019
+ var _a2;
68020
+ const currentZoom = (_a2 = this.map) == null ? void 0 : _a2.getView().getZoom();
68021
+ const zoomChanged = currentZoom !== this.lastKnownZoom;
68022
+ this.lastKnownZoom = currentZoom;
68023
+ if (zoomChanged && refreshConfig.onZoomEnd) {
68024
+ this.scheduleRefresh();
68025
+ return;
68026
+ }
68027
+ if (!zoomChanged && refreshConfig.onMoveEnd) {
68028
+ this.scheduleRefresh();
68029
+ return;
68030
+ }
68031
+ if (refreshConfig.onMoveEnd && refreshConfig.onZoomEnd) {
68032
+ this.scheduleRefresh();
68033
+ }
68034
+ };
68035
+ this.map.on("moveend", this.moveEndListener);
68036
+ }
68037
+ }
68038
+ clearRefreshBehavior() {
68039
+ if (this.refreshTimer) {
68040
+ clearInterval(this.refreshTimer);
68041
+ this.refreshTimer = null;
68042
+ }
68043
+ if (this.refreshDebounceTimer) {
68044
+ clearTimeout(this.refreshDebounceTimer);
68045
+ this.refreshDebounceTimer = null;
68046
+ }
68047
+ if (this.map && this.moveEndListener) {
68048
+ this.map.un("moveend", this.moveEndListener);
68049
+ }
68050
+ this.moveEndListener = null;
67710
68051
  }
67711
68052
  /**
67712
68053
  * 创建样式函数
@@ -68110,7 +68451,6 @@ class GeoJSONLayerHandler extends BaseLayer2 {
68110
68451
  * 应用过滤器(实现基类的抽象方法)
68111
68452
  */
68112
68453
  applyFilters() {
68113
- debugger;
68114
68454
  const layer2 = this.getLayer();
68115
68455
  const source = layer2.getSource();
68116
68456
  if (!source)
@@ -68366,6 +68706,29 @@ class GeoJSONLayerHandler extends BaseLayer2 {
68366
68706
  clearAllFeatureFilters() {
68367
68707
  this.clearAllFilters();
68368
68708
  }
68709
+ updateConfig(newConfig) {
68710
+ super.updateConfig(newConfig);
68711
+ if (this.layer) {
68712
+ this.layer.setStyle(
68713
+ this.createStyleFunction()
68714
+ );
68715
+ }
68716
+ this.setupRefreshBehavior();
68717
+ if (newConfig.url !== void 0 || newConfig.data !== void 0 || newConfig.method !== void 0 || newConfig.headers !== void 0 || newConfig.params !== void 0 || newConfig.body !== void 0 || newConfig.dataPath !== void 0 || newConfig.geojsonConfig !== void 0 || newConfig.config !== void 0 || newConfig.projection !== void 0) {
68718
+ void this.initializeSource();
68719
+ }
68720
+ }
68721
+ setMap(map2) {
68722
+ super.setMap(map2);
68723
+ if (this.layer) {
68724
+ this.setupRefreshBehavior();
68725
+ }
68726
+ }
68727
+ destroy() {
68728
+ this.clearRefreshBehavior();
68729
+ this.vectorSource = null;
68730
+ super.destroy();
68731
+ }
68369
68732
  }
68370
68733
  class KMLLayerHandler extends BaseLayer2 {
68371
68734
  constructor(config, map2) {
@@ -333369,6 +333732,72 @@ class LayerManager {
333369
333732
  getLayerHandler(layerId) {
333370
333733
  return this.layerHandlers.get(layerId);
333371
333734
  }
333735
+ async refreshLayer(layerId, options) {
333736
+ try {
333737
+ const config = this.getLayerConfig(layerId);
333738
+ if (!config) {
333739
+ return false;
333740
+ }
333741
+ if (!this.layerHandlers.has(layerId) && config.visible) {
333742
+ const loaded = await this.loadLayerOnDemand(layerId);
333743
+ if (!loaded) {
333744
+ return false;
333745
+ }
333746
+ }
333747
+ const handler = this.layerHandlers.get(layerId);
333748
+ if (!(handler == null ? void 0 : handler.refresh)) {
333749
+ return false;
333750
+ }
333751
+ await handler.refresh(options);
333752
+ return true;
333753
+ } catch (error2) {
333754
+ console.error("刷新图层失败:", error2);
333755
+ return false;
333756
+ }
333757
+ }
333758
+ updateLayerRequestParams(layerId, params) {
333759
+ var _a2, _b2, _c2, _d, _e2, _f, _g;
333760
+ try {
333761
+ const config = this.getLayerConfig(layerId);
333762
+ if (!config) {
333763
+ return false;
333764
+ }
333765
+ const nextConfig = {
333766
+ ...config,
333767
+ params: {
333768
+ ...config.params || {},
333769
+ ...params
333770
+ },
333771
+ geojsonConfig: {
333772
+ ...config.geojsonConfig || ((_a2 = config.config) == null ? void 0 : _a2.geojson) || {},
333773
+ request: {
333774
+ ...((_c2 = config.geojsonConfig || ((_b2 = config.config) == null ? void 0 : _b2.geojson)) == null ? void 0 : _c2.request) || {},
333775
+ params: {
333776
+ ...((_f = (_e2 = config.geojsonConfig || ((_d = config.config) == null ? void 0 : _d.geojson)) == null ? void 0 : _e2.request) == null ? void 0 : _f.params) || {},
333777
+ ...params
333778
+ }
333779
+ }
333780
+ }
333781
+ };
333782
+ if (this.layerConfigs.has(layerId)) {
333783
+ this.layerConfigs.set(layerId, nextConfig);
333784
+ }
333785
+ if (this.pendingLayerConfigs.has(layerId)) {
333786
+ this.pendingLayerConfigs.set(layerId, nextConfig);
333787
+ }
333788
+ const handler = this.layerHandlers.get(layerId);
333789
+ (_g = handler == null ? void 0 : handler.updateRequestParams) == null ? void 0 : _g.call(handler, params);
333790
+ this.saveLayerConfigs();
333791
+ this.eventBus.emit("layer-config-updated", {
333792
+ layerId,
333793
+ config: nextConfig
333794
+ });
333795
+ return true;
333796
+ } catch (error2) {
333797
+ console.error("更新图层请求参数失败:", error2);
333798
+ return false;
333799
+ }
333800
+ }
333372
333801
  /**
333373
333802
  * 设置底图图层ID列表(用于底图互斥判断)
333374
333803
  */
@@ -333692,12 +334121,19 @@ class LayerManager {
333692
334121
  updateLayerConfig(layerId, newConfig) {
333693
334122
  try {
333694
334123
  const handler = this.layerHandlers.get(layerId);
333695
- const config = this.layerConfigs.get(layerId);
333696
- if (handler && config) {
334124
+ const config = this.layerConfigs.get(layerId) || this.pendingLayerConfigs.get(layerId);
334125
+ if (config) {
333697
334126
  const updatedConfig = { ...config, ...newConfig };
333698
- this.layerConfigs.set(layerId, updatedConfig);
333699
- handler.updateConfig(newConfig);
333700
- if (newConfig.style || newConfig.customCss !== void 0) {
334127
+ if (this.layerConfigs.has(layerId)) {
334128
+ this.layerConfigs.set(layerId, updatedConfig);
334129
+ }
334130
+ if (this.pendingLayerConfigs.has(layerId)) {
334131
+ this.pendingLayerConfigs.set(layerId, updatedConfig);
334132
+ }
334133
+ if (handler) {
334134
+ handler.updateConfig(newConfig);
334135
+ }
334136
+ if (handler && (newConfig.style || newConfig.customCss !== void 0)) {
333701
334137
  if ("updateLayerStyles" in handler) {
333702
334138
  handler.updateLayerStyles(
333703
334139
  updatedConfig.style,
@@ -336901,6 +337337,10 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
336901
337337
  var _a2;
336902
337338
  return (_a2 = mapManager.value) == null ? void 0 : _a2.getEventManager();
336903
337339
  },
337340
+ clearAll: () => {
337341
+ var _a2;
337342
+ (_a2 = mapManager.value) == null ? void 0 : _a2.clearAll();
337343
+ },
336904
337344
  updateMapConfig,
336905
337345
  startCoordinatePick,
336906
337346
  stopCoordinatePick,
@@ -336930,19 +337370,19 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
336930
337370
  }
336931
337371
  });
336932
337372
  const defaultComponents = {
336933
- measurement: () => import("./MeasurementDialog-7c08ba58.mjs"),
336934
- basemap: () => import("./BasemapPanel-a8d7373d.mjs"),
336935
- print: () => import("./MapPrintDialog-97054260.mjs"),
336936
- "layer-panel": () => import("./LayerPanel-c716b7cc.mjs"),
336937
- coordinate: () => import("./CoordinateLocationDialog-274aff1a.mjs"),
336938
- "region-navigation": () => import("./RegionNavigationDialog-4b7b4e5f.mjs"),
336939
- "my-markers": () => import("./MyMarkersDialog-89bd594e.mjs"),
336940
- "view-bookmarks": () => import("./ViewBookmarksDialog-7ee33d4e.mjs"),
336941
- "map-drawing": () => import("./index-3699244d.mjs"),
336942
- "filter-panel": () => import("./FilterPanel-ccdaaac3.mjs"),
336943
- "swipe-compare": () => import("./SwipeCompareDialog-2b89b65e.mjs"),
336944
- "split-compare": () => import("./SplitCompareDialog-b51b55c1.mjs"),
336945
- "quad-compare": () => import("./QuadCompareDialog-78dd2cf6.mjs")
337373
+ measurement: () => import("./MeasurementDialog-44599074.mjs"),
337374
+ basemap: () => import("./BasemapPanel-d022a31a.mjs"),
337375
+ print: () => import("./MapPrintDialog-c65f685b.mjs"),
337376
+ "layer-panel": () => import("./LayerPanel-1a0456a4.mjs"),
337377
+ coordinate: () => import("./CoordinateLocationDialog-6cdf239b.mjs"),
337378
+ "region-navigation": () => import("./RegionNavigationDialog-b1cdc5f9.mjs"),
337379
+ "my-markers": () => import("./MyMarkersDialog-dd288574.mjs"),
337380
+ "view-bookmarks": () => import("./ViewBookmarksDialog-2a6bc942.mjs"),
337381
+ "map-drawing": () => import("./index-199c60c9.mjs"),
337382
+ "filter-panel": () => import("./FilterPanel-de00b336.mjs"),
337383
+ "swipe-compare": () => import("./SwipeCompareDialog-dfae0afd.mjs"),
337384
+ "split-compare": () => import("./SplitCompareDialog-6dd0fb71.mjs"),
337385
+ "quad-compare": () => import("./QuadCompareDialog-2cd17881.mjs")
336946
337386
  };
336947
337387
  const _DialogRegistry = class _DialogRegistry {
336948
337388
  constructor() {
@@ -351970,7 +352410,7 @@ function(t3) {
351970
352410
  */
351971
352411
  function(t3) {
351972
352412
  function e8() {
351973
- return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-e3be4489.mjs")).catch(function(t4) {
352413
+ return (n.canvg ? Promise.resolve(n.canvg) : import("./index.es-560c236e.mjs")).catch(function(t4) {
351974
352414
  return Promise.reject(new Error("Could not load canvg: " + t4));
351975
352415
  }).then(function(t4) {
351976
352416
  return t4.default ? t4.default : t4;
@@ -366026,6 +366466,22 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
366026
366466
  }
366027
366467
  return false;
366028
366468
  },
366469
+ refreshLayer: (layerId, options) => {
366470
+ var _a2;
366471
+ const layerManager = (_a2 = mapContainerRef.value) == null ? void 0 : _a2.getLayerManager();
366472
+ if (layerManager) {
366473
+ return layerManager.refreshLayer(layerId, options);
366474
+ }
366475
+ return false;
366476
+ },
366477
+ updateLayerRequestParams: (layerId, params) => {
366478
+ var _a2;
366479
+ const layerManager = (_a2 = mapContainerRef.value) == null ? void 0 : _a2.getLayerManager();
366480
+ if (layerManager) {
366481
+ return layerManager.updateLayerRequestParams(layerId, params);
366482
+ }
366483
+ return false;
366484
+ },
366029
366485
  getAllLayerConfigs: () => {
366030
366486
  var _a2;
366031
366487
  const layerManager = (_a2 = mapContainerRef.value) == null ? void 0 : _a2.getLayerManager();
@@ -366328,7 +366784,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
366328
366784
  };
366329
366785
  }
366330
366786
  });
366331
- const OlMap = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-d71e468f"]]);
366787
+ const OlMap = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-888f37cb"]]);
366332
366788
  const Property = {
366333
366789
  ACCURACY: "accuracy",
366334
366790
  ACCURACY_GEOMETRY: "accuracyGeometry",
@@ -1,4 +1,4 @@
1
- import { c as commonjsGlobal, g as getDefaultExportFromCjs, _ as _asyncToGenerator, a as _defineProperty } from "./index-98c677b7.mjs";
1
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs, _ as _asyncToGenerator, a as _defineProperty } from "./index-e868c4e2.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-98c677b7.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-e868c4e2.mjs";
2
2
  import "vue";
3
3
  import "@element-plus/icons-vue";
4
4
  import "ol";