Skip to content

Commit

Permalink
requestAnimationFrame
Browse files Browse the repository at this point in the history
  • Loading branch information
simon04 committed Dec 19, 2024
1 parent 3058856 commit 12e3e77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,10 @@ async function buildMarkerMap(bulletins: AvalancheBulletin[]) {
map.addLayer(layer);

map.on("pointermove", (e) => {
const regionID = findMicroRegionID(e);
layer.set("regionID", regionID);
requestAnimationFrame(() => {
const regionID = findMicroRegionID(e);
layer.set("regionID", regionID);
});
});

map.on("click", (e) => {
Expand Down

0 comments on commit 12e3e77

Please sign in to comment.