OpenStreet maps embedding


(Ilya Kuchaev) #1

Continuing the discussion from Can Google Maps be embedded into Topics?:

Can we add this for http://www.openstreetmap.org/?


(Ilya Kuchaev) #2

Here is the iframe:

<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.openstreetmap.org/export/embed.html?bbox=33.49883794784546%2C44.61190236910504%2C33.52287054061889%2C44.62091409166478&amp;layer=mapnik&amp;marker=44.61640840520352%2C33.51085424423218" style="border: 1px solid black"></iframe><br/><small><a href="http://www.openstreetmap.org/?mlat=44.6164&amp;mlon=33.5109#map=16/44.6164/33.5109">Посмотреть более крупную карту</a></small>

(Marcin Rataj) #3

There are also permalinks which could trigger oneboxing:

http://www.openstreetmap.org/?mlat=51.2269&mlon=22.5115#map=16/51.2269/22.5115

This would be a good way to emphasize Discourse’s support of open web. :+1:

OSM is the only real and open alternative to Google Maps we have.
IMO should be supported and whitelisted by default: just like Wikipedia is.


(Ilya Kuchaev) #4

Let’s include Wikimapia also :blush:


(Marcin Rataj) #5

Hi, short update:

I created PR which adds OSM iframe whitelisting:

https://github.com/discourse/discourse/pull/2973

If someone is interested I also started development of a simple onebox plugin: discourse-openstreetmap.

It provides oneboxer for links like:


With the recent change to onebox library, oneboxing of links starting with a hash (like OpenStreetMap) works too.

(Perhaps if the PR above gets accepted and the plugin feels mature enough at some point the OSM oneboxer could be introduced as a PR for the onebox library.)


#6

Wouldn’t it be nice to have direct embedding of OSM maps from UMAP links? For example, this doesn’t give anything now, but it could embed the actual map, maybe using the OpenStreetMap plugin, or the Locations plugin…

http://umap.fluv.io/en/map/belvil-pick-up_5141

http://umap.openstreetmap.fr/en/map/ethnographic-map-of-mus-and-bingol-updated11_180964


#7

You may know this by now, and it may not have been possible back then, but there are two things you need to check to see the actual map in place, rather than just a friendly external link:

  • whitelist openstreetmap in settings -> security
  • if necessary, ensure the iframe includes the https flavour of links (you may have to manually add the ‘s’ to ‘http’ - check both links, the one inside the iframe tag may be just ‘http’).

Then the map should appear as expected:


View Larger Map