diff --git a/android/.idea/compiler.xml b/android/.idea/compiler.xml
index 8fabff5a..8b3f1027 100644
--- a/android/.idea/compiler.xml
+++ b/android/.idea/compiler.xml
@@ -1,6 +1,6 @@
-
+
\ No newline at end of file
diff --git a/android/.idea/deploymentTargetSelector.xml b/android/.idea/deploymentTargetSelector.xml
new file mode 100644
index 00000000..95551b5a
--- /dev/null
+++ b/android/.idea/deploymentTargetSelector.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/.idea/migrations.xml b/android/.idea/migrations.xml
new file mode 100644
index 00000000..48052b24
--- /dev/null
+++ b/android/.idea/migrations.xml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml
index 8978d23d..74dd639e 100644
--- a/android/.idea/misc.xml
+++ b/android/.idea/misc.xml
@@ -1,6 +1,7 @@
+
-
+
diff --git a/android/.idea/runConfigurations.xml b/android/.idea/runConfigurations.xml
new file mode 100644
index 00000000..5bd6771a
--- /dev/null
+++ b/android/.idea/runConfigurations.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/android/build.gradle b/android/build.gradle
index 9b95a5e9..1b105d32 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -7,7 +7,7 @@ buildscript {
mavenCentral()
}
dependencies {
- classpath 'com.android.tools.build:gradle:8.2.1'
+ classpath 'com.android.tools.build:gradle:8.8.0'
// classpath 'com.google.gms:google-services:4.4.0'
// NOTE: Do not place your application dependencies here; they belong
diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties
index 829e1a5a..36074adc 100644
--- a/android/gradle/wrapper/gradle-wrapper.properties
+++ b/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/src/js/globals.js b/src/js/globals.js
index bc7a84b9..f3d2a922 100644
--- a/src/js/globals.js
+++ b/src/js/globals.js
@@ -3,6 +3,7 @@
*
* This program and the accompanying materials are made available under the terms of the GPL License, Version 3.0.
*/
+import { Network } from "@capacitor/network";
/** global: map */
let map = null;
@@ -98,7 +99,7 @@ let landmark = null;
let compareLandmark = null;
// Global flag: is the device connected to the internet?
-let online = true;
+let online = (await Network.getStatus()).connected;
// Scroll
let maxScroll = (document.scrollingElement.scrollHeight - document.scrollingElement.clientHeight);
diff --git a/src/js/layer-manager/layer-switcher.js b/src/js/layer-manager/layer-switcher.js
index b5e577c3..108b6fd4 100644
--- a/src/js/layer-manager/layer-switcher.js
+++ b/src/js/layer-manager/layer-switcher.js
@@ -288,7 +288,10 @@ class LayerSwitcher extends EventTarget {
if (typeof id !== "undefined") {
if (this.layers[id].type === "vector") {
var pos = this.layers[id].position;
- var beforeId = this.map.getStyle().layers[this.#getIndexLayer(pos)].id;
+ var beforeId = 0;
+ if (this.map.getStyle().layers.length) {
+ beforeId = this.map.getStyle().layers[this.#getIndexLayer(pos)].id;
+ }
var max = (pos === Object.keys(this.layers).length - 1);
if (!max) {
// ne jamais déplacer le groupe avant le background tout blanc
diff --git a/src/js/poi.js b/src/js/poi.js
index d08d9729..e260e6a4 100644
--- a/src/js/poi.js
+++ b/src/js/poi.js
@@ -68,6 +68,9 @@ class POI {
async load() {
var props = LayersConfig.getLayerProps(this.id);
var style = props.style; // url !
+ if (!Globals.online) {
+ style = props.fallbackStyle; // url !;
+ }
return fetch(style)
.then((response) => {