MapScript: Turn layers on/off

Michael Anderson m_anderson14 at hotmail.com
Mon Jul 24 17:45:29 PDT 2000


Hello,

I am trying to use MapScript to turn layers on and off and am having no 
luck. I have a feeling the problem may be the order I an doing things, but I 
have tried several combinations with no luck. Here is what I want to do

$map=new MapObj("anymap.map")
$img=$map->draw()
$layer=$map->getLayerByName("layerName")
$layer->draw($map,$img)
mapscript::msSaveImage($img,"image.gif",1,1)

I am using Python, not Perl, so there may be a few errors in the code. I 
don't really know Perl. I have tried using prepareImage before making the 
image, redoing the $map->draw()after turning the layer on, and a few other 
combinations I can't remmeber now. Can someone set me straight?

Tomorrow I am plan to try to add layers to a map using MapScript. Is this 
possible?

Thanks,
Mike


________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com




More information about the MapServer-users mailing list