You are correct.

For information, the second argument to the register method is the
scope. "this" in the callback will reference the object this scope
references. Hope I'm clear enough.

Note that can also use the "on" method:

layer.events.on({
    featuremodified: function(o) {
    },
   scope: your_scope
});

Cheers,

Eric

2008/12/12, Alexandre Dube <ad...@mapgears.com>:
> Hi,
>
>   The onModification function of ModifyControl is deprecated.  How do
> you register a featuremodified instead ?
>
>   I've tried this but oFeature is the layer object instead of a feature :
>
>
> layer.events.register("featuremodified",'', onRoadModification);
>
> function onRoadModification(oFeature) {
>     OpenLayers.Console.log("modified", oFeature.id);
> };
>
>
> I tried ("featuremodified",this.feature, onRoadModification), not
> working either.
>
> this could work, but I'm not sure it's the good way to do it.
> function onRoadModification(object) {
>     oFeature = object.feature;
>     OpenLayers.Console.log("modified", oFeature.id);
> };
>
> The old onModification was called with (object.feature), so I suppose
> the above solution is the good way, but I just want to be sure.
>
> Any hint ?
>
> --
> Alexandre Dubé
> Mapgears
> www.mapgears.com
>
> _______________________________________________
> Users mailing list
> Users@openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to