openlayers-style-editor 0.1.7 → 0.1.8
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/index.cjs +18 -15
- package/dist/index.js +18 -15
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -46,10 +46,11 @@
|
|
|
46
46
|
return GraduatedModes2;
|
|
47
47
|
})(GraduatedModes || {});
|
|
48
48
|
function getCategorizedStyle(attribute, colors, outlineColor, outlineWidth, defaultColor) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
let outlineColorCopy = outlineColor ? [...outlineColor] : void 0;
|
|
50
|
+
if (outlineWidth == 0 && outlineColorCopy != void 0)
|
|
51
|
+
outlineColorCopy[3] = 0;
|
|
52
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColorCopy)
|
|
53
|
+
outlineColorCopy[3] = 1;
|
|
53
54
|
let aux = [];
|
|
54
55
|
aux.push("match");
|
|
55
56
|
aux.push(["get", attribute]);
|
|
@@ -63,23 +64,24 @@
|
|
|
63
64
|
"case",
|
|
64
65
|
["==", ["var", "highlightedId"], ["id"]],
|
|
65
66
|
"white",
|
|
66
|
-
|
|
67
|
+
outlineColorCopy || "#000000"
|
|
67
68
|
],
|
|
68
69
|
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
69
70
|
"fill-color": aux
|
|
70
71
|
};
|
|
71
72
|
}
|
|
72
73
|
function singleColorStyle(color, outlineColor, outlineWidth) {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
let outlineColorCopy = outlineColor ? [...outlineColor] : void 0;
|
|
75
|
+
if (outlineWidth == 0 && outlineColorCopy != void 0)
|
|
76
|
+
outlineColorCopy[3] = 0;
|
|
77
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColorCopy)
|
|
78
|
+
outlineColorCopy[3] = 1;
|
|
77
79
|
return {
|
|
78
80
|
"stroke-color": [
|
|
79
81
|
"case",
|
|
80
82
|
["==", ["var", "highlightedId"], ["id"]],
|
|
81
83
|
"white",
|
|
82
|
-
|
|
84
|
+
outlineColorCopy || "#000000"
|
|
83
85
|
],
|
|
84
86
|
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
85
87
|
"stroke-offset": 0,
|
|
@@ -94,10 +96,11 @@
|
|
|
94
96
|
};
|
|
95
97
|
}
|
|
96
98
|
function getGraduatedStyle(attribute, ramp, outlineColor, outlineWidth) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
let outlineColorCopy = outlineColor ? [...outlineColor] : void 0;
|
|
100
|
+
if (outlineWidth == 0 && outlineColorCopy != void 0)
|
|
101
|
+
outlineColorCopy[3] = 0;
|
|
102
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColorCopy)
|
|
103
|
+
outlineColorCopy[3] = 1;
|
|
101
104
|
let aux = [];
|
|
102
105
|
aux.push("interpolate");
|
|
103
106
|
aux.push(["linear"]);
|
|
@@ -111,7 +114,7 @@
|
|
|
111
114
|
"case",
|
|
112
115
|
["==", ["var", "highlightedId"], ["id"]],
|
|
113
116
|
"white",
|
|
114
|
-
|
|
117
|
+
outlineColorCopy || "#000000"
|
|
115
118
|
],
|
|
116
119
|
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
117
120
|
"fill-color": aux
|
package/dist/index.js
CHANGED
|
@@ -60,10 +60,11 @@ var GraduatedModes = /* @__PURE__ */ ((GraduatedModes2) => {
|
|
|
60
60
|
return GraduatedModes2;
|
|
61
61
|
})(GraduatedModes || {});
|
|
62
62
|
function getCategorizedStyle(attribute, colors, outlineColor, outlineWidth, defaultColor) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
let outlineColorCopy = outlineColor ? [...outlineColor] : void 0;
|
|
64
|
+
if (outlineWidth == 0 && outlineColorCopy != void 0)
|
|
65
|
+
outlineColorCopy[3] = 0;
|
|
66
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColorCopy)
|
|
67
|
+
outlineColorCopy[3] = 1;
|
|
67
68
|
let aux = [];
|
|
68
69
|
aux.push("match");
|
|
69
70
|
aux.push(["get", attribute]);
|
|
@@ -77,23 +78,24 @@ function getCategorizedStyle(attribute, colors, outlineColor, outlineWidth, defa
|
|
|
77
78
|
"case",
|
|
78
79
|
["==", ["var", "highlightedId"], ["id"]],
|
|
79
80
|
"white",
|
|
80
|
-
|
|
81
|
+
outlineColorCopy || "#000000"
|
|
81
82
|
],
|
|
82
83
|
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
83
84
|
"fill-color": aux
|
|
84
85
|
};
|
|
85
86
|
}
|
|
86
87
|
function singleColorStyle(color, outlineColor, outlineWidth) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
let outlineColorCopy = outlineColor ? [...outlineColor] : void 0;
|
|
89
|
+
if (outlineWidth == 0 && outlineColorCopy != void 0)
|
|
90
|
+
outlineColorCopy[3] = 0;
|
|
91
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColorCopy)
|
|
92
|
+
outlineColorCopy[3] = 1;
|
|
91
93
|
return {
|
|
92
94
|
"stroke-color": [
|
|
93
95
|
"case",
|
|
94
96
|
["==", ["var", "highlightedId"], ["id"]],
|
|
95
97
|
"white",
|
|
96
|
-
|
|
98
|
+
outlineColorCopy || "#000000"
|
|
97
99
|
],
|
|
98
100
|
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
99
101
|
"stroke-offset": 0,
|
|
@@ -108,10 +110,11 @@ function singleColorStyleForLines(color) {
|
|
|
108
110
|
};
|
|
109
111
|
}
|
|
110
112
|
function getGraduatedStyle(attribute, ramp, outlineColor, outlineWidth) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
let outlineColorCopy = outlineColor ? [...outlineColor] : void 0;
|
|
114
|
+
if (outlineWidth == 0 && outlineColorCopy != void 0)
|
|
115
|
+
outlineColorCopy[3] = 0;
|
|
116
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColorCopy)
|
|
117
|
+
outlineColorCopy[3] = 1;
|
|
115
118
|
let aux = [];
|
|
116
119
|
aux.push("interpolate");
|
|
117
120
|
aux.push(["linear"]);
|
|
@@ -125,7 +128,7 @@ function getGraduatedStyle(attribute, ramp, outlineColor, outlineWidth) {
|
|
|
125
128
|
"case",
|
|
126
129
|
["==", ["var", "highlightedId"], ["id"]],
|
|
127
130
|
"white",
|
|
128
|
-
|
|
131
|
+
outlineColorCopy || "#000000"
|
|
129
132
|
],
|
|
130
133
|
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
131
134
|
"fill-color": aux
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openlayers-style-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A style editor extension for OpenLayers currently working with WebGL Vector Layers",
|
|
6
6
|
"homepage": "https://land-it.github.io/openlayers-style-editor/",
|