my-openlayer 0.0.9 → 0.0.11

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
@@ -17,13 +17,16 @@ export default class Line {
17
17
  features: (new GeoJSON()).readFeatures(data)
18
18
  }),
19
19
  style: function (feature) {
20
+ feature.set('type', options.type);
21
+ feature.set('layerName', options.type);
20
22
  return new Style({
21
23
  stroke: new Stroke({
22
24
  color: options.strokeColor || 'rgba(3, 122, 255, 1)',
23
25
  width: options.strokeWidth || 3
24
26
  }),
25
27
  });
26
- }
28
+ },
29
+ zIndex: options.zIndex ?? 3
27
30
  });
28
31
  this[options.type + 'Layer'] = layer;
29
32
  this.map.addLayer(layer);
@@ -50,7 +53,9 @@ export default class Line {
50
53
  name: 'river',
51
54
  layerName: 'river',
52
55
  source: vectorSource,
53
- style: function () {
56
+ style: function (feature) {
57
+ feature.set('type', options.type);
58
+ feature.set('layerName', options.type);
54
59
  return new Style({
55
60
  stroke: new Stroke({
56
61
  color: options.strokeColor || 'rgb(0,113,255)',
@@ -58,7 +63,7 @@ export default class Line {
58
63
  })
59
64
  });
60
65
  },
61
- zIndex: 6,
66
+ zIndex: options.zIndex ?? 6
62
67
  });
63
68
  riverLayer.setVisible(false);
64
69
  this.riverLayerList.push(riverLayer);
@@ -41,7 +41,8 @@ export default class Polygon {
41
41
  features: (new GeoJSON()).readFeatures(data)
42
42
  }),
43
43
  style: function (feature) {
44
- feature.set('layerName', type);
44
+ feature.set('type', options.type);
45
+ feature.set('layerName', options.type);
45
46
  return new Style({
46
47
  stroke: new Stroke({
47
48
  color: options.strokeColor || '#EBEEF5',
@@ -79,6 +80,7 @@ export default class Polygon {
79
80
  features: (new GeoJSON()).readFeatures(dataJSON, options.projectionOptOptions ?? {})
80
81
  }),
81
82
  style: function (feature) {
83
+ feature.set('type', options.type);
82
84
  feature.set('layerName', options.type);
83
85
  return new Style({
84
86
  stroke: new Stroke({
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "my-openlayer",
3
3
  "private": false,
4
- "version": "0.0.9",
4
+ "version": "0.0.11",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",