From 7d521e8411dbeb9ca6bbeb98453145b44c7e5913 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 3 Jun 2022 08:25:48 -0700 Subject: Add geometry color to theme --- modern/src/map/main/MapAccuracy.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'modern/src/map/main/MapAccuracy.js') diff --git a/modern/src/map/main/MapAccuracy.js b/modern/src/map/main/MapAccuracy.js index 089389bd..3c48c788 100644 --- a/modern/src/map/main/MapAccuracy.js +++ b/modern/src/map/main/MapAccuracy.js @@ -2,14 +2,19 @@ import { useEffect } from 'react'; import { useSelector } from 'react-redux'; import circle from '@turf/circle'; +import { useTheme } from '@mui/styles'; import { map } from '../core/MapView'; const MapAccuracy = () => { const id = 'accuracy'; + const theme = useTheme(); + const positions = useSelector((state) => ({ type: 'FeatureCollection', - features: Object.values(state.positions.items).filter((position) => position.accuracy > 0).map((position) => circle([position.longitude, position.latitude], position.accuracy * 0.001)), + features: Object.values(state.positions.items) + .filter((position) => position.accuracy > 0) + .map((position) => circle([position.longitude, position.latitude], position.accuracy * 0.001)), })); useEffect(() => { @@ -29,8 +34,8 @@ const MapAccuracy = () => { ['==', '$type', 'Polygon'], ], paint: { - 'fill-color': '#3bb2d0', - 'fill-outline-color': '#3bb2d0', + 'fill-color': theme.palette.colors.geometry, + 'fill-outline-color': theme.palette.colors.geometry, 'fill-opacity': 0.25, }, }); -- cgit v1.2.3