[Users] FeatureStore/Layer synch?
Eric Lemoine
eric.lemoine at camptocamp.com
Sat Nov 28 10:44:50 CET 2009
On Friday, November 27, 2009, White, Gary D. [OS-US]
<GARY.D.WHITE at saic.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
>
> I’m a total newbie to GeoExt/OpenLayers/ExtJS and am
> trying to understand the relationship (if any) between OpenLayers.Feature.Vector.attributes
> and GeoExt.data.FeatureRecord.fields.
>
>
>
> I’ve added a point-drawing GeoExt.Action to the map in
> the http://dev.geoext.org/trunk/geoext/examples/feature-grid.html
> example with the following snippet:
>
>
>
> action = new GeoExt.Action({
>
> text: "draw
> point",
>
> control: new
> OpenLayers.Control.DrawFeature(
>
>
> vecLayer, OpenLayers.Handler.Point,
>
>
> {
>
>
> eventListeners: {
>
>
> featureadded: function(evt) {
>
>
> //evt.feature.attributes.long = evt.feature.geometry.x;
>
>
> //evt.feature.attributes.lat = evt.feature.geometry.y;
after setting attributes try triggering a featuremodified event with:
vecLayer.events.triggerEvent("featuremodified", {feature: evt.feature});
this event should be caught by the feature store, which, as a result,
will update the corresponding record's data.
--
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