aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modern/src/map/MapGeofenceEdit.js2
-rw-r--r--modern/src/map/MapRoutePath.js2
-rw-r--r--modern/src/map/main/MapDefaultCamera.js2
3 files changed, 3 insertions, 3 deletions
diff --git a/modern/src/map/MapGeofenceEdit.js b/modern/src/map/MapGeofenceEdit.js
index c387a086..a7e07483 100644
--- a/modern/src/map/MapGeofenceEdit.js
+++ b/modern/src/map/MapGeofenceEdit.js
@@ -148,7 +148,7 @@ const MapGeofenceEdit = ({ selectedGeofenceId }) => {
}
const bounds = coordinates.reduce(
(bounds, coordinate) => bounds.extend(coordinate),
- new maplibregl.LngLatBounds(coordinates[0], coordinates[0]),
+ new maplibregl.LngLatBounds(coordinates[0], coordinates[1]),
);
const canvas = map.getCanvas();
map.fitBounds(bounds, { padding: Math.min(canvas.width, canvas.height) * 0.1 });
diff --git a/modern/src/map/MapRoutePath.js b/modern/src/map/MapRoutePath.js
index d2d6827c..7971e3d3 100644
--- a/modern/src/map/MapRoutePath.js
+++ b/modern/src/map/MapRoutePath.js
@@ -71,7 +71,7 @@ const MapRoutePath = ({ positions }) => {
},
});
if (coordinates.length) {
- const bounds = coordinates.reduce((bounds, item) => bounds.extend(item), new maplibregl.LngLatBounds(coordinates[0], coordinates[0]));
+ const bounds = coordinates.reduce((bounds, item) => bounds.extend(item), new maplibregl.LngLatBounds(coordinates[0], coordinates[1]));
const canvas = map.getCanvas();
map.fitBounds(bounds, {
padding: Math.min(canvas.width, canvas.height) * 0.1,
diff --git a/modern/src/map/main/MapDefaultCamera.js b/modern/src/map/main/MapDefaultCamera.js
index bb9ea404..f6b6ed9c 100644
--- a/modern/src/map/main/MapDefaultCamera.js
+++ b/modern/src/map/main/MapDefaultCamera.js
@@ -27,7 +27,7 @@ const MapDefaultCamera = () => {
} else {
const coordinates = Object.values(positions).map((item) => [item.longitude, item.latitude]);
if (coordinates.length > 1) {
- const bounds = coordinates.reduce((bounds, item) => bounds.extend(item), new maplibregl.LngLatBounds(coordinates[0], coordinates[0]));
+ const bounds = coordinates.reduce((bounds, item) => bounds.extend(item), new maplibregl.LngLatBounds(coordinates[0], coordinates[1]));
const canvas = map.getCanvas();
map.fitBounds(bounds, {
duration: 0,