my-openlayer 0.1.10 → 0.1.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 +4 -4
- package/dist/core/Point.js +3 -3
- package/dist/core/Polygon.js +5 -5
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/core/Line.js
CHANGED
|
@@ -11,8 +11,8 @@ export default class Line {
|
|
|
11
11
|
}
|
|
12
12
|
addLine(data, options) {
|
|
13
13
|
const layer = new VectorLayer({
|
|
14
|
-
name: options.
|
|
15
|
-
layerName: options.
|
|
14
|
+
name: options.layerName,
|
|
15
|
+
layerName: options.layerName,
|
|
16
16
|
source: new VectorSource({
|
|
17
17
|
features: (new GeoJSON()).readFeatures(data)
|
|
18
18
|
}),
|
|
@@ -57,8 +57,8 @@ export default class Line {
|
|
|
57
57
|
layerName: 'river',
|
|
58
58
|
source: vectorSource,
|
|
59
59
|
style: function (feature) {
|
|
60
|
-
feature.set('type', options.
|
|
61
|
-
feature.set('layerName', options.
|
|
60
|
+
feature.set('type', options.layerName);
|
|
61
|
+
feature.set('layerName', options.layerName);
|
|
62
62
|
return new Style({
|
|
63
63
|
stroke: new Stroke({
|
|
64
64
|
color: options.strokeColor || 'rgb(0,113,255)',
|
package/dist/core/Point.js
CHANGED
|
@@ -32,7 +32,7 @@ export default class Point {
|
|
|
32
32
|
// clickLocation: options.clickLocation,
|
|
33
33
|
// all: JSON.stringify(item),
|
|
34
34
|
rawData: item, //保存原始数据
|
|
35
|
-
type: options.
|
|
35
|
+
type: options.layerName,
|
|
36
36
|
geometry: new olPoint([item.lgtd, item.lttd])
|
|
37
37
|
});
|
|
38
38
|
const style = {};
|
|
@@ -64,7 +64,7 @@ export default class Point {
|
|
|
64
64
|
pointFeatureList.push(pointFeature);
|
|
65
65
|
});
|
|
66
66
|
const PointVectorLayer = new VectorLayer({
|
|
67
|
-
layerName: options.
|
|
67
|
+
layerName: options.layerName,
|
|
68
68
|
source: new VectorSource({
|
|
69
69
|
features: pointFeatureList
|
|
70
70
|
}),
|
|
@@ -91,7 +91,7 @@ export default class Point {
|
|
|
91
91
|
source: source,
|
|
92
92
|
});
|
|
93
93
|
const clusterLayer = new VectorLayer({
|
|
94
|
-
layerName: options.
|
|
94
|
+
layerName: options.layerName,
|
|
95
95
|
source: clusterSource,
|
|
96
96
|
style: function (feature) {
|
|
97
97
|
const name = feature.get('features')[0].get(options.nameKey);
|
package/dist/core/Polygon.js
CHANGED
|
@@ -33,7 +33,7 @@ export default class Polygon {
|
|
|
33
33
|
*/
|
|
34
34
|
addBorderPolygon(data, options) {
|
|
35
35
|
options = options ?? {};
|
|
36
|
-
options.
|
|
36
|
+
options.layerName = options.layerName ?? 'border';
|
|
37
37
|
options.fillColor = options.fillColor ?? 'rgba(255, 255, 255, 0)';
|
|
38
38
|
this.addPolygon(data, options);
|
|
39
39
|
if (options.mask)
|
|
@@ -43,12 +43,12 @@ export default class Polygon {
|
|
|
43
43
|
//fyBasinJson中的id的key需要跟options中的nameKey一致
|
|
44
44
|
addPolygon(dataJSON, options) {
|
|
45
45
|
options = options ?? {};
|
|
46
|
-
if (options.
|
|
47
|
-
MapTools.removeLayer(this.map, options.
|
|
46
|
+
if (options.layerName != null) {
|
|
47
|
+
MapTools.removeLayer(this.map, options.layerName);
|
|
48
48
|
}
|
|
49
49
|
const layer = new VectorLayer({
|
|
50
|
-
name: options.
|
|
51
|
-
layerName: options.
|
|
50
|
+
name: options.layerName,
|
|
51
|
+
layerName: options.layerName,
|
|
52
52
|
source: new VectorSource({
|
|
53
53
|
features: (new GeoJSON()).readFeatures(dataJSON, options.projectionOptOptions ?? {})
|
|
54
54
|
}),
|
package/dist/types.d.ts
CHANGED