bug fixeed in zoom map

parent 38c7a6a3
...@@ -70,8 +70,10 @@ function addImageLayer(labelDate) { ...@@ -70,8 +70,10 @@ function addImageLayer(labelDate) {
map.addLayer(xyz); map.addLayer(xyz);
}) })
let currentZoom = map.getView().getZoom();
// fit and zoom // fit and zoom
map.getView().fit(ol.proj.transformExtent(data.boundingBox, 'EPSG:4326', 'EPSG:3857')) map.getView().fit(ol.proj.transformExtent(data.boundingBox, 'EPSG:4326', 'EPSG:3857'))
map.getView().setZoom(currentZoom);
map.getView().setMinZoom(data.zoom.min); map.getView().setMinZoom(data.zoom.min);
map.getView().setMaxZoom(data.zoom.max); map.getView().setMaxZoom(data.zoom.max);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment