var map; var point; function gander(location) { switch(location) { case "europe": map.centerAndZoom(new GPoint(17, 49), 13); break; case "world": map.centerAndZoom(new GPoint(13, 25), 15); break; default: map.centerAndZoom(new GPoint(-95, 39), 13); break; } } function drawmap() { // New map map = new GMap(document.getElementById("map")); map.setMapType(G_HYBRID_MAP); // Add controls map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); // Set the default center and zoom map.centerAndZoom(new GPoint(13, 25), 15); // Get points var allPoints = new Array([-76.0909,42.146,0],[-117.0416,33.1349,1],[2.65,39.5667,1],[-117.9001,33.6153,1],[-75.612,39.9893,1],[12.8556,56.6714,1],[8.25,50.0833,1],[-84.2446,30.4629,1],[-3.2,51.5,1],[-80.0942,26.4095,1],[17.3,62.3833,1],[23.7333,37.9833,1],[8.6333,45.4667,1],[-73.5833,45.5,1],[-86.2539,32.404,1],[11.0333,50.9833,1],[8.3858,49.0047,1],[7.5333,46.3,1],[-121.9144,37.3239,2],[22,39,2],[-1.85,53.7167,2],[-77.05,-12.05,2],[-122.1826,37.3762,2],[-71.5353,42.1294,2],[-91.0321,41.4046,2],[31.25,30.05,2],[9.2167,48.4833,2],[-97,38,2],[-112.0839,33.5222,2],[8.4647,49.4883,2],[-70.414,41.6686,2],[-73.8833,45.5333,2],[12,51.5,2],[-94.1459,33.4431,2],[8,47,2],[-102,23,3],[-121.5567,37.0692,3],[-118.2988,34.0416,3],[-84.5067,37.0985,3],[-83.1785,42.5983,3],[13.4,52.5167,3],[12.3333,51.3,3],[144.9667,-37.8167,3],[-80.1468,26.3739,3],[-93.0884,44.9679,3],[-79.9333,43.65,3],[-115.4167,55.3333,3],[153.0167,-27.5,3],[-100.3167,25.6667,3],[21.7344,38.2444,3],[-0.1667,51.2333,3],[-88.8303,33.4259,4],[-85.8464,42.9156,4],[-122.0574,37.4192,4],[-0.1167,51.5,4],[-3.2,55.95,4],[-87.7004,37.5337,4],[-104.9793,39.7437,4],[-70.6667,-33.45,4],[-81.8443,32.3729,4],[22.8075,37.5636,4],[-87.575,33.3056,4],[-73.8397,41.0837,4],[-73.9933,40.7605,4],[-73.2253,44.4929,4],[-8.3,41.45,4],[-111.7116,40.3143,4],[-87.5068,34.9054,4],[-77.4801,37.5409,5],[-79.2667,43.8667,5],[-1.0594,54.6075,5],[-122.4294,37.7645,5],[-98.514,29.4717,5],[-86.4547,36.3913,5],[-82.6112,28.9168,5],[-85.9035,35.1805,5],[7.0167,51.45,5],[-73.9763,40.7619,5],[-104.6838,38.6657,5],[-96.6061,40.8602,5],[-2.45,42.4667,5],[-90.4444,38.6143,5],[-89.52,44.8876,5],[-74.2628,40.3595,5],[-95.717,39.0399,6],[-86.1407,39.8062,6],[-80.0855,26.3453,6],[8.55,50.1333,6],[-122.4337,48.7413,6],[-82.0718,39.9553,6],[-87.6744,41.8675,6],[36.3,33.5,6],[11.6833,49.45,6],[-75.5622,6.3389,6],[-83.7472,42.2747,6],[-3,53.4167,6],[-122.6554,45.5184,6],[-113.5,53.55,6],[-81.2584,28.4806,6],[13.4833,48.6667,6],[-77.0231,38.9097,6],[-2,54,7],[7.6667,45.05,7],[-115.1479,36.0097,7],[9.9833,57.4667,7],[-82.5581,28.4656,7],[-85.6635,42.8664,7],[-80.742,32.1964,7],[-71.2558,42.5493,7],[-97.3459,31.9522,7],[8.5667,50.1667,7],[-97.2469,38.1009,7],[-1.3833,54.9119,7],[-97.8082,30.4998,7],[-64.3667,45.0833,7],[2.1833,41.3833,7],[22.9439,40.6403,7],[23.8167,63,7],[-73.9072,41.5277,8],[-3.6833,40.4,8],[8.3833,52.9333,8],[9.2333,52.9167,8],[-3.8667,40.4667,8],[25.1306,35.325,8],[-78.92,33.6948,8],[-93.4339,44.9518,8],[-86.7844,36.1458,8],[-78.6421,35.8278,8],[-81.448,28.3853,8],[-84.5168,33.8599,8],[9,51,8],[-74.4863,40.8841,8],[24.4019,40.9397,8],[-105.1396,40.524,8],[-84.3865,33.8004,9],[-91.384,39.9315,9],[7.6,47.5667,9],[-85.6768,38.189,9],[-89.906,37.7307,9],[-93.2007,44.4614,9],[-82.4114,41.1062,9],[-77.0928,38.9376,9],[-79.1294,40.64,9],[-95.4909,29.7482,9],[7.55,53.4,9],[-122.8178,44.5253,9],[-98.898,31.7353,9],[-120.1955,47.4941,9],[-93.4947,45.1234,9],[-75.1968,39.9597,9],[12.3167,58.3667,9],[-86.8642,40.3987,10],[-84.5177,33.9532,10],[23.1667,37.4667,10],[-77.4698,38.9092,10],[7.4667,51.35,10],[5.0833,50.75,10],[-84.1446,40.7331,10],[-83.9815,34.1046,10],[-66.6333,45.95,10],[6.95,50.9333,10],[9.2167,52.6333,10],[-84.0337,33.7964,10],[-81.1966,41.17,10],[9.6667,52.0333,10],[-73.1181,40.8156,10],[-76.3528,39.4526,10],[-80.7958,35.3366,10],[-95.7826,29.7961,11],[-79.8333,43.25,11],[-97.1463,31.5581,11],[-9.1,38.6167,11],[22.9667,37.9833,11],[-99.1386,19.4342,11],[-74.9415,40.103,11],[-79.66,40.4554,11],[-77.4427,43.1473,11],[10,53.55,11],[-86.7987,33.5054,11],[-122.3326,47.5951,11],[-92.6901,38.1122,11],[-98.014,29.8729,11],[-77.532,36.7215,11],[-74.1224,42.9693,11],[-71.9766,41.3749,12],[-97.5274,35.3848,12],[-115.2048,36.1515,12],[9.7,52.8667,12],[8.6833,50.1167,12],[-75.3973,38.668,12],[-85.8383,44.6288,12],[-117.2978,34.1362,12],[-0.8,51.8167,12],[10.4167,49.5,12],[-75.3809,40.1545,12],[-122.3422,47.6344,12],[-104.905,39.529,12],[-97.1667,49.8833,12],[-83.3892,33.965,12],[-77.5852,43.1518,12]); // Describe icons var baseIcon = new GIcon(); baseIcon.shadow = "http://www.zipwise.com/images/shadow.png"; baseIcon.iconSize = new GSize(12, 20); baseIcon.shadowSize = new GSize(22, 20); baseIcon.iconAnchor = new GPoint(6, 20); baseIcon.infoWindowAnchor = new GPoint(5, 1); // Map all the points in the array for(var i = allPoints.length - 1; i >= 0; i--) { var point = new GLatLng(allPoints[i][1], allPoints[i][0]); var icon = new GIcon(baseIcon); icon.image = "http://www.zipwise.com/images/red" + allPoints[i][2] + ".png"; var marker = new GMarker(point, icon) map.addOverlay(marker); } }