<p dir="auto">Currently map layer API keys have one extra level of indirection:</p>
<ul dir="auto">
<li>keys are defined in the settings</li>
<li><code class="notranslate">osm.js.erb</code> reads them from the settings and writes them to <code class="notranslate">OSM.THUNDERFOREST_KEY</code> and <code class="notranslate">OSM.TRACESTRACK_KEY</code></li>
<li><code class="notranslate">layers.yml</code> contain names of <code class="notranslate">OSM</code> properties to check for keys</li>
</ul>
<p dir="auto">Instead of this <code class="notranslate">osm.js.erb</code> could write keys directly to layer definitions, skipping <code class="notranslate">OSM.THUNDERFOREST_KEY</code> and <code class="notranslate">OSM.TRACESTRACK_KEY</code>. <code class="notranslate">layers.yml</code> could contain the corresponding settings names. The advantage is that Thunderforest and Tracestrack keys are no longer special. A new key can be added just by editing <code class="notranslate">settings.yml</code> and <code class="notranslate">layers.yml</code>. Also it's possible to skip layer definitions if they require a key and that key is missing.</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/5352'>https://github.com/openstreetmap/openstreetmap-website/pull/5352</a></p>
<h4>Commit Summary</h4>
<ul>
<li><a href="https://github.com/openstreetmap/openstreetmap-website/pull/5352/commits/25279c4697a5805c6e0c3325ed8963bbca9d0d8b" class="commit-link">25279c4</a> Put api keys directly in js layer definitions</li>
</ul>
<h4 style="display: inline-block">File Changes </h4> <p style="display: inline-block">(<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5352/files">3 files</a>)</p>
<ul>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5352/files#diff-f060eef487077b042f45b3a12e7a2cbd54a446f8c744cdb98405a1295430e8b9">app/assets/javascripts/leaflet.map.js</a>
(14)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5352/files#diff-a9b88a8a3644f944b9bd54361da588c69fa6a210cf7327194c17895a8ad2b0d6">app/assets/javascripts/osm.js.erb</a>
(24)
</li>
<li>
<strong>M</strong>
<a href="https://github.com/openstreetmap/openstreetmap-website/pull/5352/files#diff-d892782f9b64fbeb09be7a61ed829d071c868b6b125f6a74df1de4bb033524a2">config/layers.yml</a>
(6)
</li>
</ul>
<h4>Patch Links:</h4>
<ul>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5352.patch'>https://github.com/openstreetmap/openstreetmap-website/pull/5352.patch</a></li>
<li><a href='https://github.com/openstreetmap/openstreetmap-website/pull/5352.diff'>https://github.com/openstreetmap/openstreetmap-website/pull/5352.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/5352">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLKMMTMXAU73YZIDUUT2CECH5AVCNFSM6AAAAABSLRM6WSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGY4DMNZVGE4DSMQ">unsubscribe</a>.<br />You are receiving this because you are subscribed to this thread.<img src="https://github.com/notifications/beacon/AAK2OLLMNNEKVHBTE2NT6L32CECH5A5CNFSM6AAAAABSLRM6WSWGG33NNVSW45C7OR4XAZNFJFZXG5LFVJRW63LNMVXHIX3JMTHKAJEUSQ.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/5352</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/5352",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/5352",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>