Add GPX file download
This commit is contained in:
@@ -126,7 +126,9 @@ class Project extends PhpObject {
|
|||||||
|
|
||||||
if(!Converter::isGeoJsonValid($asProject['geofile'])) Converter::convertToGeoJson($asProject['geofile']);
|
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;
|
$asProject['codename'] = $sCodeName;
|
||||||
}
|
}
|
||||||
return $bSpecificProj?$asProject:$asProjects;
|
return $bSpecificProj?$asProject:$asProjects;
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ function initProject(sProjectCodeName){
|
|||||||
//Project Geojson: Hike track
|
//Project Geojson: Hike track
|
||||||
$.ajax({
|
$.ajax({
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
url: self.vars(['project', 'geofile']),
|
url: self.vars(['project', 'geofilepath']),
|
||||||
mimeType: 'application/json'
|
mimeType: 'application/json'
|
||||||
})
|
})
|
||||||
).done(function(aoMessages, aoTracks) {
|
).done(function(aoMessages, aoTracks) {
|
||||||
@@ -249,6 +249,7 @@ function initSpotMessages(aoMessages, aoTracks) {
|
|||||||
var $Label = $('<label>').append($('<div>')
|
var $Label = $('<label>').append($('<div>')
|
||||||
.append($Radio)
|
.append($Radio)
|
||||||
.append($('<span>').text(' '+asProject.name))
|
.append($('<span>').text(' '+asProject.name))
|
||||||
|
.append($('<a>', {'class':'fa fa-download push-left', href:asProject.gpxfilepath}).click(function(e){e.stopPropagation();}))
|
||||||
);
|
);
|
||||||
$Labels.append($Label);
|
$Labels.append($Label);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -18,6 +18,9 @@ $fa-css-prefix: fa;
|
|||||||
&.push {
|
&.push {
|
||||||
margin-right: 0.5em;
|
margin-right: 0.5em;
|
||||||
}
|
}
|
||||||
|
&.push-left {
|
||||||
|
margin-left: 0.5em;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.control-icon {
|
.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}-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-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}-elev-gain:before { content: fa-content($fa-var-arrow-circle-up); }
|
||||||
|
.#{$fa-css-prefix}-download:before { content: fa-content($fa-var-file-download); }
|
||||||
|
|
||||||
/* Feed */
|
/* Feed */
|
||||||
.#{$fa-css-prefix}-post:before { content: fa-content($fa-var-comment); }
|
.#{$fa-css-prefix}-post:before { content: fa-content($fa-var-comment); }
|
||||||
|
|||||||
@@ -106,6 +106,14 @@ $legend-color: #222;
|
|||||||
&.leaflet-control-layers-expanded {
|
&.leaflet-control-layers-expanded {
|
||||||
color: $legend-color;
|
color: $legend-color;
|
||||||
width: calc(100% - 2em - 16px);
|
width: calc(100% - 2em - 16px);
|
||||||
|
|
||||||
|
a.fa-download {
|
||||||
|
color: $legend-color;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
color: #0078A8;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&.leaflet-control-scale {
|
&.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
Reference in New Issue
Block a user