Skip to content

Commit

Permalink
Fix maps (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
fblupi authored Feb 7, 2024
1 parent ae9d64c commit 21d6c3d
Showing 1 changed file with 65 additions and 6 deletions.
71 changes: 65 additions & 6 deletions config/initializers/decidim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,72 @@
config.default_locale = Rails.application.secrets.decidim[:default_locale].presence || :en
config.available_locales = Rails.application.secrets.decidim[:available_locales].presence || [:en]

# Geocoder configuration
config.maps = {
provider: :here,
api_key: Rails.application.secrets.maps[:api_key],
static: { url: "https://image.maps.ls.hereapi.com/mia/1.6/mapview" }
}
# Map and Geocoder configuration
#
# == HERE Maps ==
# config.maps = {
# provider: :here,
# api_key: Rails.application.secrets.maps[:api_key],
# static: { url: "https://image.maps.ls.hereapi.com/mia/1.6/mapview" }
# }
#
# == OpenStreetMap (OSM) services ==
# To use the OSM map service providers, you will need a service provider for
# the following map servers or host all of them yourself:
# - A tile server for the dynamic maps
# (https://wiki.openstreetmap.org/wiki/Tile_servers)
# - A Nominatim geocoding server for the geocoding functionality
# (https://wiki.openstreetmap.org/wiki/Nominatim)
# - A static map server for static map images
# (https://github.com/jperelli/osm-static-maps)
#
# When used, please read carefully the terms of service for your service
# provider.
#
# config.maps = {
# provider: :osm,
# api_key: Rails.application.secrets.maps[:api_key],
# dynamic: {
# tile_layer: {
# url: "https://tiles.example.org/{z}/{x}/{y}.png?key={apiKey}&{foo}",
# api_key: true,
# foo: "bar=baz",
# attribution: %(
# <a href="https://www.openstreetmap.org/copyright" target="_blank">&copy; OpenStreetMap</a> contributors
# ).strip
# # Translatable attribution:
# # attribution: -> { I18n.t("tile_layer_attribution") }
# }
# },
# static: { url: "https://staticmap.example.org/" },
# geocoding: { host: "nominatim.example.org", use_https: true }
# }
#
# == Combination (OpenStreetMap default + HERE Maps dynamic map tiles) ==
# config.maps = {
# provider: :osm,
# api_key: Rails.application.secrets.maps[:api_key],
# dynamic: {
# provider: :here,
# api_key: Rails.application.secrets.maps[:here_api_key]
# },
# static: { url: "https://staticmap.example.org/" },
# geocoding: { host: "nominatim.example.org", use_https: true }
# }

# Geocoder configurations if you want to customize the default geocoding
# settings. The maps configuration will manage which geocoding service to use,
# so that does not need any additional configuration here. Use this only for
# the global geocoder preferences.
# config.geocoder = {
# # geocoding service request timeout, in seconds (default 3):
# timeout: 5,
# # set default units to kilometers:
# units: :km,
# # caching (see https://github.com/alexreisner/geocoder#caching for details):
# cache: Redis.new,
# cache_prefix: "..."
# }
if Rails.application.secrets.maps.present? && Rails.application.secrets.maps[:static_provider].present?
static_provider = Rails.application.secrets.maps[:static_provider]
dynamic_provider = Rails.application.secrets.maps[:dynamic_provider]
Expand Down

0 comments on commit 21d6c3d

Please sign in to comment.