aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/core
diff options
context:
space:
mode:
Diffstat (limited to 'modern/src/map/core')
-rw-r--r--modern/src/map/core/mapUtil.js2
-rw-r--r--modern/src/map/core/preloadImages.js12
2 files changed, 10 insertions, 4 deletions
diff --git a/modern/src/map/core/mapUtil.js b/modern/src/map/core/mapUtil.js
index feb458d6..8dcded2c 100644
--- a/modern/src/map/core/mapUtil.js
+++ b/modern/src/map/core/mapUtil.js
@@ -79,7 +79,7 @@ export const geofenceToFeature = (theme, item) => {
geometry,
properties: {
name: item.name,
- color: item.attributes.color || theme.palette.colors.geometry,
+ color: item.attributes.color || theme.palette.geometry.main,
},
};
};
diff --git a/modern/src/map/core/preloadImages.js b/modern/src/map/core/preloadImages.js
index 0634251b..e2aba74e 100644
--- a/modern/src/map/core/preloadImages.js
+++ b/modern/src/map/core/preloadImages.js
@@ -1,5 +1,6 @@
-import palette from '../../common/theme/palette';
import { loadImage, prepareIcon } from './mapUtil';
+import { grey, indigo } from '@mui/material/colors';
+import createPalette from '@mui/material/styles/createPalette';
import directionSvg from '../../resources/images/direction.svg';
import backgroundSvg from '../../resources/images/background.svg';
@@ -53,15 +54,20 @@ export const mapIconKey = (category) => (mapIcons.hasOwnProperty(category) ? cat
export const mapImages = {};
+const mapPalette = createPalette({
+ primary: { main: indigo[900] },
+ neutral: { main: grey[500] },
+});
+
export default async () => {
const background = await loadImage(backgroundSvg);
mapImages.background = await prepareIcon(background);
mapImages.direction = await prepareIcon(await loadImage(directionSvg));
await Promise.all(Object.keys(mapIcons).map(async (category) => {
const results = [];
- ['primary', 'positive', 'negative', 'neutral'].forEach((color) => {
+ ['primary', 'success', 'error', 'neutral'].forEach((color) => {
results.push(loadImage(mapIcons[category]).then((icon) => {
- mapImages[`${category}-${color}`] = prepareIcon(background, icon, palette().colors[color]);
+ mapImages[`${category}-${color}`] = prepareIcon(background, icon, mapPalette[color].main);
}));
});
await Promise.all(results);