<p>I saw <a href="https://help.openstreetmap.org/questions/52023/embedded-maps-not-working">a report</a> on help.openstreetmap.org and thought I should investigate.</p>
<p>The embedded maps are no longer working for the Transport and Cycle layers, since the JavaScript code that generates the embedding output does not included the JavaScript code that sets the API Keys. Using an embedded map on a test site, I see the following in the console:</p>
<pre><code>Error: No value provided for variable {apikey}
...unction(e,n){var o=a[n];if(o===t)throw new Error("No value provided for variable...
</code></pre>
<p><a href="http://www.openstreetmap.org/export/embed.html?layer=cyclemap">http://www.openstreetmap.org/export/embed.html?layer=cyclemap</a><br>
<a href="http://www.openstreetmap.org/export/embed.html">http://www.openstreetmap.org/export/embed.html</a></p>
<p>I'm assuming that the <code>app/assets/javascripts/embed.js.erb</code> file isn't including the correct file (i.e. <code>app/assets/javascripts/osm.js.erb</code> where the API Key is transferred into the javascript code).</p>
<p>Unfortunately I haven't figured out the javascript dependencies for <code>embed.js.erb</code> so I can't see what should be fixed and where the dependency should be added. I don't see any of the files referenced at the top of that file ( "leaflet", "leaflet.osm", "i18n/translations") so there's some magic somewhere.</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/issues/1293">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABWnLW6J77kiArWvJ8rX0wqEoDuFVLU_ks5qsXVIgaJpZM4KDHnr">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABWnLWCo3AesaYz_jzqJo7AhorNB0pfDks5qsXVIgaJpZM4KDHnr.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
<link itemprop="url" href="https://github.com/openstreetmap/openstreetmap-website/issues/1293"></link>
<meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/openstreetmap/openstreetmap-website","title":"openstreetmap/openstreetmap-website","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/openstreetmap/openstreetmap-website"}},"updates":{"snippets":[{"icon":"DESCRIPTION","message":"Embedded maps are broken for Thunderforest layers (#1293)"}],"action":{"name":"View Issue","url":"https://github.com/openstreetmap/openstreetmap-website/issues/1293"}}}</script>