Replace leaflet with maplibre GL
This commit is contained in:
@@ -83,11 +83,12 @@ export default class Spot {
|
||||
});
|
||||
}
|
||||
|
||||
async get2(sAction, oVars) {
|
||||
async get2(sAction, oVars, bLoading) {
|
||||
oVars = oVars || {};
|
||||
oVars['a'] = sAction;
|
||||
oVars['t'] = this.consts.timezone;
|
||||
|
||||
bLoading = true;
|
||||
|
||||
let oUrl = new URL(this.consts.server+this.consts.process_page);
|
||||
oUrl.search = new URLSearchParams(oVars).toString();
|
||||
|
||||
@@ -95,9 +96,13 @@ export default class Spot {
|
||||
let oUrl = new URL(this.consts.server+this.consts.process_page);
|
||||
oUrl.search = new URLSearchParams(oVars).toString();
|
||||
const oRequest = await fetch(oUrl, {method: 'GET', /*body: JSON.stringify(oVars),*/ headers: {"Content-Type": "application/json"}});
|
||||
if(!oRequest.ok) throw new Error('Error HTTP '+oRequest.status+': '+oRequest.statusText);
|
||||
if(!oRequest.ok) {
|
||||
bLoading = false;
|
||||
throw new Error('Error HTTP '+oRequest.status+': '+oRequest.statusText);
|
||||
}
|
||||
else {
|
||||
let oResponse = await oRequest.json();
|
||||
bLoading = false;
|
||||
if(oResponse.desc.substr(0, this.consts.lang_prefix.length)==this.consts.lang_prefix) oResponse.desc = this.lang(oData.desc.substr(this.consts.lang_prefix.length));
|
||||
|
||||
if(oResponse.result == this.consts.error) return Promise.reject(oResponse.desc);
|
||||
@@ -105,6 +110,7 @@ export default class Spot {
|
||||
}
|
||||
}
|
||||
catch(oError) {
|
||||
bLoading = false;
|
||||
throw oError;
|
||||
}
|
||||
}
|
||||
@@ -126,6 +132,10 @@ export default class Spot {
|
||||
return sLang;
|
||||
}
|
||||
|
||||
isMobile() {
|
||||
return $('#mobile').is(':visible');
|
||||
}
|
||||
|
||||
/* Page Switch - Trigger & Event catching */
|
||||
|
||||
onHashChange() {
|
||||
|
||||
Reference in New Issue
Block a user