Skip to content

Commit

Permalink
fix(myaccount): map interaction with saved features (#115)
Browse files Browse the repository at this point in the history
  • Loading branch information
azarz authored Jul 29, 2024
1 parent 832eb92 commit dea14e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
9 changes: 3 additions & 6 deletions src/js/landmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,9 @@ class Landmark {
duration: "long",
position: "top"
});
this.map.flyTo({center: landmarkJson.geometry.coordinates});
this.map.once("resize", () => {
setTimeout(() => {
this.map.flyTo({center: landmarkJson.geometry.coordinates});
}, 100);
});
setTimeout(() => {
this.map.flyTo({center: landmarkJson.geometry.coordinates});
}, 200);
this.hide();
});
}
Expand Down
7 changes: 6 additions & 1 deletion src/js/my-account/my-account.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,14 @@ class MyAccount {
if (["routeDraw", "routeDrawSave"].includes(Globals.backButtonState)) {
return;
}
if (this.map.queryRenderedFeatures(e.point, {layers: [MyAccountLayers["landmark-casing"].id]}).length > 0) {
return;
}
const routeId = this.map.queryRenderedFeatures(e.point, {layers: [MyAccountLayers["line-casing"].id]})[0].properties.id;
const route = this.routes.filter( route => route.id == routeId)[0];
this.showRouteDetails(route);
if (route.visible) {
this.showRouteDetails(route);
}
});

App.addListener("appUrlOpen", (data) => {
Expand Down

0 comments on commit dea14e8

Please sign in to comment.