my-openlayer 0.0.17 → 0.0.18

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.
package/dist/core/Line.js CHANGED
@@ -34,7 +34,7 @@ export default class Line {
34
34
  }
35
35
  // 添加水系并按照zoom显示不同级别
36
36
  addRiverLayersByZoom(fyRiverJson, options = { type: 'river' }) {
37
- this.riverLayerShow = !!options.show;
37
+ this.riverLayerShow = !!options.visible;
38
38
  this.riverLayerList = [];
39
39
  for (let i = 1; i <= 5; i++) {
40
40
  const vectorSource = new VectorSource({
@@ -70,7 +70,7 @@ export default class Point {
70
70
  }),
71
71
  zIndex: options.zIndex || 4,
72
72
  });
73
- PointVectorLayer.setVisible(options.show === undefined ? true : options.show);
73
+ PointVectorLayer.setVisible(options.visible === undefined ? true : options.visible);
74
74
  this.map.addLayer(PointVectorLayer);
75
75
  return PointVectorLayer;
76
76
  }
@@ -115,7 +115,7 @@ export default class Point {
115
115
  },
116
116
  zIndex: options.zIndex || 4,
117
117
  });
118
- clusterLayer.setVisible(options.show === undefined ? true : options.show);
118
+ clusterLayer.setVisible(options.visible === undefined ? true : options.visible);
119
119
  this.map.addLayer(clusterLayer);
120
120
  }
121
121
  /**
@@ -61,7 +61,7 @@ export default class Polygon {
61
61
  },
62
62
  zIndex: options.zIndex ?? 2
63
63
  });
64
- borderLayer.setVisible(options.show === undefined ? true : options.show);
64
+ borderLayer.setVisible(options.visible === undefined ? true : options.visible);
65
65
  this.map.addLayer(borderLayer);
66
66
  if (options.mask)
67
67
  this.setOutLayer(data);
@@ -102,7 +102,7 @@ export default class Polygon {
102
102
  },
103
103
  zIndex: options.zIndex ?? 2
104
104
  });
105
- layer.setVisible(options.show === undefined ? true : options.show);
105
+ layer.setVisible(options.visible === undefined ? true : options.visible);
106
106
  this.map.addLayer(layer);
107
107
  if (options.fitView) {
108
108
  // 获取面的范围
@@ -140,7 +140,7 @@ export default class Polygon {
140
140
  }),
141
141
  fill: new Fill({ color: newColor }),
142
142
  text: new Text({
143
- text: options.showText === false ? "" : name,
143
+ text: options.textVisible === false ? "" : name,
144
144
  font: options.textFont ?? '14px Calibri,sans-serif',
145
145
  fill: new Fill({ color: options.textFillColor || '#FFF' }),
146
146
  stroke: new Stroke({
@@ -267,8 +267,8 @@ export default class Polygon {
267
267
  imageLayer.setSource(source);
268
268
  imageLayer.setZIndex(options.zIndex ?? 3);
269
269
  imageLayer.setOpacity(options.opacity ?? 1);
270
- if (options.show !== undefined)
271
- imageLayer.setVisible(options.show);
270
+ if (options.visible !== undefined)
271
+ imageLayer.setVisible(options.visible);
272
272
  if (options.mapClip && options.mapClipData) {
273
273
  imageLayer = MapTools.setMapClip(imageLayer, options.mapClipData);
274
274
  }
package/dist/types.d.ts CHANGED
@@ -30,14 +30,14 @@ export interface OptionsType {
30
30
  scale?: number;
31
31
  hasImg?: boolean;
32
32
  zIndex?: number;
33
- show?: boolean;
33
+ visible?: boolean;
34
34
  projectionOptOptions?: any;
35
35
  strokeColor?: string | number[];
36
36
  strokeWidth?: number;
37
37
  lineDash?: number[];
38
38
  lineDashOffset?: number;
39
39
  fillColor?: string;
40
- showText?: boolean;
40
+ textVisible?: boolean;
41
41
  textFont?: string;
42
42
  textFillColor?: string;
43
43
  textStrokeColor?: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "my-openlayer",
3
3
  "private": false,
4
- "version": "0.0.17",
4
+ "version": "0.0.18",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",