Skip to content

Commit

Permalink
fix: change metro map config tile URL for prod (#2322)
Browse files Browse the repository at this point in the history
  • Loading branch information
thecristen authored Jan 9, 2025
1 parent ed46513 commit 785a43f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
9 changes: 8 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ config :dotcom, :redix_pub_sub, Redix.PubSub
config :dotcom, :otp_module, OpenTripPlannerClient
config :dotcom, :req_module, Req

tile_server_url =
if config_env() == :prod,
do: "https://cdn.mbta.com",
else: "https://mbta-map-tiles-dev.s3.amazonaws.com"

config :dotcom, tile_server_url: tile_server_url

config :sentry,
enable_source_code_context: true,
root_source_code_paths: [File.cwd!()],
Expand All @@ -50,7 +57,7 @@ config :mbta_metro, :map, %{
"sources" => %{
"raster-tiles" => %{
"type" => "raster",
"tiles" => ["https://mbta-map-tiles-dev.s3.amazonaws.com/osm_tiles/{z}/{x}/{y}.png"],
"tiles" => ["#{tile_server_url}/osm_tiles/{z}/{x}/{y}.png"],
"tileSize" => 256,
"attribution" =>
"&copy; <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a>"
Expand Down
7 changes: 0 additions & 7 deletions config/dotcom/dotcom.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@ config :dotcom, start_data_processes: config_env() != :test

config :dotcom, Dotcom.BodyTag, mticket_header: "x-mticket"

tile_server_url =
if config_env() == :prod,
do: "https://cdn.mbta.com",
else: "https://mbta-map-tiles-dev.s3.amazonaws.com"

config :dotcom, tile_server_url: tile_server_url

response_fn =
if config_env() == :prod,
do: {DotcomWeb.StaticFileController, :redirect_through_cdn},
Expand Down

0 comments on commit 785a43f

Please sign in to comment.