﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
28195	Make OSMWidget zoom level configurable	Danilo Bargen	nobody	"The OSMWidget has a default zoom level of 12 (as seen in django/contrib/gis/static/gis/js/OLMapWidget.js on line 55).

{{{#!javascript
default_zoom: 12,
}}}

That zoom level is not only used as default zoom level, but also as max zoom level for fitting the map to data:

{{{#!javascript
this.map.getView().fit(extent, this.map.getSize(), {maxZoom: this.options.default_zoom});
}}}

This causes maps to be zoomed out considerably even when showing a pretty small polygon with a few meters in diameter. That makes fitting the zoom level to the data pretty useless.

Unfortunately this value is not configurable, in contrast to `default_lat` and `default_lon`. Therefore as a first, non-controversial change I'd suggest to make this value configurable in the OSMWidget. I'll provide a pull request for that shortly.

Some further comments:

- The default zoom level should probably be decoupled from map zoom fitting.
- The default zoom level is different from the one used in admin, where it's 4: https://code.djangoproject.com/ticket/26774"	New feature	closed	GIS	dev	Normal	fixed	gis, osm, map, zoom		Accepted	1	0	0	0	1	0
