[OpenLayers-Users] HTTP protocol with featureserver

Alexandre Dube adube at mapgears.com
Wed Dec 10 12:14:52 EST 2008


Hi list,

  I use a sandbox version of OpenLayers ( topp/wfs ).  I'm trying 
featureserver for the first time and having some difficulties with 
transactions ( insert/update/delete ).

  Here's how I define my layer :

        var oSaveStrategy = new OpenLayers.Strategy.Save();
        var szFSURL = szHost+"featureserver/featureserver.cgi";

        olWFSRoads = new OpenLayers.Layer.Vector("Roads - FS", {
            scales: oMap.getScales(8,10),
            styleMap: oStyleMap,
            strategies: [new OpenLayers.Strategy.BBOX(), oSaveStrategy],
            protocol: new OpenLayers.Protocol.HTTP({
                url: szFSURL+"/bdga_route_l_arc?format=GeoJSON",
                format: new OpenLayers.Format.GeoJSON()
            })
        });

    So far the layer displays its features correctly.  I can add and 
save new features, but the fid of the added feature remains null unless 
I refresh the page.

    I can see the "id" value that should be affected to the added 
feature in the response of the request in Firebug.  And after a couple 
of minutes browsing the code, it seems that there's nothing implemented 
yet in Protocol.HTTP to read response its requests.  I've got a lot of 
other issues ( update duplicates instead of modifying, can't delete yet 
) but I'll stick on this one for now, so my question is :

    How can I read this response ?  Is there currently some work for 
this ?  Or, did anybody use FeatureServer in OpenLayers and managed to 
do some transactions ?  Or anybody willing to help me ?

-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Users mailing list