var map; var icon0; var markers = new Array(); var popups = new Array(); var newpoints = new Array(); $(function(){ loadMap(); addPoints(); createListViewForMarkers(); $("#main_box_google").children().click(function(){ stopRotatingContent(); }); $("#main_top10").children().click(function(){ stopRotatingContent(); }); }); function stopRotatingContent() { //stop outer timer that rotates content if(!stopTimer) { stopTimer=true; clearTimeout(contentTimeout); } } function loadMap() { map = new GMap2(document.getElementById("main_box_google"), { size: new GSize(640,360) } ) map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); map.setCenter(new GLatLng( 40.735909, -73.990281), 16); map.setMapType(G_NORMAL_MAP); icon0 = new GIcon(); icon0.image = "http://www.google.com/mapfiles/marker.png"; icon0.shadow = "http://www.google.com/mapfiles/shadow50.png"; icon0.iconSize = new GSize(20, 34); icon0.shadowSize = new GSize(37, 34); icon0.iconAnchor = new GPoint(9, 34); icon0.infoWindowAnchor = new GPoint(9, 2); icon0.infoShadowAnchor = new GPoint(18, 25); } function createListViewForMarkers() { $(markers).each(function(i,marker){ GEvent.addListener(marker, "click", function(){ map.panTo(marker.getLatLng()); stopRotatingContent(); }); $("
") .html(""+newpoints[i][3]+"") .click(function(){ map.panTo(marker.getLatLng()); marker.openInfoWindowHtml(createMarkerPopup(newpoints[i][4])); stopRotatingContent(); }) .appendTo("#list"); }); } function createMarker(point, icon, popuphtml, index) { var popuphtml = createMarkerPopup(popuphtml); var marker = new GMarker(point, icon); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(popuphtml); popups[index] = popuphtml; stopRotatingContent(); }); return marker; } function createMarkerPopup(popuphtml) { return "