[mapserver-users] getAllLayerNames() in PHP/Mapscript

Puneet Kishor pkishor at GeoAnalytics.com
Thu Apr 4 10:35:43 EST 2002


Thanks Chip,

strange...

$layers = $map->getAllLayerNames();


==== following does not work ==========
  for($i=0; $i<=count($layers); $i++) {
    print "$layers[i]<br />";
  }
==== does not work ==========



==== following does work ==========
  foreach ($layers as $v) {
    echo "$v<BR>";
  }
==== does work ==========



what am I missing here...


pk/





> -----Original Message-----
> From: Hankley, Chip [mailto:Chip.Hankley at GASAI.Com]
[snip]
> I ran the following code on a map file and it worked fine...
> 
> <?
> $map = ms_newMapObj("test.map");
> $a = $map->getAllLayerNames();
> 
> foreach ($a as $v) {
>   echo "$v<BR>";
> }
> ?>
> 
> btw... I'm running 3.5 mapscript, php 4.06, win2K w/ IIS.
> 
> Chip
> 
> -----Original Message-----
> From: Puneet Kishor [mailto:pkishor at GeoAnalytics.com]
> Sent: Wednesday, April 03, 2002 7:27 PM
> To: 'mapserver-users at lists.gis.umn.edu'
> Subject: [mapserver-users] getAllLayerNames() in PHP/Mapscript
> 
> 
> $arLayers = mapObj->getAllLayerNames()
> 
> should yield an array of all layer names, no?
> 
> I get an array with the correct number of elements in it... 
> but the elements
> have no value... they are all empty.
> 
> What am I missing?
> 
> pk/
> 



More information about the mapserver-users mailing list