aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-03 11:48:36 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-03 11:48:36 -0700
commita78b32f7d59d51effe7f1419902637fe39a451b9 (patch)
tree2a1b2ac8ab40be9f90b5762f4b1be4e39eafdf63 /modern/src/map/main
parent0ed3111ec95e588f90e8d4f14472b651714444d9 (diff)
downloadtrackermap-web-a78b32f7d59d51effe7f1419902637fe39a451b9.tar.gz
trackermap-web-a78b32f7d59d51effe7f1419902637fe39a451b9.tar.bz2
trackermap-web-a78b32f7d59d51effe7f1419902637fe39a451b9.zip
Custom geofence colors (fix #967)
Diffstat (limited to 'modern/src/map/main')
-rw-r--r--modern/src/map/main/MapGeofence.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/modern/src/map/main/MapGeofence.js b/modern/src/map/main/MapGeofence.js
index b62cd378..12eedf7d 100644
--- a/modern/src/map/main/MapGeofence.js
+++ b/modern/src/map/main/MapGeofence.js
@@ -29,8 +29,8 @@ const MapGeofence = () => {
['==', '$type', 'Polygon'],
],
paint: {
- 'fill-color': theme.palette.colors.geometry,
- 'fill-outline-color': theme.palette.colors.geometry,
+ 'fill-color': ['get', 'color'],
+ 'fill-outline-color': ['get', 'color'],
'fill-opacity': 0.1,
},
});
@@ -39,7 +39,7 @@ const MapGeofence = () => {
id: 'geofences-line',
type: 'line',
paint: {
- 'line-color': theme.palette.colors.geometry,
+ 'line-color': ['get', 'color'],
'line-width': 2,
},
});
@@ -77,7 +77,7 @@ const MapGeofence = () => {
useEffect(() => {
map.getSource(id).setData({
type: 'FeatureCollection',
- features: Object.values(geofences).map(geofenceToFeature),
+ features: Object.values(geofences).map((geofence) => geofenceToFeature(theme, geofence)),
});
}, [geofences]);