diff options
-rw-r--r-- | plugin.rb | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -9,14 +9,14 @@ class Onebox::Engine::OpenStreetMapOnebox @@width = 425 @@height = 350 @@tile_size = 256 - @@REGEX = /^https?:\/\/umap\.openstreetmap\.fr/.*#map=([\d\.]+)\/([-\d\.]+)\/([-\d\.]+)/ + @@REGEX = /^https?:\/\/umap\.openstreetmap\.fr\/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 = "//umap.openstreetmap.fr/fr/map?bbox=#{get_bbox(lat.to_f, lon.to_f, zoom.to_i)}" + map_name, zoom, lat, lon = @url.match(@@REGEX).captures + iframe_url = "//umap.openstreetmap.fr/fr/map/#{map_name}?bbox=#{get_bbox(lat.to_f, lon.to_f, zoom.to_i)}" if marker = @url.match(/mlat=([-\d\.]+).+mlon=([-\d\.]+)/) mlat, mlon = marker.captures |