{{{
this.map.zoomToExtent(feat.geometry.getBounds());
if (this.options.geom_name === 'Point') {
this.map.zoomTo(this.options.point_zoom);
}
}}}
to:
{{{
this.map.getView().fit(extent, this.map.getSize(), {maxZoom:
this.options.default_zoom});
}}}
As a result, the zoom is often the `default_zoom`, which is mostly not
adequate at all (not enough zoom). If we simply remove the maxZoom, the
zoom is too high for points (hence the `point_zoom` in the initial
version). I think instead of `maxZoom`, a `minResolution` (see
https://openlayers.org/en/latest/apidoc/module-ol_View-View.html#fit)
would be more appropriate.
We would probably need to reintroduce some `point_zoom` variable, as
providing a hard-coded value is not an option.
--
Ticket URL: <https://code.djangoproject.com/ticket/33637>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted
Comment:
Using `minResolution` sounds reasonable.
--
Ticket URL: <https://code.djangoproject.com/ticket/33637#comment:1>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/15593 PR]
I finally opted for a hard-coded value, as IMO a resolution of `1` should
be accurate for most (all?) layer types.
--
Ticket URL: <https://code.djangoproject.com/ticket/33637#comment:2>
* owner: nobody => Claude Paroz
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/33637#comment:3>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"08f30d1b6ac9b7bc05857f88a70277d5ceb27ba1" 08f30d1b]:
{{{
#!CommitTicketReference repository=""
revision="08f30d1b6ac9b7bc05857f88a70277d5ceb27ba1"
Fixed #33637 -- Improved initial zoom level in MapWidget.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33637#comment:4>