Problems with zoomrectangle and MINSCALE with php mapscript

BJSVW PraktiantIn AGI Praktikant.agi at BD.SO.CH
Tue Mar 6 08:07:18 PST 2007


   
   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?
   
   I think if somebody zooms further into the map as minscale allows
   zoomrectangle should deliver the minscale or am I wrong here.
   
   For example: We have an map with a scale of 1:11.000 now we try to
   zoom in by rectangle to a scale like 1:9.000
   This is bigger like the minscale so zoomrectangle gives back the
   minscale 1:10.000 but not 1.14.000.
   
   Here is the example which I made to test zoomrectangle:
   
   <?
   dl("php_mapscript.so-4.8.1");
   $map = ms_newMapObj("path to my mapfile")
   //this extent delivers me a scale which is around 1:10.020
   $map->setextent(619108.26548362,237920.03039802,620891.73451638,23919
   2.80280864);
   $geoext0=ms_newrectObj();
   $geoext0->setextent(619108.26548362,237920.03039802,620891.73451638,2
   39192.80280864);
   $pix_minx = 127;
   $pix_miny = 63;
   $pix_maxx = 551;
   $pix_maxy = 379;
   $pixext = ms_newrectObj();
   $pixext->setextent($pix_minx,$pix_miny,$pix_maxx,$pix_maxy);
   //And now zooming in
   $map->zoomrectangle($pixext, 675, 480, $geoext0);
   $pixext->free();
   $image=$map->draw();
   //And now my scale is somthing around 1:14.000
   echo $map->scale;
   $image_url=$image->saveWebImage(MS_PNG, 0, 0, 0);
   ?>
   
   Maybe somebody can help me if this is the normal behaviour of
   zoomrectangle. Btw I think with zoompoint i have the same problems.
   
   Thanks in advance.
   
   Michael
   
   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20070306/3b5221d8/attachment.htm>


More information about the MapServer-users mailing list