Skip to content

Commit d7e0143

Browse files
authored
Merge pull request #171 from seav/fix/#165
Fix #165 (zoom level is not max)
2 parents 2c17b8c + 52a12e3 commit d7e0143

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

leaflet/static/leaflet/leaflet.forms.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,12 +177,7 @@ L.GeometryField = L.Class.extend({
177177
// Change view extent
178178
if (this.drawnItems.getLayers().length > 0) {
179179
var bounds = this.drawnItems.getBounds();
180-
// In case of points, fitBounds() fails.
181-
// https://github.com/makinacorpus/django-leaflet/issues/90
182-
if (!bounds._southWest.equals(bounds._northEast))
183-
this._map.fitBounds(bounds);
184-
else
185-
this._map.setView(bounds._northEast, this.default_zoom);
180+
this._map.fitBounds(this.drawnItems.getBounds());
186181
}
187182
// Else keep view extent set by django-leaflet template tag
188183
},

0 commit comments

Comments
 (0)