[OpenLayers-Users] HTTP protocol with featureserver

Alexandre Dube adube at mapgears.com
Wed Dec 10 14:16:56 EST 2008


Hi list,

  I've just tried the other 2 possibles formats that supports 
Input&Output within FeatureServer : KML and GeoRSS.  They are also 
displaying features, but they both have an annoying problem : their 
feature's attributes.  Instead of having attributes in a hash ( key is 
attribute name, value the value), they are in a "description" element, 
all put together in one big HTML string.

  Because of that, theses 2 formats are pretty useless ( can't style 
them by attribute value, can't directly access an attribute ) so I'm 
sticked with the GeoJSON format.  Any hint about my first questions from 
my first e-mail ?

Many thanks in advance,

Alexandre

Alexandre Dube wrote:
> 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