<meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title></title><meta name="GENERATOR" content="OpenOffice.org 3.0 (Win32)"><style type="text/css">
        <!--
                @page { margin: 2cm }
                P { margin-bottom: 0.21cm }
                A:link { so-language: zxx }
        --></style><br><meta http-equiv="CONTENT-TYPE" content="text/html; charset=utf-8"><title></title><meta name="GENERATOR" content="OpenOffice.org 3.0 (Win32)"><style type="text/css">
        <!--
                @page { margin: 2cm }
                P { margin-bottom: 0.21cm }
                A:link { so-language: zxx }
        -->
        </style>
<p style="margin-bottom: 0.5cm;"><font face="Arial, sans-serif"><font size="3">Hi
again, thanks a lot for your response, Andreas.<br>Finally I used the
vector layer's events (featuresadded) with something like:</font></font></p>
<pre><font face="Arial, sans-serif"><font size="3">var vecLayer = new OpenLayers.Layer.Vector("WFS", {</font></font>
<font face="Arial, sans-serif"><font size="3">eventListeners: {</font></font>
<font face="Arial, sans-serif"><font size="3">featuresadded: function() {</font></font>
<font face="Arial, sans-serif"><font size="3">var extent = vecLayer.getDataExtent()</font></font>
<font face="Arial, sans-serif"><font size="3">mapPanelWMS.map.zoomToExtent(extent);</font></font>
<font face="Arial, sans-serif"><font size="3">mapPanelWFS.map.zoomToExtent(extent);</font></font>
<font face="Arial, sans-serif"><font size="3">wms.setVisibility(true);</font></font>
<font face="Arial, sans-serif"><font size="3">}</font></font>
<font face="Arial, sans-serif"><font size="3">}</font></font>
<font face="Arial, sans-serif"><font size="3">});</font></font>
<font face="Arial, sans-serif"><font size="3">I used the example on this page:</font></font>
<font face="Arial, sans-serif"><font size="3"><a href="http://workshops.opengeo.org/geoext/more_ogc/dissect.html">http://workshops.opengeo.org/geoext/more_ogc/dissect.html</a><br><br>Regards.<br></font></font></pre>
<br><div class="gmail_quote">2010/4/19 Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
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.<br>
<br>
Regards,<br>
Andreas.<br>
<div><div></div><div class="h5"><br>
On Apr 19, 2010, at 00:59 , Lluís Peinado wrote:<br>
<br>
> Hi everyone, this is my first message to the list.<br>
> I'm working on an application based on this example:<br>
> <a href="http://dev.geoext.org/trunk/geoext/examples/feature-grid.html" target="_blank">http://dev.geoext.org/trunk/geoext/examples/feature-grid.html</a><br>
><br>
> 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<br>
><br>
> // create vector layer<br>
><br>
> var vecLayer = new OpenLayers.Layer.Vector("vector");<br>
><br>
> map.addLayers([wmsLayer, vecLayer]);<br>
><br>
> // create feature store, binding it to the vector layer<br>
> store = new GeoExt.data.FeatureStore({<br>
> layer: vecLayer,<br>
> fields: [<br>
> {name: 'name', type: 'string'},<br>
> {name: 'elevation', type: 'float'}<br>
> ],<br>
> proxy: new GeoExt.data.ProtocolProxy({<br>
> protocol: new OpenLayers.Protocol.HTTP({<br>
> url: "data/summits.json",<br>
> format: new OpenLayers.Format.GeoJSON()<br>
> })<br>
> }),<br>
> autoLoad: true<br>
> });<br>
><br>
> It really works fine, but when I want to read the vector layer features i can't localize them, things like:<br>
> this.store.layer.features[] has no point features as spected on an OpenLayers vector layer<br>
> I've tried also to look at<br>
> this.mapPanel.map.layers[1].features[]<br>
> but no success, only "remove" method is listed on firebug watcher.<br>
> Is there anyway to access this data?, is just I need to read the point coordinates to center the map and things like that.<br>
><br>
> Thanks a lot for any suggestion.<br>
> Lluís.<br>
><br>
</div></div>> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@geoext.org">Users@geoext.org</a><br>
> <a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
<br>
</font></blockquote></div><br>