[ms4w-users] drawLegend() Function in MS4W 2.2.6 Mapserver 5.0

Evgeni T. mapserver at mail.ru
Thu Dec 6 10:34:18 EST 2007


Hallo,

I foud out that the php-mapscript method drawLegend() does not work with Layers that have any maxscale setted. So now i'm forced to change the maxscale of each Layer to null in the MapObject so that the layer legend can be constructed.

Here is the sample code of my application:
-------------------------------------------------------------------

$oLayer = $obj->oMap->getlayerbyname("test");
$oLayer->set("status", MS_ON);

// only for MapServer 5.0 
$oLayer->set("maxscale", 0);

$obj->oMap->selectOutputformat("image/png");
$leg=$obj->oMap->drawLegend();
$ret=$leg->saveWebImage(MS_PNG,1,1,0);

---------------------------------------------------------------------
Does anyone have the same problem? And is it a bug or just a new feature of mapserver 5.0? 

Best regards from Iserlohn, Germany

Evgeni T.


More information about the ms4w-users mailing list