<p dir="auto"><a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2770637460" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/5474" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/5474/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/5474">#5474</a> added an unpleasant blink when an overlay is enabled, and you try to close the sidebar:</p>
<p dir="auto"><a href="https://github.com/user-attachments/assets/4d3063b9-dd39-4553-844b-e2bd99c11241">https://github.com/user-attachments/assets/4d3063b9-dd39-4553-844b-e2bd99c11241</a></p>
<p dir="auto">This is because <code class="notranslate">var layers = layerParam || "M";</code> does not add <code class="notranslate">M</code> when overlay is enabled (<code class="notranslate">layerParam</code> is not empty). I added a check that if Mapnik is the current layer, then we add its code, so that`.removeLayer () ' was not called for it.</p>
<p dir="auto">Checking <code class="notranslate">this.getMapbaslaver() &&</code> is important because when opening the tab it can return undefined.</p>

<hr>

<h4>You can view, comment on, or merge this pull request online at:</h4>
<p>  <a href='https://github.com/openstreetmap/openstreetmap-website/pull/5570'>https://github.com/openstreetmap/openstreetmap-website/pull/5570</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5570/commits/202d3f6286448a0144e53c4ac19ff3a82a6c0a9e" class="commit-link">202d3f6</a>  fix map blink when active Mapnik + some overlay</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5570/files">1 file</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5570/files#diff-f060eef487077b042f45b3a12e7a2cbd54a446f8c744cdb98405a1295430e8b9">app/assets/javascripts/leaflet.map.js</a>
    (3)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5570.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5570.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5570.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5570.diff</a></li>
</ul>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/5570">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLN4RUJCQAG6XUARDSD2NALNRAVCNFSM6AAAAABWBVF2ICVHI2DSMVQWIX3LMV43ASLTON2WKOZSHAYTMOJVGEYTEMY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLM4OD3BMWRCS4E4E732NALNRA5CNFSM6AAAAABWBVF2ICWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHKPZ2DKM.gif" height="1" width="1" alt="" /><span style="color: transparent; font-size: 0; display: none; visibility: hidden; overflow: hidden; opacity: 0; width: 0; height: 0; max-width: 0; max-height: 0; mso-hide: all">Message ID: <span><openstreetmap/openstreetmap-website/pull/5570</span><span>@</span><span>github</span><span>.</span><span>com></span></span></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/5570",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5570",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>