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

Hankley, Chip Chip.Hankley at GASAI.Com
Thu Apr 4 09:40:22 EST 2002


Do you have the NAME value filled in your map file (like below)?

  LAYER
    NAME "OP0"
    DATA o20_scale.tif
    MINSCALE 24600
    STATUS DEFAULT
    OFFSITE 0
    TYPE RASTER
  END

  LAYER 
    NAME "OP1" 
    MAXSCALE 24600
    MINSCALE 9218
    STATUS DEFAULT
    TILEINDEX "tile_test\s10images\o_10scale.shp"
    TILEITEM "Location"
    TYPE RASTER
    OFFSITE 0
  END

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