Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/js/compare-landmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class compareLandmark {
*/
#generateGeoJson() {
let id = -1;
if (this.compareLandmarkId !== null && this.compareLandmarkId >= 0) {
if (this.compareLandmarkId !== null && (this.compareLandmarkId >= 0 || typeof this.compareLandmarkId === "string")) {
id = this.compareLandmarkId;
}
return {
Expand Down
3 changes: 2 additions & 1 deletion src/js/compare-poi/compare-poi.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ class ComparePoi {
setData(comparePoi) {
this.dom.advancedBtn.classList.add("d-none");
this.comparePoiId = -1;
if (comparePoi.id !== null && comparePoi.id >= 0) {
if (comparePoi.id !== null && (comparePoi.id >= 0 || typeof comparePoi.id === "string")) {
this.comparePoiId = comparePoi.id;
}
this.compareConfig = {
Expand Down Expand Up @@ -207,6 +207,7 @@ class ComparePoi {
const comparePoi = this.map.queryRenderedFeatures(e.point, {layers: layers})[0];
comparePoi.properties.opacity = 0.6;
comparePoi.properties.radiusRatio = 0;
comparePoi.id = comparePoi.properties.id;
const source = this.map.getSource("selected-compare-poi");
source.setData({
"type": "FeatureCollection",
Expand Down
30 changes: 0 additions & 30 deletions src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import { SafeAreaController } from "@aashu-dubey/capacitor-statusbar-safe-area";
import { TextZoom } from "@capacitor/text-zoom";
import { Device } from "@capacitor/device";
import { App } from "@capacitor/app";
import { Preferences } from "@capacitor/preferences";
import { Toast } from "@capacitor/toast";

import { Protocol } from "pmtiles";
Expand All @@ -46,35 +45,6 @@ defineCustomElements(window);
* Fonction définissant l'application
*/
function app() {
// REMOVEME : rétrocompatibilité des itinéraires / PR / PR comparer : migration du localStorage vers Preferences
if (localStorage.getItem("savedRoutes")) {
Preferences.set({
key: "savedRoutes",
value: localStorage.getItem("savedRoutes"),
}).then( () => {
localStorage.removeItem("savedRoutes");
});
}

if (localStorage.getItem("savedLandmarks")) {
Preferences.set({
key: "savedLandmarks",
value: localStorage.getItem("savedLandmarks"),
}).then( () => {
localStorage.removeItem("savedLandmarks");
});
}

if (localStorage.getItem("savedCompareLandmarks")) {
Preferences.set({
key: "savedCompareLandmarks",
value: localStorage.getItem("savedCompareLandmarks"),
}).then( () => {
localStorage.removeItem("savedCompareLandmarks");
});
}
// END REMOVEME

// Ajout du protocole PM Tiles
let protocol = new Protocol();
maplibregl.addProtocol("pmtiles", protocol.tile);
Expand Down
2 changes: 1 addition & 1 deletion src/js/landmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Landmark {
*/
#generateGeoJson() {
let id = -1;
if (this.landmarkId !== null && this.landmarkId >= 0) {
if (this.landmarkId !== null && (this.landmarkId >= 0 || typeof this.landmarkId === "string")) {
id = this.landmarkId;
}
return {
Expand Down
Loading