mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-22 00:57:26 +00:00
Before it would display a gray/blank div instead of map because the map latitude, longitude couldn't be calculated without geocoded enterprises. This adds a setting so the default coordinates can be set even if no geocoded enterprises present.
32 lines
855 B
Ruby
32 lines
855 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Api
|
|
class OpenStreetMapConfigSerializer < ActiveModel::Serializer
|
|
attributes :open_street_map_enabled,
|
|
:open_street_map_provider_name,
|
|
:open_street_map_provider_options,
|
|
:open_street_map_default_latitude,
|
|
:open_street_map_default_longitude
|
|
|
|
def open_street_map_enabled
|
|
ContentConfig.open_street_map_enabled
|
|
end
|
|
|
|
def open_street_map_provider_name
|
|
ContentConfig.open_street_map_provider_name
|
|
end
|
|
|
|
def open_street_map_provider_options
|
|
ContentConfig.open_street_map_provider_options.to_json
|
|
end
|
|
|
|
def open_street_map_default_latitude
|
|
ContentConfig.open_street_map_default_latitude
|
|
end
|
|
|
|
def open_street_map_default_longitude
|
|
ContentConfig.open_street_map_default_longitude
|
|
end
|
|
end
|
|
end
|