I'm new to Extjs4.2/OL/Geoext2 developing, and I'm confused about how it should work.
--- edit ---
I'm trying to write a small app to read GeoJSON, place read features on the map, let the user to edit them / draw new ones, and finally save them back to GeoJSON.
My current approach: OpenLayers.Layer.Vector is bound to Geoext.data.FeatureStore. Layer reads GeoJSON, and FeatureStore is populated.
And now my question - how to save the modified by user data to GeoJSON? I can save the data as JSON by FeatureStore, but I don't see an easy way to make FetureStore save GeoJSON. Should I use vector layer to save GeoJSON, or try to add some type of conversion to add geometry attributes of the features to FeatureStore, and then sync() the store?
--- edit ---
Already done this by inserting another attribute to the model:
{
name: 'geom',
convert: function(value, record) {
return record.raw.geometry.toString();
}
}
Now my FeatureStore saves GeoJSON-like output with geometry, which is ok for me.
Question: Is it the right way to do this?
Regards, Pawel