[OpenLayers-Users] catch the safe.success event

Eric Lemoine eric.lemoine at camptocamp.com
Fri Sep 18 11:44:03 EDT 2009


On Wed, Sep 16, 2009 at 10:47 AM, Marco Scheuble <mail at marco-scheuble.de> wrote:
>
> Hi list,
>
> I'm having troubles with catching the success event, when saving a wfs
> layer.
> Saving and everything works fine, but I don't know, how to register/catch
> this event!
>
> here is some code:
>
> saveStrategy = new OpenLayers.Strategy.Save();
>
> var poly  = new OpenLayers.Layer.Vector( 'Flächen', {
>        strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy ],
>        projection: gk,
>        styleMap: styles,
>        protocol: new OpenLayers.Protocol.WFS({
>                version: '1.1.0',
>                srsName: 'EPSG:31467',
>                url: '/geoserver/wfs',
>                featureNS :  'http://www.openplans.org/topp',
>                featureType: 'poly',
>                geometryName: 'the_geom'})
>        });
>
> and now there must be s.th. like this:
>
> ??.events.on({"success": message})
> function message(event){...}
>
> but i don't know what exactly to write

saveStrategy.events.on({
   success: function(evt) {
       var response = evt.response;
       var features = response.features;
   }
});

Hope this helps,

-- 
Eric Lemoine

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac, Cedex

Tel : 00 33 4 79 44 44 96
Mail : eric.lemoine at camptocamp.com
http://www.camptocamp.com



More information about the Users mailing list