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

Embed OpenStreetMap #84

Closed
xplosionmind opened this issue Mar 24, 2022 · 2 comments · Fixed by #250
Closed

Embed OpenStreetMap #84

xplosionmind opened this issue Mar 24, 2022 · 2 comments · Fixed by #250
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@xplosionmind
Copy link

It would be awesome to add the possibility of embedding OpenStreetMap

@gfscott
Copy link
Owner

gfscott commented Mar 28, 2022

Interesting! Would need some further investigation first. At first glance I don't see an obvious 1:1 relationship between the URL structure when browsing the website (i.e. https://www.openstreetmap.org/#map=9/44.6337/-110.4361) which is based on a single lat/long coordinate and a zoom level) and the embed URLs (i.e. https://www.openstreetmap.org/export/embed.html?bbox=-111.80249691009523%2C43.380302213389164%2C-109.06964778900148%2C45.86056277171565), which defines a rectangular bounding box containing that view.

I'm sure there's a way to calculate it, but just not sure what it is. But definitely worth considering, I've never really thought about adding mapping platforms to the mix. Thanks for filing an issue!

@gfscott gfscott added enhancement New feature or request help wanted Extra attention is needed labels Mar 28, 2022
@muffinresearch
Copy link

muffinresearch commented Sep 12, 2022

I like this feature idea, and seeing the help wanted I took at look at what it would take to make a conversion from the URL to a working embed. Here's an example based on porting this perl code to JavaScript with a couple of small tweaks to get the results to match what the map page embed output would display. Feel free to use it as you see fit.

It'll need tidying up, but at least this provides something resembling a PoC.

gfscott added a commit that referenced this issue Nov 12, 2022
* Add clipboard-write value to allow params

* update tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants