diff --git a/app/views/pages/map.slim b/app/views/pages/map.slim index 3d68e1a..10af0ea 100644 --- a/app/views/pages/map.slim +++ b/app/views/pages/map.slim @@ -10,6 +10,18 @@ css: #map javascript: + + function pinSymbol(color) { + return { + path: 'M 0,0 C -2,-20 -10,-22 -10,-30 A 10,10 0 1,1 10,-30 C 10,-22 2,-20 0,0 z M -2,-30 a 2,2 0 1,1 4,0 2,2 0 1,1 -4,0', + fillColor: color, + fillOpacity: 1, + strokeColor: '#000', + strokeWeight: 1, + scale: 0.5, + }; + } + function initMap() { var supporters = #{@supporters.to_json.html_safe} @@ -43,6 +55,12 @@ javascript: center: {lat: supporter.coordinates[1], lng: supporter.coordinates[0]}, radius: radius }); + + var marker = new google.maps.Marker({ + position: {lat: supporter.coordinates[1], lng: supporter.coordinates[0]}, + map: map, + icon: pinSymbol(color) + }); }); }