#33637: Regression in feature zoom for MapWidget
----------------------------------------+------------------------
               Reporter:  Claude Paroz  |          Owner:  nobody
                   Type:  Bug           |         Status:  new
              Component:  GIS           |        Version:  4.0
               Severity:  Normal        |       Keywords:
           Triage Stage:  Unreviewed    |      Has patch:  0
    Needs documentation:  0             |    Needs tests:  0
Patch needs improvement:  0             |  Easy pickings:  0
                  UI/UX:  0             |
----------------------------------------+------------------------
 When I rewrote MapWidget for OpenLayers 3 in [2ebfda38e], the code to
 autozoom to the initial feature (if present) was changed from:

 {{{
 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.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701801d0a2a33-9e8610b3-a247-4197-b14e-e1d3e9585a74-000000%40eu-central-1.amazonses.com.

Reply via email to