Skip to content

Fix Wind Rose not displayed after new map generation#1415

Merged
Azgaar merged 2 commits into
masterfrom
copilot/fix-wind-rose-display-issue
May 26, 2026
Merged

Fix Wind Rose not displayed after new map generation#1415
Azgaar merged 2 commits into
masterfrom
copilot/fix-wind-rose-display-issue

Conversation

Copilot AI commented May 6, 2026

Copy link
Copy Markdown
Contributor

Description

The Wind Rose (compass rose) disappears after generating a new map because undraw() removes all <use> SVG elements from the viewbox — including the compass rose's <use xlink:href="#defs-compass-rose"> child. drawLayers() then restores visibility of the #compass group but never re-appends the deleted <use> element, leaving it empty.

Changes in public/modules/ui/layers.js:

  • drawLayers() — guard-check before restoring compass visibility; re-append <use> if missing:
    if (layerIsOn("toggleCompass")) {
      if (!compass.select("use").size()) compass.append("use").attr("xlink:href", "#defs-compass-rose");
      compass.style("display", "block");
    }
  • toggleCompass() — same guard added when the user manually re-enables the layer after a regeneration cycle, preventing the same blank-compass scenario on explicit toggle.

Copilot AI requested review from Copilot and removed request for Copilot May 6, 2026 21:02
Copilot AI linked an issue May 6, 2026 that may be closed by this pull request
@netlify

netlify Bot commented May 6, 2026

Copy link
Copy Markdown

Deploy Preview for afmg ready!

Name Link
🔨 Latest commit eb47941
🔍 Latest deploy log https://app.netlify.com/projects/afmg/deploys/69fbad7a2ff27400092641dc
😎 Deploy Preview https://deploy-preview-1415--afmg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI requested review from Copilot and removed request for Copilot May 6, 2026 21:07
Copilot AI changed the title [WIP] Fix wind rose not displayed after new map generation Fix Wind Rose not displayed after new map generation May 6, 2026
Copilot finished work on behalf of Azgaar May 6, 2026 21:08
Copilot AI requested a review from Azgaar May 6, 2026 21:08
@Azgaar Azgaar marked this pull request as ready for review May 26, 2026 11:02
@Azgaar Azgaar merged commit ef69952 into master May 26, 2026
4 checks passed
@Azgaar Azgaar deleted the copilot/fix-wind-rose-display-issue branch May 26, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wind Rose is not displayed after the new map generation

2 participants