[mapserver-users] getLayer()

Stephen Woodbridge woodbri at swoodbridge.com
Wed May 29 08:16:30 PDT 2002


Manuel,

I had a similar situation on Linux that I resolved by recompiling
everything cleaning. It seems that I had some libraries that were out of
sync.

Also you are on a pretty old version (3.4), I would strongly recommend
upgrading to the released version of 3.5, which will be easier to get
support on.

-Steve

Manuel Marichal Pérez wrote:
> 
>         Hi all. I'm having problems obtaining a layer. In my map, I've got only
>         two layers (one named "gc" and another one named "mun"). I can obtain
>         the name of the first layer doing:
> 
>         <?
>         dl('php_mapscript_34.dll');
> 
>         $path="c:\\inetpub\\wwwroot\\hristo2\\";
>         $map = ms_newMapObj($path."hristo.map");
>         $layer=$map->getLayer(0);                       <<----- The first layer
>         $foo=$layer->name;
>         ?>
> 
>         If I print '$layer->name' I obtain "gc". Good. But if I try to obtain the
> name
>         of the second layer, impredictable results are shown:
> 
>         <?
>         dl('php_mapscript_34.dll');
> 
>         $path="c:\\inetpub\\wwwroot\\hristo2\\";
>         $map = ms_newMapObj($path."hristo.map");
>         $layer=$map->getLayerByName(1);         <<----- Now the second one
>         $foo=$layer->name;
>         ?>
> 
>         If I try this, obtain only "non-printable" characters in '$layer->name'. It
> seems
>         not to have obtain the layer properly. ¿...?.
> 
>         What's the problem???
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com



More information about the MapServer-users mailing list