Yes I did,<br><br>it's as frustrating as all the examples at <a href="http://openlayers.org/dev/examples">http://openlayers.org/dev/examples</a><br><br>All the lat, lon and zoom are always hardcoded. Not dynamic as I need it.<br>
So not helpfull. <br><br>Please find a screenshot of what I did using shell and perl scripts I wrote today and gpsbabel:<br><br>From thousands of lines like this:<br>1244296533 1 8.664075 49.993945 172.012836<br>
<br>to this:<br><a href="http://mybestprojects.com/data/test3/Skytraq-Venus_6-GPS_tracks.png">http://mybestprojects.com/data/test3/Skytraq-Venus_6-GPS_tracks.png</a><br><br>Nice eh?<br>Now how to make this zoom working?<br>
<br>Jan<br><br><div class="gmail_quote">On Mon, Jun 8, 2009 at 11:32 PM, Vivien Deparday <span dir="ltr"><<a href="mailto:vivien.deparday@gmail.com">vivien.deparday@gmail.com</a>></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;">
Did you have a look at this: <a href="http://wiki.openstreetmap.org/wiki/Openlayers_Track_example" target="_blank">http://wiki.openstreetmap.org/wiki/Openlayers_Track_example</a><br>
<br>
Cheers,<br>
<br>
Vivien<br>
<br>
<br>
Jan Martin 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 class="im">
Hi Arndt,<br>
<br>
OK, I should have told that the code is borrowed from<br>
<a href="http://oms.wff.ch/ol_track.htm" target="_blank">http://oms.wff.ch/ol_track.htm</a> and <a href="http://nuug.no/kart.shtml" target="_blank">http://nuug.no/kart.shtml</a><br>
<br>
So I cleaned up the file and also got rid of GPX.js as well as Ajax.js.<br>
Still doesn't work. No zoom, not even a track anymore.<br>
Firebug reports: bounds is null<br>
<br>
Check it out:<br>
<a href="http://mybestprojects.com/data/test3/tracks_layers.html" target="_blank">http://mybestprojects.com/data/test3/tracks_layers.html</a><br>
<br>
Thanks,<br>
Jan<br>
<br></div><div class="im">
On Mon, Jun 8, 2009 at 9:21 PM, Arnd Wippermann <<a href="mailto:arnd.wippermann@web.de" target="_blank">arnd.wippermann@web.de</a> <mailto:<a href="mailto:arnd.wippermann@web.de" target="_blank">arnd.wippermann@web.de</a>>> wrote:<br>
<br>
Hi Jan,<br>
It seems, that your code GPX.js (OpenLayers.Layer.GPX) miss<br>
something like<br>
this.events.triggerEvent("loadend");<br>
you should have mentioned, that you use own code for<br>
OpenLayers.Layer.GPX.<br>
Arnd<br>
------------------------------------------------------------------------<br>
*Von:* <a href="mailto:users-bounces@openlayers.org" target="_blank">users-bounces@openlayers.org</a><br>
<mailto:<a href="mailto:users-bounces@openlayers.org" target="_blank">users-bounces@openlayers.org</a>><br>
[mailto:<a href="mailto:users-bounces@openlayers.org" target="_blank">users-bounces@openlayers.org</a><br>
<mailto:<a href="mailto:users-bounces@openlayers.org" target="_blank">users-bounces@openlayers.org</a>>] *Im Auftrag von *Jan Martin<br>
*Gesendet:* Montag, 8. Juni 2009 19:15<br>
*An:* Vivien Deparday<br></div>
*Cc:* <a href="mailto:users@openlayers.org" target="_blank">users@openlayers.org</a> <mailto:<a href="mailto:users@openlayers.org" target="_blank">users@openlayers.org</a>><div class="im"><br>
*Betreff:* Re: [OpenLayers-Users] Going nuts: getDataExtent<br>
<br>
Hi Vivien,<br>
hi all,<br>
<br>
unfortunately it did not work.<br>
<br>
Changed file here:<br>
<a href="http://mybestprojects.com/data/test2/tracks_layers.html" target="_blank">http://mybestprojects.com/data/test2/tracks_layers.html</a><br>
<br>
I also would prefer the "try to register the same function but<br>
before adding the layer" method, and NOT "within the constructor".<br>
<br>
Thanks,<br>
Jan<br>
<br>
On Mon, Jun 8, 2009 at 5:47 PM, Vivien Deparday<br></div><div><div></div><div class="h5">
<<a href="mailto:vivien.deparday@gmail.com" target="_blank">vivien.deparday@gmail.com</a> <mailto:<a href="mailto:vivien.deparday@gmail.com" target="_blank">vivien.deparday@gmail.com</a>>> wrote:<br>
<br>
I think it's because you register your function on the event<br>
loadend but the layer is already added and the event loadend<br>
has already been fired. So, try to register the same function<br>
but before adding the layer. You can even do it within the<br>
constructor with the option eventListeners. I guess it would<br>
look like something like this but I'm not sure as I never used<br>
the gpx format.<br>
<br>
var lgpx = new OpenLayers.Layer.GPX("20090606175533.gpx",<br>
"separated/20090606175533.gpx", "#FF0000",{eventListeners:<br>
{'loadend': function(){this.zoomToExtent(lgpx.getDataExtent())<br>
}}});<br>
<br>
Let me know if it helps.<br>
<br>
Vivien Deparday<br>
<br>
Jan Martin wrote:<br>
<br>
Hi all,<br>
<br>
I am going nuts over not beeing able to figure out how to<br>
make getDataExtent work for me.<br>
<br>
This is my page NOT working yet:<br>
<a href="http://mybestprojects.com/data/test/tracks_layers.html" target="_blank">http://mybestprojects.com/data/test/tracks_layers.html</a><br>
<br>
I try to model after<br>
<a href="http://oms.wff.ch/ol_track.htm" target="_blank">http://oms.wff.ch/ol_track.htm</a> (tracks work fine, just<br>
zoom in on the red point manually.)<br>
and<br>
<a href="http://nuug.no/kart.shtml" target="_blank">http://nuug.no/kart.shtml</a> (automatic zoom by getDataExtent<br>
not working for me.)<br>
<br>
Code in question might be:<br>
if( ! map.getCenter() ){<br>
lgpx.events.register('loadend', map,<br>
function(){this.zoomToExtent(lgpx.getDataExtent())});<br>
map.setCenter(null, null);<br>
<br>
<br>
}<br>
or check out whole page source at<br>
<a href="http://mybestprojects.com/data/test/tracks_layers.html" target="_blank">http://mybestprojects.com/data/test/tracks_layers.html</a><br>
<br>
What's wrong?<br>
<br>
Thanks,<br>
Jan<br>
<br>
<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Users mailing list<br></div></div>
<a href="mailto:Users@openlayers.org" target="_blank">Users@openlayers.org</a> <mailto:<a href="mailto:Users@openlayers.org" target="_blank">Users@openlayers.org</a>><div class="im"><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br>
<br>
<br>
<br>
------------------------------------------------------------------------<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@openlayers.org" target="_blank">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br>
</div></blockquote>
<br>
</blockquote></div><br>