ym-giswidget-2d 1.0.60 → 1.0.61

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.
@@ -1,8 +1,11 @@
1
1
  import { IMapService } from 'ym-gis-2d/entity';
2
2
  import { default as OLMap } from 'ym-gis-2d/mapView/Map';
3
+ interface ILayerSwitcher extends IMapService {
4
+ isRepels?: boolean;
5
+ }
3
6
  type __VLS_Props = {
4
7
  map: OLMap;
5
- layers: IMapService[];
8
+ layers: ILayerSwitcher[];
6
9
  };
7
10
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
8
11
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import _sfc_main from "./LayerSwitcher.vue2.js";
2
2
  /* empty css */
3
3
  import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const _LayerSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-2222fecf"]]);
4
+ const _LayerSwitcher = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-d9bf6ad4"]]);
5
5
  export {
6
6
  _LayerSwitcher as default
7
7
  };
@@ -13,21 +13,25 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
13
13
  activeIds: []
14
14
  //用户存储当前激活的图层id
15
15
  });
16
- onMounted(() => {
16
+ onMounted(async () => {
17
17
  for (const layer of props.layers) {
18
18
  if (layer.checked) {
19
- reactiveValues.activeIds.push(layer.id);
20
- props.map.addMapLayer(layer);
19
+ await addLayer(layer);
21
20
  }
22
21
  }
23
22
  });
24
- function addLayer(layer) {
23
+ async function addLayer(layer) {
25
24
  if (reactiveValues.activeIds.indexOf(layer.id) > -1) {
26
25
  reactiveValues.activeIds.splice(reactiveValues.activeIds.indexOf(layer.id), 1);
27
26
  props.map.removeLayerById(layer.id);
28
27
  } else {
28
+ const ids = props.layers.filter((t) => t.isRepels).map((t) => t.id);
29
+ if (layer.isRepels && ids && ids.length > 0) {
30
+ props.map.removeLayerByIds(ids);
31
+ reactiveValues.activeIds = reactiveValues.activeIds.filter((t) => ids.indexOf(t) === -1);
32
+ }
29
33
  reactiveValues.activeIds.push(layer.id);
30
- props.map.addMapLayer(layer);
34
+ await props.map.addMapLayer(layer);
31
35
  }
32
36
  }
33
37
  return (_ctx, _cache) => {
@@ -1,5 +1,5 @@
1
1
  @charset "UTF-8";
2
- .layerSwitcher[data-v-2222fecf] {
2
+ .layerSwitcher[data-v-d9bf6ad4] {
3
3
  width: 106px;
4
4
  height: 70px;
5
5
  position: absolute;
@@ -16,22 +16,22 @@
16
16
  -o-transition: width 0.8s, height 0.8s, -o-transform 0.8s;
17
17
  /* Opera */
18
18
  }
19
- .layerSwitcher[data-v-2222fecf]:hover {
19
+ .layerSwitcher[data-v-d9bf6ad4]:hover {
20
20
  width: unset;
21
21
  padding-right: 5px;
22
22
  background: rgba(255, 255, 255, 0.3);
23
23
  display: flex;
24
24
  align-items: center;
25
25
  }
26
- .layerSwitcher:hover .layer[data-v-2222fecf] {
26
+ .layerSwitcher:hover .layer[data-v-d9bf6ad4] {
27
27
  margin-left: 5px;
28
28
  position: unset;
29
29
  }
30
- .layerSwitcher:hover span[data-v-2222fecf] {
30
+ .layerSwitcher:hover span[data-v-d9bf6ad4] {
31
31
  position: unset !important;
32
32
  margin-top: 42px;
33
33
  }
34
- .layerSwitcher .mapTypeCard[data-v-2222fecf] {
34
+ .layerSwitcher .mapTypeCard[data-v-d9bf6ad4] {
35
35
  position: absolute;
36
36
  top: 5px;
37
37
  width: 86px;
@@ -53,7 +53,7 @@
53
53
  -o-transition: right 0.8s;
54
54
  /* Opera */
55
55
  }
56
- .layerSwitcher .mapTypeCard span[data-v-2222fecf] {
56
+ .layerSwitcher .mapTypeCard span[data-v-d9bf6ad4] {
57
57
  width: 84px;
58
58
  border-radius: 2px;
59
59
  height: 16px;
@@ -67,15 +67,15 @@
67
67
  background: #888f88;
68
68
  opacity: 0.8;
69
69
  }
70
- .layerSwitcher .layer[data-v-2222fecf] {
70
+ .layerSwitcher .layer[data-v-d9bf6ad4] {
71
71
  background-position: center;
72
72
  background-repeat: no-repeat;
73
73
  background-size: cover;
74
74
  }
75
- .layerSwitcher .layer[data-v-2222fecf]:hover {
75
+ .layerSwitcher .layer[data-v-d9bf6ad4]:hover {
76
76
  border: solid 1px #31a5f7;
77
77
  }
78
- .layerSwitcher .layer:hover span[data-v-2222fecf],
79
- .layerSwitcher .active span[data-v-2222fecf] {
78
+ .layerSwitcher .layer:hover span[data-v-d9bf6ad4],
79
+ .layerSwitcher .active span[data-v-d9bf6ad4] {
80
80
  background: #31a5f7;
81
81
  }
@@ -400,6 +400,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
400
400
  addMapLayers: (layerInfo: import('ym-gis-2d/entity').IMapService[]) => Promise<import('ol/layer/Base').default[]>;
401
401
  addLayer: (layer: import('ol/layer/Base').default, fitLayer?: boolean) => void;
402
402
  removeLayerById: (id: string) => void;
403
+ removeLayerByIds: (ids: string[]) => void;
403
404
  getLayerById: (id: string) => import('ol/layer/Base').default | undefined;
404
405
  getLayerByLayerTag: (layerTag: string) => import('ol/layer/Base').default | undefined;
405
406
  getLayersByIds: (ids: string[]) => import('ol/layer/Base').default[];
@@ -395,6 +395,7 @@ export declare const MapView: import('../../utils').WithInstall<import('vue').De
395
395
  addMapLayers: (layerInfo: import('ym-gis-2d/entity').IMapService[]) => Promise<import('ol/layer/Base').default[]>;
396
396
  addLayer: (layer: import('ol/layer/Base').default, fitLayer?: boolean) => void;
397
397
  removeLayerById: (id: string) => void;
398
+ removeLayerByIds: (ids: string[]) => void;
398
399
  getLayerById: (id: string) => import('ol/layer/Base').default | undefined;
399
400
  getLayerByLayerTag: (layerTag: string) => import('ol/layer/Base').default | undefined;
400
401
  getLayersByIds: (ids: string[]) => import('ol/layer/Base').default[];
@@ -402,6 +402,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
402
402
  addMapLayers: (layerInfo: IMapService[]) => Promise<import('ol/layer/Base').default[]>;
403
403
  addLayer: (layer: import('ol/layer/Base').default, fitLayer?: boolean) => void;
404
404
  removeLayerById: (id: string) => void;
405
+ removeLayerByIds: (ids: string[]) => void;
405
406
  getLayerById: (id: string) => import('ol/layer/Base').default | undefined;
406
407
  getLayerByLayerTag: (layerTag: string) => import('ol/layer/Base').default | undefined;
407
408
  getLayersByIds: (ids: string[]) => import('ol/layer/Base').default[];
@@ -398,6 +398,7 @@ export declare const MultiScreen: import('../../utils').WithInstall<import('vue'
398
398
  addMapLayers: (layerInfo: import('ym-gis-2d/entity').IMapService[]) => Promise<import('ol/layer/Base').default[]>;
399
399
  addLayer: (layer: import('ol/layer/Base').default, fitLayer?: boolean) => void;
400
400
  removeLayerById: (id: string) => void;
401
+ removeLayerByIds: (ids: string[]) => void;
401
402
  getLayerById: (id: string) => import('ol/layer/Base').default | undefined;
402
403
  getLayerByLayerTag: (layerTag: string) => import('ol/layer/Base').default | undefined;
403
404
  getLayersByIds: (ids: string[]) => import('ol/layer/Base').default[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ym-giswidget-2d",
3
- "version": "1.0.60",
3
+ "version": "1.0.61",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -10,6 +10,6 @@
10
10
  "element-plus": "^2.9.0",
11
11
  "jszip": "^3.10.1",
12
12
  "ol": "^9.2.4",
13
- "ym-gis-2d": "1.0.38"
13
+ "ym-gis-2d": "1.0.40"
14
14
  }
15
15
  }
@@ -1,8 +0,0 @@
1
- export declare const LayerSwitcher: import('../../utils').WithInstall<import('vue').DefineComponent<{
2
- map: import('ym-gis-2d/mapView/Map').default;
3
- layers: import('ym-gis-2d/entity').IMapService[];
4
- }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
5
- map: import('ym-gis-2d/mapView/Map').default;
6
- layers: import('ym-gis-2d/entity').IMapService[];
7
- }> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>>;
8
- export default LayerSwitcher;