Skip to content

Fix Wind Rose not displayed after new map generation#1415

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-wind-rose-display-issue
Draft

Fix Wind Rose not displayed after new map generation#1415
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-wind-rose-display-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 6, 2026

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
Copy link
Copy Markdown

netlify Bot commented May 6, 2026

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
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