Bugfix: weather geolocation not working when there are multiple results.
This commit is contained in:
parent
b6a0adac56
commit
10b70f0c53
1 changed files with 1 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
function fetchCoordinates(city, callback, errorCallback) {
|
function fetchCoordinates(city, callback, errorCallback) {
|
||||||
var geoUrl = "https://geocoding-api.open-meteo.com/v1/search?name=" + encodeURIComponent(city) + "&count=1&language=en&format=json";
|
var geoUrl = "https://geocoding-api.open-meteo.com/v1/search?name=" + encodeURIComponent(city) + "&language=en&format=json";
|
||||||
var xhr = new XMLHttpRequest();
|
var xhr = new XMLHttpRequest();
|
||||||
xhr.onreadystatechange = function() {
|
xhr.onreadystatechange = function() {
|
||||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue