openlayers-style-editor 0.1.5 → 0.1.7
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 +31 -7
- package/dist/index.js +31 -7
- package/package.json +17 -16
package/dist/index.cjs
CHANGED
|
@@ -46,6 +46,10 @@
|
|
|
46
46
|
return GraduatedModes2;
|
|
47
47
|
})(GraduatedModes || {});
|
|
48
48
|
function getCategorizedStyle(attribute, colors, outlineColor, outlineWidth, defaultColor) {
|
|
49
|
+
if (outlineWidth == 0 && outlineColor != void 0)
|
|
50
|
+
outlineColor[3] = 0;
|
|
51
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColor)
|
|
52
|
+
outlineColor[3] = 1;
|
|
49
53
|
let aux = [];
|
|
50
54
|
aux.push("match");
|
|
51
55
|
aux.push(["get", attribute]);
|
|
@@ -61,11 +65,15 @@
|
|
|
61
65
|
"white",
|
|
62
66
|
outlineColor || "#000000"
|
|
63
67
|
],
|
|
64
|
-
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth
|
|
68
|
+
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
65
69
|
"fill-color": aux
|
|
66
70
|
};
|
|
67
71
|
}
|
|
68
72
|
function singleColorStyle(color, outlineColor, outlineWidth) {
|
|
73
|
+
if (outlineWidth == 0 && outlineColor != void 0)
|
|
74
|
+
outlineColor[3] = 0;
|
|
75
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColor)
|
|
76
|
+
outlineColor[3] = 1;
|
|
69
77
|
return {
|
|
70
78
|
"stroke-color": [
|
|
71
79
|
"case",
|
|
@@ -73,7 +81,7 @@
|
|
|
73
81
|
"white",
|
|
74
82
|
outlineColor || "#000000"
|
|
75
83
|
],
|
|
76
|
-
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth
|
|
84
|
+
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
77
85
|
"stroke-offset": 0,
|
|
78
86
|
"fill-color": color
|
|
79
87
|
};
|
|
@@ -86,6 +94,10 @@
|
|
|
86
94
|
};
|
|
87
95
|
}
|
|
88
96
|
function getGraduatedStyle(attribute, ramp, outlineColor, outlineWidth) {
|
|
97
|
+
if (outlineWidth == 0 && outlineColor != void 0)
|
|
98
|
+
outlineColor[3] = 0;
|
|
99
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColor)
|
|
100
|
+
outlineColor[3] = 1;
|
|
89
101
|
let aux = [];
|
|
90
102
|
aux.push("interpolate");
|
|
91
103
|
aux.push(["linear"]);
|
|
@@ -101,7 +113,7 @@
|
|
|
101
113
|
"white",
|
|
102
114
|
outlineColor || "#000000"
|
|
103
115
|
],
|
|
104
|
-
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth
|
|
116
|
+
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
105
117
|
"fill-color": aux
|
|
106
118
|
};
|
|
107
119
|
}
|
|
@@ -260,7 +272,11 @@
|
|
|
260
272
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
261
273
|
MyColorPicker,
|
|
262
274
|
{
|
|
263
|
-
color:
|
|
275
|
+
color: (() => {
|
|
276
|
+
if (borderColor.at(3) < 1)
|
|
277
|
+
return [borderColor[0], borderColor[1], borderColor[2], 1];
|
|
278
|
+
return borderColor;
|
|
279
|
+
})(),
|
|
264
280
|
hideAlpha: true,
|
|
265
281
|
onChange: (e) => setBorderColor(color_js.fromString(e))
|
|
266
282
|
}
|
|
@@ -908,7 +924,11 @@
|
|
|
908
924
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
909
925
|
MyColorPicker,
|
|
910
926
|
{
|
|
911
|
-
color:
|
|
927
|
+
color: (() => {
|
|
928
|
+
if (borderColor.at(3) < 1)
|
|
929
|
+
return [borderColor[0], borderColor[1], borderColor[2], 1];
|
|
930
|
+
return borderColor;
|
|
931
|
+
})(),
|
|
912
932
|
hideAlpha: true,
|
|
913
933
|
onChange: (e) => setBorderColor(color_js.fromString(e))
|
|
914
934
|
}
|
|
@@ -1009,7 +1029,7 @@
|
|
|
1009
1029
|
datatable_esm_js.DataTable,
|
|
1010
1030
|
{
|
|
1011
1031
|
value: table,
|
|
1012
|
-
selectionMode: rowClick ?
|
|
1032
|
+
selectionMode: rowClick ? null : "checkbox",
|
|
1013
1033
|
tableStyle: { minWidth: "25rem" },
|
|
1014
1034
|
selection: table.filter((tr) => tr.visible),
|
|
1015
1035
|
onSelectionChange: (e) => {
|
|
@@ -1579,7 +1599,11 @@
|
|
|
1579
1599
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1580
1600
|
MyColorPicker,
|
|
1581
1601
|
{
|
|
1582
|
-
color:
|
|
1602
|
+
color: (() => {
|
|
1603
|
+
if (borderColor.at(3) < 1)
|
|
1604
|
+
return [borderColor[0], borderColor[1], borderColor[2], 1];
|
|
1605
|
+
return borderColor;
|
|
1606
|
+
})(),
|
|
1583
1607
|
hideAlpha: true,
|
|
1584
1608
|
onChange: (e) => setBorderColor(color_js.fromString(e))
|
|
1585
1609
|
}
|
package/dist/index.js
CHANGED
|
@@ -60,6 +60,10 @@ var GraduatedModes = /* @__PURE__ */ ((GraduatedModes2) => {
|
|
|
60
60
|
return GraduatedModes2;
|
|
61
61
|
})(GraduatedModes || {});
|
|
62
62
|
function getCategorizedStyle(attribute, colors, outlineColor, outlineWidth, defaultColor) {
|
|
63
|
+
if (outlineWidth == 0 && outlineColor != void 0)
|
|
64
|
+
outlineColor[3] = 0;
|
|
65
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColor)
|
|
66
|
+
outlineColor[3] = 1;
|
|
63
67
|
let aux = [];
|
|
64
68
|
aux.push("match");
|
|
65
69
|
aux.push(["get", attribute]);
|
|
@@ -75,11 +79,15 @@ function getCategorizedStyle(attribute, colors, outlineColor, outlineWidth, defa
|
|
|
75
79
|
"white",
|
|
76
80
|
outlineColor || "#000000"
|
|
77
81
|
],
|
|
78
|
-
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth
|
|
82
|
+
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
79
83
|
"fill-color": aux
|
|
80
84
|
};
|
|
81
85
|
}
|
|
82
86
|
function singleColorStyle(color, outlineColor, outlineWidth) {
|
|
87
|
+
if (outlineWidth == 0 && outlineColor != void 0)
|
|
88
|
+
outlineColor[3] = 0;
|
|
89
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColor)
|
|
90
|
+
outlineColor[3] = 1;
|
|
83
91
|
return {
|
|
84
92
|
"stroke-color": [
|
|
85
93
|
"case",
|
|
@@ -87,7 +95,7 @@ function singleColorStyle(color, outlineColor, outlineWidth) {
|
|
|
87
95
|
"white",
|
|
88
96
|
outlineColor || "#000000"
|
|
89
97
|
],
|
|
90
|
-
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth
|
|
98
|
+
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
91
99
|
"stroke-offset": 0,
|
|
92
100
|
"fill-color": color
|
|
93
101
|
};
|
|
@@ -100,6 +108,10 @@ function singleColorStyleForLines(color) {
|
|
|
100
108
|
};
|
|
101
109
|
}
|
|
102
110
|
function getGraduatedStyle(attribute, ramp, outlineColor, outlineWidth) {
|
|
111
|
+
if (outlineWidth == 0 && outlineColor != void 0)
|
|
112
|
+
outlineColor[3] = 0;
|
|
113
|
+
else if (outlineWidth != void 0 && outlineWidth > 0 && outlineColor)
|
|
114
|
+
outlineColor[3] = 1;
|
|
103
115
|
let aux = [];
|
|
104
116
|
aux.push("interpolate");
|
|
105
117
|
aux.push(["linear"]);
|
|
@@ -115,7 +127,7 @@ function getGraduatedStyle(attribute, ramp, outlineColor, outlineWidth) {
|
|
|
115
127
|
"white",
|
|
116
128
|
outlineColor || "#000000"
|
|
117
129
|
],
|
|
118
|
-
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth
|
|
130
|
+
"stroke-width": ["case", ["==", ["var", "highlightedId"], ["id"]], 2, outlineWidth == void 0 ? 1 : outlineWidth],
|
|
119
131
|
"fill-color": aux
|
|
120
132
|
};
|
|
121
133
|
}
|
|
@@ -274,7 +286,11 @@ const UniqueSymbol = (props) => {
|
|
|
274
286
|
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
275
287
|
MyColorPicker,
|
|
276
288
|
{
|
|
277
|
-
color:
|
|
289
|
+
color: (() => {
|
|
290
|
+
if (borderColor.at(3) < 1)
|
|
291
|
+
return [borderColor[0], borderColor[1], borderColor[2], 1];
|
|
292
|
+
return borderColor;
|
|
293
|
+
})(),
|
|
278
294
|
hideAlpha: true,
|
|
279
295
|
onChange: (e) => setBorderColor(fromString(e))
|
|
280
296
|
}
|
|
@@ -922,7 +938,11 @@ const Categorized = (props) => {
|
|
|
922
938
|
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
923
939
|
MyColorPicker,
|
|
924
940
|
{
|
|
925
|
-
color:
|
|
941
|
+
color: (() => {
|
|
942
|
+
if (borderColor.at(3) < 1)
|
|
943
|
+
return [borderColor[0], borderColor[1], borderColor[2], 1];
|
|
944
|
+
return borderColor;
|
|
945
|
+
})(),
|
|
926
946
|
hideAlpha: true,
|
|
927
947
|
onChange: (e) => setBorderColor(fromString(e))
|
|
928
948
|
}
|
|
@@ -1023,7 +1043,7 @@ const Categorized = (props) => {
|
|
|
1023
1043
|
DataTable,
|
|
1024
1044
|
{
|
|
1025
1045
|
value: table,
|
|
1026
|
-
selectionMode: rowClick ?
|
|
1046
|
+
selectionMode: rowClick ? null : "checkbox",
|
|
1027
1047
|
tableStyle: { minWidth: "25rem" },
|
|
1028
1048
|
selection: table.filter((tr) => tr.visible),
|
|
1029
1049
|
onSelectionChange: (e) => {
|
|
@@ -1593,7 +1613,11 @@ const Graduated = (props) => {
|
|
|
1593
1613
|
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
1594
1614
|
MyColorPicker,
|
|
1595
1615
|
{
|
|
1596
|
-
color:
|
|
1616
|
+
color: (() => {
|
|
1617
|
+
if (borderColor.at(3) < 1)
|
|
1618
|
+
return [borderColor[0], borderColor[1], borderColor[2], 1];
|
|
1619
|
+
return borderColor;
|
|
1620
|
+
})(),
|
|
1597
1621
|
hideAlpha: true,
|
|
1598
1622
|
onChange: (e) => setBorderColor(fromString(e))
|
|
1599
1623
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openlayers-style-editor",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
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/",
|
|
@@ -26,7 +26,8 @@
|
|
|
26
26
|
"dev": "vite",
|
|
27
27
|
"build": "vite build --config vite.config.ts",
|
|
28
28
|
"build2": "tsc && vite build",
|
|
29
|
-
"start": "vite --host --open"
|
|
29
|
+
"start": "vite --host --open",
|
|
30
|
+
"publish": "npm publish"
|
|
30
31
|
},
|
|
31
32
|
"peerDependencies": {
|
|
32
33
|
"ol": ">= 10.4.0",
|
|
@@ -34,29 +35,29 @@
|
|
|
34
35
|
"react-dom": ">= 17.0.0"
|
|
35
36
|
},
|
|
36
37
|
"dependencies": {
|
|
37
|
-
"chart.js": "4.
|
|
38
|
+
"chart.js": "4.5.1",
|
|
38
39
|
"geobuckets": "0.0.3",
|
|
39
|
-
"i18next": "
|
|
40
|
+
"i18next": "25.6.0",
|
|
40
41
|
"primeicons": "7.0.0",
|
|
41
|
-
"primereact": "10.9.
|
|
42
|
+
"primereact": "10.9.7",
|
|
42
43
|
"react-best-gradient-color-picker": "3.0.14",
|
|
43
|
-
"react-i18next": "
|
|
44
|
+
"react-i18next": "16.2.0"
|
|
44
45
|
},
|
|
45
46
|
"devDependencies": {
|
|
46
|
-
"@eslint/js": "9.
|
|
47
|
-
"@types/node": "
|
|
47
|
+
"@eslint/js": "9.38.0",
|
|
48
|
+
"@types/node": "24.9.1",
|
|
48
49
|
"@types/react": "18.3.18",
|
|
49
50
|
"@types/react-dom": "18.3.5",
|
|
50
|
-
"@vitejs/plugin-react": "
|
|
51
|
+
"@vitejs/plugin-react": "5.1.0",
|
|
51
52
|
"eslint": "8.57.0",
|
|
52
|
-
"eslint-plugin-react-hooks": "
|
|
53
|
-
"eslint-plugin-react-refresh": "0.4.
|
|
54
|
-
"globals": "16.
|
|
55
|
-
"typescript": "5.
|
|
56
|
-
"typescript-eslint": "8.
|
|
57
|
-
"vite": "6.
|
|
53
|
+
"eslint-plugin-react-hooks": "7.0.0",
|
|
54
|
+
"eslint-plugin-react-refresh": "0.4.24",
|
|
55
|
+
"globals": "16.4.0",
|
|
56
|
+
"typescript": "5.9.3",
|
|
57
|
+
"typescript-eslint": "8.46.2",
|
|
58
|
+
"vite": "6.4.1",
|
|
58
59
|
"vite-plugin-css-injected-by-js": "3.5.2",
|
|
59
|
-
"vite-plugin-dts": "4.5.
|
|
60
|
+
"vite-plugin-dts": "4.5.4"
|
|
60
61
|
},
|
|
61
62
|
"publishConfig": {
|
|
62
63
|
"access": "public"
|