attributes, WFS?

Stefanie Weykam sweykam at TELELINE.ES
Wed Oct 12 03:21:47 PDT 2005


Leopold,
Unless the user actually queries a wms or wfs layer, you may use MapScript
and QueryByPoint ().

$pt is your pountObj , the user click-point converted to map coordinates 

if (@$currentLayer->queryByPoint($pt, MS_SINGLE ,0)==MS_SUCCESS)   
{
$result = $currentLayer->getResult(0);
$currentLayer->open();
# get the names of the fields - only needed once per layer
$items = $currentLayer->getitems();   # array with column names
if (!empty($items))     
   {
   foreach($items as $j)
           {
           echo $j;                  # column names
           }
## get the shapeobj - each result has a shape-, tile- and classindex
  $data_shp=$currentLayer->getshape($result->tileindex,$result->shapeindex);

## get the values from the shapeobj                                   
  $data_val = $data_shp->values;      # array values
   }
$currentLayer->close();         
}

best regards,
Stefanie



More information about the MapServer-users mailing list