Compare commits
2 Commits
a6d094af2b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
cc855ddf58
|
|||
| c7300dd617 |
6
main.mjs
6
main.mjs
@@ -136,7 +136,7 @@ function geocodeNearestCity () {
|
||||
const result = data.currentUserLocation.openCageResult;
|
||||
let { city, town, village, hamlet, county } = result.components;
|
||||
if (!city) { city = town || village || hamlet || county; }
|
||||
const query = `${city}, ${result.components.state}, ${result.components['ISO_3166-1_alpha-2']}&no_record=1&min_confidence=3`;
|
||||
const query = `${city}, ${result.components.state}, ${result.components['ISO_3166-1_alpha-2']}&no_record=1&min_confidence=2`;
|
||||
|
||||
return geocoder.geocode(query).then(res => {
|
||||
const result = res.results[0];
|
||||
@@ -152,7 +152,7 @@ function geocodeNearestCity () {
|
||||
function geocodeLocationInput () {
|
||||
console.debug('Geocoding supplied location...');
|
||||
const input = document.querySelector('input.location').value;
|
||||
const query = `${input},&no_record=1&min_confidence=3`;
|
||||
const query = `${input},&no_record=1&min_confidence=2`;
|
||||
|
||||
return geocoder.geocode(query).then(res => {
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -186,7 +186,7 @@ function createGeoJSON () {
|
||||
"country": res.components.country,
|
||||
"timezone": res.annotations.timezone
|
||||
}
|
||||
console.debug('Created GeoJSON object:', data.currentCity.geojson);
|
||||
console.debug('Created GeoJSON object:', data.currentCity.geoJSON);
|
||||
}
|
||||
|
||||
async function fetchMapImage () {
|
||||
|
||||
Reference in New Issue
Block a user