Skip to content

Commit

Permalink
option to set minimum bounds on a map
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Oct 2, 2014
1 parent 7648414 commit 2447491
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/wq/map.js
Expand Up @@ -327,10 +327,14 @@ map.createMap = function(page, itemid, override) {
if (!map.config.defaults.autoZoom)
return;
var bounds = layerConfs[0].layer.getBounds();
if (layerConfs.length > 1)
if (layerConfs.length > 1) {
layerConfs.slice(1).forEach(function(layerconf) {
bounds.extend(layerconf.layer.getBounds());
});
}
if (mapconf.minBounds) {
bounds.extend(mapconf.minBounds);
}
setTimeout(function() {
m.fitBounds(bounds, map.config.defaults.autoZoom);
}, map.config.defaults.autoZoom.wait * 1000);
Expand Down

0 comments on commit 2447491

Please sign in to comment.