diff options
author | hellekin <how@cepheide.org> | 2024-03-17 11:59:08 +0100 |
---|---|---|
committer | hellekin <how@cepheide.org> | 2024-03-17 11:59:08 +0100 |
commit | 87751ff172c110b18616d56ae9808979ef8f9b08 (patch) | |
tree | 02af7a1c785e1cd0345c06449ee014d29849176c /plugin.rb | |
parent | 362ba18d975b7241222881441c1f0f6bbcedae1f (diff) | |
download | discourse-umap-87751ff172c110b18616d56ae9808979ef8f9b08.tar.gz |
Adapt plugin for UMAP
Diffstat (limited to 'plugin.rb')
-rw-r--r-- | plugin.rb | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -9,14 +9,14 @@ class Onebox::Engine::OpenStreetMapOnebox @@width = 425 @@height = 350 @@tile_size = 256 - @@REGEX = /^https?:\/\/(?:www\.)openstreetmap\.org\/.*#map=([\d\.]+)\/([-\d\.]+)\/([-\d\.]+)/ + @@REGEX = /^https?:\/\/umap\.openstreetmap\.fr/.*#map=([\d\.]+)\/([-\d\.]+)\/([-\d\.]+)/ # enable oneboxing permalinks (http://wiki.openstreetmap.org/wiki/Permalink) into iframes matches_regexp(@@REGEX) def to_html zoom, lat, lon = @url.match(@@REGEX).captures - iframe_url = "//www.openstreetmap.org/export/embed.html?bbox=#{get_bbox(lat.to_f, lon.to_f, zoom.to_i)}" + iframe_url = "//umap.openstreetmap.fr/fr/map?bbox=#{get_bbox(lat.to_f, lon.to_f, zoom.to_i)}" if marker = @url.match(/mlat=([-\d\.]+).+mlon=([-\d\.]+)/) mlat, mlon = marker.captures |