Skip to content

Commit

Permalink
refactoring: explicit variable names for event callback
Browse files Browse the repository at this point in the history
  • Loading branch information
davvalent committed Mar 13, 2024
1 parent 6e3e8d2 commit fdebb01
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions dist/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ console.log(
* Event passé automatiquement au callback
* Le callback est exécuté lorsque la visioneuse s'ouvre
*/
layer.on("popupopen", async (event) => {

const popupId = `id-${e.popup._leaflet_id}-`;
const popupId = `id-${event.popup._leaflet_id}-`;

let URI = feature.properties.URI;

Expand Down Expand Up @@ -384,14 +385,14 @@ console.log(
*/

/** récupérer données de géolocalisation */
pifm.on("click", (e) => {
pifm.on("click", (event) => {

console.log(e.latlng);
console.log(event.latlng);

let coordinates = `[ a ecrm:E53_Place ;\n`;
coordinates += ` ecrm:P168_place_is_defined_by [\n`;
coordinates += ` a geo:Geometry ;\n`;
coordinates += ` geo:asGeoJSON "{\\"type\\": \\"Point\\", \\"coordinates\\": [${e.latlng.lng},${e.latlng.lat}]}"^^geo:geoJSONLiteral\n`
coordinates += ` geo:asGeoJSON "{\\"type\\": \\"Point\\", \\"coordinates\\": [${event.latlng.lng},${event.latlng.lat}]}"^^geo:geoJSONLiteral\n`
coordinates += ` ]\n`;
coordinates += `]`;

Expand All @@ -402,8 +403,8 @@ console.log(
pifm.on("popupopen", () => {
devConsole("Dev: Message fired on POPUP OPENING");
});
pifm.on("popupclose", (e) => {
devConsole("Dev CLOSE: Message fired on pop-up closing", e);
pifm.on("popupclose", (event) => {
devConsole("Dev CLOSE: Message fired on pop-up closing", event);
});
};

Expand Down

0 comments on commit fdebb01

Please sign in to comment.