Hello,<br><br>the workaround suggested by Tim will do it, because I want to zoom to a single feature at this time.<br>Thanks for the help, guys!<br><br>Cheers,<br>Dmitri<br><br><div><span class="gmail_quote">2007/7/6, Erik Uzureau <
<a href="mailto:erik.uzureau@metacarta.com">erik.uzureau@metacarta.com</a>>:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">I would note that the work that I'm doing in my untiled3 branch could
<br>be helpful for this.<br><br>The problem is that WFS layer is no longer subclassed off of grid. I<br>think this is a mistake, but so be it.<br><br>At the very least, the work with sending loadStart and loadEnd events<br>
can be a good model.<br><br>--erik<br><br><br>On 7/6/07, Tim Schaub <<a href="mailto:noreply@geocartic.com">noreply@geocartic.com</a>> wrote:<br>> Hey Dmitri-<br>><br>> Dmitri Mizerkin wrote:<br>> > Hi!
<br>> ><br>> > I haven't got any reaction to my previous mail, so I'm trying to point<br>> > your attention to my problem again in this follow-up.<br>> > The problem is: after loading a GML layer the features collection of the
<br>> > layer stays empty (at least for some time), which means that there's no<br>> > way to handle those in the loadend-event of the layer. Is there another<br>> > event, which is raised after the features collection of the loaded layer
<br>> > is initialized? Is there any rational workaround?<br>><br>> You're right. There is no good way to do what you want right now. I<br>> assume you're talking about the WFS layer in vector mode (as opposed to
<br>> marker mode). When the tile for this layer is drawn a WFS request is<br>> made asynchronously - when this request returns, the GML is parsed and<br>> added to your layer. As each feature is added to your layer, the
<br>> optional onFeatureInsert property of your layer (a function) is called.<br>> This is not handy if you want to know when the features are done being<br>> added.<br>><br>> I thought there was a ticket out there already for this. I'll check -
<br>> and add one if not.<br>><br>> I'm hoping to do some work on the WFS layer in the near future. This<br>> and other issues will likely get addressed then.<br>><br>> Tim<br>><br>><br>> >
<br>> > Cheers,<br>> > Dmitri Mizerkin<br>> ><br>> > ---------- Forwarded message ----------<br>> > From: *Dmitri Mizerkin* <<a href="mailto:eisberg@gmail.com">eisberg@gmail.com</a> <mailto:
<a href="mailto:eisberg@gmail.com">eisberg@gmail.com</a>>><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> <mailto:<a href="mailto:users@openlayers.org">users@openlayers.org</a>><br>> ><br>> > Hello everybody!<br>> ><br>> > I'm experiencing problems with handling the features of a GML layer,
<br>> > which is loaded when the page is opened. The problem is that after the<br>> > 'loanend' event is raised, the features-property of the layer stays<br>> > empty for some more time, so there is no way to examine the features in
<br>> > this handler. In my case I need to extract the bounds-properties of the<br>> > features to construct an common bounds-object for zooming (the action<br>> > should simulate feature selection and zooming to the selection).
<br>> ><br>> > Any ideas, how this could work?<br>> ><br>> > Here's my code snapshot:<br>> ><br>> > function SelectFeature() {<br>> > var layer = GetLayerByName(FEATURE_LAYER); //returns a MapServer layer
<br>> > to send a request on<br>> > if (layer == null)<br>> > return;<br>> > var selection_url = CreateWFSGetFeatureRequest(layer, FIELD_NAME,<br>> > FIELD_VALUE); //creates a WFS GetFeature-request
<br>> > if ((selection != null)&&(selection.map != null)) {<br>> > OLMap.removeLayer (selection);<br>> > selection = null;<br>> > }<br>> > selection = new OpenLayers.Layer.GML
("Selected Objects", selection_url);<br>> > OLMap.addLayer(selection);<br>> > selection.displayInLayerChooser = false;<br>> > selection.events.register ("loadend", selection, ZoomToSelection);
<br>> > selection.events.triggerEvent("loadend");<br>> > }<br>> ><br>> > function ZoomToSelection() {<br>> > var bounds = ComputeSelectionBounds();<br>> > if (bounds == null)
<br>> > return;<br>> > OLMap.zoomToExtent(bounds);<br>> > }<br>> ><br>> > Thanks in advance!<br>> ><br>> > --<br>> > Regards,<br>> > Dmitri<br>> ><br>> > --
<br>> > Gruß,<br>> > Dmitri<br>> ><br>> ><br>> > ------------------------------------------------------------------------<br>> ><br>> > _______________________________________________
<br>> > Users mailing list<br>> > <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>> > <a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users
</a><br>><br>> _______________________________________________<br>> Users mailing list<br>> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>> <a href="http://openlayers.org/mailman/listinfo/users">
http://openlayers.org/mailman/listinfo/users</a><br>><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br><a href="http://openlayers.org/mailman/listinfo/users">
http://openlayers.org/mailman/listinfo/users</a><br></blockquote></div><br>