[enh] template_oscar: maxZoom if fitting bounds

This commit is contained in:
Thomas Pointhuber 2014-11-02 22:35:06 +01:00
parent 740594a4b7
commit b2c976a5a3

View File

@ -100,7 +100,9 @@ $(document).ready(function(){
if(map_bounds) { if(map_bounds) {
// TODO hack: https://github.com/Leaflet/Leaflet/issues/2021 // TODO hack: https://github.com/Leaflet/Leaflet/issues/2021
setTimeout(function () { setTimeout(function () {
map.fitBounds(map_bounds); map.fitBounds(map_bounds, {
maxZoom:17
});
}, 0); }, 0);
} else if (map_lon && map_lat) { } else if (map_lon && map_lat) {
if(map_zoom) if(map_zoom)
@ -113,8 +115,8 @@ $(document).ready(function(){
if(map_geojson) if(map_geojson)
L.geoJson(map_geojson).addTo(map); L.geoJson(map_geojson).addTo(map);
//if(map_bounds) /*else if(map_bounds)
// L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map); L.rectangle(map_bounds, {color: "#ff7800", weight: 3, fill:false}).addTo(map);*/
}); });
// this event occour only once per element // this event occour only once per element