Skip to content

Commit

Permalink
Pulsars get removed as soon as first hover
Browse files Browse the repository at this point in the history
  • Loading branch information
krasch committed Dec 18, 2024
1 parent 98c6278 commit 165d0df
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions script/components/map/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@ class MapWrapper {

// set up mouse events for interacting with cities
layerMouseEvents.cities.on("mouseOver", (id, lngLat) => {
if (!pulsarsRemoved) {
for (let p of pulsars) p.remove();
pulsarsRemoved = true;
}

this.map.getCanvas().style.cursor = "pointer";
this.setCityHoverState(id, true);
/*this.#cityTooltip
Expand All @@ -234,10 +239,6 @@ class MapWrapper {
//this.#cityTooltip.remove();
});
layerMouseEvents.cities.on("click", (id, lngLat) => {
if (!pulsarsRemoved) {
for (let p of pulsars) p.remove();
pulsarsRemoved = true;
}
// when clicking on city name, popup should show
this.#objects.cityMenus.show(this.map, id);
});
Expand Down

0 comments on commit 165d0df

Please sign in to comment.