From 7e65af532d2c29fd2e1f49cee11e1144fd2c5276 Mon Sep 17 00:00:00 2001 From: Skud Date: Wed, 11 Sep 2013 18:05:38 +1000 Subject: [PATCH] Set Leaflet icon path explicitly. When we tried to deploy maps on staging, we got the following error message in our Javascript console: Error: Couldn't autodetect L.Icon.Default.imagePath, set it manually. ... so we did. The end. --- app/assets/javascripts/places.js.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/assets/javascripts/places.js.erb b/app/assets/javascripts/places.js.erb index b783cb9a4..9bf3e9af8 100644 --- a/app/assets/javascripts/places.js.erb +++ b/app/assets/javascripts/places.js.erb @@ -5,6 +5,8 @@ cloudmade_url = "http://{s}.tile.cloudmade.com/" + cloudmade_key + "/997/256/{z} nominatim_base_url = 'http://nominatim.openstreetmap.org/search/'; nominatim_user_agent_email = "<%= Growstuff::Application.config.user_agent_email %>"; +L.Icon.Default.imagePath = '/assets' + if (location.pathname === places_base_path) { //places index page map = L.map('map').setView([0.0, -0.0], 2); showMap(map);