[OpenLayers-Users] registering featuremodified

Eric Lemoine eric.lemoine at camptocamp.com
Wed Dec 9 02:39:20 EST 2009


On Wed, Dec 9, 2009 at 8:20 AM, Adorian Ardelean <mynature at gmail.com> wrote:
> Hi,
>
> I am trying to register a "featuremodified" event to a vector layers
> containing a feature built from a GeoJSON file.
>
> For registering event, I have used both methods below:
>
> trails.events.register('featuremodified', '',serialize);
> or
> trails.events.on({featuremodified:
> function(feature){alert(feature.id)}});
>
>
> serialize = function (feature)
> {
>    alert(feature.id);
> }
>
> In both cases I receive an "undefined" in message box.
>
> Could somebody guide me on how this event should be registered so that I
> can get access to feature data?

try:

var serialize = function(e) {
    alert(e.feature.id);
};

Cheers,

-- 
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