Compare commits
4 Commits
359b1e8f3d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
cc855ddf58
|
|||
| c7300dd617 | |||
| a6d094af2b | |||
| 185ef5bfda |
19
main.mjs
19
main.mjs
@@ -1,8 +1,11 @@
|
|||||||
import ApiKeys from './modules/rs-module-api-keys.mjs';
|
//
|
||||||
import Geocoder from './modules/geocode.mjs';
|
// License: Do whatever you want with it. I'm not liable.
|
||||||
import initializeSettings from './modules/settings.mjs';
|
//
|
||||||
import initializeProfileUpdates from './modules/profile.mjs';
|
import ApiKeys from './lib/rs-module-api-keys.mjs';
|
||||||
import { showElement, hideElement, renderImage } from './modules/dom-helpers.mjs';
|
import Geocoder from './lib/geocode.mjs';
|
||||||
|
import initializeSettings from './lib/settings.mjs';
|
||||||
|
import initializeProfileUpdates from './lib/profile.mjs';
|
||||||
|
import { showElement, hideElement, renderImage } from './lib/dom-helpers.mjs';
|
||||||
|
|
||||||
const remoteStorage = new RemoteStorage({ modules: [ApiKeys] });
|
const remoteStorage = new RemoteStorage({ modules: [ApiKeys] });
|
||||||
remoteStorage.access.claim('profile', 'rw');
|
remoteStorage.access.claim('profile', 'rw');
|
||||||
@@ -133,7 +136,7 @@ function geocodeNearestCity () {
|
|||||||
const result = data.currentUserLocation.openCageResult;
|
const result = data.currentUserLocation.openCageResult;
|
||||||
let { city, town, village, hamlet, county } = result.components;
|
let { city, town, village, hamlet, county } = result.components;
|
||||||
if (!city) { city = town || village || hamlet || county; }
|
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 => {
|
return geocoder.geocode(query).then(res => {
|
||||||
const result = res.results[0];
|
const result = res.results[0];
|
||||||
@@ -149,7 +152,7 @@ function geocodeNearestCity () {
|
|||||||
function geocodeLocationInput () {
|
function geocodeLocationInput () {
|
||||||
console.debug('Geocoding supplied location...');
|
console.debug('Geocoding supplied location...');
|
||||||
const input = document.querySelector('input.location').value;
|
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 geocoder.geocode(query).then(res => {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -183,7 +186,7 @@ function createGeoJSON () {
|
|||||||
"country": res.components.country,
|
"country": res.components.country,
|
||||||
"timezone": res.annotations.timezone
|
"timezone": res.annotations.timezone
|
||||||
}
|
}
|
||||||
console.debug('Created GeoJSON object:', data.currentCity.geojson);
|
console.debug('Created GeoJSON object:', data.currentCity.geoJSON);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchMapImage () {
|
async function fetchMapImage () {
|
||||||
|
|||||||
496
vendor/remotestorage.js
vendored
496
vendor/remotestorage.js
vendored
File diff suppressed because one or more lines are too long
2
vendor/remotestorage.js.map
vendored
2
vendor/remotestorage.js.map
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user