Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Embedded maps are broken for Thunderforest layers #1293

Closed
gravitystorm opened this issue Sep 21, 2016 · 2 comments
Closed

Embedded maps are broken for Thunderforest layers #1293

gravitystorm opened this issue Sep 21, 2016 · 2 comments
Labels
bug Something is broken or not working as expected

Comments

@gravitystorm
Copy link
Collaborator

I saw a report on help.openstreetmap.org and thought I should investigate.

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:

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

http://www.openstreetmap.org/export/embed.html?layer=cyclemap
http://www.openstreetmap.org/export/embed.html

I'm assuming that the app/assets/javascripts/embed.js.erb file isn't including the correct file (i.e. app/assets/javascripts/osm.js.erb where the API Key is transferred into the javascript code).

Unfortunately I haven't figured out the javascript dependencies for embed.js.erb 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.

@gravitystorm gravitystorm added the bug Something is broken or not working as expected label Sep 21, 2016
@tomhughes
Copy link
Member

Well embed.js.erb is kind of standalone, but as it's erb it can insert the global directly...

@black-snow
Copy link

@tomhughes Embedded maps are (again?) not working for me.

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.openstreetmap.org/export/embed.html?bbox=13.27938884496689%2C52.47697613861493%2C13.282763063907625%2C52.478498702364185&amp;layer=mapnik&amp;marker=52.47773742707537%2C13.281075954437256" style="border: 1px solid black"></iframe><br/><small><a href="http://www.openstreetmap.org/?mlat=52.47774&amp;mlon=13.28108#map=19/52.47774/13.28108">Größere Karte anzeigen</a></small>

shows nothing but a gray box. Has anything changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken or not working as expected
Projects
None yet
Development

No branches or pull requests

3 participants