[Mapserver-users] Problem Selecting a Feature

Lowell Filak lfilak at medinaco.org
Thu Jan 30 09:17:54 EST 2003


It's likely that adding a 'template' for the layer, even if it is bogus, may fix the problem.
HTH
Lowell F.

The following message was sent by "Benjamin Wragg" <bwragg at tpg.com.au> on Wed, 29 Jan 2003 10:00:09 +1030.

> Hi all,
> 
>  
> 
> I have the following layer defined in my map file:
> 
>  
> 
> LAYER
> 
>   CONNECTIONTYPE postgis
> 
>   NAME "testpoints"
> 
>   CONNECTION "user=user password=password dbname=dbname host=localhost"
> 
>   DATA "the_geom from testpoints"
> 
>   STATUS ON
> 
>   TYPE POINT
> 
>   
> 
>   CLASS
> 
>     NAME "All Points"
> 
>     COLOR 0 0 0
> 
>     SIZE 10
> 
>     SYMBOL 2
> 
>   END   
> 
> END
> 
>  
> 
> If I run the following code:
> 
>  
> 
>             $layer=$map->getlayerbyname("aLayer");
> 
> $class=ms_newClassObj($layer);
> 
> $class->set("name", "Selected Feature");
> 
>             $class->setexpression('gid='.$featureGID);
> 
>             $colorId=$map->addColor(255,0,0);
> 
>             $class->set("color", $colorId);
> 
>             $class->set("size", 20);
> 
>             $class->set("symbol", 2);
> 
>             $layer->set("status", MS_ON);
> 
>             $image=$map->draw();
> 
>             $imageURL=$image->saveWebImage(MS_PNG,1,1,0);
> 
>  
> 
> I also generate a legend and replace the images in the browser with the
> newly generated images. The problem is that I can't see the feature on
> the map, but a new class shows up on the legend. What am I missing?
> 
>  
> 
> Thanks,
> 
>  
> 
> Benjamin
> 
> 




More information about the mapserver-users mailing list