Team:Leiden/scripts/map js

window.leiden =

 {   name : "Leiden University",
     country : "Netherlands",
     city : "Leiden",
     contactperson : "Wouter Liefting",
     coordinates : {lat: 52.168921, lng: 4.466822},
     description : "Home!",
     website : "https://www.universiteitleiden.nl/",
     icon : "icon_leiden",
 }

window.annotationsArray = []; window.collaboratorAnnotations = []; window.sponsorAnnotations = [];

window.collaborators = [

 {
 name : "CosmoCrops UCPH: Science in space collaboration!",
 country : "Denmark",
 city : "Copenhagen",
 contactperson : "The whole awesome team!",
 coordinates : {lat: 55.683379, lng: 12.544241},
 shortDescription : "Science collaboration: studying for the other team how their bacteria behave in the space conditions we can test for each other.",
 description : "Science collaboration: studying for the other team how their bacteria behave in the space conditions we can test for each other.",
 website : "https://2016.igem.org/Team:UNIK_Copenhagen/Collaborations"

},{

 name : "Safe by Design discussions",
 country : "Netherlands",
 city : "",
 contactperson : "",
 coordinates : {lat: 52.0900182, lng: 5.1031939},
 shortDescription : "Organized by the National Institute for Public Health, we had lively discussions and presentations on Safe by   Design with the other Dutch iGEM teams",
 description : "Organized by the National Institute for Public Health, we had lively discussions and presentations on Safe by Design with the other Dutch iGEM teams from Wageningen, Groningen, Eindhoven and Delft.",
 website : "https://2016.igem.org/Team:Leiden/HP/Gold"

},{

 name : "Toulouse: Dutch audio for videos",
 country : "France",
 city : "Toulouse",
 contactperson : "Oumnia and Marine",
 coordinates : {lat: 43.5706889, lng: 1.4644183},
 shortDescription : "This team recorded four videos on standard cloning protocols, and ask if we could record the audio in Dutch – and of course we could!",
 description : "This team recorded four videos on standard cloning protocols, and ask if we could record the audio in Dutch – and of course we could!",
 website : "https://2016.igem.org/Team:Toulouse_France/Collaborations"

},{

 name : "EPFL: igem.today website",
 country : "Switzerland",
 city : "Lausanne",
 contactperson : "Marie Matos",
 coordinates : {lat: 46.5190557, lng: 6.566757615},
 shortDescription : "Contributed to their website igem.today, a great place to read about other projects and the current developments! We were their first team of the week!",
 description : " Contributed to their website igem.today, a great place to read about other projects and the current developments! We were their first team of the week, being interviewed via Skype!",
 website : "http://igem.today/2016/08/02/team-of-the-week/"

},{

 name : "XMU-China: Newsletter",
 country : "China",
 city : "Xiamen",
 contactperson : "",
 coordinates : {lat: 24.4373484, lng: 118.097855},
 shortDescription : "Contributed to their Newsletter, in which we were allowed to describe our project and share our enthusiasm!",
 description : "Contributed to their Newsletter, in which we were allowed to describe our project and share our enthusiasm!",
 website : "https://2016.igem.org/Team:XMU-China/HP/Newsletter"

},{

 name : "Eindhoven: Bionieuws",
 country : "Netherlands",
 city : "Eindhoven",
 contactperson : "Marijn Kruit",
 coordinates : {lat: 51.4486098, lng: 5.4907148},
 shortDescription : "iGEM Eindhoven got all the Dutch iGEM teams an advertisement in the Dutch magazine for biologists: Bionieuws – thanks for that opportunity!",
 description : "iGEM Eindhoven got all the Dutch iGEM teams an advertisement in the Dutch magazine for biologists: Bionieuws – thanks for that opportunity!",
 website : "https://2016.igem.org/Team:TU-Eindhoven/HP/Silver"

},{

 name : "Wageningen UR: National Meet-up, BioSB",
 country : "the Netherlands",
 city : "Wageningen",
 contactperson : "Thomas Swartjes",
 coordinates : {lat: 51.985563, lng: 5.664123},
 shortDescription : "Had a lot of fun, attended their National Meetup, met at different conferences and helped them by providing them with access to a plate reader.",
 description : "Had a lot of fun, attended their National Meetup, met at different conferences and helped them by providing them with access to a plate reader.",
 website : "https://2016.igem.org/Team:Wageningen_UR"

},{

 name : "European Experience",
 country : "France",
 city : "Paris",
 contactperson : "",
 coordinates : {lat: 48.866096, lng: 2.3711066},
 shortDescription : "Big shoutout to iGEM IONIS and Evry for organizing this massive meet-up! We had a lot of fun meeting so many other teams and even Randy Rettberg!",
 description : "We met with this team at the IWBDA2016 in Newcastle, having a lot of fun together!",
 website : "https://2016.igem.org/Team:Ionis_Paris/Events"

},{

 name : "Newcastle: meeting at the IWBDA2016",
 country : "United Kingdom",
 city : "Newcastle upon Tyne",
 contactperson : "",
 coordinates : {lat: 54.9673092, lng: -1.622896},
 shortDescription : "We met with the Newcastle iGEM team but also iGEM HQ Traci Haddock-Angelli at the IWBDA2016 in Newcastle, having a lot of fun together!",
 description : "We met with the Newcastle iGEM team but also iGEM HQ Traci Haddock-Angelli at the IWBDA2016 in Newcastle, having a lot of fun together!",
 website : "https://2016.igem.org/Team:Newcastle"

},{

 name : "Pasteur: our 1st Skype meeting!",
 country : "France",
 city : "Paris",
 contactperson : "",
 coordinates : {lat: 48.8407134, lng: 2.3096849},
 shortDescription : "Pasteur invited us for our first video call in iGEM, which was great fun – really nice to hear about each other’s projects. Besides, we also had a great day together in Paris during the European Experience!",
 description : "Pasteur invited us for our first video call in iGEM, which was great fun – really nice to hear about each other’s projects. Besides, we also had a great day together in Paris during the European Experience!",
 website : "https://2016.igem.org/Team:Pasteur_Paris"

},{

 name : "Edinburgh UG: Skype-meeting",
 country : "United Kingdom",
 city : "Edinburgh",
 contactperson : "",
 coordinates : {lat: 55.9445158, lng: -3.1914317},
 shortDescription : "We had a nice chat with Edinburgh undergrad, which was working on BabbleBricks and increased radiation resistance. Unfortunately, we weren’t able to integrate their improved BioBrick in our project, but the idea was much appreciated!",
 description : "We had a nice chat with Edinburgh undergrad, which was working on BabbleBricks and increased radiation resistance. Unfortunately, we weren’t able to integrate their improved BioBrick in our project, but the idea was much appreciated!",
 website : "https://2016.igem.org/Team:Edinburgh_UG"

},{

 name : "Exeter: Skype-meeting",
 country : "United Kingdom",
 city : "Exeter",
 contactperson : "",
 coordinates : {lat: 50.7371369, lng: -3.5351475},
 shortDescription : "Had a nice Skype chat when shaping the ideas of our projects",
 description : "Had a nice skype chat when shaping the ideas of our projects",
 website : "https://2016.igem.org/Team:Exeter"

},{

 name : "Calgary: Space Skype-meeting",
 country : "Canada",
 city : "Calgary",
 contactperson : "",
 coordinates : {lat: 51.0794423, lng: -114.1433664},
 shortDescription : "We got into touch with this team because they also worked on an awesome space project!",
 description : "We got into touch with this team because they also worked on an awesome space project!",
 website : "https://2016.igem.org/Team:UofC_Calgary"

},{

 name : "TEC Costa Rica",
 country : "Costa Rica",
 city : "Cartago",
 contactperson : "Pablo A. Vargas Rosales",
 coordinates : {lat: 9.8539661, lng: -83.9117613},
 shortDescription : "This team reacted on our call to get into touch with us, even if it’s just to say hi! Exchanged some nice experiences with each other and stayed in touch during the competition.",
 description : "This team reacted on our call to get into touch with us, even if it’s just to say hi! Exchanged some nice experiences with each other and stayed in touch during the competition.",
 website : "https://2016.igem.org/Team:TEC-Costa_Rica"

},{

 name : "TEC Costa Rica",
 country : "Costa Rica",
 city : "Cartago",
 contactperson : "Pablo A. Vargas Rosales",
 coordinates : {lat: 9.8539661, lng: -83.9117613},
 shortDescription : "This team reacted on our call to get into touch with us, even if it’s just to say hi! Exchanged some nice experiences with each other and stayed in touch during the competition.",
 description : "This team reacted on our call to get into touch with us, even if it’s just to say hi! Exchanged some nice experiences with each other and stayed in touch during the competition.",
 website : "https://2016.igem.org/Team:TEC-Costa_Rica"

},{

 name : "Groningen: Biosecurity",
 country : "Netherlands",
 city : "Groningen",
 contactperson : "",
 coordinates : {lat: 53.2192666, lng: 6.5607932},
 shortDescription : "Survey on encrypting messages in DNA, cyber security and data storage.",
 description : "Survey on encrypting messages in DNA, cyber security and data storage.",
 website : "https://2016.igem.org/Team:Groningen/Collaborations",

},{

 name : "Peshawar: Air pollution",
 country : "Pakistan",
 city : "Peshawar",
 contactperson : "",
 coordinates : {lat: 34.0014767, lng: 71.4849421},
 shortDescription : "Survey on synthetic biology related to the testing of air pollution.",
 description : "Survey on synthetic biology related to the testing of air pollution.",
 website : "https://2016.igem.org/Team:Peshawar"

},{

 name: "Yale University",
 country: "United States of America",
 city: "New Haven",
 contactperson: " Jaymin Patel",
 coordinates: {lat: 41.310726, lng:-72.929916},
 description: "Yale University has developed a software that identified all homologs of chlorite dismutase. Many chlorite dismutase homologs were found in E.coli and other Enterobacteria.",
 website: "http://www.yale.edu/"

} ];

window.sponsors = [

 // {	name : "Integrated DNA Technologies",
 // 	shortname : "IDT",
 // 	coordinates : {lat: 52., lng: -10.},
 // 	website : "http://eu.idtdna.com/site",
 // 	internlink : "sponsors.html#idt-text",
 // 	image : "images/sponsor/image16.png",
 // 	description : "doet gave dingen met gratis DNA"
 // }

]

function removeAllAnnotations( annotations ) {

 for (var i = 0; i < annotations.length; i++){
   annotations[i].setMap(null);
 }
 annotations.length = 0;

}

function initMap() {

 window.openInfoWindow = 0;
 var mapDiv = document.getElementById('map');
 var map = new google.maps.Map(mapDiv, {
     center: {lat: 52.168921, lng: 4.466822},
     zoom: 3,
     scrollwheel: false
 });
 var markerLeidenImage = {
   url: $("#" + window.leiden.icon).attr('src'),
   size: new google.maps.Size(30, 30),
   origin: new google.maps.Point(0, 0),
   anchor: new google.maps.Point(15, 15)
 };
 var markerLeiden = new google.maps.Marker({
   position: window.leiden.coordinates,
   map: map,
   title: window.leiden.name,
   icon: markerLeidenImage
 });
 window.map = map;
 window.markerLeiden = markerLeiden;
 window.google = google;
 window.geodesicOptionsCollaborators = {
   strokeColor: 'rgb(152,52,44)',
   strokeOpacity: 1.0,
   strokeWeight: 1.5,
   geodesic: true,
   map: window.map
 };
 window.displayCollaborators();

}

function loadMarkers( markerInfo, annotations ) {

 for (var i = 0; i < markerInfo.length; i++)
 {
   var mark = markerInfo[i];
   var desc = "" + mark.name + "";
   if( mark.contactperson.length > 0 ){
     desc = desc + " (" + mark.contactperson+")";
   }
   if( mark.description.length > 0 ){
     desc += "
" + mark.description; }
   var marker = new google.maps.Marker({
     position: (markerInfo[i]).coordinates,
     map: map,
     title: (markerInfo[i]).name,
     collaborator: markerInfo[i],
     infowindow: new google.maps.InfoWindow({
       content: desc
     })
   });
   annotations.push(marker);
   marker.addListener('click', function() {
     var infowindow = this.infowindow;
     if (window.openInfoWindow == 0 || (window.openInfoWindow.anchor == null && window.openInfoWindow.map == null)) {
       infowindow.open( map, this );
       window.openInfoWindow = infowindow;
     }
     else if (window.openInfoWindow == infowindow) {
       infowindow.close();
       window.openInfoWindow = 0;
     }
     else {
       window.openInfoWindow.close();
       infowindow.open( map, this);
       window.openInfoWindow = infowindow;
     }
   });
   map.addListener('click', function() {
     if (window.openInfoWindow != 0){
       window.openInfoWindow.close();
     }
   });
 }

};

function loadLines ( markerInfo, color, annotations ) {

 for (var i = 0; i < markerInfo.length; i++)
 {
   loadMarkers ( markerInfo, annotations );
   window.geodesicOptionsCollaborators.strokeColor = color;
   var path = [window.leiden.coordinates, markerInfo[i].coordinates];
   var geodesicPoly1 = new google.maps.Polyline(window.geodesicOptionsCollaborators);
   geodesicPoly1.setPath(path);


   annotations.push(geodesicPoly1);
 }

};


loadCollaborators = function () {

 loadLines ( window.collaborators, "rgb(152,52,44)", window.collaboratorAnnotations );

}

removeCollaborators = function () {

 removeAllAnnotations( collaboratorAnnotations );

}

displayCollaborators = function() {

 collaboratorChecked = true; //document.getElementById("checkCollaborators").checked;
 if (collaboratorChecked){
   loadCollaborators();
 }
 else{
   removeCollaborators();
 }

}

loadSponsors = function () {

 loadLines ( window.sponsors, "#ff0000", window.sponsorAnnotations );

}

removeSponsors = function () {

 removeAllAnnotations( sponsorAnnotations );

}

displaySponsors = function () {

 sponsorChecked = true; //document.getElementById("checkSponsors").checked;
 if (sponsorChecked){
   loadSponsors();
 }
 else{
   removeSponsors();
 }

}

window.removeAllAnnotations = removeAllAnnotations; window.initMap = initMap; window.loadMarkers = loadMarkers; window.loadLines = loadLines; window.loadCollaborators = loadCollaborators; window.loadSponsors = loadSponsors; window.removeCollaborators = removeCollaborators; window.removeSponsors = removeSponsors; window.displayCollaborators = displayCollaborators; window.displaySponsors = displaySponsors;