[Mapserver-users] multiple queries, hilite in different color

Lowell Filak lfilak at medinaco.org
Mon Feb 2 15:50:13 EST 2004


If I am understanding your question correctly there is an alternate way.
Instead of using the queryMapObj you can change the data value for
existing/created layers and use the objects in the query result as the
data item and then use the mapObj.
With each layer having it's own symbolization the result is more
customizable.

Lowell

The following message was sent by "Nikolai Vladychevski"
<niko at isl.net.mx> on Mon, 02 Feb 2004 16:20:58 GMT.

> Hi, 
> 
> I want to select each found item on a layer with different color. This
> problem is due to when quering multiple layers the 'state' layer hilites
> with the same color that found points or lines on other layers and the
> result (at close views) is all shown in one color , the user can't
> distinguish anything. 
> 
> This is my code: 
> 
> if ($mode eq "nquery" || $mode eq "query") {
>   my $queryPt=new mapscript::pointObj();
>   my ($x,$y)=&click2map($map,$xclick,$yclick,$imgext_obj);
>   $queryPt->{x}=$x; $queryPt->{y}=$y;
>   $map->prepareQuery();
>   if ($mode eq "nquery") {
>       my $layer=$map->getLayerByName("regiones");
>       $layer->{status}=$mapscript::MS_OFF;
>       my $layer=$map->getLayerByName("estados");
>       $layer->{status}=$mapscript::MS_OFF;
>       my $layer=$map->getLayerByName("municipios");
>       $layer->{status}=$mapscript::MS_OFF;
>       $res=$map->queryByPoint($queryPt,$mapscript::MS_MULTIPLE,0);
>   } else {
>       $res=$map->queryByPoint($queryPt,$mapscript::MS_SINGLE,0);
>   }
>   for (my $lidx=0;$lidx< $map->{numlayers};$lidx++) {
>       my $l=$map->getLayer($lidx);
>       print "layer $l->{name} has $l->{resultcache}->{numresults}
> results<br>";
>       my $result=$l->getResult(0);
>       .... and display results 
> 
> The layers "regiones", "estados" and "municipios" are polygons, wich I
want
> to be hilited in some other color than other layers. How can this be done?
> Right now I am turning them off. 
> 
> I have been thinking, if queryMapObj would be related to layer, I could
> change the color of the found items, but since it is not possible, I
need to
> query each group of layers separately and find a way to merge 2 images
> resulted from each query. 
> 
> Any ideas? 
> 
> Thanks in advance
> Nikolai 
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users




More information about the mapserver-users mailing list