// JavaScript Document function bpmsCreateMarker(mymap, myx, myy, html, icon) { var point = new GPoint(myx, myy); var marker = new GMarker(point, icon); GEvent.addListener(marker, "click", function() { marker.openInfoWindowHtml(html); }); /*window.setTimeout(function() { //Verisione 1 delle API //mymap.recenterOrPanToLatLng(point); //Versione 2 delle API mymap.panTo(point); }, 2000);*/ return marker; } function bpmsSearch(comune) { loading(true); var coordsArr = null; if(comune == 'none'){ var sel = document.getElementById('prjComune'); sel.options[0].selected = true; } //prompt("url:","http://mappe.bpms.re.it/maps-cbec/includes/main_projects.inc.php?Comune=" + comune); //Recupero tramite Ajax lo script JS creato dinamicamente dal server in funzione dei parametri passati var bindArgs = { // // The following URL must match that used to test the server. url: "http://mappe.bpms.re.it/maps-cbec/includes/main_projects.inc.php?Comune=" + ((comune)? comune: "none"), handleAs: "text", // The LOAD function will be called on a successful response. load: function(response, ioArgs) { // if (response) { eval(response); //createComunePolygon(coordsArr); //Pulisco l'array coordsArr = null; checkView('projectsStatus', ''); } loading(false); response = null; return response; }, // The ERROR function will be called in an error case. error: function(response, ioArgs) { // alert("Errore durante il recupero delle triangolazioni:\r\n" + "HTTP status code ", ioArgs.xhr.status); // return response; // } }; // dispatch the request dojo.xhrGet(bindArgs); } function createComunePolygon(coordsArr){ var GLatLngArr = new Array(); for(var i = 0; i < coordsArr.length; i++){ GLatLngArr[i] = new GLatLng(coordsArr[i][0], coordsArr[i][1]); } //Creo il confine polygonComuneProjects = new GPolygon(GLatLngArr,'#9999CC', 2, 0.8, '#9999CC', 0.2); map.addOverlay(polygonComuneProjects); } function shProjects(bool){ if(markersProjects != null){ for(var i = 0; i < markersProjects.length; i++){ if(bool){ markersProjects[i].show(); }else{ markersProjects[i].hide(); } } } if(polygonComuneProjects != null){ if(bool){ polygonComuneProjects.show(); }else{ polygonComuneProjects.hide(); } } }