aboutsummaryrefslogtreecommitdiff
path: root/modern/src/map/MainMap.js
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-10-24 16:05:36 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-10-24 16:05:36 -0700
commit7806cb2d725ab1aa4f66db86bc376a027dda6df5 (patch)
tree18b318131c3cfc854b6623715bbd3ec273d4cbd9 /modern/src/map/MainMap.js
parent326f64d9a6c3ce9fe50b8658d54efc3275d30d7f (diff)
downloadtrackermap-web-7806cb2d725ab1aa4f66db86bc376a027dda6df5.tar.gz
trackermap-web-7806cb2d725ab1aa4f66db86bc376a027dda6df5.tar.bz2
trackermap-web-7806cb2d725ab1aa4f66db86bc376a027dda6df5.zip
Extract map unit functions
Diffstat (limited to 'modern/src/map/MainMap.js')
-rw-r--r--modern/src/map/MainMap.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/modern/src/map/MainMap.js b/modern/src/map/MainMap.js
index 0b7eea25..4ee6d4dc 100644
--- a/modern/src/map/MainMap.js
+++ b/modern/src/map/MainMap.js
@@ -6,6 +6,7 @@ import mapboxgl from 'mapbox-gl';
import mapManager from './mapManager';
import store from '../store';
import StatusView from '../StatusView';
+import { calculateBounds } from './mapUtil';
import { useHistory } from 'react-router-dom';
const MainMap = () => {
@@ -92,7 +93,7 @@ const MainMap = () => {
});
mapManager.addLayer('device-icon', 'positions', '{category}', '{name}', markerClickHandler);
- const bounds = mapManager.calculateBounds(positions.features);
+ const bounds = calculateBounds(positions.features);
if (bounds) {
mapManager.map.fitBounds(bounds, {
padding: 100,