var chart; var dataProvider; var map; var ginpoparray; var pingMarker; var ginpopimage; var ginpopgreen; var ginpopgray; var ib; var ibb; var popdata; var locations; var selectedpop; var topop; var topopindex; var pingimage; var pingwarning; var pingmarkers; var links = new Array(); var green = "#33cc33"; var circuit; function initialize() { var unlabeledStyles = [ { "featureType": "poi", "stylers": [ { "visibility": "off" } ] },{ "featureType": "administrative", "stylers": [ { "visibility": "off" } ] },{ "featureType": "transit", "stylers": [ { "visibility": "off" } ] },{ "featureType": "landscape", "stylers": [ { "visibility": "simplified" }, { "color": "#edf5f9" } ] },{ "featureType": "road", "stylers": [ { "visibility": "off" } ] },{ "featureType": "water", "stylers": [ { "visibility": "simplified" }, { "color": "#00517f" } ] } ]; //var unlabeledStyles = [ { featureType: "administrative", stylers: [ { visibility: "off" } ] },{ featureType: "poi", stylers: [ { visibility: "off" } ] },{ featureType: "water", elementType: "labels", stylers: [ { visibility: "off" } ] },{ featureType: "water", stylers: [ {hue: "#4d7c96"}, { saturation: 100 }, { lightness: 0 }, { gamma: 0.2 } ] },{ featureType: "landscape", stylers: [ {hue: "#00003c"}, { saturation: 100 }, { lightness: 0 }, { gamma: 0.025 } ] },{ featureType: "landscape", elementType: "labels", stylers: [ { visibility: "off" } ] },{ featureType: "road", stylers: [ { visibility: "off" } ] },{ featureType: "transit", stylers: [ { visibility: "off" } ] } ]; //[ { featureType: "administrative", stylers: [ { visibility: "off" } ] },{ featureType: "poi", stylers: [ { visibility: "off" } ] },{ featureType: "water", elementType: "labels", stylers: [ { visibility: "off" } ] },{ featureType: "water", stylers: [ {hue: "#ffffff"}, { saturation: 100 }, { lightness: 100 }, { gamma: 0.0 } ] },{ "featureType": "landscape", "stylers": [ { "visibility": "off" } ] },{ featureType: "landscape", elementType: "labels", stylers: [ { visibility: "off" } ] },{ featureType: "road", stylers: [ { visibility: "off" } ] },{ featureType: "transit", stylers: [ { visibility: "off" } ] } ]; var unlabeledMapType = new google.maps.StyledMapType(unlabeledStyles,{name: "Basic"}); var mapcenter = new google.maps.LatLng(39.8600, -98.0000); var mapOptions = { center: mapcenter, zoom: 3, mapTypeId: google.maps.MapTypeId.SATELLITE, disableDoubleClickZoom: false, streetViewControl: false, zoomControl: true, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.SATELLITE, 'Basic'] } }; mapOptions.zoom = 2; map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); map.mapTypes.set('Basic', unlabeledMapType); map.setMapTypeId('Basic'); //Bug - at low resolutions the mapcenter parameter doesn't work so use this to recenter var t=setTimeout(function(){ map.setCenter(mapcenter); },500) //ginpopimage = new google.maps.MarkerImage("/about/image/sla-pop.png",new google.maps.Size(15,25),new google.maps.Point(10,0),new google.maps.Point(0,0)); popdata = new Array(); linkdata = new Array(); ginpopimage = { url: "image/sla-pop.png", size: new google.maps.Size(26, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(13, 30), scaledSize: new google.maps.Size(26, 30) }; ginpopgreen = { url: "image/sla-pop-green.png", size: new google.maps.Size(26, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(13, 30), scaledSize: new google.maps.Size(26, 30) }; ginpopgray = { url: "image/sla-pop-gray.png", size: new google.maps.Size(26, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(13, 30), scaledSize: new google.maps.Size(26, 30) }; pingimage = new google.maps.MarkerImage("image/ping-green.png",new google.maps.Size(30,30),new google.maps.Point(0,0),new google.maps.Point(15,15)); pingwarning = new google.maps.MarkerImage("image/ping-warning.png",new google.maps.Size(30,30),new google.maps.Point(0,0),new google.maps.Point(15,15)); ginpoparray = new Array(); pingmarkers = new Array(); // Create the locations var HongKong = new google.maps.LatLng(22.3964,114.1095); popdata["HongKong"] = {name: 'Hong Kong' ,locname: 'HongKong' ,city: 'Tseung Kwan O Industrial Estate' ,addrone: '6 Chun Kwong St' ,addrtwo: '2/F' ,state: 'HK' ,country: 'HK' ,continent: 'as' ,code: 'tkokhk01' ,id: 53 ,apops: ["Hong Kong 2 - chwahk02","Hong Kong 1 - newthk01","Hong Kong 3 - newthk03","Hong Kong 1 - tkokhk01"] }; ginpoparray["HongKong"] = addGINPOP("Hong Kong","HongKong",HongKong, map, -10, 20); google.maps.event.addListener(ginpoparray["HongKong"], 'click', function() { popClick('HongKong'); }); pingmarkers["HongKong"] = new google.maps.Marker({ position: HongKong, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Osaka = new google.maps.LatLng(34.6937,135.5022); popdata["Osaka"] = {name: 'Osaka' ,locname: 'Osaka' ,city: 'Osaka' ,addrone: '3-1-59 Dojima, 2F' ,addrtwo: 'Kita-ku' ,state: '' ,country: 'JP' ,continent: 'as' ,code: 'osakjp02' ,id: 38 ,apops: [] }; ginpoparray["Osaka"] = addGINPOP("Osaka","Osaka",Osaka, map, -10, 20); google.maps.event.addListener(ginpoparray["Osaka"], 'click', function() { popClick('Osaka'); }); pingmarkers["Osaka"] = new google.maps.Marker({ position: Osaka, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Singapore = new google.maps.LatLng(1.3521,103.8198); popdata["Singapore"] = {name: 'Singapore' ,locname: 'Singapore' ,city: 'Singapore' ,addrone: '20 Ayer Rajah Crescent' ,addrtwo: 'Equinix Singapore Pte. Ltd.' ,state: '' ,country: 'SG' ,continent: 'as' ,code: 'sngpsi02' ,id: 49 ,apops: ["Singapore 3 - sngpsi03","Singapore 5 - sngpsi05"] }; ginpoparray["Singapore"] = addGINPOP("Singapore","Singapore",Singapore, map, -10, 20); google.maps.event.addListener(ginpoparray["Singapore"], 'click', function() { popClick('Singapore'); }); pingmarkers["Singapore"] = new google.maps.Marker({ position: Singapore, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Sydney = new google.maps.LatLng(-33.8671,151.2071); popdata["Sydney"] = {name: 'Sydney' ,locname: 'Sydney' ,city: 'Sydney' ,addrone: '363 Oxford St' ,addrtwo: 'Paddington, Reach OTC Building' ,state: 'NW' ,country: 'AU' ,continent: 'as' ,code: 'sydnau01' ,id: 37 ,apops: [] }; ginpoparray["Sydney"] = addGINPOP("Sydney","Sydney",Sydney, map, -10, 20); google.maps.event.addListener(ginpoparray["Sydney"], 'click', function() { popClick('Sydney'); }); pingmarkers["Sydney"] = new google.maps.Marker({ position: Sydney, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Tokyo = new google.maps.LatLng(35.6785,139.6823); popdata["Tokyo"] = {name: 'Tokyo' ,locname: 'Tokyo' ,city: 'Tokyo' ,addrone: '2-3-5 Otemachi, 8F' ,addrtwo: 'Chiyoda-ku' ,state: 'JP' ,country: 'JP' ,continent: 'as' ,code: 'tokyjp05' ,id: 35 ,apops: ["Tokyo 3 - tokyjp03","Tokyo 4 - tokyjp04","Tokyo 5 - tokyjp05"] }; ginpoparray["Tokyo"] = addGINPOP("Tokyo","Tokyo",Tokyo, map, -10, 20); google.maps.event.addListener(ginpoparray["Tokyo"], 'click', function() { popClick('Tokyo'); }); pingmarkers["Tokyo"] = new google.maps.Marker({ position: Tokyo, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Amsterdam = new google.maps.LatLng(52.3738,4.8909); popdata["Amsterdam"] = {name: 'Amsterdam' ,locname: 'Amsterdam' ,city: 'Amsterdam' ,addrone: 'Kuiperbergweg 13' ,addrtwo: 'Telecity 2 South East Site' ,state: 'NL' ,country: 'NL' ,continent: 'eu' ,code: 'amstnl02' ,id: 34 ,apops: ["Amsterdam 3 - amstnl03","Stockholm 1 - stocse01"] }; ginpoparray["Amsterdam"] = addGINPOP("Amsterdam","Amsterdam",Amsterdam, map, -10, 20); google.maps.event.addListener(ginpoparray["Amsterdam"], 'click', function() { popClick('Amsterdam'); }); pingmarkers["Amsterdam"] = new google.maps.Marker({ position: Amsterdam, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Frankfurt = new google.maps.LatLng(50.1115,8.6805); popdata["Frankfurt"] = {name: 'Frankfurt' ,locname: 'Frankfurt' ,city: 'Frankfurt am Main' ,addrone: 'Weissmuellerstrasse 19' ,addrtwo: '' ,state: '' ,country: 'DE' ,continent: 'eu' ,code: 'frnkge03' ,id: 52 ,apops: ["Brussels 1 - brslbe01","Bucharest 1 - buchro01","Budapest 1 - budahu01","Dusseldorf 1 - dsdfge01","Dusseldorf 2 - dsdfge02","Frankfurt 2 - frnkge02","Frankfurt 4 - frnkge04","Milan 1 - mlanit01","Munich 1 - mnchge01","Sofia 1 - sofibu01","Vienna 1 - vienat01","Warsaw 1 - wrswpl01"] }; ginpoparray["Frankfurt"] = addGINPOP("Frankfurt","Frankfurt",Frankfurt, map, -10, 20); google.maps.event.addListener(ginpoparray["Frankfurt"], 'click', function() { popClick('Frankfurt'); }); pingmarkers["Frankfurt"] = new google.maps.Marker({ position: Frankfurt, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var LondonTelehouse = new google.maps.LatLng(51.5002,-.1262); popdata["LondonTelehouse"] = {name: 'London - Telehouse' ,locname: 'LondonTelehouse' ,city: 'London ' ,addrone: 'Coriander Avenue' ,addrtwo: '4th floor Telehouse Docklands East' ,state: '' ,country: 'UK' ,continent: 'eu' ,code: 'londen03' ,id: 47 ,apops: ["London 1 - londen01","London 4 - londen04","London 5 - londen05","London 8 - londen08","London 10 - londen10","London 11 - londen11"] }; ginpoparray["LondonTelehouse"] = addGINPOP("London - Telehouse","LondonTelehouse",LondonTelehouse, map, -10, 20); google.maps.event.addListener(ginpoparray["LondonTelehouse"], 'click', function() { popClick('LondonTelehouse'); }); pingmarkers["LondonTelehouse"] = new google.maps.Marker({ position: LondonTelehouse, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Madrid = new google.maps.LatLng(40.4167,-3.7032); popdata["Madrid"] = {name: 'Madrid' ,locname: 'Madrid' ,city: 'Madrid' ,addrone: 'Calle Yecora 4' ,addrtwo: 'Poligono Industrial "Las Mercedes"' ,state: '' ,country: 'ES' ,continent: 'eu' ,code: 'mdrdsp04' ,id: 33 ,apops: ["Barcelona 1 - barcsp01","Madrid 1 - mdrdsp01","Madrid 3 - mdrdsp03","Valencia 1 - valesp01"] }; ginpoparray["Madrid"] = addGINPOP("Madrid","Madrid",Madrid, map, -10, 20); google.maps.event.addListener(ginpoparray["Madrid"], 'click', function() { popClick('Madrid'); }); pingmarkers["Madrid"] = new google.maps.Marker({ position: Madrid, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Paris = new google.maps.LatLng(48.8567,2.351); popdata["Paris"] = {name: 'Paris' ,locname: 'Paris' ,city: 'Saint Denis' ,addrone: '114 Rue Ambroise Croizat' ,addrtwo: '' ,state: '' ,country: 'FR' ,continent: 'eu' ,code: 'parsfr02' ,id: 30 ,apops: ["Paris 2 - parsfr02","Paris 3 - parsfr03"] }; ginpoparray["Paris"] = addGINPOP("Paris","Paris",Paris, map, -10, 20); google.maps.event.addListener(ginpoparray["Paris"], 'click', function() { popClick('Paris'); }); pingmarkers["Paris"] = new google.maps.Marker({ position: Paris, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Ashburn = new google.maps.LatLng(39.0403,-77.4868); popdata["Ashburn"] = {name: 'Ashburn' ,locname: 'Ashburn' ,city: 'Ashburn' ,addrone: '21701 Filigree Ct.' ,addrtwo: '' ,state: 'VA' ,country: 'US' ,continent: 'us' ,code: 'asbnva02' ,id: 24 ,apops: ["Ashburn 3 - asbnva03","Reston 3 - rstnva03"] }; ginpoparray["Ashburn"] = addGINPOP("Ashburn","Ashburn",Ashburn, map, -10, 20); google.maps.event.addListener(ginpoparray["Ashburn"], 'click', function() { popClick('Ashburn'); }); pingmarkers["Ashburn"] = new google.maps.Marker({ position: Ashburn, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Atlanta = new google.maps.LatLng(33.7555,-84.3913); popdata["Atlanta"] = {name: 'Atlanta' ,locname: 'Atlanta' ,city: 'Atlanta' ,addrone: '56 Marietta St NW' ,addrtwo: '3rd Floor' ,state: 'GA' ,country: 'US' ,continent: 'us' ,code: 'atlnga05' ,id: 54 ,apops: ["Atlanta 4 - atlnga04"] }; ginpoparray["Atlanta"] = addGINPOP("Atlanta","Atlanta",Atlanta, map, -10, 20); google.maps.event.addListener(ginpoparray["Atlanta"], 'click', function() { popClick('Atlanta'); }); pingmarkers["Atlanta"] = new google.maps.Marker({ position: Atlanta, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var ChicagoCermak = new google.maps.LatLng(41.8795,-87.6243); popdata["ChicagoCermak"] = {name: 'Chicago - Cermak' ,locname: 'ChicagoCermak' ,city: 'Chicago' ,addrone: '350 E Cermak' ,addrtwo: '6th Floor' ,state: 'IL' ,country: 'US' ,continent: 'us' ,code: 'chcgil09' ,id: 29 ,apops: ["Chicago 10 - chcgil10"] }; ginpoparray["ChicagoCermak"] = addGINPOP("Chicago - Cermak","ChicagoCermak",ChicagoCermak, map, -10, 20); google.maps.event.addListener(ginpoparray["ChicagoCermak"], 'click', function() { popClick('ChicagoCermak'); }); pingmarkers["ChicagoCermak"] = new google.maps.Marker({ position: ChicagoCermak, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Dallas = new google.maps.LatLng(32.7811,-96.7971); popdata["Dallas"] = {name: 'Dallas' ,locname: 'Dallas' ,city: 'Dallas' ,addrone: '1950 N. Stemmons Freeway' ,addrtwo: 'Suite 1031' ,state: 'TX' ,country: 'US' ,continent: 'us' ,code: 'dllstx09' ,id: 2 ,apops: ["Dallas 4 - dllstx04","Dallas 6 - dllstx06","Dallas 7 - dllstx07","Dallas 10 - dllstx10","Dallas 11 - dllstx11"] }; ginpoparray["Dallas"] = addGINPOP("Dallas","Dallas",Dallas, map, -10, 20); google.maps.event.addListener(ginpoparray["Dallas"], 'click', function() { popClick('Dallas'); }); pingmarkers["Dallas"] = new google.maps.Marker({ position: Dallas, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var LosAngeles = new google.maps.LatLng(34.0522,-118.2434); popdata["LosAngeles"] = {name: 'Los Angeles' ,locname: 'LosAngeles' ,city: 'Los Angeles' ,addrone: '900 N. Alameda' ,addrtwo: '' ,state: 'CA' ,country: 'US' ,continent: 'us' ,code: 'lsanca07' ,id: 5 ,apops: ["Los Angeles 17 - lsanca17","Los Angeles 19 - lsanca19"] }; ginpoparray["LosAngeles"] = addGINPOP("Los Angeles","LosAngeles",LosAngeles, map, -10, 20); google.maps.event.addListener(ginpoparray["LosAngeles"], 'click', function() { popClick('LosAngeles'); }); pingmarkers["LosAngeles"] = new google.maps.Marker({ position: LosAngeles, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Miami = new google.maps.LatLng(25.7743,-80.1903); popdata["Miami"] = {name: 'Miami' ,locname: 'Miami' ,city: 'Miami' ,addrone: '50 NE 9th Street' ,addrtwo: '' ,state: 'FL' ,country: 'US' ,continent: 'us' ,code: 'miamfl02' ,id: 25 ,apops: [] }; ginpoparray["Miami"] = addGINPOP("Miami","Miami",Miami, map, -10, 20); google.maps.event.addListener(ginpoparray["Miami"], 'click', function() { popClick('Miami'); }); pingmarkers["Miami"] = new google.maps.Marker({ position: Miami, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var NewYork = new google.maps.LatLng(40.7561,-73.987); popdata["NewYork"] = {name: 'New York' ,locname: 'NewYork' ,city: 'New York' ,addrone: '111 Eighth Ave., Suite 729' ,addrtwo: '' ,state: 'NY' ,country: 'US' ,continent: 'us' ,code: 'nycmny01' ,id: 22 ,apops: ["New York 12 - nycmny12","New York 13 - nycmny13","New York 14 - nycmny14","New York 83 - nycmny83"] }; ginpoparray["NewYork"] = addGINPOP("New York","NewYork",NewYork, map, -10, 20); google.maps.event.addListener(ginpoparray["NewYork"], 'click', function() { popClick('NewYork'); }); pingmarkers["NewYork"] = new google.maps.Marker({ position: NewYork, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var PaloAlto = new google.maps.LatLng(37.4373,-122.1599); popdata["PaloAlto"] = {name: 'Palo Alto' ,locname: 'PaloAlto' ,city: 'Palo Alto' ,addrone: '529 Bryant' ,addrtwo: '' ,state: 'CA' ,country: 'US' ,continent: 'us' ,code: 'plalca01' ,id: 7 ,apops: [] }; ginpoparray["PaloAlto"] = addGINPOP("Palo Alto","PaloAlto",PaloAlto, map, -10, 20); google.maps.event.addListener(ginpoparray["PaloAlto"], 'click', function() { popClick('PaloAlto'); }); pingmarkers["PaloAlto"] = new google.maps.Marker({ position: PaloAlto, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var SanJoseGreatOaks = new google.maps.LatLng(37.3201,-121.8776); popdata["SanJoseGreatOaks"] = {name: 'San Jose - Great Oaks' ,locname: 'SanJoseGreatOaks' ,city: 'San Jose' ,addrone: '11 Great Oaks Blvd' ,addrtwo: '' ,state: 'CA' ,country: 'US' ,continent: 'us' ,code: 'snjsca04' ,id: 26 ,apops: ["San Jose 9 - snjsca09","Santa Clara 1 - sntcca01","Santa Clara 2 - sntcca02"] }; ginpoparray["SanJoseGreatOaks"] = addGINPOP("San Jose - Great Oaks","SanJoseGreatOaks",SanJoseGreatOaks, map, -10, 20); google.maps.event.addListener(ginpoparray["SanJoseGreatOaks"], 'click', function() { popClick('SanJoseGreatOaks'); }); pingmarkers["SanJoseGreatOaks"] = new google.maps.Marker({ position: SanJoseGreatOaks, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var SanJoseLundy = new google.maps.LatLng(37.1607,-122.0267); popdata["SanJoseLundy"] = {name: 'San Jose - Lundy' ,locname: 'SanJoseLundy' ,city: 'San Jose' ,addrone: '2334 Lundy Place' ,addrtwo: '' ,state: 'CA' ,country: 'US' ,continent: 'us' ,code: 'mlpsca01' ,id: 27 ,apops: [] }; ginpoparray["SanJoseLundy"] = addGINPOP("San Jose - Lundy","SanJoseLundy",SanJoseLundy, map, -10, 20); google.maps.event.addListener(ginpoparray["SanJoseLundy"], 'click', function() { popClick('SanJoseLundy'); }); pingmarkers["SanJoseLundy"] = new google.maps.Marker({ position: SanJoseLundy, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Seattle = new google.maps.LatLng(47.621,-122.3473); popdata["Seattle"] = {name: 'Seattle' ,locname: 'Seattle' ,city: 'Seattle' ,addrone: '2001 Sixth Avenue Suite 900' ,addrtwo: '' ,state: 'WA' ,country: 'US' ,continent: 'us' ,code: 'sttlwa01' ,id: 10 ,apops: [] }; ginpoparray["Seattle"] = addGINPOP("Seattle","Seattle",Seattle, map, -10, 20); google.maps.event.addListener(ginpoparray["Seattle"], 'click', function() { popClick('Seattle'); }); pingmarkers["Seattle"] = new google.maps.Marker({ position: Seattle, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); var Sterling = new google.maps.LatLng(38.9825,-77.423); popdata["Sterling"] = {name: 'Sterling' ,locname: 'Sterling' ,city: 'Dulles' ,addrone: '22451 Shaw Rd' ,addrtwo: '' ,state: 'VA' ,country: 'US' ,continent: 'us' ,code: 'stngva01' ,id: 17 ,apops: [] }; ginpoparray["Sterling"] = addGINPOP("Sterling","Sterling",Sterling, map, -10, 20); google.maps.event.addListener(ginpoparray["Sterling"], 'click', function() { popClick('Sterling'); }); pingmarkers["Sterling"] = new google.maps.Marker({ position: Sterling, clickable: false, icon: pingimage, map: map, draggable: false, visible: false, zIndex: 400, optimized: false }); links.push({source: getPopName(2),destination: getPopName(30)}); links.push({source: getPopName(2),destination: getPopName(33)}); links.push({source: getPopName(2),destination: getPopName(34)}); links.push({source: getPopName(2),destination: getPopName(35)}); links.push({source: getPopName(2),destination: getPopName(37)}); links.push({source: getPopName(2),destination: getPopName(38)}); links.push({source: getPopName(2),destination: getPopName(47)}); links.push({source: getPopName(2),destination: getPopName(49)}); links.push({source: getPopName(2),destination: getPopName(52)}); links.push({source: getPopName(2),destination: getPopName(53)}); links.push({source: getPopName(5),destination: getPopName(30)}); links.push({source: getPopName(5),destination: getPopName(33)}); links.push({source: getPopName(5),destination: getPopName(34)}); links.push({source: getPopName(5),destination: getPopName(35)}); links.push({source: getPopName(5),destination: getPopName(37)}); links.push({source: getPopName(5),destination: getPopName(38)}); links.push({source: getPopName(5),destination: getPopName(47)}); links.push({source: getPopName(5),destination: getPopName(49)}); links.push({source: getPopName(5),destination: getPopName(52)}); links.push({source: getPopName(5),destination: getPopName(53)}); links.push({source: getPopName(7),destination: getPopName(30)}); links.push({source: getPopName(7),destination: getPopName(33)}); links.push({source: getPopName(7),destination: getPopName(34)}); links.push({source: getPopName(7),destination: getPopName(35)}); links.push({source: getPopName(7),destination: getPopName(37)}); links.push({source: getPopName(7),destination: getPopName(38)}); links.push({source: getPopName(7),destination: getPopName(47)}); links.push({source: getPopName(7),destination: getPopName(49)}); links.push({source: getPopName(7),destination: getPopName(52)}); links.push({source: getPopName(7),destination: getPopName(53)}); links.push({source: getPopName(10),destination: getPopName(30)}); links.push({source: getPopName(10),destination: getPopName(33)}); links.push({source: getPopName(10),destination: getPopName(34)}); links.push({source: getPopName(10),destination: getPopName(35)}); links.push({source: getPopName(10),destination: getPopName(37)}); links.push({source: getPopName(10),destination: getPopName(38)}); links.push({source: getPopName(10),destination: getPopName(47)}); links.push({source: getPopName(10),destination: getPopName(49)}); links.push({source: getPopName(10),destination: getPopName(52)}); links.push({source: getPopName(10),destination: getPopName(53)}); links.push({source: getPopName(17),destination: getPopName(30)}); links.push({source: getPopName(17),destination: getPopName(33)}); links.push({source: getPopName(17),destination: getPopName(34)}); links.push({source: getPopName(17),destination: getPopName(35)}); links.push({source: getPopName(17),destination: getPopName(37)}); links.push({source: getPopName(17),destination: getPopName(38)}); links.push({source: getPopName(17),destination: getPopName(47)}); links.push({source: getPopName(17),destination: getPopName(49)}); links.push({source: getPopName(17),destination: getPopName(52)}); links.push({source: getPopName(17),destination: getPopName(53)}); links.push({source: getPopName(22),destination: getPopName(30)}); links.push({source: getPopName(22),destination: getPopName(33)}); links.push({source: getPopName(22),destination: getPopName(34)}); links.push({source: getPopName(22),destination: getPopName(35)}); links.push({source: getPopName(22),destination: getPopName(37)}); links.push({source: getPopName(22),destination: getPopName(38)}); links.push({source: getPopName(22),destination: getPopName(47)}); links.push({source: getPopName(22),destination: getPopName(49)}); links.push({source: getPopName(22),destination: getPopName(52)}); links.push({source: getPopName(22),destination: getPopName(53)}); links.push({source: getPopName(24),destination: getPopName(30)}); links.push({source: getPopName(24),destination: getPopName(33)}); links.push({source: getPopName(24),destination: getPopName(34)}); links.push({source: getPopName(24),destination: getPopName(35)}); links.push({source: getPopName(24),destination: getPopName(37)}); links.push({source: getPopName(24),destination: getPopName(38)}); links.push({source: getPopName(24),destination: getPopName(47)}); links.push({source: getPopName(24),destination: getPopName(49)}); links.push({source: getPopName(24),destination: getPopName(52)}); links.push({source: getPopName(24),destination: getPopName(53)}); links.push({source: getPopName(25),destination: getPopName(30)}); links.push({source: getPopName(25),destination: getPopName(33)}); links.push({source: getPopName(25),destination: getPopName(34)}); links.push({source: getPopName(25),destination: getPopName(35)}); links.push({source: getPopName(25),destination: getPopName(37)}); links.push({source: getPopName(25),destination: getPopName(38)}); links.push({source: getPopName(25),destination: getPopName(47)}); links.push({source: getPopName(25),destination: getPopName(49)}); links.push({source: getPopName(25),destination: getPopName(52)}); links.push({source: getPopName(25),destination: getPopName(53)}); links.push({source: getPopName(26),destination: getPopName(30)}); links.push({source: getPopName(26),destination: getPopName(33)}); links.push({source: getPopName(26),destination: getPopName(34)}); links.push({source: getPopName(26),destination: getPopName(35)}); links.push({source: getPopName(26),destination: getPopName(37)}); links.push({source: getPopName(26),destination: getPopName(38)}); links.push({source: getPopName(26),destination: getPopName(47)}); links.push({source: getPopName(26),destination: getPopName(49)}); links.push({source: getPopName(26),destination: getPopName(52)}); links.push({source: getPopName(26),destination: getPopName(53)}); links.push({source: getPopName(27),destination: getPopName(30)}); links.push({source: getPopName(27),destination: getPopName(33)}); links.push({source: getPopName(27),destination: getPopName(34)}); links.push({source: getPopName(27),destination: getPopName(35)}); links.push({source: getPopName(27),destination: getPopName(37)}); links.push({source: getPopName(27),destination: getPopName(38)}); links.push({source: getPopName(27),destination: getPopName(47)}); links.push({source: getPopName(27),destination: getPopName(49)}); links.push({source: getPopName(27),destination: getPopName(52)}); links.push({source: getPopName(27),destination: getPopName(53)}); links.push({source: getPopName(29),destination: getPopName(30)}); links.push({source: getPopName(29),destination: getPopName(33)}); links.push({source: getPopName(29),destination: getPopName(34)}); links.push({source: getPopName(29),destination: getPopName(35)}); links.push({source: getPopName(29),destination: getPopName(37)}); links.push({source: getPopName(29),destination: getPopName(38)}); links.push({source: getPopName(29),destination: getPopName(47)}); links.push({source: getPopName(29),destination: getPopName(49)}); links.push({source: getPopName(29),destination: getPopName(52)}); links.push({source: getPopName(29),destination: getPopName(53)}); links.push({source: getPopName(30),destination: getPopName(35)}); links.push({source: getPopName(30),destination: getPopName(37)}); links.push({source: getPopName(30),destination: getPopName(38)}); links.push({source: getPopName(30),destination: getPopName(49)}); links.push({source: getPopName(30),destination: getPopName(53)}); links.push({source: getPopName(30),destination: getPopName(54)}); links.push({source: getPopName(33),destination: getPopName(35)}); links.push({source: getPopName(33),destination: getPopName(37)}); links.push({source: getPopName(33),destination: getPopName(38)}); links.push({source: getPopName(33),destination: getPopName(49)}); links.push({source: getPopName(33),destination: getPopName(53)}); links.push({source: getPopName(33),destination: getPopName(54)}); links.push({source: getPopName(34),destination: getPopName(35)}); links.push({source: getPopName(34),destination: getPopName(37)}); links.push({source: getPopName(34),destination: getPopName(38)}); links.push({source: getPopName(34),destination: getPopName(49)}); links.push({source: getPopName(34),destination: getPopName(53)}); links.push({source: getPopName(34),destination: getPopName(54)}); links.push({source: getPopName(35),destination: getPopName(47)}); links.push({source: getPopName(35),destination: getPopName(52)}); links.push({source: getPopName(35),destination: getPopName(54)}); links.push({source: getPopName(37),destination: getPopName(47)}); links.push({source: getPopName(37),destination: getPopName(52)}); links.push({source: getPopName(37),destination: getPopName(54)}); links.push({source: getPopName(38),destination: getPopName(47)}); links.push({source: getPopName(38),destination: getPopName(52)}); links.push({source: getPopName(38),destination: getPopName(54)}); links.push({source: getPopName(47),destination: getPopName(49)}); links.push({source: getPopName(47),destination: getPopName(53)}); links.push({source: getPopName(47),destination: getPopName(54)}); links.push({source: getPopName(49),destination: getPopName(52)}); links.push({source: getPopName(49),destination: getPopName(54)}); links.push({source: getPopName(52),destination: getPopName(53)}); links.push({source: getPopName(52),destination: getPopName(54)}); links.push({source: getPopName(53),destination: getPopName(54)}); var infoBoxOptions = { content: document.getElementById('infobox'), disableAutoPan: false, maxWidth: 0, pixelOffset: new google.maps.Size(-100, 1), zIndex: null, boxStyle: { width: "200px" }, closeBoxMargin: "-290px 2px 2px 2px", closeBoxURL: "", infoBoxClearance: new google.maps.Size(1, 1), pane: "floatPane", visible: false, enableEventPropagation: false, }; ib = new InfoBox(infoBoxOptions); ib.open(map); infoBoxOptions.content = document.getElementById('infoboxb'); ibb = new InfoBox(infoBoxOptions); ibb.open(map); google.maps.event.addListener(map, 'zoom_changed', function() { //document.getElementById('zoom-selector').selectedIndex = map.getZoom() - 3; if(map.getZoom() < 2) { map.setZoom(2); } }); google.maps.event.addListener(map, 'bounds_changed', function() { //fix point display issue /* for(var i in ginpoparray) { ginpoparray[i].setMap(null); //ginpoparray[i].setMap(map); } var t=setTimeout(function(){ for(var i in ginpoparray) { ginpoparray[i].setMap(map); } },3000) */ }); } function addGINPOP(name,jsname, loc, map,x,y) { var marker = new MarkerWithLabel({ position: loc, icon: ginpopimage, map: map, draggable: false, clickable: true, labelContent: name, labelAnchor: new google.maps.Point(x, y), labelClass: "citylabel " + jsname + "label", // the CSS class for the label labelInBackground: false, labelVisible: false, zIndex: 500 }); /* var marker = new google.maps.Marker({ position: loc, icon: ginpopimage, map: map, draggable: false, clickable: true, title: name });*/ google.maps.event.addListener(marker, "mouseover", function (e) { $('.' + jsname + 'label').show(); }); google.maps.event.addListener(marker, "mouseout", function (e) { //if(marker.icon != ginpopgreen) //{ $('.' + jsname + 'label').hide(); //} }); return marker; } function selectLocation(name,pan) { if(!name) return; var bounds = new google.maps.LatLngBounds(); //An inactive destination pop selected, reset the selection values if(ginpoparray[name].getIcon() == ginpopgray) { if(selectedpop != null) { ginpoparray[selectedpop].setIcon(ginpopimage); //ginpoparray[selectedpop].labelVisible = false; ginpoparray[selectedpop].setZIndex(500); selectedpop = null; ib.setVisible(false); } } if(topop != null) { ginpoparray[topop].setIcon(ginpopimage); //ginpoparray[topop].labelVisible = false; ginpoparray[topop].setZIndex(500); ibb.setVisible(false); topop = null; } if(circuit != null) { circuit.setVisible(false); } $('#lp_content').slideUp(); if(selectedpop != null) { //They have selected the currently selected pop, so reset and exit if(selectedpop == name) { ginpoparray[selectedpop].setIcon(ginpopimage); //ginpoparray[selectedpop].labelVisible = false; ginpoparray[selectedpop].setZIndex(500); selectedpop = null; ib.setVisible(false); ibb.setVisible(false); $('#selPop').val(""); $('#lp_destSelect').slideUp(); for(var i in ginpoparray) { ginpoparray[i].setIcon(ginpopimage); } return; } } if(selectedpop == null) //Select Source Pop { $('#selPop').val(name); $('#selPopDest').val(""); $('#lp_destSelect').slideDown(); if(selectedpop != null) { ginpoparray[selectedpop].setIcon(ginpopimage); //ginpoparray[selectedpop].labelVisible = false; } $('#selPopDest').empty(); $('#selPopDest').html(''); var currentRegion = ''; for(var i in popdata) { if (isValidLink(i,name)) { if(currentRegion != popdata[i].continent) { $('#selPopDest').append(''); currentRegion = popdata[i].continent; } $('#selPopDest').append(''); ginpoparray[i].setIcon(ginpopimage); } else { ginpoparray[i].setIcon(ginpopgray); } } selectedpop = name; ginpoparray[name].setIcon(ginpopgreen); //ginpoparray[name].labelVisible = true; ginpoparray[name].setZIndex(1000); bounds.extend(ginpoparray[name].position); setInfoBoxContent($('#infobox_content'),name); ib.setPosition(ginpoparray[name].getPosition()); ib.setVisible(true); if(pan) { map.setCenter(bounds.getCenter()); } } else //Select Destination Pop { $('#selPopDest').val(name); topop = name; ginpoparray[name].setIcon(ginpopgreen); //ginpoparray[name].labelVisible = true; ginpoparray[name].setZIndex(1000); bounds = getBoxBounds(ginpoparray[selectedpop].position, bounds); bounds = getBoxBounds(ginpoparray[topop].position, bounds); //bounds.extend(ginpoparray[selectedpop].position); //bounds.extend(ginpoparray[topop].position); setInfoBoxContent($('#infoboxb_content'),name); ibb.setPosition(ginpoparray[name].getPosition()); ibb.setVisible(true); var linePoints = getBezierPath(ginpoparray[selectedpop].getPosition(), ginpoparray[topop].getPosition(), 20, 0, "up", 12); circuit = new google.maps.Polyline({"map":map,"path":linePoints,"strokeColor":green,"strokeOpacity":1,"strokeWeight":2,"zIndex": 400}); circuit.setVisible(true); $.get('getLinkDataP2P.cfm?region=Global&f='+ popdata[selectedpop].id +'&t=' + popdata[topop].id + '&i='+$('#selInterval').val() + '&x=true',function(data) { $('#lp_content').html(data); $('#lp_content').slideDown(); initLinkData(); }); if(pan) { map.fitBounds(bounds); } } //alert(ginpoparray['Sterling'].zIndex); //alert(ginpoparray['Ashburn'].zIndex); //redraws markerswithlabels because of visibility bug var t=setTimeout(function(){ map.panBy(60,0); map.panBy(-60,0); },50) //$('#popsourceinfo').html(popdata[name].addrone + "
" + popdata[name].addrtwo + "
" + popdata[name].city + " " + popdata[name].state + " " + popdata[name].country).slideDown(); } function setInfoBoxContent(obj, name) { obj.html(""); obj.html("

" + popdata[name].name + "

"); obj.html(obj.html() + popdata[name].addrone + "
"); if(popdata[name].addrtwo) obj.html(obj.html() + popdata[name].addrtwo + "
"); obj.html(obj.html() + popdata[name].city + " " + popdata[name].state + " " + popdata[name].country); if(popdata[name].apops.length > 0) { obj.html(obj.html() + '

Associated POPs

'); for(var p=0;p"); } } } //adds 100 pixel boundary around the center point to accomodate the infobox function getBoxBounds(center, bounds){ var scale = Math.pow(2,map.getZoom()); var proj = map.getProjection(); var wc = proj.fromLatLngToPoint(center); var sw = new google.maps.Point(((wc.x * scale) - 50)/ scale, ((wc.y * scale) - 50)/ scale); bounds.extend(proj.fromPointToLatLng(sw)); var ne = new google.maps.Point(((wc.x * scale) + 50)/ scale, ((wc.y * scale) + 50)/ scale); bounds.extend(proj.fromPointToLatLng(ne)); return bounds; } function popClick(name) { //alert(name); map.panTo(ginpoparray[name].getPosition()); var linkcount = 0; var avail_avg = 0; var latency_avg = 0; var packetloss_avg = 0; var jitter_avg = 0; var maxjitter_avg = 0; /* for(var i = 0; iRegion: " + popdata[name].group + ""); //$('#lp_title').html("Selected Region: " + popdata[name].group); //$('#ib-address').html(popdata[name].addrone + "
" + popdata[name].addrtwo + "
" + popdata[name].city + " " + popdata[name].state + " " + popdata[name].country); //ib.setPosition(ginpoparray[name].getPosition()); //ib.setVisible(true); selectLocation(name,true); } function preload(arrayOfImages) { $(arrayOfImages).each(function(){ $('')[0].src = this; }); } function selectZoom(obj) { map.setZoom(parseInt(obj.options[obj.selectedIndex].value)); } $(document).ready(function(){ //return; $('#map_canvas').width($(window).width()-$('#left_pane').outerWidth()); $('#left_pane').height($(window).height()-$('#top_pane').outerHeight()); $('#map_canvas').height($(window).height()-$('#top_pane').outerHeight()); /* $.get('getData.cfm/us_v4_15min.xml',function(data) { sladata = $.parseXML(data); //alert($(sladata).find("SLA").children("Availability").text()); //alert(sladata); initialize(); }); */ initialize(); $('#infobox_close').click(function(){ ib.setVisible(false); }); $('#infoboxb_close').click(function(){ ibb.setVisible(false); }); $('#selInterval').val('Last 15 Minutes'); $('#selInterval').change(function(){ selectLocation(topop,false); }); $('#selPop').val(""); $('#selPop').change(function(){ //Clear the current selection first if(selectedpop != null) { ginpoparray[selectedpop].setIcon(ginpopimage); //ginpoparray[selectedpop].labelVisible = false; selectedpop = null; } selectLocation($(this).val(),true); }); $('#selPopDest').change(function(){ if(topop != null) { ginpoparray[topop].setIcon(ginpopimage); //ginpoparray[topop].labelVisible = false; ginpoparray[topop].setZIndex(500); topop = null; } selectLocation($(this).val(),true); }); preload([ 'image/cb-off.gif', 'image//pop-key-off.png', 'image/datacenter-key-off.png', 'image/ppp-key-off.png', 'image/ping-green.png', 'image/ping-warning.png', 'image/sla-pop-green.png' ]); if(document.width < 600) { $('#logo-image').css('display','none'); } var portrait = document.width < document.height; var iphone=navigator.userAgent.toLowerCase().indexOf('iphone')!=-1; if(iphone && ((portrait && document.height < 400) || (!portrait && document.height < 250))) { alert('For the best view, please add this site to your homescreen by using the bookmark button'); } var refreshLinkDataTimer=setTimeout(function(){ refreshLinkData(); },300000) //document.getElementById('pop-selector').selectedIndex = 0; //document.getElementById('zoom-selector').selectedIndex = 0; }); function getPopName(id) { for(var i in popdata) { if(popdata[i].id == id) { return popdata[i].locname; } } } function isValidLink(src,dst) { for(var i in links) { if((links[i].source == src && links[i].destination == dst) || (links[i].source == dst && links[i].destination == src)) { return true; } } return false; } $(window).resize(function(){ $('#map_canvas').width($(window).width()-$('#left_pane').outerWidth()); $('#left_pane').height($(window).height()-$('#top_pane').outerHeight()); $('#map_canvas').height($(window).height()-$('#top_pane').outerHeight()); }); function initLinkData() { $('.viewHistory').click(function(){ var modaloptions = { overlayClose: true, onClose: function (dialog) { $.modal.close(); }}; $('#dialogContent').html(''); //$.getJSON('getHistoricalJson.cfm?f=' + selectedregion + "&t=" + toregion + "&i=" + $('#selInterval').val() + "&m=" + $(this).attr('measurement'),function(data){ $.getScript('getHistoricalJS.cfm?region=Global&f=' + popdata[selectedpop].id + "&t=" + popdata[topop].id + "&i=" + $('#selInterval').val() + "&m=" + $(this).attr('measurement') + "&l=" + $(this).attr('threshold'),function(data, textStatus, jqxhr){ //alert(graphDataSet); //alert(graphDataSet[0].date); if(historyError) { alert(historyError); return; } $('#dialog').modal(modaloptions); $('#chartContainer').highcharts({ chart: { type: 'line' }, colors: [ '#00517f', '#0d233a', '#8bbc21', '#910000', '#1aadce', '#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a' ], title: { text: graphTitle }, subtitle: { text: graphSubTitle }, legend: { enabled: false }, xAxis: { type: 'datetime', dateTimeLabelFormats: { millisecond: '%H:%M:%S.%L', second: '%H:%M:%S', minute: '%H:%M', hour: '%H:%M', day: '%b %e', week: '%b %e', month: '%b/%y', year: '%Y' } }, yAxis: yAxisOptions, tooltip: { formatter: function() { return "" + Highcharts.dateFormat('%m/%d %H:%M', this.x) +'
'+ this.y + graphUnit; } }, plotOptions: { area: { fillColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1}, stops: [ [0, Highcharts.getOptions().colors[0]], [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0.3).get('rgba')] ] }, lineWidth: 1, shadow: false, states: { hover: { lineWidth: 1 } }, threshold: null } }, series: [{ name: 'Data', type: 'area', // Define the data points. All series have a dummy year // of 1970/71 in order to be compared on the same x axis. Note // that in JavaScript, months start at 0 for January, 1 for February etc. data: graphDataSet }] }); }); /* $.get('getHistoricalData.cfm?f=' + selectedregion + "&t=" + toregion + "&i=" + $('#selInterval').val() + "&m=" + $(this).attr('measurement'),function(data){ $('#dialogContent').html(data); $('#dialog').modal(modaloptions); }); */ }); } function initRegionData(){ $('.region-expander').click(function(){ $(this).next('.link-region').click(); }); $('.link-region').click(function() { var i = $(this).attr("index"); //close other active region if(toregionindex != null && toregionindex != i) { $('#region-expander-' + toregionindex).html(">"); $('#region-data-'+toregionindex).slideUp(); } //toggle active region if($('#region-expander-' + i).html()==">") { ib.setVisible(false); $('#region-expander-' + i).html("v"); $('#region-data-'+i).slideDown(); toregion = $(this).attr("region"); toregionindex = $(this).attr("index"); //Gray out the unselected POPs and set map boundaries var bounds = new google.maps.LatLngBounds(); for(var i in popdata) { if(popdata[i].group != toregion && popdata[i].group != selectedregion) { ginpoparray[i].setIcon(ginpopgray); pingmarkers[i].setVisible(false); } else { //set the map boundaries from the selected points pingmarkers[i].setVisible(true); if($(this).hasClass('warning')) { pingmarkers[i].setIcon(pingwarning); } else { pingmarkers[i].setIcon(pingimage); } if(popdata[i].group == toregion) { ginpoparray[i].setIcon(ginpopimage); } bounds.extend(ginpoparray[i].position); } } map.fitBounds(bounds); //redraws markerswithlabels because of visibility bug var t=setTimeout(function(){ map.panBy(1,0); map.panBy(-1,0); },50) } else { $('#region-expander-' + i).html(">"); $('#region-data-'+i).slideUp(); toregion = null; toregionindex = null; } }); $('.viewHistory').click(function(){ var modaloptions = { overlayClose: true, onClose: function (dialog) { $.modal.close(); }}; $('#dialogContent').html(''); //$.getJSON('getHistoricalJson.cfm?f=' + selectedregion + "&t=" + toregion + "&i=" + $('#selInterval').val() + "&m=" + $(this).attr('measurement'),function(data){ $.getScript('getHistoricalJS.cfm?region=Global&f=' + selectedregion + "&t=" + toregion + "&i=" + $('#selInterval').val() + "&m=" + $(this).attr('measurement') + "&l=" + $(this).attr('threshold'),function(data, textStatus, jqxhr){ //alert(graphDataSet); //alert(graphDataSet[0].date); $('#dialog').modal(modaloptions); $('#chartContainer').highcharts({ chart: { type: 'line' }, colors: [ '#00517f', '#0d233a', '#8bbc21', '#910000', '#1aadce', '#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a' ], title: { text: graphTitle }, subtitle: { text: graphSubTitle }, legend: { enabled: false }, xAxis: { type: 'datetime', dateTimeLabelFormats: { millisecond: '%H:%M:%S.%L', second: '%H:%M:%S', minute: '%H:%M', hour: '%H:%M', day: '%b %e', week: '%b %e', month: '%b/%y', year: '%Y' } }, yAxis: yAxisOptions, tooltip: { formatter: function() { return "" + Highcharts.dateFormat('%m/%d %H:%M', this.x) +'
'+ this.y + graphUnit; } }, plotOptions: { area: { fillColor: { linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1}, stops: [ [0, Highcharts.getOptions().colors[0]], [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0.3).get('rgba')] ] }, lineWidth: 1, shadow: false, states: { hover: { lineWidth: 1 } }, threshold: null } }, series: [{ name: 'Data', type: 'area', // Define the data points. All series have a dummy year // of 1970/71 in order to be compared on the same x axis. Note // that in JavaScript, months start at 0 for January, 1 for February etc. data: graphDataSet }] }); }); /* $.get('getHistoricalData.cfm?f=' + selectedregion + "&t=" + toregion + "&i=" + $('#selInterval').val() + "&m=" + $(this).attr('measurement'),function(data){ $('#dialogContent').html(data); $('#dialog').modal(modaloptions); }); */ }); } function isTranspacific(start, finish) { if(start.lng() > finish.lng()) { var temp = start; start = finish; finish = temp; } var deltaone = start.lng() + 180; var deltatwo = 180 - finish.lng(); if(deltaone + deltatwo < finish.lng() - start.lng()) { return true; } return false; } function refreshLinkData() { $.get('refreshLinkData.cfm?region=Global',function(data) { $('#timestamp').html(data); }); var refreshLinkDataTimer=setTimeout(function(){ refreshLinkData(); },300000) } function getBezierPath(start, finish, arcHeight, skew, upDown, numSegments) { // assumes exisatence of a global VEMap object named 'map' instantiated via LoadMap() // start & finish: required VELatLong // transPacific: specifies if the curve is to go over the Pacific Ocean // arcHeight: required double latitude degrees // skew: required double left-right degrees // color: optional VEColor for line; default = red // width: optional integer line width; default = 2 // upDown: optional string 'up' or 'down'; default = 'up' // numSegments: optional int number of segments to use for line; default = 10 // stroke: optional white outline // layer: optional layer to add the curve to // see http://mathforum.org/library/drmath/view/54434.html for the math //calculate to see if the path over the pacific is the shortest route. var transPacific = isTranspacific(start, finish); if(start.lng() < finish.lng()) { temp = start; start = finish; finish = temp; } if (typeof width == 'undefined') { var width = 2; } if (typeof upDown == 'undefined') { var upDown = 'up'; } if (typeof numPoints == 'undefined') { var numPoints = 10; } if (typeof stroke == 'undefined') { var stroke = false; } //Use a different structure for finish to allow transpacific routes var f = {lat: finish.lat(),lng: finish.lng()}; //If the curve is to go across the pacific we have to translate the finish point location and then translate back each segment if (transPacific) { f = {lat: finish.lat(),lng: 180+180-Math.abs(f["lng"])}; } /* if (start.lng > f["lng"]) { // adjust so start is to the left of finish var temp = start; start = new google.maps.LatLng(f["lat"],f["lng"]); f = {lat: temp.lat(),lng: temp.lng()}; }*/ if (numSegments < 2) numSegments = 2; var midLon = (f["lng"] - start.lng()) / 2.0; var midLat = (f["lat"] - start.lat()) / 2.0; if (Math.abs(start.lng() - f["lng"]) < 0.0001) { // nearly vertical if (upDown == 'up') midLon -= arcHeight; else midLon += arcHeight; midLat += skew; } else { // 'normal' case, not vertical if (upDown == 'up') midLat += arcHeight; else midLat -= arcHeight; midLon += skew; } var tDelta = 1.0 / numSegments; var lons = new Array(); // 'x' values for (t = 0.0; t <= 1.0; t += tDelta) { var firstTerm = (1.0 - t * t) * start.lng(); var secondTerm = 2.0 * (1.0 - t) * t * midLon; var thirdTerm = t * t * f["lng"]; var B = firstTerm + secondTerm + thirdTerm; if(transPacific && B > 180) B = B - 180 - 180; lons.push(B); } var lats = new Array(); // 'y' values for (t = 0.0; t <= 1.0; t += tDelta) { var firstTerm = (1.0 - t * t) * start.lat(); var secondTerm = 2.0 * (1.0 - t) * t * midLat; var thirdTerm = t * t * f["lat"]; var B = firstTerm + secondTerm + thirdTerm; lats.push(B); } var debug = ""; var points = new Array(); for (i = 0; i < lats.length; ++i) { debug = debug + "\n" + lats[i]; points.push(new google.maps.LatLng(lats[i], lons[i])); } return points; } function dump(arr,level) { var dumped_text = ""; if(!level) level = 0; //The padding given at the beginning of the line. var level_padding = ""; for(var j=0;j \"" + value + "\"\n"; } } } else { //Stings/Chars/Numbers etc. dumped_text = "===>"+arr+"<===("+typeof(arr)+")"; } return dumped_text; }