Skip to content

Commit

Permalink
Fix a bug where older (more transparent) markers could render on top …
Browse files Browse the repository at this point in the history
…of newer ones, creating odd colours
  • Loading branch information
ianrenton committed Nov 2, 2024
1 parent f0aba92 commit 63a0b91
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions code.js
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,11 @@ async function updateGMASpot(uid, cacheKey, apiResponse) {
// Update the objects that are rendered on the map. Clear old markers and draw new ones. This is
// called when the data model changes due to a server query.
async function updateMapObjects() {
// Iterate through spots. For each, update an existing marker
// Iterate through spots, sorted by time so that new markers are created on top of older ones. For each, update an existing marker
// or create a new marker if required.
spots.forEach(function(s) {
var spotObjects = Array.from(spots.values());
spotObjects.sort((a, b) => a.time.diff(b.time));
spotObjects.forEach(function(s) {
var pos = getIconPosition(s);

// Filter for the time threshold, programs, bands and modes we are interested in.
Expand Down

0 comments on commit 63a0b91

Please sign in to comment.