Add GPX file download

This commit is contained in:
2020-01-02 14:57:02 +01:00
parent 1d7e9d10c0
commit 6e12c44f54
6 changed files with 19 additions and 4 deletions

View File

@@ -126,7 +126,9 @@ class Project extends PhpObject {
if(!Converter::isGeoJsonValid($asProject['geofile'])) Converter::convertToGeoJson($asProject['geofile']);
$asProject['geofile'] = Spot::addTimestampToFilePath(Geo::getFilePath($asProject['geofile'], GeoJson::EXT));
$asProject['geofilepath'] = Spot::addTimestampToFilePath(Geo::getFilePath($asProject['geofile'], GeoJson::EXT));
$asProject['gpxfilepath'] = Spot::addTimestampToFilePath(Geo::getFilePath($asProject['geofile'], Gpx::EXT));
unset($asProject['geofile']);
$asProject['codename'] = $sCodeName;
}
return $bSpecificProj?$asProject:$asProjects;

View File

@@ -142,7 +142,7 @@ function initProject(sProjectCodeName){
//Project Geojson: Hike track
$.ajax({
dataType: 'json',
url: self.vars(['project', 'geofile']),
url: self.vars(['project', 'geofilepath']),
mimeType: 'application/json'
})
).done(function(aoMessages, aoTracks) {
@@ -249,6 +249,7 @@ function initSpotMessages(aoMessages, aoTracks) {
var $Label = $('<label>').append($('<div>')
.append($Radio)
.append($('<span>').text(' '+asProject.name))
.append($('<a>', {'class':'fa fa-download push-left', href:asProject.gpxfilepath}).click(function(e){e.stopPropagation();}))
);
$Labels.append($Label);
});

View File

@@ -18,6 +18,9 @@ $fa-css-prefix: fa;
&.push {
margin-right: 0.5em;
}
&.push-left {
margin-left: 0.5em;
}
}
.control-icon {
@@ -40,6 +43,7 @@ $fa-css-prefix: fa;
.#{$fa-css-prefix}-distance:before { content: fa-content($fa-var-arrow-circle-right); }
.#{$fa-css-prefix}-elev-drop:before { content: fa-content($fa-var-arrow-circle-down); }
.#{$fa-css-prefix}-elev-gain:before { content: fa-content($fa-var-arrow-circle-up); }
.#{$fa-css-prefix}-download:before { content: fa-content($fa-var-file-download); }
/* Feed */
.#{$fa-css-prefix}-post:before { content: fa-content($fa-var-comment); }

View File

@@ -106,6 +106,14 @@ $legend-color: #222;
&.leaflet-control-layers-expanded {
color: $legend-color;
width: calc(100% - 2em - 16px);
a.fa-download {
color: $legend-color;
&:hover {
color: #0078A8;
}
}
}
&.leaflet-control-scale {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long