Hi Andreas,<br><br>thanks for your help.<br><br>I hope I changed my file right, but unfortunately its not working:<br><br><a href="http://mybestprojects.com/data/test5/test5.html">http://mybestprojects.com/data/test5/test5.html</a><br>

<br>Also I have no clue how to implement Format.GPX::read<br>There are no results of anybody using it  when googling for it. <br>Can&#39;t be can it?<br><br>Jan<br><br><div class="gmail_quote">On Thu, Jun 11, 2009 at 6:07 PM, Andreas Hocevar <span dir="ltr">&lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">Hi Jan,<br>
<br>
one more thing that came to my mind: are you aware that you are<br>
working with two layers here? From what you wrote, it seems you think<br>
that you have one layer lgpx. But in fact you have two, you just use<br>
the same variable for both.<br>
<br>
You could also solve your problem with just one layer, but then you<br>
would have to use Format.GPX::read to get the features from both urls.<br>
You would also have to take care to style the features properly (red<br>
from one url, green from the other).<br>
<br>
I guess the way you chose is simpler, you just have to be aware that<br>
you are working with two layers.<br>
<br>
Regards,<br>
Andreas.<br>
<br>
On Thu, Jun 11, 2009 at 5:55 PM, Andreas Hocevar&lt;<a href="mailto:ahocevar@opengeo.org">ahocevar@opengeo.org</a>&gt; wrote:<br>
&gt; Hi Jan,<br>
&gt;<br>
&gt; On Thu, Jun 11, 2009 at 5:20 PM, Jan Martin&lt;<a href="mailto:janmartin3@googlemail.com">janmartin3@googlemail.com</a>&gt; wrote:<br>
&gt;&gt; Hi all,<br>
&gt;&gt;<br>
&gt;&gt; right now getDataExtent() only considers the data added LAST (red).<br>
&gt;&gt; But I need the map to zoom in on ALL data in lgpx (green AND red).<br>
&gt;&gt;<br>
&gt;&gt; What&#39;s my error?<br>
&gt;<br>
&gt; you need to take into account the dataExtent of both layers:<br>
&gt;<br>
&gt; var dataExtent;<br>
&gt; var setExtent = function() {<br>
&gt;   dataExtent = dataExtent ? this.getDataExtent() :<br>
&gt; this.getDataExtent().extend(dataExtent);<br>
&gt;   map.zoomToExtent(dataExtent);<br>
&gt; }<br>
&gt; lgpx = new OpenLayers.Layer.GML<br>
&gt; (&quot;green&quot;,&quot;separated/20090607172151.gpx&quot;,{<br>
&gt;     projection: new  OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>
&gt;     style: {strokeColor: &quot;green&quot;, strokeWidth: 5, strokeOpacity: 0.8},<br>
&gt;     format: OpenLayers.Format.GPX,});<br>
&gt; lgpx.events.register(&quot;loadend&quot;, lgpx, setExtent);<br>
&gt; map.addLayer(lgpx);<br>
&gt; lgpx = new OpenLayers.Layer.GML<br>
&gt; (&quot;red&quot;,&quot;separated/20090607110550.gpx&quot;,{<br>
&gt;    projection: new  OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>
&gt;     style: {strokeColor: &quot;red&quot;, strokeWidth: 5, strokeOpacity: 0.8},<br>
&gt;     format: OpenLayers.Format.GPX,});<br>
&gt; lgpx.events.register(&quot;loadend&quot;, lgpx, setExtent);<br>
&gt; map.addLayer(lgpx);<br>
&gt;<br>
&gt; Regards,<br>
&gt; Andreas.<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>
</div></div><div><div></div><div class="h5">_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
</div></div></blockquote></div><br>