highlight all matching features in CGI-style query

Ken Lord kenlord at GMAIL.COM
Fri Jul 22 13:09:08 PDT 2005


Hi Dylan,
 I do something like what you are asking, with CGI mapserver, it may not be 
right for your needs and may not be the best way, but it may give you some 
ideas.
 You could have a pull down box of the polygon types on your website, some 
javascript passes the selected value from the box to a variable in a hidden 
input in your html form. Make the default value a value that it does not 
occur in your dataset.
 In your mapfile, have an extra layer for that data under the primary layer 
(so that it is drawn on top of the primary layer on the map), with a filter 
item whose value is the variable in your form input ... FILTER %polytype% or 
whatever. With a class that will show your selected polygons highlights 
however you want.
 You may need to set the hidden input value in your HTML form to your 
variable to keep your selection highlighted as you pan/zoom: 
 <input type='hidden' name='polytype' value='[polytype]'> 
 and if you have an entry page to your website that sets up the initial map 
parameters, you should assign the default value there:
 <input type='hidden' name='polytype' value='XXXX'> 
 In our case, we are using a Flash interface to keep track of everything, so 
the 'instancing' isn't a problem, and the variable goes into a WHERE clause 
in an SQL query in our layer's DATA parameter, accessing the spatial data 
from PostGIS.
 Cheers,
Ken Lord
Vancouver BC
      

 On 7/22/05, Dylan Beaudette <dylan at iici.no-ip.org> wrote: 
> 
> Greetings,
> 
> just wondering if it is possible to highlight all matching occurrences of 
> a
> given polygon type after a user has queried a single polygon.
> 
> for example, there are 5 polygons on the screen, the user clicks on 
> poylgon
> type 1. A querymap image is returned with polygon 1 highlighted. Would it 
> be
> possible for a similar operation to highlight all polygons of type 1 in 
> the
> returned querymap image? ... or would this require mapscript... ?
> 
> 
> thanks in advance!
> 
> --
> Dylan Beaudette
> Soils and Biogeochemistry Graduate Group
> University of California at Davis
> 530.754.7341
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050722/1a75abd8/attachment.htm>


More information about the MapServer-users mailing list