Skip to content

Commit 7374255

Browse files
committed
fix(ios<16): disable templayers
1 parent 417eac9 commit 7374255

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/js/utils/config-utils.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import InseeCommWiki from "../../../config/com_wiki.json";
2020
import GfiRulesProps from "../../../config/gfi-rules.json";
2121

2222
import { Capacitor } from "@capacitor/core";
23+
import { Device } from "@capacitor/device";
2324

2425
const config = {
2526
baseLayers: null,
@@ -106,6 +107,15 @@ async function loadConfigs() {
106107
}
107108
});
108109

110+
// Disable tempLayers on iOS < 16 (not working because of preflight OPTIONS request)
111+
const info = await Device.getInfo();
112+
if (info.platform === 'ios') {
113+
// info.osVersion is usually like "15.6.1" or "16.0"
114+
const version = parseFloat(info.osVersion);
115+
if (version < 16.0) {
116+
config.tempLayers = [];
117+
}
118+
}
109119
// Filter temp layers
110120
config.tempLayers = config.tempLayers.filter((layer) => {
111121
if (!layer.isProdReady && Capacitor.getPlatform() !== "web") {

0 commit comments

Comments
 (0)