Skip to content

Commit 02b8d1f

Browse files
committed
refactor(ol-webgl-points-layer): use new flat style format
BREAKING CHANGE: use the [new introduced flat format from OpenLayers 8](https://github.com/openlayers/openlayers/blob/v8.0.0/changelog/upgrade-notes.md#change-of-the-symbol-style-format-in-ollayerwebglpointslayer)
1 parent 84232e9 commit 02b8d1f

File tree

3 files changed

+39
-72
lines changed

3 files changed

+39
-72
lines changed

Diff for: src/demos/AppDemo.vue

+13-24
Original file line numberDiff line numberDiff line change
@@ -431,30 +431,19 @@ const zones = [
431431
];
432432
433433
const webglPointsStyle = {
434-
symbol: {
435-
symbolType: "circle",
436-
size: [
437-
"interpolate",
438-
["linear"],
439-
["get", "population"],
440-
40000,
441-
8,
442-
2000000,
443-
28,
444-
],
445-
color: "#ffed02",
446-
rotateWithView: false,
447-
offset: [0, 0],
448-
opacity: [
449-
"interpolate",
450-
["linear"],
451-
["get", "population"],
452-
40000,
453-
0.6,
454-
2000000,
455-
0.92,
456-
],
457-
},
434+
"circle-radius": 6,
435+
"circle-fill-color": "yellow",
436+
"circle-stroke-width": 2,
437+
"circle-stroke-color": "darkblue",
438+
"circle-opacity": [
439+
"interpolate",
440+
["linear"],
441+
["get", "population"],
442+
40000,
443+
0.6,
444+
2000000,
445+
0.92,
446+
],
458447
};
459448
</script>
460449

Diff for: src/demos/WebglPointsLayerDemo.vue

+13-24
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,18 @@ const format = inject("ol-format");
3737
const geoJson = new format.GeoJSON();
3838
3939
const webglPointsStyle = {
40-
symbol: {
41-
symbolType: "circle",
42-
size: [
43-
"interpolate",
44-
["linear"],
45-
["get", "population"],
46-
40000,
47-
8,
48-
2000000,
49-
28,
50-
],
51-
color: "#ffed02",
52-
rotateWithView: false,
53-
offset: [0, 0],
54-
opacity: [
55-
"interpolate",
56-
["linear"],
57-
["get", "population"],
58-
40000,
59-
0.6,
60-
2000000,
61-
0.92,
62-
],
63-
},
40+
"circle-radius": 6,
41+
"circle-fill-color": "yellow",
42+
"circle-stroke-width": 2,
43+
"circle-stroke-color": "darkblue",
44+
"circle-opacity": [
45+
"interpolate",
46+
["linear"],
47+
["get", "population"],
48+
40000,
49+
0.6,
50+
2000000,
51+
0.92,
52+
],
6453
};
6554
</script>

Diff for: src/demos/WebglPointsSourceDemo.vue

+13-24
Original file line numberDiff line numberDiff line change
@@ -47,29 +47,18 @@ const getRandomInRange = (from, to, fixed) => {
4747
};
4848
4949
const webglPointsStyle = {
50-
symbol: {
51-
symbolType: "circle",
52-
size: [
53-
"interpolate",
54-
["linear"],
55-
["get", "population"],
56-
40000,
57-
8,
58-
2000000,
59-
28,
60-
],
61-
color: "#ffed02",
62-
rotateWithView: false,
63-
offset: [0, 0],
64-
opacity: [
65-
"interpolate",
66-
["linear"],
67-
["get", "population"],
68-
40000,
69-
0.6,
70-
2000000,
71-
0.92,
72-
],
73-
},
50+
"circle-radius": 6,
51+
"circle-fill-color": "yellow",
52+
"circle-stroke-width": 2,
53+
"circle-stroke-color": "darkblue",
54+
"circle-opacity": [
55+
"interpolate",
56+
["linear"],
57+
["get", "population"],
58+
40000,
59+
0.6,
60+
2000000,
61+
0.92,
62+
],
7463
};
7564
</script>

0 commit comments

Comments
 (0)