Building a web application: postgresql query from html form, show result in openlayer

المشرف العام

Administrator
طاقم الإدارة
I'd like to build a gis application, but I'm stuck a little bit on how to go on. What I want to do:


  • build a sql query from user specifications
  • execute this query on postgis database
  • show the result in openlayers map
So far, i'm able to show sample data on the map by calling a php-script when creating the openlayers map in the html body (map.html):

var vectorLayer = new OpenLayers.Layer.Vector("Address points", { strategies: [new OpenLayers.Strategy.BBOX()], protocol: new OpenLayers.Protocol.HTTP({ url: "http://localhost/geoinfo/test.php", format: new OpenLayers.Format.GeoJSON(), }) }); test.php is creating geojson formatted text from a sql query, which is then shown on the map as a vectorlayer. What I'd like to do now is to create the connection between the user input (html select form, /index.html)

< 50 qm 50 - 80 qm 81 - 130 qm ... and the output (openlayers map, map.html). I already tried to pass the user input via php variables ($_POST["size"]) to test.php, but due to my poor programming skills, I found no way to modify the sql query dynamically in test.php.

I'm glad about any help, thanks a lot!



أكثر...
 
أعلى