added markers

This commit is contained in:
2015-10-06 15:24:14 +02:00
parent a0e6d39a3e
commit 82a91e2f2a
+18
View File
@@ -10,6 +10,18 @@ css:
#map #map
javascript: 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() { function initMap() {
var supporters = #{@supporters.to_json.html_safe} var supporters = #{@supporters.to_json.html_safe}
@@ -43,6 +55,12 @@ javascript:
center: {lat: supporter.coordinates[1], lng: supporter.coordinates[0]}, center: {lat: supporter.coordinates[1], lng: supporter.coordinates[0]},
radius: radius radius: radius
}); });
var marker = new google.maps.Marker({
position: {lat: supporter.coordinates[1], lng: supporter.coordinates[0]},
map: map,
icon: pinSymbol(color)
});
}); });
} }