[OpenLayers-Users] WFS-T without geometry

aho forum.email.a at googlemail.com
Fri Dec 14 01:10:14 PST 2012


Hello all,

I was wondering how I can manage the tables without geometry openLayers.
I actually created a WFS-Protocol and this is working fine - I get my 
features... But the layer remains empty. I need to delete, insert and 
update features - so far I havn´t found how I could achieve that with 
the protocol. Here is my testing code so far:

var saveStrategy = new OpenLayers.Strategy.Save();
saveStrategy.events.register("success", '', this.showSuccessMsg);
saveStrategy.events.register("fail", '', this.showFailureMsg);

var equalFilter = new OpenLayers.Filter.Comparison({
type: OpenLayers.Filter.Comparison.EQUAL_TO,
property: "id",
value: this.currentId
});

protocol = new OpenLayers.Protocol.WFS({
version: "1.1.0",
srsName: "EPSG:900913",
url: "/cgi-bin/",
featureNS : "www.something.de/else",
featurePrefix: "prefix",
featureType: "feature_type",
filter: equalFilter,
geometryName: ""
});

protocol.read(
{
callback: function(response){
if(response.success()){
for(var i = 0; i < response.features.length; i++)
{
... do something here
}
}
else
{
console.log('error');
}
}
})

var layer= new OpenLayers.Layer.Vector("test_layer", {
strategies: saveStrategy,
protocol: protocol
});


Thanks in advance!!




More information about the Users mailing list