Skip to content

Commit

Permalink
Changed links for airports, changed styling for waypoints
Browse files Browse the repository at this point in the history
  • Loading branch information
fboes committed Mar 29, 2024
1 parent d591f76 commit 8c8c546
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 24 deletions.
8 changes: 8 additions & 0 deletions dist/Aerofly/Mission.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,15 @@ export class Mission {
cp.name.match(/^(RW)?\d\d[A-Z]?$/)) {
cp.type = i === 1 ? MissionCheckpoint.TYPE_DEPARTURE_RUNWAY : MissionCheckpoint.TYPE_DESTINATION_RUNWAY;
cp.name = cp.name.replace(/^(RW)/, "");
/*if (cp.type === MissionCheckpoint.TYPE_DEPARTURE_RUNWAY) {
gpl.departureRunway = undefined;
} else {
gpl.destinationRunway = undefined;
}*/
}
//this.addCheckpointAfter(0, 0.5);
// if (gpl.departureRunway) {
// if (gpl.destinationRunway) {
return cp;
});
const flight_category = this.conditions.getFlightCategory(this.origin_country !== "US");
Expand Down
12 changes: 6 additions & 6 deletions dist/Export/GeoJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class GeoJson {
altitude: c.lon_lat.altitude_m,
direction: c.direction,
frequency: c.frequency_string,
"marker-symbol": this.getGeoJsonIcon(c, forExport),
"marker-symbol": this.getGeoJsonIcon(c),
"marker-color": c.type === MissionCheckpoint.TYPE_ORIGIN || c.type === MissionCheckpoint.TYPE_DESTINATION
? "#5e6eba"
: "#555555",
Expand Down Expand Up @@ -253,19 +253,19 @@ export class GeoJson {
getGeoJsonPosition(entry) {
return entry.altitude_m ? [entry.lon, entry.lat, entry.altitude_m] : [entry.lon, entry.lat];
}
getGeoJsonIcon(cp, forExport = false) {
getGeoJsonIcon(cp) {
switch (cp.type_extended) {
case MissionCheckpoint.TYPE_ORIGIN:
case MissionCheckpoint.TYPE_DESTINATION:
return "airport";
case MissionCheckpoint.TYPE_VOR:
return forExport ? "square-stroked" : "dot-10";
return "navaid-vor";
case MissionCheckpoint.TYPE_NDB:
return forExport ? "circle-stroked" : "dot-10";
return "navaid-ndb";
case MissionCheckpoint.TYPE_FIX:
return forExport ? "triangle-stroked" : "dot-10";
return "navaid-fix";
default:
return forExport ? "triangle" : "dot-10";
return "navaid-waypoint";
}
}
}
8 changes: 4 additions & 4 deletions dist/Export/Markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ Check your [Sky Vector Flight Plan](${s.toString()}). You may also want to take
### Airports
| | Location | Country | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ------- | ----------------- | ---------------- | --- |
| Departure | [${m.origin_icao}](https://skyvector.com/airport/${m.origin_icao}) | ${m.origin_country} | ${this.outputDateTime(m.conditions.time.dateTime)} | ${sunStateOrigin.localSolarTime} | ${this.outputSunState(sunStateOrigin)} |
| Destination | [${m.destination_icao}](https://skyvector.com/airport/${m.destination_icao}) | ${m.destination_country} | ${this.outputDateTime(time)} | ${sunStateDestination.localSolarTime} | ${this.outputSunState(sunStateDestination)} |
| | Location | Country | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ------- | ----------------- | ---------------- | --- |
| Departure | [${m.origin_icao}](https://www.pilotnav.com/airport/${m.origin_icao}) | ${m.origin_country} | ${this.outputDateTime(m.conditions.time.dateTime)} | ${sunStateOrigin.localSolarTime} | ${this.outputSunState(sunStateOrigin)} |
| Destination | [${m.destination_icao}](https://www.pilotnav.com/airport/${m.destination_icao}) | ${m.destination_country} | ${this.outputDateTime(time)} | ${sunStateDestination.localSolarTime} | ${this.outputSunState(sunStateDestination)} |
### Checkpoints
Expand Down
4 changes: 2 additions & 2 deletions dist/Web/Components.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ export class ComponentsAirports extends ComponentsOutputtable {
let html = "";
html += this.outputLine([
"Departure",
`<a target="skyvector" href="https://skyvector.com/airport/${encodeURIComponent(m.origin_icao)}">${Quote.html(m.origin_icao)}</a>`,
`<a target="pilotnav" href="https://www.pilotnav.com/airport/${encodeURIComponent(m.origin_icao)}">${Quote.html(m.origin_icao)}</a>`,
m.origin_country,
this.outputDateTime(m.conditions.time.dateTime),
sunStateOrigin.localSolarTime,
this.outputSunState(sunStateOrigin),
]);
html += this.outputLine([
"Destination",
`<a target="skyvector" href="https://skyvector.com/airport/${encodeURIComponent(m.destination_icao)}">${Quote.html(m.destination_icao)}</a>`,
`<a target="pilotnav" href="https://www.pilotnav.com/airport/${encodeURIComponent(m.destination_icao)}">${Quote.html(m.destination_icao)}</a>`,
m.destination_country,
this.outputDateTime(time),
sunStateDestination.localSolarTime,
Expand Down
12 changes: 6 additions & 6 deletions src/Export/GeoJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export class GeoJson implements GeoJSON.FeatureCollection {
altitude: c.lon_lat.altitude_m,
direction: c.direction,
frequency: c.frequency_string,
"marker-symbol": this.getGeoJsonIcon(c, forExport),
"marker-symbol": this.getGeoJsonIcon(c),
"marker-color":
c.type === MissionCheckpoint.TYPE_ORIGIN || c.type === MissionCheckpoint.TYPE_DESTINATION
? "#5e6eba"
Expand Down Expand Up @@ -302,19 +302,19 @@ export class GeoJson implements GeoJSON.FeatureCollection {
return entry.altitude_m ? [entry.lon, entry.lat, entry.altitude_m] : [entry.lon, entry.lat];
}

protected getGeoJsonIcon(cp: MissionCheckpoint, forExport = false): string {
protected getGeoJsonIcon(cp: MissionCheckpoint): string {
switch (cp.type_extended) {
case MissionCheckpoint.TYPE_ORIGIN:
case MissionCheckpoint.TYPE_DESTINATION:
return "airport";
case MissionCheckpoint.TYPE_VOR:
return forExport ? "square-stroked" : "dot-10";
return "navaid-vor";
case MissionCheckpoint.TYPE_NDB:
return forExport ? "circle-stroked" : "dot-10";
return "navaid-ndb";
case MissionCheckpoint.TYPE_FIX:
return forExport ? "triangle-stroked" : "dot-10";
return "navaid-fix";
default:
return forExport ? "triangle" : "dot-10";
return "navaid-waypoint";
}
}
}
8 changes: 4 additions & 4 deletions src/Export/Markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ Check your [Sky Vector Flight Plan](${s.toString()}). You may also want to take
### Airports
| | Location | Country | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ------- | ----------------- | ---------------- | --- |
| Departure | [${m.origin_icao}](https://skyvector.com/airport/${m.origin_icao}) | ${
| | Location | Country | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ------- | ----------------- | ---------------- | --- |
| Departure | [${m.origin_icao}](https://www.pilotnav.com/airport/${m.origin_icao}) | ${
m.origin_country
} | ${this.outputDateTime(m.conditions.time.dateTime)} | ${
sunStateOrigin.localSolarTime
} | ${this.outputSunState(sunStateOrigin)} |
| Destination | [${m.destination_icao}](https://skyvector.com/airport/${m.destination_icao}) | ${
| Destination | [${m.destination_icao}](https://www.pilotnav.com/airport/${m.destination_icao}) | ${
m.destination_country
} | ${this.outputDateTime(time)} | ${sunStateDestination.localSolarTime} | ${this.outputSunState(
sunStateDestination
Expand Down
4 changes: 2 additions & 2 deletions src/Web/Components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export class ComponentsAirports extends ComponentsOutputtable {

html += this.outputLine([
"Departure",
`<a target="skyvector" href="https://skyvector.com/airport/${encodeURIComponent(m.origin_icao)}">${Quote.html(
`<a target="pilotnav" href="https://www.pilotnav.com/airport/${encodeURIComponent(m.origin_icao)}">${Quote.html(
m.origin_icao
)}</a>`,
m.origin_country,
Expand All @@ -207,7 +207,7 @@ export class ComponentsAirports extends ComponentsOutputtable {
]);
html += this.outputLine([
"Destination",
`<a target="skyvector" href="https://skyvector.com/airport/${encodeURIComponent(
`<a target="pilotnav" href="https://www.pilotnav.com/airport/${encodeURIComponent(
m.destination_icao
)}">${Quote.html(m.destination_icao)}</a>`,
m.destination_country,
Expand Down

0 comments on commit 8c8c546

Please sign in to comment.