Set icon paths for markers on the embedded map
[rails.git] / app / assets / javascripts / embed.js.erb
similarity index 83%
rename from app/assets/javascripts/embed.js
rename to app/assets/javascripts/embed.js.erb
index 914eabb5b381ec3e0e7426057892c3eb29778382..09e211b0a5a1bcbb8c36c6d3109f8bf3574790a2 100644 (file)
@@ -26,7 +26,10 @@ window.onload = function () {
   }
 
   if (args.marker) {
-    L.marker(args.marker).addTo(map);
+    L.marker(args.marker, {icon: L.icon({
+      iconUrl: <%= asset_path('images/marker-icon.png').to_json %>,
+      shadowUrl: <%= asset_path('images/marker-shadow.png').to_json %>
+    })}).addTo(map);
   }
 
   if (args.bbox) {