commit ea4796ae5ea0f32d7b8a8eb2defa0b65d4b8679c
parent 6f93314c9d6099b298edf10bd75d1bfe8116bdde
Author: LennartSchroot <[email protected]>
Date: Mon, 3 Jul 2023 14:44:02 +0200
final?
Diffstat:
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
@@ -6,8 +6,8 @@
<component name="ChangeListManager">
<list default="true" id="f1ac0514-5d96-49e8-8c16-ecccecd1bbe1" name="Changes" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/Controller/api/api.php" beforeDir="false" afterPath="$PROJECT_DIR$/Controller/api/api.php" afterDir="false" />
- <change beforePath="$PROJECT_DIR$/Controller/hdata/hdata.php" beforeDir="false" />
+ <change beforePath="$PROJECT_DIR$/index.php" beforeDir="false" afterPath="$PROJECT_DIR$/index.php" afterDir="false" />
+ <change beforePath="$PROJECT_DIR$/js/map.js" beforeDir="false" afterPath="$PROJECT_DIR$/js/map.js" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -58,7 +58,8 @@
<workItem from="1688053996805" duration="1600000" />
<workItem from="1688382982148" duration="967000" />
<workItem from="1688384517492" duration="305000" />
- <workItem from="1688384956857" duration="576000" />
+ <workItem from="1688384956857" duration="828000" />
+ <workItem from="1688387080412" duration="1016000" />
</task>
<servers />
</component>
diff --git a/index.php b/index.php
@@ -25,7 +25,7 @@ $router->addRoute(["GET"], "/api/:data", function ($key) {
$db = new mysqli("86.92.67.21", "friedel", "hailiwa", "panda");
$query = "SELECT city, min(wind_chill) as wind_chill, country
FROM retrieve_zoos
- WHERE date = curdate()
+ WHERE date = '2023-06-28'
group by city, country
";
diff --git a/js/map.js b/js/map.js
@@ -76,9 +76,9 @@ country "United States"
fetch(`http://localhost:8080/api/${zooToken}`)
.then(response => response.json())
.then(data => {
- for (let { windchill: temperature, location: city, country } of data) {
+ for (let { windchill: windchill, location: city, country } of data) {
fetch(`https://nominatim.openstreetmap.org/search?format=json&q=${city},${country}`)
.then(res => res.json())
- .then(res => L.marker([ res[0].lat, res[0].lon ]).addTo(map).bindPopup(`${city}, ${country}: ${temperature} °C`))
+ .then(res => L.marker([ res[0].lat, res[0].lon ]).addTo(map).bindPopup(`${city}, ${country}: ${windchill} °C`))
}
});
\ No newline at end of file