set minmax zoom in minimap

parent dd923837
...@@ -16,8 +16,7 @@ var map = new ol.Map({ ...@@ -16,8 +16,7 @@ var map = new ol.Map({
view: new ol.View({ view: new ol.View({
center: ol.proj.fromLonLat([-99.19, 19.61]), center: ol.proj.fromLonLat([-99.19, 19.61]),
zoom: 4, zoom: 4,
minZoom:4, minZoom:4
maxZoom: 14
}) })
}); });
...@@ -37,8 +36,8 @@ function addImageLayer(labelDate) { ...@@ -37,8 +36,8 @@ function addImageLayer(labelDate) {
projection: 'EPSG:3857', projection: 'EPSG:3857',
url: getURL(purchase_id, zone, labelDate), url: getURL(purchase_id, zone, labelDate),
tilePixelRatio: 2, tilePixelRatio: 2,
minZoom: 9, minZoom: data.zoom.min,
maxZoom: 14 maxZoom: data.zoom.max
}) })
}); });
...@@ -47,6 +46,8 @@ function addImageLayer(labelDate) { ...@@ -47,6 +46,8 @@ function addImageLayer(labelDate) {
var extent = ol.proj.transformExtent(data.boundingBox, 'EPSG:4326', 'EPSG:3857'); var extent = ol.proj.transformExtent(data.boundingBox, 'EPSG:4326', 'EPSG:3857');
map.getView().fit(extent, {duration: 800}) map.getView().fit(extent, {duration: 800})
map.getView().setMinZoom(data.zoom.min);
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