mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2026-10-22 09:32:12 +00:00
load and display gpx
This commit is contained in:
1 parent
0c97410c87
commit
685c2bb541
7 files changed
+141
-302
No files matched your search
+15
-1
@@ -123,7 +123,21 @@ export class Track extends GPXTreeNode<TrackSegment> {
|
||||
}
|
||||
|
||||
toGeoJSON(): any {
|
||||
return this.getChildren().map((child) => child.toGeoJSON());
|
||||
return this.getChildren().map((child) => {
|
||||
let geoJSON = child.toGeoJSON();
|
||||
if (this.extensions && this.extensions['gpx_style:line']) {
|
||||
if (this.extensions['gpx_style:line'].color) {
|
||||
geoJSON.properties['color'] = this.extensions['gpx_style:line'].color;
|
||||
}
|
||||
if (this.extensions['gpx_style:line'].opacity) {
|
||||
geoJSON.properties['opacity'] = this.extensions['gpx_style:line'].opacity;
|
||||
}
|
||||
if (this.extensions['gpx_style:line'].weight) {
|
||||
geoJSON.properties['weight'] = this.extensions['gpx_style:line'].weight;
|
||||
}
|
||||
}
|
||||
return geoJSON;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user