diff --git a/src/routes/en/docs/air-quality-api/+page.svelte b/src/routes/en/docs/air-quality-api/+page.svelte index 25c09fce..b9853ad9 100644 --- a/src/routes/en/docs/air-quality-api/+page.svelte +++ b/src/routes/en/docs/air-quality-api/+page.svelte @@ -8,6 +8,7 @@ import AccordionItem from '$lib/Elements/AccordionItem.svelte'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; const defaultParameter = { hourly: [], @@ -20,8 +21,8 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], ...defaultParameter, hourly: ['pm10', 'pm2_5'] }); @@ -82,9 +83,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -100,39 +111,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Hourly Air Quality Variables

diff --git a/src/routes/en/docs/climate-api/+page.svelte b/src/routes/en/docs/climate-api/+page.svelte index ac3236a3..2ac0e4cd 100644 --- a/src/routes/en/docs/climate-api/+page.svelte +++ b/src/routes/en/docs/climate-api/+page.svelte @@ -11,6 +11,7 @@ import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; import { onMount } from 'svelte'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; const defaultParameter = { temperature_unit: 'celsius', @@ -22,8 +23,8 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], start_date: '1950-01-01', end_date: '2050-12-31', models: [ @@ -103,9 +104,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -126,39 +137,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Specify Time Interval

diff --git a/src/routes/en/docs/dwd-api/+page.svelte b/src/routes/en/docs/dwd-api/+page.svelte index 981073f7..81b4a733 100644 --- a/src/routes/en/docs/dwd-api/+page.svelte +++ b/src/routes/en/docs/dwd-api/+page.svelte @@ -14,6 +14,7 @@ import AccordionItem from '$lib/Elements/AccordionItem.svelte'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; const defaultParameter = { hourly: [], @@ -32,8 +33,8 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], ...defaultParameter, hourly: ['temperature_2m'] }); @@ -180,9 +181,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -202,39 +213,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Hourly Weather Variables

diff --git a/src/routes/en/docs/ecmwf-api/+page.svelte b/src/routes/en/docs/ecmwf-api/+page.svelte index d24ad4c8..154472b4 100644 --- a/src/routes/en/docs/ecmwf-api/+page.svelte +++ b/src/routes/en/docs/ecmwf-api/+page.svelte @@ -14,6 +14,7 @@ import AccordionItem from '$lib/Elements/AccordionItem.svelte'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; const defaultParameter = { hourly: [], @@ -27,8 +28,8 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], ...defaultParameter, hourly: ['temperature_2m'] }); @@ -89,9 +90,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -112,39 +123,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

3-Hourly Weather Variables

diff --git a/src/routes/en/docs/elevation-api/+page.svelte b/src/routes/en/docs/elevation-api/+page.svelte index df1a679e..c5281799 100644 --- a/src/routes/en/docs/elevation-api/+page.svelte +++ b/src/routes/en/docs/elevation-api/+page.svelte @@ -1,164 +1,225 @@ - - Elevation API | Open-Meteo.com - - - - - + + Elevation API | Open-Meteo.com + + + - - - -
-

Select Coordinates or City

-
-
- - -
-
-
-
- - -
-
-
- -
-
- - - -
- -
- - -
-
{response}
-
- -
- - -
You can copy this API URL into your application
-
- -
-

API Documentation

-

The API endpoint /v1/elevation accepts one or multiple geographical coordinate and returns the - terrain elevation for those points.

-

Data is based on the Copernicus DEM 2021 release GLO-90 with 90 meters resolution. The GLO-90 dataset is - available worldwide with a free license.

-

All URL parameters are listed below:

-
- - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterFormatRequiredDefaultDescription
latitude
longitude
Floating point arrayYes - Geographical WGS84 coordinates of the location. - Multiple coordinates can be coma , separated. - Up to 100 coordinates can be requested at once. - Example for multiple coordinates. -
apikeyStringNo - Only required to commercial use to access reserved API resources for customers. The - server URL requires the prefix customer-. See - pricing for more information.
-
-

Additional optional URL parameters will be added. For API stability, no required parameters will be added in the - future!

- -

JSON Return Object

-

On success a JSON object is returned with just one attribute elevation. It is always an array, even - if only one coordinate is requested.

-
+
+
+
+
+

Select Coordinates or City

+ {#each $params.latitude as _, index} +
+
+ + +
+
+
+
+ + +
+
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each} +
+ + + +
+ +
+ + +
+
{response}
+
+ +
+ + +
You can copy this API URL into your application
+
+ +
+

API Documentation

+

+ The API endpoint /v1/elevation accepts one or multiple geographical coordinate and returns + the terrain elevation for those points. +

+

+ Data is based on the Copernicus DEM 2021 release GLO-90 with 90 meters resolution. The GLO-90 dataset is available worldwide with a free license. +

+

All URL parameters are listed below:

+
+ + + + + + + + + + + + + + + + + + + + + + + + +
ParameterFormatRequiredDefaultDescription
latitude
longitude
Floating point arrayYes + + Geographical WGS84 coordinates of the location. Multiple coordinates can be coma , + separated. Up to 100 coordinates can be requested at once. Example for + multiple coordinates. +
apikeyStringNo + Only required to commercial use to access reserved API resources for customers. The + server URL requires the prefix customer-. See + pricing for more information.
+
+

+ Additional optional URL parameters will be added. For API stability, no required parameters will + be added in the future! +

+ +

JSON Return Object

+

+ On success a JSON object is returned with just one attribute elevation. It is + always an array, even if only one coordinate is requested. +

+
       
 {`
   "elevation": [38.0]
@@ -166,10 +227,12 @@
       
     
-

Errors

-

In case an error occurs, for example a URL parameter is not correctly specified, a JSON error object is returned - with a HTTP 400 status code.

-
+	

Errors

+

+ In case an error occurs, for example a URL parameter is not correctly specified, a JSON error + object is returned with a HTTP 400 status code. +

+
       
 {`
   "error":true,
@@ -177,15 +240,15 @@
 `}
       
     
-
+
-

Citation & Acknowledgement

-
+

Citation & Acknowledgement

+
 ESA - EUsers, who, in their research, use the Copernicus DEM, are requested to use the following DOI when citing the data source in their publications: 
 
 https://doi.org/10.5270/ESA-c5d3d65
   
-

All users of Open-Meteo data must provide a clear attribution to the Copernicus program as well as a reference to - Open-Meteo.

- - +

+ All users of Open-Meteo data must provide a clear attribution to the Copernicus program as well as + a reference to Open-Meteo. +

diff --git a/src/routes/en/docs/ensemble-api/+page.svelte b/src/routes/en/docs/ensemble-api/+page.svelte index 629e7386..cf60102e 100644 --- a/src/routes/en/docs/ensemble-api/+page.svelte +++ b/src/routes/en/docs/ensemble-api/+page.svelte @@ -8,6 +8,7 @@ import AccordionItem from '$lib/Elements/AccordionItem.svelte'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; const defaultParameter = { hourly: [], @@ -26,8 +27,8 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], ...defaultParameter, hourly: ['temperature_2m'], models: ['icon_seamless'] @@ -312,9 +313,19 @@ [{ name: 'gem_global', label: 'GEM Global Ensemble' }] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -334,39 +345,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}
diff --git a/src/routes/en/docs/flood-api/+page.svelte b/src/routes/en/docs/flood-api/+page.svelte index e788052b..c61d69c1 100644 --- a/src/routes/en/docs/flood-api/+page.svelte +++ b/src/routes/en/docs/flood-api/+page.svelte @@ -8,6 +8,7 @@ import AccordionItem from '$lib/Elements/AccordionItem.svelte'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; const defaultParameter = { daily: [], @@ -21,8 +22,8 @@ }; const params = urlHashStore({ - latitude: 59.91, - longitude: 10.75, + latitude: [59.91], + longitude: [10.75], ...defaultParameter, daily: ['river_discharge'] }); @@ -60,9 +61,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -78,39 +89,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Daily Weather Variables

diff --git a/src/routes/en/docs/gem-api/+page.svelte b/src/routes/en/docs/gem-api/+page.svelte index 0a0f77a0..ca36f367 100644 --- a/src/routes/en/docs/gem-api/+page.svelte +++ b/src/routes/en/docs/gem-api/+page.svelte @@ -14,6 +14,8 @@ import AccordionItem from '$lib/Elements/AccordionItem.svelte'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; + const defaultParameter = { hourly: [], @@ -31,8 +33,8 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], ...defaultParameter, hourly: ['temperature_2m'] }); @@ -146,9 +148,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -166,39 +178,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Hourly Weather Variables

diff --git a/src/routes/en/docs/gfs-api/+page.svelte b/src/routes/en/docs/gfs-api/+page.svelte index e7b74332..e03427ff 100644 --- a/src/routes/en/docs/gfs-api/+page.svelte +++ b/src/routes/en/docs/gfs-api/+page.svelte @@ -14,6 +14,7 @@ import AccordionItem from '$lib/Elements/AccordionItem.svelte'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; const defaultParameter = { hourly: [], @@ -32,8 +33,8 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], ...defaultParameter, hourly: ['temperature_2m'] }); @@ -167,9 +168,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -188,39 +199,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Hourly Weather Variables

diff --git a/src/routes/en/docs/historical-weather-api/+page.svelte b/src/routes/en/docs/historical-weather-api/+page.svelte index 76b8ed8e..542bfd45 100644 --- a/src/routes/en/docs/historical-weather-api/+page.svelte +++ b/src/routes/en/docs/historical-weather-api/+page.svelte @@ -11,7 +11,7 @@ import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; import { onMount } from 'svelte'; - import { reset } from '__sveltekit/paths'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; var d = new Date(); d.setDate(d.getDate() - 5); @@ -33,8 +33,8 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], start_date: startDateDefault, end_date: endDateDefault, ...defaultParameter, @@ -172,9 +172,19 @@ models.push([{ name: 'ecmwf_ifs', label: 'ECMWF IFS', caption: '9 km, Global' }]); } - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -198,39 +208,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Specify Time Interval

diff --git a/src/routes/en/docs/jma-api/+page.svelte b/src/routes/en/docs/jma-api/+page.svelte index ead9fd0a..cf6e5726 100644 --- a/src/routes/en/docs/jma-api/+page.svelte +++ b/src/routes/en/docs/jma-api/+page.svelte @@ -14,6 +14,7 @@ import AccordionItem from '$lib/Elements/AccordionItem.svelte'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; const defaultParameter = { hourly: [], @@ -30,8 +31,8 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], ...defaultParameter, hourly: ['temperature_2m'] }); @@ -124,9 +125,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -143,39 +154,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Hourly Weather Variables

diff --git a/src/routes/en/docs/marine-weather-api/+page.svelte b/src/routes/en/docs/marine-weather-api/+page.svelte index 68c18d12..116a1f4c 100644 --- a/src/routes/en/docs/marine-weather-api/+page.svelte +++ b/src/routes/en/docs/marine-weather-api/+page.svelte @@ -1,19 +1,12 @@ @@ -97,39 +100,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Hourly Marine Variables

diff --git a/src/routes/en/docs/meteofrance-api/+page.svelte b/src/routes/en/docs/meteofrance-api/+page.svelte index e5b0d065..669480b2 100644 --- a/src/routes/en/docs/meteofrance-api/+page.svelte +++ b/src/routes/en/docs/meteofrance-api/+page.svelte @@ -14,6 +14,7 @@ import AccordionItem from '$lib/Elements/AccordionItem.svelte'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; const defaultParameter = { hourly: [], @@ -31,8 +32,8 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], ...defaultParameter, hourly: ['temperature_2m'] }); @@ -167,9 +168,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -188,39 +199,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Hourly Weather Variables

diff --git a/src/routes/en/docs/metno-api/+page.svelte b/src/routes/en/docs/metno-api/+page.svelte index 5c7139ee..16a0804e 100644 --- a/src/routes/en/docs/metno-api/+page.svelte +++ b/src/routes/en/docs/metno-api/+page.svelte @@ -8,6 +8,7 @@ import AccordionItem from '$lib/Elements/AccordionItem.svelte'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; const defaultParameter = { hourly: [], @@ -23,8 +24,8 @@ }; const params = urlHashStore({ - latitude: 59.91, - longitude: 10.75, + latitude: [59.91], + longitude: [10.75], ...defaultParameter, hourly: ['temperature_2m'] }); @@ -81,9 +82,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -102,39 +113,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

Hourly Weather Variables

diff --git a/src/routes/en/docs/seasonal-forecast-api/+page.svelte b/src/routes/en/docs/seasonal-forecast-api/+page.svelte index b94ba9ce..79711b06 100644 --- a/src/routes/en/docs/seasonal-forecast-api/+page.svelte +++ b/src/routes/en/docs/seasonal-forecast-api/+page.svelte @@ -6,7 +6,8 @@ import { urlHashStore } from '$lib/url-hash-store'; import SveltyPicker from 'svelty-picker'; import { slide } from 'svelte/transition'; - + import { PlusLg, Trash } from 'svelte-bootstrap-icons'; + const defaultParameter = { six_hourly: [], daily: [], @@ -23,10 +24,10 @@ }; const params = urlHashStore({ - latitude: 52.52, - longitude: 13.41, + latitude: [52.52], + longitude: [13.41], ...defaultParameter, - daily: ['temperature_2m_max'] + daily: ['temperature_2m_max'] }); $: endDateInvalid = $params.start_date != null && $params.end_date == null; @@ -76,9 +77,19 @@ ] ]; - function locationCallback(event: CustomEvent) { - $params.latitude = Number(event.detail.latitude.toFixed(4)); - $params.longitude = Number(event.detail.longitude.toFixed(4)); + function locationCallback(event: CustomEvent, index: number) { + const latitude = Number(event.detail.latitude.toFixed(4)); + const longitude = Number(event.detail.longitude.toFixed(4)); + $params.latitude = $params.latitude.toSpliced(index, 1, latitude); + $params.longitude = $params.longitude.toSpliced(index, 1, longitude); + } + function addLocation() { + $params.latitude = [...$params.latitude, NaN]; + $params.longitude = [...$params.longitude, NaN]; + } + function removeLocation(index: number) { + $params.latitude = $params.latitude.toSpliced(index, 1); + $params.longitude = $params.longitude.toSpliced(index, 1); } @@ -92,39 +103,60 @@

Select Coordinates or City

-
-
- - + {#each $params.latitude as _, index} +
+
+ + +
-
-
-
- - +
+
+ + +
-
-
- -
+
+ locationCallback(event, index)} /> +
+ {#if index == 0} +
+ +
+ {:else} +
+ +
+ {/if} + {/each}

6-Hourly Weather Variables