Explorar o código

Fixed #33637 -- Improved initial zoom level in MapWidget.

Claude Paroz %!s(int64=2) %!d(string=hai) anos
pai
achega
08f30d1b6a

+ 1 - 1
django/contrib/gis/static/gis/js/OLMapWidget.js

@@ -99,7 +99,7 @@ ol.inherits(GeometryTypeControl, ol.control.Control);
                 ol.extent.extend(extent, feature.getGeometry().getExtent());
             }, this);
             // Center/zoom the map
-            this.map.getView().fit(extent, {maxZoom: this.options.default_zoom});
+            this.map.getView().fit(extent, {minResolution: 1});
         } else {
             this.map.getView().setCenter(this.defaultCenter());
         }

+ 1 - 1
js_tests/gis/mapwidget.test.js

@@ -33,7 +33,7 @@ QUnit.test('MapWidget.defaultCenter', function(assert) {
         '6.81,47.08',
         'Default center at 6.81, 47.08'
     );
-    assert.equal(widget.map.getView().getZoom(), 12);
+    assert.equal(widget.map.getView().getZoom(), 17);
 });
 
 QUnit.test('MapWidget.interactions', function(assert) {