[mapserver-users] zoom out in phpmapscript: possible bug

Claude Philipona claude.philipona at camptocamp.com
Tue Nov 13 14:30:05 EST 2001


Hello,
I've observed a strange behaviour when we zoom out beyond the extent with
php-mapscript. This problem appears only if the width/height ratio of the EXTENT
is bigger than width/height ratio of the mapsize. Actually the map rendered is
totally off the EXTENT limit. This totally reproducible. Let me explain the
situation more in detail:

PHP-Mapscript used:
MapScript Version (Spet 13, 2001)
MapServer version 3.5 (pre-alpha) OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
SUPPORTS=PROJ SUPPORTS=TTF SUPPORTS=WMS INPUT=EPPL7 INPUT=JPEG INPUT=OGR
INPUT=GDAL INPUT=SHAPEFILE

EXTENT in .map file (unit meters)
490000 70000 840000 310000
MAXSCALE 2000000

which gives
Width_EXTENT: 350000
Height_EXTENT: 240000

Ratio Width_EXTENT/Height_EXTENT= 1.4583

----> CASE 1: ratio_MAPSIZE > ratio_EXTENT (no bug, comportement is normal):
we choose a map size:
Width_MAPSIZE 600
Height_MAPSIZE 400

which gives a ratio of 1.5 so ratio_MAPSIZE > ratio_EXTENT

We assume that the maxscale is set big enough so that when we zoom out, mapserver
has to reajust to the EXTENT (in this example 2000000 is ok)

Now we zoom out and we see that everything is normal. It comes a point when
mapserver reajust automatically the BBOX to the EXTENT. The map is always
properly placed inside the extent.
returned BBOX: 490000 70000 840000 310000


----> CASE 2: ratio_MAPSIZE < ratio_EXTENT (buggy):
we choose a map size:
Width_MAPSIZE 600
Height_MAPSIZE 500

which gives a ratio of 1.2 so ratio_MAPSIZE < ratio_EXTENT

We assume that the maxscale is set big enough so that when we zoom out, mapserver
has to reajust to the EXTENT (in this example 2000000 is ok)

Now we zoom out and we see that mapserver doesn't reajust properly when go beyond
the EXTENT, mapserver doesn't reajust properly to the max EXTENT: Suddenly, there
is a strong offset to the top, the map is almost totally off the extent limit. If
we take a look at the returned BBOX, we see that mapserver has set y_max_extent
to y_min_bbox, and a strange number to y_max_bbox:
returned BBOX: 490000 310000 840000 361333.33333333


This totally reproducible. I could also reproduce with gmap (with modification of
mapsize). I'm almost  sure that it is bug, but not knowing the source code that
well I couldn't find it. It seems to appear at least with zoompoint () and
zoomscale().

Has anyone an idea?

Claude






More information about the mapserver-users mailing list