Skip to content

Commit

Permalink
feat(myaccount): enregistrement des landmarks et actions sur les land…
Browse files Browse the repository at this point in the history
…marks
  • Loading branch information
azarz committed Feb 12, 2024
1 parent 2cfe9dd commit f1d53b0
Show file tree
Hide file tree
Showing 23 changed files with 411 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/workflows/android-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- name: Make envfile
run: |
echo "GPF_key=${{ secrets.GPF_key }}" > .env
echo "signalement_url=${{ secrets.SIGNALEMENT_URL }}" >> .env
- name: Setup Node.js
uses: actions/setup-node@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ios-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- name: Make envfile
run: |
echo "GPF_key=${{ secrets.GPF_key }}" > .env
echo "signalement_url=${{ secrets.SIGNALEMENT_URL }}" >> .env
- name: Setup Node.js
uses: actions/setup-node@v3
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/web-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
- name: Make envfile
run: |
echo "GPF_key=${{ secrets.GPF_key }}" > .env
echo "signalement_url=${{ secrets.SIGNALEMENT_URL }}" >> .env
- name: Setup Node.js
uses: actions/setup-node@v3
Expand Down
Binary file added src/css/assets/landmark-favourite-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/css/assets/landmark-saved-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/css/assets/landmark-tovisit-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions src/css/layer-switcher.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
}


div[id^="landmark-container_ID_"],
div[id^="route-container_ID_"],
div[id^="container_ID_"] {
display: flex;
Expand All @@ -23,6 +24,7 @@ div[id^="container_ID_"] {
padding-bottom: 20px;
}

div[id^="landmark-cross-picto_ID_"],
div[id^="route-cross-picto_ID_"],
div[id^="cross-picto_ID_"] {
position: relative;
Expand All @@ -32,13 +34,15 @@ div[id^="cross-picto_ID_"] {
background: url("./assets/drag-and-drop-light.svg") center center no-repeat, #f4f6f8;
}

div[id^="landmark-basic-tools_ID_"],
div[id^="route-basic-tools_ID_"],
div[id^="basic-tools_ID_"] {
display: flex;
flex-direction: row;
padding: 10px;
max-width: 250px;
}
div[id^="landmark-basic-tools_ID_"],
div[id^="route-basic-tools_ID_"] {
align-items: center
}
Expand All @@ -60,6 +64,7 @@ div[id^="thumbnail_ID_"] {
padding-left: 10px;
}

span[id^="landmark-title_ID_"],
span[id^="route-title_ID_"],
span[id^="title_ID_"] {
word-break: break-word;
Expand Down Expand Up @@ -97,6 +102,7 @@ div[id^="opacity-middle-div_ID_"] {
padding-left: 6px;
}

label[id^="landmark-show-advanced-tools_ID_"],
label[id^="route-show-advanced-tools_ID_"],
label[id^="show-advanced-tools_ID_"] {
width: 25px;
Expand All @@ -105,6 +111,7 @@ label[id^="show-advanced-tools_ID_"] {
background-repeat: no-repeat;
background-position: center;
}
div[id^="landmark-advanced-tools_ID_"],
div[id^="route-advanced-tools_ID_"],
div[id^="advanced-tools_ID_"] {
margin: auto;
Expand All @@ -124,12 +131,15 @@ div[id^="advanced-tools_ID_"] {
top: -30px;
}

div[id^="landmark-advanced-tools_ID_"],
div[id^="route-advanced-tools_ID_"] {
top: 25px;
right: 35px;
left: unset;
}

label[id^="landmark-show-advanced-tools_ID_"]:hover
+ div[id^="landmark-advanced-tools_ID_"],
label[id^="route-show-advanced-tools_ID_"]:hover
+ div[id^="route-advanced-tools_ID_"],
label[id^="show-advanced-tools_ID_"]:hover
Expand All @@ -140,6 +150,7 @@ label[id^="show-advanced-tools_ID_"]:hover
transition: max-height 0.3s ease-out;
}

div[id^="landmark-advanced-tools_ID_"]:hover,
div[id^="route-advanced-tools_ID_"]:hover,
div[id^="advanced-tools_ID_"]:hover {
display: flex;
Expand All @@ -148,6 +159,7 @@ div[id^="advanced-tools_ID_"]:hover {
transition: max-height 0.3s ease-out;
}

input[id^="landmark-visibility_ID_"],
input[id^="route-visibility_ID_"],
input[id^="visibility_ID_"],
input[id^="color_ID_"] {
Expand All @@ -157,6 +169,7 @@ label[id^="color-picto_ID_"] {
background-image: url("./assets/layer-switcher/nb-layer.svg");
}

label[id^="landmark-visibility-picto_ID_"],
label[id^="route-visibility-picto_ID_"],
label[id^="visibility-picto_ID_"] {
background-image: url("./assets/layer-switcher/hide-layer.svg");
Expand All @@ -170,23 +183,28 @@ div[id^="info_ID_"] {
background-image: url("./assets/layer-switcher/info-layer.svg");
}

div[id^="landmark-remove_ID_"],
div[id^="route-remove_ID_"],
div[id^="remove_ID_"] {
background-image: url("./assets/layer-switcher/delete-layer.svg");
}

div[id^="landmark-remove_ID_"]:hover,
div[id^="route-remove_ID_"]:hover {
background-image: url("./assets/layer-switcher/delete-layer-confirm.svg");
}

div[id^="landmark-edit_ID_"],
div[id^="route-edit_ID_"] {
background-image: url("./assets/layer-switcher/edit-layer.svg");
}

div[id^="landmark-export_ID_"],
div[id^="route-export_ID_"] {
background-image: url("./assets/layer-switcher/export-layer.svg");
}

div[id^="landmark-share_ID_"],
div[id^="route-share_ID_"] {
background-image: url("./assets/layer-switcher/share-layer.svg");
}
Expand Down
4 changes: 4 additions & 0 deletions src/css/my-account.css
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,25 @@
padding: 0;
}

div[id^="landmark-container_ID_"],
div[id^="route-container_ID_"] {
width: 100%;
justify-content: space-between;
border-bottom: 1px solid #DDE1E6;
padding: 10px 0;
}

div[id^=landmark-cross-picto_ID_],
div[id^=route-cross-picto_ID_] {
margin-left: 15px;
}

div[id^=landmark-basic-tools_ID_],
div[id^=route-basic-tools_ID_] {
width: 100%;
}

div[id^=landmark-title_ID_]
div[id^=route-title_ID_] {
font-size: 13px;
font-family: "Open Sans Bold";
Expand Down
1 change: 1 addition & 0 deletions src/js/controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ const addControls = () => {
});
// Poi RLT
Globals.comparePoi = new ComparePoi(map, {});
Globals.myaccount.addLandmarksLayers();
});
});
};
Expand Down
4 changes: 3 additions & 1 deletion src/js/event-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ function addListeners() {
localStorage.setItem("lastMapZoom", map.getZoom());
localStorage.setItem("lastLayersDisplayed", JSON.stringify(Globals.layersDisplayed));
localStorage.setItem("savedRoutes", JSON.stringify(Globals.myaccount.routes));
localStorage.setItem("savedLandmarks", JSON.stringify(Globals.myaccount.landmarks));
});

window.addEventListener("beforeunload", () => {
Expand All @@ -91,6 +92,7 @@ function addListeners() {
localStorage.setItem("lastMapZoom", map.getZoom());
localStorage.setItem("lastLayersDisplayed", JSON.stringify(Globals.layersDisplayed));
localStorage.setItem("savedRoutes", JSON.stringify(Globals.myaccount.routes));
localStorage.setItem("savedLandmarks", JSON.stringify(Globals.myaccount.landmarks));
});

// Screen dimentions change
Expand Down Expand Up @@ -130,7 +132,7 @@ function addListeners() {
}
}
}
if (["selectOnMapDirections", "selectOnMapIsochrone", "compare"].includes(Globals.backButtonState)) {
if (["selectOnMapDirections", "selectOnMapIsochrone", "selectOnMapLandmark", "compare"].includes(Globals.backButtonState)) {
Globals.currentScrollIndex = 0;
}
if (Globals.backButtonState === "compareLayers2") {
Expand Down
29 changes: 29 additions & 0 deletions src/js/landmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { Toast } from "@capacitor/toast";
// dependance : abonnement au event du module
import Geocode from "./services/geocode";
import Location from "./services/location";
import Reverse from "./services/reverse";

/**
* Interface sur le contrôle point de repère
Expand Down Expand Up @@ -147,6 +148,34 @@ class Landmark {
};
}

/**
* listener sur la carte pour recuperer les coordonnées du point
* @param {*} e
*/
onAddWayPoint(e) {
console.debug(e);
var coordinates = e.lngLat;
Reverse.compute({
lon : coordinates.lng,
lat : coordinates.lat
})
.then(() => {})
.catch(() => {})
.finally(() => {
var coords = Reverse.getCoordinates() || {lon : coordinates.lng, lat : coordinates.lat};
var address = Reverse.getAddress() || coords.lon.toFixed(6) + ", " + coords.lat.toFixed(6);
var strAddress = address;
if (typeof address !== "string") {
strAddress = "";
strAddress += (address.number !== "") ? address.number + " " : "";
strAddress += (address.street !== "") ? address.street + ", " : "";
strAddress += address.city + ", " + address.postcode;
}
this.dom.location.dataset.coordinates = "[" + coords.lon + "," + coords.lat + "]";
this.dom.location.value = strAddress;
});
}

/**
* listener issu du dom sur l'interface du menu 'search'
* @param {*} e
Expand Down
3 changes: 3 additions & 0 deletions src/js/map-buttons-listeners.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ const addListeners = () => {
lat: Globals.map.getCenter().lat,
});
Globals.menu.close("selectOnMapDirections");
} else if (Globals.backButtonState === "selectOnMapLandmark") {
Globals.landmark.onAddWayPoint({lngLat: Globals.map.getCenter()});
Globals.menu.close("selectOnMapLandmark");
}
});
};
Expand Down
Loading

0 comments on commit f1d53b0

Please sign in to comment.