Replace the Google map on the IP address show page with a Bing map. Bing doesn't require an API key, which makes it easier to deploy. The Google Maps API requires to you to whitelist the IP addresses and domains you plan to use with your API key, which is inconvenient for development because it means maps won't display unless you whitelist your development IPs.
14 lines
424 B
Ruby
14 lines
424 B
Ruby
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
|