Problems with zoomrectangle and MINSCALE with php mapscript

Alessandro Pasotti ale.pas at TISCALI.IT
Thu Mar 15 14:41:25 EDT 2007


Il 17:07, martedì 6 marzo 2007, BJSVW PraktiantIn AGI ha scritto:
>    Hi everybody,
>
>    I have some problems with zoomrectangle and minscale. I`ve set the
>    minscale in the WEB Object of my mapfile to 10.000
>    Now I try to zoom in with zoomrectangle and this works fine untill a
>    scale of 1:10.000. I'm using php mapscript 4.8.1
>    But when I zoom to a scale bigger as 1:10.000 (eg 1:8000 it doesn't
>    matter which scale) zoomrectangle gives me back an extent for my
>    map with a scale around 1:14.000.
>
>    Is this the result which zoomrectangle should deliver in this case?


Exactly the same happens to me with zoompoint.

There are two things you can try:

1 - set your minscale to MINSCALE - 1 ( 9999 in your case)
2 - check in your mapscript that you are not trying to zoom bigger than 
minscale and change the zoom value to minscale if true.

For example (my minscale is 25000):


        $new_scale =  ($this->zoom_factor > 0) ? $this->old_geo_scale / 
$this->zoom_factor : $this->old_geo_scale * ( - $this->zoom_factor);
        if($new_scale < 25000){
            return $this->map->zoomscale(25000 + 0.1, $xy_pix, 
$this->mapwidth, $this->mapheight, $this->geoext0, $this->maxextent);
        }


This code is in a wrapper class from p.mapper, but it sould be easy to 
understand.

I see you have already opened a bug report, well done, I also feel this is a 
bug.



-- 
Alessandro Pasotti
itOpen - "Open Solutions for the Net Age"
w3:  www.itopen.it
Linux User# 167502



More information about the mapserver-users mailing list