diff --git a/index.html b/index.html
index a297e50..2685648 100644
--- a/index.html
+++ b/index.html
@@ -79,7 +79,7 @@
Exemple 2
-
+
@@ -217,7 +217,7 @@ Exemple 4
-
+
diff --git a/js/sitnlayers.js b/js/sitnlayers.js
index be759c2..326e0e6 100644
--- a/js/sitnlayers.js
+++ b/js/sitnlayers.js
@@ -434,8 +434,8 @@
sitnLayers.recenterMap = function (coordinates, zoomLevel) {
if (_map) {
const view = _map.getView();
- view.setCenter(coordinates);
- view.setZoom(zoomLevel);
+ const point = new ol.geom.Point(coordinates);
+ view.fit(point, { maxZoom: zoomLevel });
}
};