php_mapscript - showing polygon and point/annotation layers

Mike Reilly mikereilly2 at GMAIL.COM
Wed Aug 24 03:24:14 EDT 2005


Robert:

Thanks for your prompt reply. I'd tried something similar:

/* for($a=0;$a<count($layers);$a++){
echo $layers[$a];
$currentlayer=$mymap->getLayerByName($layers[$a]);
$currentlayer->status=MS_OFF;
echo $currentlayer->status."<br>";
echo
}
*/ 

but for some reason I still got all the layers displayed. I'll give it 
another run and double check tho!

On 8/24/05, robert fritz <robert-fritz at web.de> wrote:
> 
> Hi Mike,
> 
> If you want to draw some specific layers you can try this ::
> 
> 1) Switch off all Layers
> function setAllLayerOff($MapObject)
> { 
> $layers = $MapObject->getAllLayerNames(); 
> for($a=0;$a<count($layers);$a++)
> {
> $tmp = $MapObject->getlayerbyname($layers[$a]);
> $tmp->set("status",0);
> }
> }
> 
> 2) Switch on the layers you want to see in your map
> 
> ....
> $layer_on = $MapObject->getlayerbyname($layername);
> $layer_on->set("status",1); 
> 
> ......
> 
> 
> 3) Draw the map and save it
> 
> $objImage=$objMap->draw();
> $image_url=$objImage->saveWebImage(); 
> 
> 
> Mit der Gruppen-SMS von WEB.DE <http://WEB.DE> FreeMail können Sie eine 
> SMS an alle 
> Freunde gleichzeitig schicken: *http://freemail.web.de/features/?mc=021179
> * <http://freemail.web.de/features/?mc=021179> 
> 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050824/73c47dff/attachment.html


More information about the mapserver-users mailing list