mirror of
https://github.com/gpxstudio/gpx.studio.git
synced 2025-08-31 15:43:25 +00:00
load and display gpx
This commit is contained in:
@@ -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;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -16,9 +16,9 @@
|
||||
<type>Cycling</type>
|
||||
<extensions>
|
||||
<gpx_style:line>
|
||||
<color>2d3ee9</color>
|
||||
<color>#2d3ee9</color>
|
||||
<opacity>0.5</opacity>
|
||||
<weight>5</weight>
|
||||
<weight>6</weight>
|
||||
</gpx_style:line>
|
||||
</extensions>
|
||||
<trkseg>
|
||||
|
Reference in New Issue
Block a user