//' + sidebarcode[i] + ''; i++; return id; } function buildurl() { var center = map.getCenter(); var lat = Math.round(center.lat()*100000)/100000; var lng = Math.round(center.lng()*100000)/100000; document.location.hash = "/"+lat+"/"+lng+"/"+map.getZoom()+"/"+map.getCurrentMapType().getUrlArg()+"/"; } function newdata() { buildurl(); Show('loading'); readMap("http://www.luispabon.com/retina/core/core.mapgetdata.php/"+map.getBounds().getNorthEast()+"/"+map.getBounds().getSouthWest()+"/"); } readMap("http://www.luispabon.com/retina/core/core.mapgetdata.php/"+map.getBounds().getNorthEast()+"/"+map.getBounds().getSouthWest()+"/"); GEvent.addListener(map, "zoomend", function() { buildurl(); clearTimeout(datatimeout); datatimeout = setTimeout("newdata();", 4000); }); GEvent.addListener(map, 'dragend', function() { buildurl(); clearTimeout(datatimeout); datatimeout = setTimeout("newdata();", 4000); }); GEvent.addListener(map, 'dragstart', function() { clearTimeout(datatimeout); }); GEvent.addListener(map, 'zoomstart', function() { clearTimeout(datatimeout); }); GEvent.addListener(map, "mouseover", function(){ map.showControls(); }); GEvent.addListener(map, "mouseout", function(){ map.hideControls(); }); function readMap(url) { clearTimeout(datatimeout); var request = GXmlHttp.create(); request.open("GET", url, true); request.onreadystatechange = function() { if (request.readyState == 4) { var xmlDoc = request.responseXML; var markers = xmlDoc.documentElement.getElementsByTagName("marker"); map.getInfoWindow().hide(); map.clearOverlays(); gmarkers = []; side_bar_html=""; for (var i = 0; i < markers.length; i++) { var lat = parseFloat(markers[i].getAttribute("lat")); var lng = parseFloat(markers[i].getAttribute("lng")); var point = new GLatLng(lat,lng); var html = unescape(markers[i].getAttribute("html")); var label = markers[i].getAttribute("label"); var infoUrl = markers[i].getAttribute("infoUrl"); var side = unescape(markers[i].getAttribute("side")); var id = unescape(markers[i].getAttribute("id")); // make marker var marker = createMarker(point,label,html,infoUrl,star,side,id); map.addOverlay(marker); } map.hideControls(); Hide('loading'); document.getElementById("viewlinks").innerHTML = side_bar_html; if (segment[5]) {sidebarClick(picture)}; } } request.send(null); } //]]>