aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/MainMap.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-10-24 15:32:00 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-10-24 15:32:00 -0700
commit4b192b870dfd4fc1eb61b244bbe455a59f7089c3 (patch)
tree4936dcb1a70ba034315ac1bef6e40fbacf005c63 /modern/src/map/MainMap.js
parent50505e02d2464a5f353aa805c9622c6d4f940ebc (diff)
downloadtrackermap-web-4b192b870dfd4fc1eb61b244bbe455a59f7089c3.tar.gz
trackermap-web-4b192b870dfd4fc1eb61b244bbe455a59f7089c3.tar.bz2
trackermap-web-4b192b870dfd4fc1eb61b244bbe455a59f7089c3.zip
Implement category icons
Diffstat (limited to 'modern/src/map/MainMap.js')
-rw-r--r--modern/src/map/MainMap.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/modern/src/map/MainMap.js b/modern/src/map/MainMap.js
index c93c26dd..0b7eea25 100644
--- a/modern/src/map/MainMap.js
+++ b/modern/src/map/MainMap.js
@@ -30,6 +30,7 @@ const MainMap = () => {
return {
deviceId: position.deviceId,
name: device ? device.name : '',
+ category: device && device.category || 'default',
}
};
@@ -89,7 +90,7 @@ const MainMap = () => {
'type': 'geojson',
'data': positions,
});
- mapManager.addLayer('device-icon', 'positions', 'icon-marker', '{name}', markerClickHandler);
+ mapManager.addLayer('device-icon', 'positions', '{category}', '{name}', markerClickHandler);
const bounds = mapManager.calculateBounds(positions.features);
if (bounds) {
@@ -118,12 +119,7 @@ const MainMap = () => {
}
}, [positions]);
- const style = {
- width: '100%',
- height: '100%',
- };
-
- return <div style={style} ref={containerEl} />;
+ return <div style={{ width: '100%', height: '100%' }} ref={containerEl} />;
}
export default MainMap;