var geocoder; var map; var cities = new Array(); var campuses = new Array(); var contentString = new Array(); var htmlLocation; cities['all'] = [35.338878, 106.245115, 4]; cities['beijing'] = [39.939, 116.441, 11]; cities['ningbo'] = [29.881942, 121.557108, 11]; cities['chengdu'] = [30.66961, 104.112353, 12]; cities['xian'] = [34.300621, 109.012127, 11]; var campusindex = ["bj_el","bj_lj","bj_oe","bj_og","bj_ts","bj_tt","cd_cf","cd_sq","nb_hh","xa_yj"];campuses['bj_el'] = ['ia', 'IA - East Lake', 39.942052, 116.441151, 14, 2 ]; campuses['bj_lj'] = ['mik', 'MIK - Lijing', 39.92097, 116.501528, 14, 2 ]; campuses['bj_oe'] = ['ibs', 'IBS - Ocean Express Campus', 39.958172, 116.459573, 14, 2 ]; campuses['bj_og'] = ['ibs', 'IBS - Orchid Garden Campus', 40.024728, 116.531011, 14, 3 ]; campuses['bj_ts'] = ['mik', 'MIK - Tianshi', 39.904474, 116.635681, 14, 2 ]; campuses['bj_tt'] = ['mik', 'MIK - Tiantong', 40.070732, 116.427224, 14, 2 ]; campuses['cd_cf'] = ['mik', 'MIK - First City Campus', 30.632048, 104.153109, 14, 3 ]; campuses['cd_sq'] = ['mik', 'MIK - Three Thousand Castles Campus', 30.668673, 104.112425, 14, 2 ]; campuses['nb_hh'] = ['ibs', 'IBS - Huihao Campus', 29.881632, 121.557534, 14, 2 ]; campuses['xa_yj'] = ['mik', 'MIK - La Botanica', 34.2901, 109.0460, 14, 2 ]; contentString['bj_el'] = 'IA - East Lake'+ '
'; contentString['bj_lj'] = 'MIK - Lijing'+ '
'; contentString['bj_oe'] = 'IBS - Ocean Express Campus'+ '
'; contentString['bj_og'] = 'IBS - Orchid Garden Campus'+ '
'; contentString['bj_ts'] = 'MIK - Tianshi'+ '
'; contentString['bj_tt'] = 'MIK - Tiantong'+ '
'; contentString['cd_cf'] = 'MIK - First City Campus'+ '
'; contentString['cd_sq'] = 'MIK - Three Thousand Castles Campus'+ '
'; contentString['nb_hh'] = 'IBS - Huihao Campus'+ '
'; contentString['xa_yj'] = 'MIK - La Botanica'+ '
'; var gmlist = ""; $("#maplist2").html(gmlist); function getMap(e, city, campus) { geocoder = new google.maps.Geocoder(); $("#map-nav li").attr("class", ""); $(e).attr("class", "selected"); var myzoom = 4; if (campus == ""){ myzoom = cities[city][2]; mycenter = new google.maps.LatLng(cities[city][0], cities[city][1]); } else{ myzoom = campuses[campus][4]; mycenter = new google.maps.LatLng(campuses[campus][2], campuses[campus][3]); } var myOptions = { zoom: myzoom, center: mycenter, backgroundColor: "#f2f2f2", mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); for (var i = 0; i < campusindex.length; i++) { var _campus = campusindex[i]; var tmpcampus = campuses[_campus]; var tmpcontent = contentString[_campus]; var myLatLng = new google.maps.LatLng(tmpcampus[2], tmpcampus[3]); var myimage = "http://www.ivyschools.com/gmaplogos/" + tmpcampus[0] + '.png'; var _marker = "marker" + _campus; eval( _marker + " = new google.maps.Marker({ position: myLatLng, map: map, icon: myimage, title: tmpcampus[1], clickable: true }) " ); var _infowindow = "infowindow" + _campus; eval( _infowindow + " = new google.maps.InfoWindow({ content: tmpcontent, maxWidth: 300, zIndex: " + tmpcampus[5] + " }); "); eval( "google.maps.event.addListener(" + _marker + ", 'click', function() { " + _infowindow + ".open(map," + _marker + "); })" ); } if (campus != ""){ eval( "infowindow" + campus + ".open(map, marker" + campus +");"); } }