lib/onebox/engine/google_maps_onebox.rb in onebox-1.8.13 vs lib/onebox/engine/google_maps_onebox.rb in onebox-1.8.14
- old
+ new
@@ -117,10 +117,11 @@
@url = "https://www.google.com/maps/embed?pb=!3m2!2sen!4v0!6m8!1m7!1s#{panoid}!2m2!1d#{lon}!2d#{lat}!3f#{heading}!4f#{pitch}!5f#{fov}"
@placeholder = "https://maps.googleapis.com/maps/api/streetview?size=690x400&location=#{lon},#{lat}&pano=#{panoid}&fov=#{zoom}&heading=#{heading}&pitch=#{pitch}&sensor=false"
when :canonical
uri = URI(@url)
- query = Hash[*uri.query.split("&").map{|a|a.split("=")}.flatten]
+
+ query = URI::decode_www_form(uri.query).to_h
if !query.has_key?("ll")
raise ArgumentError, "canonical url lacks location argument" unless query.has_key?("sll")
query["ll"] = query["sll"]
@url += "&ll=#{query["sll"]}"
end