Skip to content

Instantly share code, notes, and snippets.

@andreaangeli
Created April 23, 2016 20:19
Show Gist options
  • Save andreaangeli/a886f4bac5246b0814f5188ec6988f1e to your computer and use it in GitHub Desktop.
Save andreaangeli/a886f4bac5246b0814f5188ec6988f1e to your computer and use it in GitHub Desktop.
stIntlAthletes
<link rel="stylesheet" href="https://d19vzq90twjlae.cloudfront.net/leaflet/v0.7.7/leaflet.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.0/leaflet.awesome-markers.css">
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/0.4.0/MarkerCluster.Default.css">
<style type="text/css">
#map { height: 500px;
width:100%;
}
.marker-cluster-small {
background-color: rgba(28,117,188,0.4);
}
.marker-cluster-small div {
background-color: rgba(28,117,188,0.4);
}
.marker-cluster-medium {
background-color: rgba(28,117,188,0.4);
}
.marker-cluster-medium div {
background-color: rgba(28,117,188,0.4);
}
.marker-cluster-large {
background-color: rgba(28,117,188,0.4);
}
.marker-cluster-large div {
background-color: rgba(28,117,188,0.4);
}
</style>
<div id="map"></div>
<script src="https://d19vzq90twjlae.cloudfront.net/leaflet/v0.7.7/leaflet.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/Leaflet.awesome-markers/2.0.0/leaflet.awesome-markers.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet.markercluster/0.4.0/leaflet.markercluster.js"></script>
<script type="text/javascript">
var xSum = 0.0;
var ySum = 0.0;
var greenMarker = L.AwesomeMarkers.icon({ icon: 'home', markerColor: 'blue', prefix: 'fa'});
var properties = [
[[12.650000, -8.000000], "Bakary Konate", "Men's Basketball" , "Bamoko, Mali", "bkonate"],
[[43.776426, -79.231752], "Mo Walker", "Men's Basketball", "Scarborough, Canada", "mwalker"],
[[-37.814107, 144.963280], "Christian Eldred", "Football", "Melbourne, Australia", "celdred"],
[[46.118462, -74.596185], "Julien Kafo", "Football", "Mont-Tremblant, Canada", "jkafo"],
[[64.067833, -21.954167], "Runar Arnorsson", "Men's Golf", "Hafnarfjorour, Iceland", "rarnorsson"],
[[43.653226, -79.383184], "Daniel Luftspring", "Men's Golf", "Toronto, Canada", "dluftspring"],
[[9.928069, -84.090725], "Jose Mendez", "Men's Golf", "San Jose, Costa Rica", "jmendez"],
[[50.454722, -104.606667], "Joel Gagnon", "Men's Gymnastics", "Regina, Canada", "jgagnon"],
[[59.329323, 18.068581], "Leon Bristedt", "Men's Hockey", "Stockholm, Sweden", "lbristedt"],
[[57.650000, 12.016667], "Robin Hoglund", "Men's Hockey", "MoIndal, Sweden", "rhoglund"],
[[-27.471011, 153.023449], "Matt Barnard", "Men's Swimming and Diving", "Brisbane, Australia", "mbarnard"],
[[59.329323, 18.068581], "Viktor Bjoerk", "Men's Swimming and Diving", "Stockholm, Sweden", "vbjoerk"],
[[48.208174, 16.373819], "Jakub Maly", "Men's Swimming and Diving", "Vienna, Austria", "jmaly"],
[[51.045325, -114.058101], "Corey Mills", "Men's Swimming and Diving", "Calgary, Canada", "cmills"],
[[49.519919, 5.761773], "Mathieu Froment", "Men's Tennis", "Longwy, France", "mfroment"],
[[46.554650, 15.645881], "Matic Spec", "Men's Tennis", "Maribor, Slovenia", "mspec"],
[[53.551085, 9.993682], "Leandro Toledo", "Men's Tennis", "Hamburg, Germany", "ltoledo"],
[[49.746201, 8.117113], "Ruben Weber", "Men's Tennis", "Alzey, Germany", "rweber"],
[[43.675914, 10.555897], "Gian Ferretti", "Men's Track and Field", "Cascina, Italy", "gferretti"],
[[52.520007, 13.404954], "Luca Wieland", "Men's Track and Field", "Berlin, Germany", "lweiland"],
[[59.329323, 18.068581], "Amanda Zahui B.", "Women's Basketball", "Stockholm, Sweden", "azahuib"],
[[18.270278, -76.770556], "Titania Markland", "Women's Cross Country <br> Women's Track and Field", "St. Mary, Jamaica", "tmarkland"],
[[51.045325, -114.058101], "Sabrine Garrison", "Women's Golf", "Calgary, Canada", "sgarrison"],
[[37.375855, -6.045006], "Carmen Laguna", "Women's Golf", "Tomares-Sevilla, Spain", "claguna"],
[[43.433152, 6.737034], "Emie Peronnin", "Women's Golf", "Frejus, France", "eperonnin"],
[[13.727896, 100.524123], "Sarinee Thitiratanakorn", "Women's Golf", "Bangkok, Thailand", "sthitiratanakorn"],
[[44.231172, -76.485954], "Amanda Leveille", "Women's Hockey", "Kingston, Canada", "aleveille"],
[[-34.928621, 138.599959], "Joyce Jollands", "Rowing", "Adelaide, Australia", "jjollands"],
[[-37.814107, 144.963280], "Bee Lovick", "Rowing", "Melbourne, Australia", "blovick"],
[[51.045325, -114.058101], "McKenzie Lukacs", "Rowing", "Calgary, Canada", "mlukacs"],
[[49.019917, -122.802611], "Sara Groenewegen", "Softball", "White Rock, Canada", "sgroenewegen"],
[[49.899754, -97.137494], "Jessica Plant", "Women's Swimming and Diving", "Winnipeg, Canada", "jplant"],
[[49.887952, -119.496011], "Kierra Smith", "Women's Swimming and Diving", "Kelowna, Canada", "ksmith"],
[[43.897545, -78.942933], "Devin Ste. Marie", "Women's Swimming and Diving", "Whitby, Canada", "dstemarie"],
[[49.899754, -97.137494], "Breanne Siwicki", "Women's Swimming and Diving", "Winnipeg, Canada", 'bsiwicki'],
[[39.904030, 116.407526], "Yu Zhou", "Women's Swimming and Diving", "Beijing, China", "yzhou"],
[[50.075538, 14.437800], "Tereza Brichacova", "Women's Tennis", "Prague, Czech Republic", "tbrichacova"],
[[40.416775, -3.703790], "Paula Rincon-Otero", "Women's Tennis", "Madrid, Spain", "princonotero"],
[[43.089558, -79.084944], "Maja Vujic", "Women's Tennis", "Niagara Falls, Canada", "mvujic"],
[[53.301347, -120.168461], "Agnes Esser", "Women's Track and Field", "McBride, Canada", "aesser"],
[[47.441718, 9.137797], "Laura Caluori", "Volleyball", "Uzwil, Switzerland", "lcaluori"]
];
var map = L.map('map', {zoomControl:false}).setView([30.0, 0.0], 2);
L.tileLayer('http://{s}.tiles.mapbox.com/v3/xaranke.jmi1m20p/{z}/{x}/{y}.png', {
maxZoom: 2,
minZoom: 2
}).addTo(map);
var markers = new L.MarkerClusterGroup({showCoverageOnHover: false, zoomToBoundsOnClick: true, maxClusterRadius:30, spiderfyDistanceMultiplier:1.5});
for (var i = 0; i < properties.length; i++) {
var marker = L.marker(properties[i][0], {icon:greenMarker, riseOnHover:true}).bindPopup('<img src="https://raw.githubusercontent.com/mndaily/data/master/intl_athletes_2014/' + properties[i][4] + '.jpg" height="120" >' + '<br><br><b>' + properties[i][1] + '</b>' + '<br>' + properties[i][2] + '<br><i>' + properties[i][3] + '</i>')
markers.addLayer(marker);
};
map.addLayer(markers);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment