Hi!<br><br>I haven&#39;t got any reaction to my previous mail, so I&#39;m trying to point your attention to my problem again in this follow-up.<br>The problem is: after loading a GML layer the features collection of the layer stays empty (at least for some time), which means that there&#39;s no way to handle those in the loadend-event of the layer. Is there another event, which is raised after the features collection of the loaded layer is initialized? Is there any rational workaround?
<br><br>My next action would be setting up a timer with the setTimeout(...) function and trying to access the features collection after some time interval hoping that the features are finally loaded. However, this seems to be a very hardcoded solution.
<br><br>Cheers,<br>Dmitri Mizerkin<br><br>---------- Forwarded message ----------<br><span class="gmail_quote">From: <b class="gmail_sendername">Dmitri Mizerkin</b> &lt;<a href="mailto:eisberg@gmail.com">eisberg@gmail.com
</a>&gt;<br>Date: 05.07.2007 10:33<br>Subject: Problem with GML features<br>To: <a href="mailto:users@openlayers.org">users@openlayers.org</a><br><br></span>Hello everybody!<br><br>I&#39;m experiencing problems with handling the features of a GML layer, which is loaded when the page is opened. The problem is that after the &#39;loanend&#39; event is raised, the features-property of the layer stays empty for some more time, so there is no way to examine the features in this handler. In my case I need to extract the bounds-properties of the features to construct an common bounds-object for zooming (the action should simulate feature selection and zooming to the selection).
<br><br>Any ideas, how this could work?<br><br>Here&#39;s my code snapshot:<br><br>function SelectFeature() {<br>&nbsp; var layer = GetLayerByName(FEATURE_LAYER); //returns a MapServer layer to send a request on<br>&nbsp; if (layer == null)
<br>&nbsp;&nbsp;&nbsp; return;<br>&nbsp; var selection_url = CreateWFSGetFeatureRequest(layer, FIELD_NAME, FIELD_VALUE); //creates a WFS GetFeature-request<br>&nbsp; if ((selection != null)&amp;&amp;(selection.map != null)) {<br>&nbsp;&nbsp;&nbsp; OLMap.removeLayer

(selection);<br>&nbsp;&nbsp;&nbsp; selection = null;&nbsp; <br>&nbsp; }<br>&nbsp; selection = new OpenLayers.Layer.GML(&quot;Selected Objects&quot;, selection_url);<br>&nbsp; OLMap.addLayer(selection);<br>&nbsp; selection.displayInLayerChooser = false;<br>&nbsp; selection.events.register

(&quot;loadend&quot;, selection, ZoomToSelection);<br>&nbsp; selection.events.triggerEvent(&quot;loadend&quot;);<br>}<br><br>function ZoomToSelection() {<br>&nbsp; var bounds = ComputeSelectionBounds();<br>&nbsp; if (bounds == null)<br>

&nbsp;&nbsp;&nbsp; return;<br>&nbsp; OLMap.zoomToExtent(bounds);<br>}<br clear="all"><br>Thanks in advance!<br><br>-- <br>Regards,<br><span class="sg">Dmitri
</span><br clear="all"><br>-- <br>Gruß,<br>Dmitri