diff --git a/app/assets/javascripts/cropmap.js.erb b/app/assets/javascripts/cropmap.js.erb index 756530666..1366a461d 100644 --- a/app/assets/javascripts/cropmap.js.erb +++ b/app/assets/javascripts/cropmap.js.erb @@ -1,10 +1,6 @@ function showCropMap(cropmap) { - var mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Rails.application.config.mapbox_map_id %>"; - var mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Rails.application.config.mapbox_access_token %>"; - var mapbox_base_url = "https://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token; - - L.tileLayer(mapbox_base_url, { - attribution: 'Map data © OpenStreetMap contributors under ODbL | Map imagery © Mapbox', + L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors', maxZoom: 18 }).addTo(cropmap); var markers = new L.MarkerClusterGroup({showCoverageOnHover: false, maxClusterRadius: 20 }); diff --git a/app/assets/javascripts/members.js.erb b/app/assets/javascripts/members.js.erb index 42fafe6b5..ab00a33b2 100644 --- a/app/assets/javascripts/members.js.erb +++ b/app/assets/javascripts/members.js.erb @@ -1,10 +1,4 @@ if (document.getElementById("membermap") !== null) { - var mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Rails.application.config.mapbox_map_id %>"; - var mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Rails.application.config.mapbox_access_token %>"; - var mapbox_base_url = "https://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token; - - L.Icon.Default.imagePath = '/assets' - L.Icon.Default.imagePath = '/assets'; var default_marker_icon = L.icon({ @@ -18,8 +12,8 @@ if (document.getElementById("membermap") !== null) { if (member.latitude && member.longitude) { var membermap = L.map('membermap').setView([member.latitude, member.longitude], 4); - L.tileLayer(mapbox_base_url, { - attribution: 'Map data © OpenStreetMap contributors under ODbL | Map imagery © Mapbox', + L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors', maxZoom: 18 }).addTo(membermap); var marker = new L.Marker(new L.LatLng(member.latitude, member.longitude), diff --git a/app/assets/javascripts/places.js.erb b/app/assets/javascripts/places.js.erb index b5917f614..93e5e9538 100644 --- a/app/assets/javascripts/places.js.erb +++ b/app/assets/javascripts/places.js.erb @@ -1,8 +1,5 @@ if (document.getElementById("placesmap") !== null) { var places_base_path = "/places"; - var mapbox_map_id = "<%= Rails.env == 'test' ? 0 : Rails.application.config.mapbox_map_id %>"; - var mapbox_access_token = "<%= Rails.env == 'test' ? 0 : Rails.application.config.mapbox_access_token %>"; - var mapbox_base_url = "https://a.tiles.mapbox.com/v4/" + mapbox_map_id + "/{z}/{x}/{y}.png?access_token=" + mapbox_access_token; var nominatim_base_url = 'https://nominatim.openstreetmap.org/search/'; var nominatim_user_agent_email = "<%= Rails.env == 'test' ? 0 : Rails.application.config.user_agent_email %>"; @@ -31,8 +28,8 @@ if (document.getElementById("placesmap") !== null) { } function showMap(placesmap) { - L.tileLayer(mapbox_base_url, { - attribution: 'Map data © OpenStreetMap contributors under ODbL | Map imagery © Mapbox', + L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', { + attribution: '© OpenStreetMap contributors', maxZoom: 18 }).addTo(placesmap); diff --git a/app/views/places/_search_form.html.haml b/app/views/places/_search_form.html.haml index 57b1a1b6f..bb4cd68ea 100644 --- a/app/views/places/_search_form.html.haml +++ b/app/views/places/_search_form.html.haml @@ -1,6 +1,6 @@ %form.form-inline{ action: search_places_path, method: :get, role: 'form' } .form-group = label_tag :new_place, "Change location:", class: 'sr-only' - = text_field_tag :new_place, '', class: 'form-control', placeholder: "New location..." + = text_field_tag :new_place, '', class: 'form-control', placeholder: "Search for city, suburb or state..." = submit_tag "Search", class: 'btn btn-primary', id: "search_button" %br/ diff --git a/config/environments/development.rb b/config/environments/development.rb index caaf7fcd9..0368822e9 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -69,11 +69,6 @@ Rails.application.configure do config.host = 'localhost:3000' config.analytics_code = '' - # this config variable cannot be put in application.yml as it is needed - # by the assets pipeline, which doesn't have access to ENV. - config.mapbox_map_id = 'growstuff.i3n2il6a' - config.mapbox_access_token = 'pk.eyJ1IjoiZ3Jvd3N0dWZmIiwiYSI6IkdxMkx4alUifQ.n0igaBsw97s14zMa0lwKCA' - config.action_controller.action_on_unpermitted_parameters = :raise config.active_job.queue_adapter = :sidekiq diff --git a/config/environments/production.rb b/config/environments/production.rb index 01f901f4d..d16a4af0d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -109,11 +109,6 @@ Rails.application.configure do eos - # this config variable cannot be put in application.yml as it is needed - # by the assets pipeline, which doesn't have access to ENV. - config.mapbox_map_id = ENV['GROWSTUFF_MAPBOX_MAP_ID'] - config.mapbox_access_token = ENV['GROWSTUFF_MAPBOX_ACCESS_TOKEN'] - config.active_job.queue_adapter = :sidekiq # Use a different logger for distributed setups. # require 'syslog/logger' diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 03330a79c..37bf1aee3 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -103,7 +103,6 @@ RSpec.configure do |config| if page.driver.browser.respond_to?(:url_blacklist) page.driver.browser.url_blacklist = [ 'gravatar.com', - 'mapbox.com', 'okfn.org', 'googlecode.com' ]