Skip to content

Commit

Permalink
proper stadium markers
Browse files Browse the repository at this point in the history
  • Loading branch information
mneedham committed Jun 30, 2013
1 parent ed7d064 commit b58230b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
Binary file added public/leaflet/.DS_Store
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/leaflet/images/marker-stadium-icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/leaflet/images/marker-stadium-icon.pxm
Binary file not shown.
18 changes: 14 additions & 4 deletions public/map.js
Expand Up @@ -11,8 +11,12 @@ var Map = function(options) {

var stadiumMarkers = [];

function markerAt(latLong) {
return L.marker([latLong.lat, latLong.lng]).addTo(map);
function markerAt(options) {
if(options.icon) {
return L.marker([options.lat, options.lng], {icon: options.icon}).addTo(map);
}
return L.marker([options.lat, options.lng]).addTo(map);

}

function diameterAt(latLong, distance) {
Expand Down Expand Up @@ -50,8 +54,14 @@ var Map = function(options) {
callback(e);
});
},
addStadium : function(options) {
var stadiumMarker = markerAt({lat: options.lat, lng: options.lon});
addStadium : function(options) {
console.log('adding stadium')
var stadiumIcon = L.icon({
iconUrl: 'leaflet/images/marker-stadium-icon.png',
iconSize: [25, 27],
});

var stadiumMarker = markerAt({lat: options.lat, lng: options.lon, icon: stadiumIcon});
stadiumMarker.bindPopup("<strong>" + options.stadium + "</strong><br />" + options.team);
stadiumMarkers.push(stadiumMarker);
},
Expand Down

0 comments on commit b58230b

Please sign in to comment.