Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
60 lines (51 sloc) 1.78 KB
<div id="map" class="w-full h-full flex-grow"></div>
<script src='https://api.mapbox.com/mapbox.js/v3.0.1/mapbox.js'></script>
<link href='https://api.mapbox.com/mapbox.js/v3.0.1/mapbox.css' rel='stylesheet' />
<script src='https://api.mapbox.com/mapbox.js/plugins/leaflet-omnivore/v0.2.0/leaflet-omnivore.min.js'></script>
<script>
L.mapbox.accessToken = 'pk.eyJ1IjoidGhpYmF1ZGRhdWNlIiwiYSI6ImNqMHdpNXNiYjAwMTkzMm1vbWpwb2p6czkifQ.bxPv6_pQ9eucWIDMdyBygg';
var map = L.mapbox.map('map', 'mapbox.streets');
// omnivore will AJAX-request this file behind the scenes and parse it:
// note that there are considerations:
// - The file must either be on the same domain as the page that requests it,
// or both the server it is requested from and the user's browser must
// support CORS.
map.setView(new L.LatLng(46.498, 2.197), 7);
var customLayer = L.geoJson(null, {
// http://leafletjs.com/reference.html#geojson-style
style: function(feature) {
return { color: '#FC6E51' };
}
});
function loadGPX(traces)
{
traces.forEach(function(trace) {
omnivore.gpx('/traces/' + trace + '.gpx', null, customLayer)
.addTo(map);
});
}
loadGPX([
'2016_08_01_15_48_Mon',
'2016_08_02_08_07_Tue',
'2016_08_03_09_29_Wed',
'2016_08_04_07_52_Thu',
'2016_08_05_07_47_Fri',
//'2016_08_08_14_33_Mon',
'2016_10_23_10_06_Sun',
'2016_08_05_15_52_Fri',
'2016_10_24_10_27_Mon',
'2016_10_25_09_03_Tue',
'2016_10_25_12_24_Tue',
'2017_01_01_12_07_Sun',
'2017_07_29_14_12_Sat',
'2018-05-05_15-04_Sat',
'2018-05-06_10-29_Sun',
'2018-05-06_13-13_Sun',
'2018-05-06_18-23_Sun',
'2018-05-07_10-07_Mon',
'2018-10-23_10-36_Tue',
'2018-10-23_13-12_Tue',
'2018-10-24_10-04_Wed',
'2018-10-25_08-37_Thu',
])
</script>