开发者

saving user input to a postgis table strategy

开发者 https://www.devze.com 2023-03-02 04:36 出处:网络
I have openlayers, geoserve开发者_StackOverflowr and postgis/postgres working quite nicely.I\'m trying to create an app that allows a user to add a point to a map.After the point is created, I need a

I have openlayers, geoserve开发者_StackOverflowr and postgis/postgres working quite nicely. I'm trying to create an app that allows a user to add a point to a map. After the point is created, I need a popup form to show with various controls that allows the user to input info about the location the point has been added to.

With postgis, do I create a seperate table to hold the user input based on the p key of the added point? Seems like a good idea to me, but I noticed the featureadded event of openlayers is triggered before the point is added to the database. Can I use geoserver to handle saving the user input, or do I need to create my own module to handle user input?


'featureadded' event in OpenLayers is totally client-side that occurs when you add feature to a vector layer. It has no idea whether you save feature to the database or not.

Why don't you do it like this:

  1. User adds point to a map.
  2. On 'featureadded' event you show a popup with input fields and 'Save' button
  3. When user clicks 'Save' you save both point and input data using OpenLayers.Strategy.Save() via WFS-T
0

精彩评论

暂无评论...
验证码 换一张
取 消