Set size and anchor position for embedded markers
authorTom Hughes <tom@compton.nu>
Fri, 23 Nov 2012 17:57:47 +0000 (17:57 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 23 Nov 2012 17:57:47 +0000 (17:57 +0000)
app/assets/javascripts/embed.js.erb

index 09e211b0a5a1bcbb8c36c6d3109f8bf3574790a2..742061fa618a6d790fd06ba5830b61af97ae236f 100644 (file)
@@ -28,7 +28,10 @@ window.onload = function () {
   if (args.marker) {
     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 %>
+      iconSize: new L.Point(25, 41),
+      iconAnchor: new L.Point(12, 41),
+      shadowUrl: <%= asset_path('images/marker-shadow.png').to_json %>,
+      shadowSize: new L.Point(41, 41)
     })}).addTo(map);
   }