OpenStreetMap Forum

The Free Wiki World Map

You are not logged in.

#1 2018-09-02 08:45:37

Herve_be
Member
From: Belgium
Registered: 2018-09-02
Posts: 7
Website

Display GPX trace on OSM

Hi everybody,
I have been using Google Maps to display about 700 .gpx treaces on map but Google has changed the rules : it does not work anymore.
Exemple : http://www.rudyv.be/MapV1.html?map=140602-LFQJ-LFQV.xml
How can I display my traces on OSM on my own web page ?

Offline

#2 2018-09-02 09:17:11

Sandal man
Member
From: Benissa
Registered: 2016-09-23
Posts: 100

Re: Display GPX trace on OSM


Fervent wandelaar aan de Costa Blanca.

Offline

#3 2018-09-02 09:42:14

Herve_be
Member
From: Belgium
Registered: 2018-09-02
Posts: 7
Website

Re: Display GPX trace on OSM

Thank you for the link where I've found this https://leafletjs.com/examples/quick-start/
Immediately a new question

var mymap = L.map('mapid').setView([51.505, -0.09], 13);

How can I find the center coordinates and the zoom level from my .gpx trace file ?
I'm not a .js specialist !

Offline

#4 2018-09-02 13:17:19

Sandal man
Member
From: Benissa
Registered: 2016-09-23
Posts: 100

Re: Display GPX trace on OSM

You can see them in the url of the map
For Bruxelles
https://www.openstreetmap.org/#map=11/50.8417/4.3293

50.8417, 4.3293  and zoom level is 11

For your gpx file the script     "map.fitBounds(runLayer.getBounds());"  will do the job.


Fervent wandelaar aan de Costa Blanca.

Offline

#5 2018-09-02 15:16:14

Herve_be
Member
From: Belgium
Registered: 2018-09-02
Posts: 7
Website

Re: Display GPX trace on OSM

OK for fitBounds but I'm not a .js specialist.
For the moment I use for instance http://www.rudyv.be/Map.html?map=Vlucht1.xml
Vlucht1.xml is a .gpx file (simply renamed to .xml) containing the to be displayed trace.
How can I display that trace on an OSM map ?

Offline

#6 2018-09-02 19:02:27

Sandal man
Member
From: Benissa
Registered: 2016-09-23
Posts: 100

Re: Display GPX trace on OSM

Upload the gpx file to your website and point leaflet to that file.
You don't have to code anything, just copy it from my website and point it to your gps files.


Fervent wandelaar aan de Costa Blanca.

Offline

#7 2018-09-02 20:59:32

Herve_be
Member
From: Belgium
Registered: 2018-09-02
Posts: 7
Website

Re: Display GPX trace on OSM

Sandal man wrote:

just copy it from my website

I don't think I have the URL of your Website.

Offline

#8 2018-09-02 21:03:02

Sandal man
Member
From: Benissa
Registered: 2016-09-23
Posts: 100

Re: Display GPX trace on OSM

Herve_be wrote:
Sandal man wrote:

just copy it from my website

I don't think I have the URL of your Website.

I send you several e-mails about it??


Fervent wandelaar aan de Costa Blanca.

Offline

#9 2018-09-03 08:02:42

Herve_be
Member
From: Belgium
Registered: 2018-09-02
Posts: 7
Website

Re: Display GPX trace on OSM

Sorry, I thought it was somebody else.
As I told you
ik zal proberen uw script te copiëren, snoien om aleen maar de kaart bewaren
En dan kom ik terug aan jou

Offline

Board footer

Powered by FluxBB