[OpenLayers-Users] Trying to query a database with attribute obtained from a mouse click

Jay Douillard jay.douillard at ubc.ca
Tue Aug 11 14:26:34 EDT 2009


Glenn,
This should get you started: http://trac.openlayers.org/wiki/GetFeatureInfo
Jay

----- Original Message -----
From: "Glenn Rowe" <growe at lancova.com>
To: users at openlayers.org
Sent: Tuesday, August 11, 2009 8:12:06 AM GMT -08:00 US/Canada Pacific
Subject: [OpenLayers-Users] Trying to query a database with attribute obtained from a mouse click

I'm looking for the simplest possible solution to a problem I'm having 
with a mapping project. I'm still struggling to figure out OpenLayers, 
so bear with me.

I have a map with 3 base layers and 2 transparent overlays, all 
generated from shapefiles that are produced and maintained in-house. 
This project is for a county government web site and the layers depict 
roads, parcels, town boundaries and such. I've been able to display the 
map on a web page using either OpenLayers.Layer.MapServer or 
OpenLayers.Layer.WMS (through the mapserv cgi). I can zoom in, zoom out, 
pan and I can switch layers on and off.

In order to make this project functional for the intended end users, I 
need to be able to "grab" the value of a single attribute of the parcels 
layer by clicking on a particular parcel polygon, send that value to a 
MySQL database query to obtain additional parcel data and then return 
the results to another area of the web page.

The parcels layer is one of the transparent overlays if that makes any 
difference.

I've already got a database query that works by entering an owner name 
or parcel ID number into an HTML form, but I need to be able to get a 
parcel ID number from the map into the database query by clicking on the 
map. Like I said before, I'm looking for the simplest approach possible. 
Any help would be appreciated.

-- 
Glenn D. Rowe
Director of General Services
Lancaster County, Virginia

_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users



More information about the Users mailing list