diff --git a/documents/memoire/ITI_LOG_memoire_diplome_Vachon_2019.docx b/documents/memoire/ITI_LOG_memoire_diplome_Vachon_2019.docx index 59715788f6a5d701c8d3a3c29c0d13ec63df05af..930a9e9ee4581e312c6617a192e17166713f502e 100644 Binary files a/documents/memoire/ITI_LOG_memoire_diplome_Vachon_2019.docx and b/documents/memoire/ITI_LOG_memoire_diplome_Vachon_2019.docx differ diff --git a/webapp/api/http_request.js b/webapp/api/http_request.js index 5ae1cf533e2eab18dd864c05212fdec6b425d4c3..d4eb519aed46a1dc76cb85eaf2c468fd1957e473 100644 --- a/webapp/api/http_request.js +++ b/webapp/api/http_request.js @@ -143,7 +143,7 @@ function geodb(point, limit, population, range){ limit = limit > 10 ? 10 : limit var lang = "fr" - const url = "http://geodb-free-service.wirefreethought.com/v1/geo/locations/" + point.lat + "+" + point.lon + "/nearbyCities?limit=" + limit +"&offset=0&minPopulation=" + population + "&radius=" + range + "&languageCode=" + lang + "&sort=-population" + const url = "http://geodb-free-service.wirefreethought.com/v1/geo/locations/" + point.lat + "+" + point.lon + "/nearbyCities?limit=" + limit +"&offset=0&minPopulation=" + population + "&radius=" + range + "&languageCode=" + lang + "&sort=-population&types=CITY&countryIds=CH" return new Promise(function(resolve, reject){ var cities = [] @@ -152,17 +152,21 @@ function geodb(point, limit, population, range){ if(error){ reject(error) }else{ - var body = JSON.parse(body)['data'], cities = [] + body = JSON.parse(body)['data'], cities = [] - for (var i = 0; i < body.length; i++) { + /*for (var i = 0; i < body.length; i++) { if(body[i]['type'] == "CITY"){ if(body[i]['countryCode'] == "CH"){ cities.push(body[i]['city']) } } + }*/ + var cities = [] + for (var i = 0; i < body.length; i++) { + cities.push(body[i]['city']) } - + console.log(cities); resolve(cities) } }) @@ -181,7 +185,7 @@ function transport_api(from, to, date){ reject(error) }else{ - console.log(JSON.parse(body)); + //console.log(JSON.parse(body)); resolve(JSON.parse(body)) } diff --git a/webapp/config/config.json b/webapp/config/config.json index fe76b79005ffb525a397a4b4fcba11affb37d1b8..5b409bae0a3f51cceca345dd0eef45e90c635b34 100644 --- a/webapp/config/config.json +++ b/webapp/config/config.json @@ -3,7 +3,7 @@ "city_search":{ "method": "geodb", "population": 10000, - "range": 40, + "range": 25, "limit": 100 }, "transport_search":{