[mapserver-users] Mapserver queries for line layer

Steve Lime Steve.Lime at dnr.state.mn.us
Tue Jan 13 13:20:27 PST 2009


Here's an example that uses OpenLayers with a hover event to fire queries off to MapServer:

  http://www.dnr.state.mn.us/waters/csg/index_copy.html 

The relevant javascript is at:

  http://maps.dnr.state.mn.us/waters/csg/current_test.js 

When ever the user pauses the app fires a query off to MapServer. In this case I'm querying points
but the same code would work for lines. If the query fails (e.g. nothing found) I use the webObj
EMPTY parameter to return content that just contains a -1. If it succeeds, templated query results
are passed back and displayed. In this case I'm using an Ext.js window but you could just as easily
update a div or use another popup library.

Hope it helps...

Steve

>>> On 1/12/2009 at 4:01 AM, in message <496B1512.8000805 at gslab.com>, Subha
Ramakrishnan <subha at gslab.com> wrote:
> Hi All,
> 
> I using Mapserver 5.0.2 and Openlayers. I had posted a query before on 
> how to show pop up for a line layer.
> 
> I am trying to use the mapserver queries for the same. I find 
> documentation that uses a shapefile for the data and use variables from 
> that on the template file. But all the data I've is in a postgresql DB.
> 
> Can someone please give me an example as to how to query DB for the 
> features' details and show it on the map as a pop up?
> And is there anything on Openlayers side that I've to do to enable this 
> mapserver queries?( like sending a request to fetch a map)
> 
> Thanks a lot for the help.
> 
> Regards,
> Subha
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org 
> http://lists.osgeo.org/mailman/listinfo/mapserver-users




More information about the MapServer-users mailing list