add gpx route parsing
parent
047cf1b1cd
commit
b051fe1e40
|
@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
[#6](https://gitlab.com/eneiluj/gpxedit-oc/issues/6) @eneiluj
|
[#6](https://gitlab.com/eneiluj/gpxedit-oc/issues/6) @eneiluj
|
||||||
- symbol selects include icons
|
- symbol selects include icons
|
||||||
[#6](https://gitlab.com/eneiluj/gpxedit-oc/issues/6) @eneiluj
|
[#6](https://gitlab.com/eneiluj/gpxedit-oc/issues/6) @eneiluj
|
||||||
|
- gpx route parsing
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- detach marker and tooltip styling option
|
- detach marker and tooltip styling option
|
||||||
|
|
|
@ -581,9 +581,9 @@ function parseGpx(xml){
|
||||||
});
|
});
|
||||||
dom.find('trk').each(function(){
|
dom.find('trk').each(function(){
|
||||||
var latlngs = [];
|
var latlngs = [];
|
||||||
var name = $(this).find('name').text();
|
var name = $(this).find('>name').text();
|
||||||
var cmt = $(this).find('cmt').text();
|
var cmt = $(this).find('>cmt').text();
|
||||||
var desc = $(this).find('desc').text();
|
var desc = $(this).find('>desc').text();
|
||||||
$(this).find('trkseg').each(function(){
|
$(this).find('trkseg').each(function(){
|
||||||
$(this).find('trkpt').each(function(){
|
$(this).find('trkpt').each(function(){
|
||||||
var lat = $(this).attr('lat');
|
var lat = $(this).attr('lat');
|
||||||
|
@ -599,6 +599,24 @@ function parseGpx(xml){
|
||||||
});
|
});
|
||||||
drawLine(latlngs, name, desc, cmt);
|
drawLine(latlngs, name, desc, cmt);
|
||||||
});
|
});
|
||||||
|
dom.find('rte').each(function(){
|
||||||
|
var latlngs = [];
|
||||||
|
var name = $(this).find('>name').text();
|
||||||
|
var cmt = $(this).find('>cmt').text();
|
||||||
|
var desc = $(this).find('>desc').text();
|
||||||
|
$(this).find('rtept').each(function(){
|
||||||
|
var lat = $(this).attr('lat');
|
||||||
|
var lon = $(this).attr('lon');
|
||||||
|
var ele = $(this).find('ele').text();
|
||||||
|
if (ele !== ''){
|
||||||
|
latlngs.push([lat,lon,ele]);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
latlngs.push([lat,lon]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
drawLine(latlngs, name, desc, cmt);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove layers from map and delete all layers data
|
// remove layers from map and delete all layers data
|
||||||
|
|
Loading…
Reference in New Issue