[Users] GeoExt.data.FeatureStore and layer features information
Andreas Hocevar
ahocevar at opengeo.org
Mon Apr 19 12:52:37 CEST 2010
Hi,
loading the features is asynchronous. If you want to access the features, you have to wait until they are loaded. The best way to do so is register for the store's load event.
Regards,
Andreas.
On Apr 19, 2010, at 00:59 , Lluís Peinado wrote:
> Hi everyone, this is my first message to the list.
> I'm working on an application based on this example:
> http://dev.geoext.org/trunk/geoext/examples/feature-grid.html
>
> I have a problem using my own application and also debugging the example's code, I create a vector layer and a FeatureStore with this
>
> // create vector layer
>
> var vecLayer = new OpenLayers.Layer.Vector("vector");
>
> map.addLayers([wmsLayer, vecLayer]);
>
> // create feature store, binding it to the vector layer
> store = new GeoExt.data.FeatureStore({
> layer: vecLayer,
> fields: [
> {name: 'name', type: 'string'},
> {name: 'elevation', type: 'float'}
> ],
> proxy: new GeoExt.data.ProtocolProxy({
> protocol: new OpenLayers.Protocol.HTTP({
> url: "data/summits.json",
> format: new OpenLayers.Format.GeoJSON()
> })
> }),
> autoLoad: true
> });
>
> It really works fine, but when I want to read the vector layer features i can't localize them, things like:
> this.store.layer.features[] has no point features as spected on an OpenLayers vector layer
> I've tried also to look at
> this.mapPanel.map.layers[1].features[]
> but no success, only "remove" method is listed on firebug watcher.
> Is there anyway to access this data?, is just I need to read the point coordinates to center the map and things like that.
>
> Thanks a lot for any suggestion.
> Lluís.
>
> _______________________________________________
> Users mailing list
> Users at geoext.org
> http://www.geoext.org/cgi-bin/mailman/listinfo/users
--
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.
More information about the Users
mailing list