Skip to content

Commit

Permalink
Changed airport links to be more clever
Browse files Browse the repository at this point in the history
  • Loading branch information
fboes committed Mar 30, 2024
1 parent ef6275b commit b8135fb
Show file tree
Hide file tree
Showing 23 changed files with 65 additions and 50 deletions.
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://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)} |
| | Location | Country | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------- | ------- | ----------------- | ---------------- | --- |
| Departure | [${m.origin_icao}](${SkyVector.airportLink(m.origin_icao)}) | ${m.origin_country} | ${this.outputDateTime(m.conditions.time.dateTime)} | ${sunStateOrigin.localSolarTime} | ${this.outputSunState(sunStateOrigin)} |
| Destination | [${m.destination_icao}](${SkyVector.airportLink(m.destination_icao)}) | ${m.destination_country} | ${this.outputDateTime(time)} | ${sunStateDestination.localSolarTime} | ${this.outputSunState(sunStateDestination)} |
### Checkpoints
Expand Down
8 changes: 8 additions & 0 deletions dist/Export/SkyVector.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@ export class SkyVector {
parameters.push("fpl=" + encodeURIComponent("N" + cruise + "A" + alt + " " + this.getCheckpoints(filterRunway).join(" ")));
return "https://skyvector.com/?" + parameters.join("&");
}
/**
* @param icaoCode of airport
* @returns URL to airport procedures and information
*/
static airportLink(icaoCode) {
return ((icaoCode.at(0) === "K" ? "https://skyvector.com/airport/" : "https://www.pilotnav.com/airport/") +
encodeURIComponent(icaoCode));
}
}
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="pilotnav" href="https://www.pilotnav.com/airport/${encodeURIComponent(m.origin_icao)}">${Quote.html(m.origin_icao)}</a>`,
`<a target="airport" href="${SkyVector.airportLink(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="pilotnav" href="https://www.pilotnav.com/airport/${encodeURIComponent(m.destination_icao)}">${Quote.html(m.destination_icao)}</a>`,
`<a target="airport" href="${SkyVector.airportLink(m.destination_icao)}">${Quote.html(m.destination_icao)}</a>`,
m.destination_country,
this.outputDateTime(time),
sunStateDestination.localSolarTime,
Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/00_get_to_know_the_pitts_s-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=53.53763457444899,

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ----------- |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ----------- |
| Departure | [EDHI](https://www.pilotnav.com/airport/EDHI) | 2022-08-15T07:09Z | 07:44 | ☀ Day @ 26° |
| Destination | [EDHI](https://www.pilotnav.com/airport/EDHI) | 2022-08-15T07:16Z | 07:51 | ☀ Day @ 27° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/01_off_to_aeroe.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=53.53760657450579,

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ----------- |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ----------- |
| Origin | [EDHI](https://www.pilotnav.com/airport/EDHI) | 2022-10-23T07:05Z | 08:00 | ☀ Day @ 7° |
| Destination | [EKAE](https://www.pilotnav.com/airport/EKAE) | 2022-10-23T07:46Z | 08:43 | ☀ Day @ 11° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/02_bridge_to_koebenhavn.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=54.85408665805144,

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ------------ |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ------------ |
| Origin | [EKAE](https://www.pilotnav.com/airport/EKAE) | 2022-10-30T06:10Z | 07:08 | ☼ Dusk @ -3° |
| Destination | [EKRK](https://www.pilotnav.com/airport/EKRK) | 2022-10-30T06:43Z | 07:47 | ☀ Day @ 2° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/03_crossing_to_sweden.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=55.591431052724666

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ------------ |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ------------ |
| Origin | [EKRK](https://www.pilotnav.com/airport/EKRK) | 2022-11-05T06:30Z | 07:34 | ☼ Dusk @ -1° |
| Destination | [ESTA](https://www.pilotnav.com/airport/ESTA) | 2022-11-05T07:05Z | 08:12 | ☀ Day @ 3° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/04_letters_to_america.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=56.28662121770193,

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ---------- |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ---------- |
| Origin | [ESTA](https://www.pilotnav.com/airport/ESTA) | 2022-11-06T07:19Z | 08:26 | ☀ Day @ 4° |
| Destination | [ESGG](https://www.pilotnav.com/airport/ESGG) | 2022-11-06T07:59Z | 09:04 | ☀ Day @ 7° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/05_the_swedish_hinterlands.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=57.67479433048351,

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ---------- |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ---------- |
| Origin | [ESGG](https://www.pilotnav.com/airport/ESGG) | 2022-11-12T07:19Z | 08:23 | ☀ Day @ 2° |
| Destination | [ESGJ](https://www.pilotnav.com/airport/ESGJ) | 2022-11-12T07:47Z | 08:58 | ☀ Day @ 5° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/06_the_lake_where_gripens_play.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=57.751506218186606

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ----------- |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ----------- |
| Origin | [ESGJ](https://www.pilotnav.com/airport/ESGJ) | 2022-11-13T08:49Z | 10:00 | ☀ Day @ 10° |
| Destination | [ESIA](https://www.pilotnav.com/airport/ESIA) | 2022-11-13T09:12Z | 10:25 | ☀ Day @ 10° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/07_carls_toyland.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=58.520264578726795

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ---------- |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ---------- |
| Origin | [ESIA](https://www.pilotnav.com/airport/ESIA) | 2022-11-20T07:45Z | 08:56 | ☀ Day @ 3° |
| Destination | [ESSL](https://www.pilotnav.com/airport/ESSL) | 2022-11-20T08:03Z | 09:19 | ☀ Day @ 5° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/08_outskirts_of_stockholm.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=58.40795780130591,

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ------------ |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ------------ |
| Origin | [ESSL](https://www.pilotnav.com/airport/ESSL) | 2022-11-26T06:49Z | 08:03 | ☼ Dusk @ -3° |
| Destination | [ESKN](https://www.pilotnav.com/airport/ESKN) | 2022-11-26T07:13Z | 08:32 | ☼ Dusk @ -1° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/09_finally_stockholm.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=58.784541072260765

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ------------ |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ------------ |
| Origin | [ESKN](https://www.pilotnav.com/airport/ESKN) | 2022-11-26T07:09Z | 08:28 | ☼ Dusk @ -1° |
| Destination | [ESSB](https://www.pilotnav.com/airport/ESSB) | 2022-11-26T07:33Z | 08:56 | ☀ Day @ 1° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/10_aland_homecoming.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=59.349212876682174

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ------------ |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ------------ |
| Origin | [ESSB](https://www.pilotnav.com/airport/ESSB) | 2022-11-27T07:19Z | 08:42 | ☼ Dusk @ -0° |
| Destination | [EFMA](https://www.pilotnav.com/airport/EFMA) | 2022-11-27T07:53Z | 09:24 | ☀ Day @ 2° |

Expand Down
4 changes: 2 additions & 2 deletions docs/carls_homecoming/11_wave_good-bye.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=60.123931066290545

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ---------- |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ---------- |
| Origin | [EFMA](https://www.pilotnav.com/airport/EFMA) | 2022-12-10T07:50Z | 09:16 | ☀ Day @ 0° |
| Destination | [EFMA](https://www.pilotnav.com/airport/EFMA) | 2022-12-10T08:28Z | 09:54 | ☀ Day @ 3° |

Expand Down
4 changes: 2 additions & 2 deletions docs/mach_loop/Low_Level_Highlander.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=57.71113752425876,

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ------------ |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ------------ |
| Departure | [EGQS](https://www.pilotnav.com/airport/EGQS) | 2022-12-17T09:02Z | 08:51 | ☼ Dusk @ -0° |
| Destination | [EGQS](https://www.pilotnav.com/airport/EGQS) | 2022-12-17T09:38Z | 09:27 | ☀ Day @ 3° |

Expand Down
4 changes: 2 additions & 2 deletions docs/mach_loop/Mach_Loop.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=53.24984430214315,

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ----------- |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ----------- |
| Origin | [EGOV](https://www.pilotnav.com/airport/EGOV) | 2022-12-01T09:56Z | 09:48 | ☀ Day @ 9° |
| Destination | [EGOV](https://www.pilotnav.com/airport/EGOV) | 2022-12-01T10:20Z | 10:11 | ☀ Day @ 11° |

Expand Down
4 changes: 2 additions & 2 deletions docs/mach_loop/Mach_Loop_from_the_Sea.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=53.24979742928385,

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ------------ |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ------------ |
| Departure | [EGOV](https://www.pilotnav.com/airport/EGOV) | 2022-12-24T08:30Z | 08:11 | ☼ Dusk @ -1° |
| Destination | [EGOV](https://www.pilotnav.com/airport/EGOV) | 2022-12-24T08:54Z | 08:35 | ☀ Day @ 2° |

Expand Down
4 changes: 2 additions & 2 deletions docs/mach_loop/Sidewinder_Low_Level.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=34.91821934264146,

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ----------- |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ----------- |
| Departure | [KEDW](https://www.pilotnav.com/airport/KEDW) | 2023-01-14T16:00Z | 07:59 | ☀ Day @ 10° |
| Destination | [KEDW](https://www.pilotnav.com/airport/KEDW) | 2023-01-14T16:39Z | 08:38 | ☀ Day @ 16° |

Expand Down
4 changes: 2 additions & 2 deletions docs/mach_loop/Star_Wars_Canyon.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Check your [Sky Vector Flight Plan](https://skyvector.com/?ll=34.908089,-117.885

### Airports

| | Location | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------ | ----------------- | ---------------- | ----------- |
| | Location | Date & time | Local solar time | Sun |
| ----------- | --------------------------------------------- | ----------------- | ---------------- | ----------- |
| Departure | [KEDW](https://www.pilotnav.com/airport/KEDW) | 2022-08-15T18:00Z | 10:04 | ☀ Day @ 56° |
| Destination | [KEDW](https://www.pilotnav.com/airport/KEDW) | 2022-08-15T18:30Z | 10:34 | ☀ Day @ 61° |

Expand Down
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://www.pilotnav.com/airport/${m.origin_icao}) | ${
| | Location | Country | Date & time | Local solar time | Sun |
| ----------- | ------------------------------------------- | ------- | ----------------- | ---------------- | --- |
| Departure | [${m.origin_icao}](${SkyVector.airportLink(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}) | ${
| Destination | [${m.destination_icao}](${SkyVector.airportLink(m.destination_icao)}) | ${
m.destination_country
} | ${this.outputDateTime(time)} | ${sunStateDestination.localSolarTime} | ${this.outputSunState(
sunStateDestination
Expand Down
11 changes: 11 additions & 0 deletions src/Export/SkyVector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,15 @@ export class SkyVector {

return "https://skyvector.com/?" + parameters.join("&");
}

/**
* @param icaoCode of airport
* @returns URL to airport procedures and information
*/
static airportLink(icaoCode: string): string {
return (
(icaoCode.at(0) === "K" ? "https://skyvector.com/airport/" : "https://www.pilotnav.com/airport/") +
encodeURIComponent(icaoCode)
);
}
}
8 changes: 2 additions & 6 deletions src/Web/Components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,19 +197,15 @@ export class ComponentsAirports extends ComponentsOutputtable {

html += this.outputLine([
"Departure",
`<a target="pilotnav" href="https://www.pilotnav.com/airport/${encodeURIComponent(m.origin_icao)}">${Quote.html(
m.origin_icao
)}</a>`,
`<a target="airport" href="${SkyVector.airportLink(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="pilotnav" href="https://www.pilotnav.com/airport/${encodeURIComponent(
m.destination_icao
)}">${Quote.html(m.destination_icao)}</a>`,
`<a target="airport" href="${SkyVector.airportLink(m.destination_icao)}">${Quote.html(m.destination_icao)}</a>`,
m.destination_country,
this.outputDateTime(time),
sunStateDestination.localSolarTime,
Expand Down

0 comments on commit b8135fb

Please sign in to comment.