I have followed the example to setup a WFS Transaction successfully:
My environment is GeoServer 2.6.1/OpenLayers 2.12.1. I do get the 4 toolbar icons on the upper right hand corner. (draw, modify, delete, save). I used a layer that is connected to an oracle table in geoserver as the editable layer.
Now, when I click on the "save" button, it does not add a record to that table. Of course, I was not expecting it to because it does not even know what key value I want to put in (as customerid) when it creates a new record with feature data; nor does it know which record to update the geometry for it its an existing key value (customerid). The editable layer I created based on the above link is:
// Customers Editable VECTOR Layer
var saveStrategy = new OpenLayers.Strategy.Save();
customers = new OpenLayers.Layer.Vector("Customers", {
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],
projection: new OpenLayers.Projection("EPSG:2236"),
protocol: new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:2236",
url: "http://pc74535:8085/geoserver/sf/wfs",
featurePrefix: "sf",
featureType: "customers",
geometryName: "GEOMETRY"
})
});
The oracle table itself has the following fields:
-customerId
-geometry
-date_updated
My question is, how do I perform inserts through openlayers/geoserver/all the way to the oracle table. (To included key value and geometry, etc) I would like the above example to actually save the geometry back to a specific record in the table. I am not sure how to proceed on this.
Aucun commentaire:
Enregistrer un commentaire