<p dir="auto">There's a bunch of map layer configuration specified directly in javascript files, and I added more in <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="2009704906" data-permission-text="Title is private" data-url="https://github.com/openstreetmap/openstreetmap-website/issues/4367" data-hovercard-type="pull_request" data-hovercard-url="/openstreetmap/openstreetmap-website/pull/4367/hovercard" href="https://github.com/openstreetmap/openstreetmap-website/pull/4367">#4367</a>, the check for a layer name that can't be embedded. But it would be more convenient to have this configuration outside.</p>
<p dir="auto">Here the map key button checks if the layer is one of <code class="notranslate">["mapnik", "cyclemap"]</code> to enable/disable itself, with these layer names directly in js. But we can look into <code class="notranslate">key.yml</code>, see which layers have keys and enable the key button based on that.</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/4368'>https://github.com/openstreetmap/openstreetmap-website/pull/4368</a></p>

<h4>Commit Summary</h4>
<ul>
  <li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/4368/commits/857e9179b870203f1411bb6f9599ab676b77d5cf" class="commit-link">857e917</a>  Read layers with available map key from config/key.yml</li>
</ul>

<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/4368/files">2 files</a>)</p>
<ul>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4368/files#diff-08a7ab143240d1f24d2cfc6f105ae9a1d8bc7fc5d1b95a280cb8a76180e93397">app/assets/javascripts/leaflet.key.js</a>
    (2)
  </li>
  <li>
    <strong>M</strong>
    <a href="https://github.com/openstreetmap/openstreetmap-website/pull/4368/files#diff-a9b88a8a3644f944b9bd54361da588c69fa6a210cf7327194c17895a8ad2b0d6">app/assets/javascripts/osm.js.erb</a>
    (3)
  </li>
</ul>

<h4>Patch Links:</h4>
<ul>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4368.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/4368.patch</a></li>
  <li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/4368.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/4368.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/4368">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLLEBQRXL43AL3GXZ7LYGCQYHAVCNFSM6AAAAAA7ZFEOGGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAYDSNZWGE2DSNY">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLI7NN2Y5DFRY7ZYGZTYGCQYHA5CNFSM6AAAAAA7ZFEOGGWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHHPSUG3E.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/4368</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/4368",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/4368",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>