0

I'd like to create a file upload button and then print the resulting gpx file on the map, could anyone have a look at this code to see where I'm going wrong?

body:

<form action="/action_page.php"> Select a file: <input type="file" id="uploadID"><br><br> <input type="submit"> 

js:

let gpx = document.getElementById('uploadID'); gpx.onchange = function() { new L.GPX(gpx, { async: true, marker_options: { startIconUrl: 'pin-icon-start.png', endIconUrl: 'pin-icon-end.png', shadowUrl: 'pin-shadow.png' } }).on('loaded', function(e) { map.fitBounds(e.target.getBounds()); }).addTo(map); } 
2
  • body: <form action="/action_page.php"> Select a file: <input type="file" id="uploadID"><br><br> <input type="submit"> </form> Commented Nov 25, 2019 at 17:15
  • It might help if you edit your question and tell us what exactly is not working right now. Also, it looks like you're already using some mapping or gpx libraries, but which? Commented Nov 29, 2019 at 7:55

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.