Betr.: [mapserver-users] Query from a text string

Emil Zegers EZS at destraat.nl
Wed Nov 27 09:08:01 EST 2002


Hello Ben,

This is only a workaround, not a real solution but maybe worth to give
a try:

Create an extra file (dbf, table in your db) or field in your shapefile
dbf containing the centerpoints of the polygons, query this file with
the label and use the output to create the request to send to
mapserver.

Disadvantages:
- points have to be updated separately when shapefile changes
- points have to be in the polygon so manually editing of centerpoints
might be required (or just use a script that creates a point in a
polygon)
- labels have to be unique

Best regards,

Emil Zegers




>>> "Ben Stewart" <stewartjb at agr.gc.ca> 11/27 1:51  >>>
Hello:

I am building a prototype for an application which highlights a polygon
on a map, then downloads data from a remote URL.  The user clicks the
map, and a download box pops up with the highlighted polygon on the map
behind it.

The query is very straight forward.  The querymap displays, and a
function retrieves the polygon label, in a CGI variable from the
shapefile.  It uses java  script to download an indexed dbase file with
the same name as the label, from a remote URL.   

As a final step, I now want to take input from a text box and achieve
the same functionality as I do when clicking on the map.   Retrieving
the ZIP file, is no problem,  but as yet I am not able to bring up the
query map.  Can anyone suggest on how I might go about doing this?  I
notice that in a query string, the coordinates of a mouse click are
usually passed to mapserver.  If I'm querying from a text string, I
can't provide the coordinates of a click.  I can only provide the label,
which as I mentioned is an attribute for that polygon.

Template and Mapfile are provided below if it would help you to look at
them, but I am just looking for some direction.
Thank you, very much for your assistance.

______________________________________________________

 This message has been checked for all known viruses
______________________________________________________



More information about the mapserver-users mailing list