Files
danbooru/app/helpers/ip_addresses_helper.rb
evazion a7dc05ce63 Enable frozen string literals.
Make all string literals immutable by default.
2021-12-14 21:33:27 -06:00

16 lines
455 B
Ruby

# frozen_string_literal: true
module IpAddressesHelper
# https://www.bing.com/maps/embed-a-map
# https://docs.microsoft.com/en-us/bingmaps/articles/create-a-custom-map-url
def embedded_map(lat, long, width, height, zoom: 10)
tag.iframe(
width: width,
height: height,
frameborder: 0,
allowfullscreen: true,
src: "https://www.bing.com/maps/embed?w=#{width}&h=#{height}&cp=#{lat}~#{long}&lvl=#{zoom}"
)
end
end