From f4bbccb5214ff0dd2cbd7bc76973f64c06fc9509 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 8 Jun 2022 12:10:44 +0200 Subject: Geodata - geoforms: manage large number of related items - fix zoom - better + button --- ishtar_common/templates/gis/openlayers-osm.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ishtar_common/templates/gis') diff --git a/ishtar_common/templates/gis/openlayers-osm.html b/ishtar_common/templates/gis/openlayers-osm.html index 404ab5708..a6797a580 100644 --- a/ishtar_common/templates/gis/openlayers-osm.html +++ b/ishtar_common/templates/gis/openlayers-osm.html @@ -19,5 +19,7 @@ $(document).ready(function() { let layer_extent = features[0].getGeometry().getExtent().slice(0); features.forEach(function(feature){ ol.extent.extend(layer_extent, feature.getGeometry().getExtent())}); {{ module }}.map.getView().fit(layer_extent, {{ module }}.map.getSize()); + let current_zoom = {{ module }}.map.getView().getZoom(); + if ({{ module }}.map.getView().getZoom() > 18) {{ module }}.map.getView().setZoom(18); }); {% endblock %} -- cgit v1.2.3