mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-25 20:46:48 +00:00
18 lines
427 B
Ruby
18 lines
427 B
Ruby
# frozen_string_literal: true
|
|
|
|
module MapHelper
|
|
def using_google_maps?
|
|
!ContentConfig.open_street_map_enabled && (
|
|
ENV["GOOGLE_MAPS_API_KEY"].present? || google_maps_configured_with_geocoder_api_key?
|
|
)
|
|
end
|
|
|
|
private
|
|
|
|
def google_maps_configured_with_geocoder_api_key?
|
|
ENV["GEOCODER_API_KEY"].present? && (
|
|
ENV["GEOCODER_SERVICE"].to_s == "google" || ENV["GEOCODER_SERVICE"].blank?
|
|
)
|
|
end
|
|
end
|