app/soc/content/js/map-090825.js
changeset 2938 062d5ddb15b7
parent 2801 0ee67cc9bd20
equal deleted inserted replaced
2937:2252dc0be5db 2938:062d5ddb15b7
   233       jQuery.each(map_data.people, function (key, person) {
   233       jQuery.each(map_data.people, function (key, person) {
   234         if (person.type === "student") {
   234         if (person.type === "student") {
   235           students[key] = {
   235           students[key] = {
   236             "name": person.name,
   236             "name": person.name,
   237             "lat": person.lat,
   237             "lat": person.lat,
   238             "long": person.long,
   238             "lon": person.lon,
   239             "projects": person.projects
   239             "projects": person.projects
   240           };
   240           };
   241         }
   241         }
   242         if (person.type === "mentor") {
   242         if (person.type === "mentor") {
   243           mentors[key] = {
   243           mentors[key] = {
   244             "name": person.name,
   244             "name": person.name,
   245             "lat": person.lat,
   245             "lat": person.lat,
   246             "long": person.long,
   246             "lon": person.lon,
   247             "projects": person.projects
   247             "projects": person.projects
   248           };
   248           };
   249         }
   249         }
   250       });
   250       });
   251 
   251 
   254         var current_student = students[project.student_key];
   254         var current_student = students[project.student_key];
   255         var current_mentor = mentors[project.mentor_key];
   255         var current_mentor = mentors[project.mentor_key];
   256         if (current_student !== undefined && 
   256         if (current_student !== undefined && 
   257             current_mentor !== undefined &&
   257             current_mentor !== undefined &&
   258             current_student.lat !== null &&
   258             current_student.lat !== null &&
   259             current_student.long !== null &&
   259             current_student.lon !== null &&
   260             current_mentor.lat !== null &&
   260             current_mentor.lat !== null &&
   261             current_mentor.long !== null) {
   261             current_mentor.lon !== null) {
   262               /*jslint white: false */
   262               /*jslint white: false */
   263               polylines.push([
   263               polylines.push([
   264                 [current_student.lat, current_student.long],
   264                 [current_student.lat, current_student.lon],
   265                 [current_mentor.lat, current_mentor.long]
   265                 [current_mentor.lat, current_mentor.lon]
   266               ]);
   266               ]);
   267               /*jslint white: true */
   267               /*jslint white: true */
   268         }
   268         }
   269       });
   269       });
   270 
   270 
   271       // Iterate over students
   271       // Iterate over students
   272       jQuery.each(students, function (key, person) {
   272       jQuery.each(students, function (key, person) {
   273         var html = "";
   273         var html = "";
   274         var marker = null;
   274         var marker = null;
   275 
   275 
   276         if (person.lat !== null && person.long !== null) {
   276         if (person.lat !== null && person.lon !== null) {
   277           var point = new window.GLatLng(person.lat, person.long);
   277           var point = new window.GLatLng(person.lat, person.lon);
   278 
   278 
   279           marker = new window.GMarker(point, student_icon);
   279           marker = new window.GMarker(point, student_icon);
   280           html = [
   280           html = [
   281             "<strong>", person.name, "</strong><br />",
   281             "<strong>", person.name, "</strong><br />",
   282             "<span style='font-style:italic;'>Student</span><br />",
   282             "<span style='font-style:italic;'>Student</span><br />",
   304       // Iterate over mentors
   304       // Iterate over mentors
   305       jQuery.each(mentors, function (key, person) {
   305       jQuery.each(mentors, function (key, person) {
   306         var html = "";
   306         var html = "";
   307         var marker = null;
   307         var marker = null;
   308 
   308 
   309         if (person.lat !== null && person.long !== null) {
   309         if (person.lat !== null && person.lon !== null) {
   310           var point = new window.GLatLng(person.lat, person.long);
   310           var point = new window.GLatLng(person.lat, person.lon);
   311 
   311 
   312           marker = new window.GMarker(point, mentor_icon);
   312           marker = new window.GMarker(point, mentor_icon);
   313           html = [
   313           html = [
   314             "<strong>", person.name, "</strong><br />",
   314             "<strong>", person.name, "</strong><br />",
   315             "<span style='font-style:italic;'>Mentor</span><br />",
   315             "<span style='font-style:italic;'>Mentor</span><br />",