var iugisSlider=null; var serviziConfigurati=new Array(); var popupIdentify=null; function zoomIndirizzoIugis(currentPosizioneIndirizzo) { //alert("zoomIndirizzo: " + currentPosizioneIndirizzo.posizioneX + " " + currentPosizioneIndirizzo.posizioneY); //#{action.currentPosizioneIndirizzo.posizioneX}, #{action.currentPosizioneIndirizzo.posizioneY} /*var bounds = new OpenLayers.Bounds(); bounds.extend(new OpenLayers.LonLat(currentPosizioneIndirizzo.posizioneX-200,currentPosizioneIndirizzo.posizioneY-200)); bounds.extend(new OpenLayers.LonLat(currentPosizioneIndirizzo.posizioneX+200,currentPosizioneIndirizzo.posizioneY+200)); bounds.toBBOX();*/ if (currentPosizioneIndirizzo==null || currentPosizioneIndirizzo.posizioneX == null || currentPosizioneIndirizzo.posizioneY == null || currentPosizioneIndirizzo.posizioneX == 0 || currentPosizioneIndirizzo.posizioneY==0 ) return 444; try { var xmin=currentPosizioneIndirizzo.posizioneX-200; var ymin=currentPosizioneIndirizzo.posizioneY-200; var xmax=currentPosizioneIndirizzo.posizioneX+200; var ymax=currentPosizioneIndirizzo.posizioneY+200; mappe[0].zoomToExtents(xmin,ymin,xmax,ymax); } catch (err) { //console.error(err); } try { var centrox=currentPosizioneIndirizzo.posizioneX; var centroy=currentPosizioneIndirizzo.posizioneY; var indirizzoLayer=null; var lll=mappe[0].mappaOl.getLayersByName("indirizzoLayer"); if (lll!=null && lll.length>0) { for (var markerCount=0;markerCount",newlev); url=url.replace("",x); url=url.replace("",y); return url; } function extendRefreshMap () { OpenLayers.GreaseOl.MainMapOL.prototype.refreshMap = (function (old) { return function () { var result=3; var a=document.getElementById(this.getIdForm()+":elencoServiziId_"+this.getIdMappa()).value; this.serviziToRefresh=a.split('|'); var accesi=new Array(); var almenoUnaChiamataAjax=false; for (var i=0;i//.jpg" ,{ 'type':'jpg', 'getURL':getUrlFromCfg ,projection: new OpenLayers.Projection("EPSG:32632") ,units: 'm' ,numZoomLevels: 2 ,maxResolution: 1831.0546875 ,maxExtent: new OpenLayers.Bounds(185625,4779625,654375,5248375) }) ]}); this.mappaOl.addControl(panel_overview); //coordinate del mounse this.mappaOl.addControl(new OpenLayers.Control.MousePosition({numDigits:0,prefix:"[UTM-WGS84] "})); // scala this.mappaOl.addControl(new OpenLayers.Control.ScaleLine()); fullToggleControl('PAN',defaultMapCmdOptions['PAN']); if (regionePiemonte==true) attivaEventiPopUp(); else attivaEventiPopUp(); //TODO aggiungere altre eventuali customizzazioni return result; }; })(OpenLayers.GreaseOl.MainMapOL.prototype.initMap); } function extendToggleCtrl() { OpenLayers.GreaseOl.MainMapOL.prototype.toggleControl = (function (old) { return function (baseType,extendedType) { //var result = old.apply(this, arguments); var result="asd"; var keyToActivate=null; var options=extendedType; //console.debug(baseType +"--->"+extendedType); for(var key in this.olcontrolli) { //console.debug(" "+key); var control = this.olcontrolli[key]; //if(key!=null && key.indexOf(attivato+"_mapNO")==0) { //var options=defaultMapCmdOptions[extendedType]; if(key!=null && key.indexOf(baseType)==0) { keyToActivate=key; } else { try { control.deactivate(); } catch (err) { //console.debug(key+"++"+err); } } } alert(keyToActivate); if (null!=keyToActivate) { alert(keyToActivate); if (options!=null) { document.getElementById(this.getIdForm()+":comando").value=options.command; try { var tmpRet=this.olcontrolli[keyToActivate].setGreaseOptions(options); } catch (errA) { } var cssStyle=null; if (options.cursorClass !==undefined && options.cursorClass!=null) cssStyle= options.cursorClass; else if (this.olcontrolli[keyToActivate].cssStyle && this.olcontrolli[keyToActivate].cssStyle!=null) cssStyle=this.olcontrolli[keyToActivate].cssStyle; this.mappaOl.div.style.cursor=''; if (this.prevCssStyle!=null) gisJQuery(this.mappaOl.div).removeClass(this.prevCssStyle); if (cssStyle!=null) gisJQuery(this.mappaOl.div).addClass(cssStyle); this.prevCssStyle=cssStyle; } if (keyToActivate!="DRAW_MODIFY") { this.lastControlKey=keyToActivate; this.lastControlOption=options; } this.olcontrolli[keyToActivate].activate(); } return result; }; })(OpenLayers.GreaseOl.MainMapOL.prototype.toggleControl); } function extendOlLayer() { OpenLayers.GreaseOl.Layer.GreaseLayer.prototype.updateImages = (function (old) { return function (servizioCorrente) { var res=111; // alert("updateImages"); this.clearImages(); progressBars[0].hideProgress(servizioCorrente.idServizio); var leftN = parseInt(this.map.layerContainerDiv.style.left); var topN = parseInt(this.map.layerContainerDiv.style.top); var ret='ko'; if (servizioCorrente==null || servizioCorrente.images==null || servizioCorrente.images.length<=0) return ret; //this.setOpacity(parseFloat(servizioCorrente.opacity)); var size=this.map.getSize(); this.imgContdiv.style.top=(0-topN-size.h)+"px"; this.imgContdiv.style.left=(0-leftN-size.w)+"px"; this.imgContdiv.style.width=(size.w*3)+"px"; this.imgContdiv.style.height=(size.h*3)+"px"; for (var cntImages=0;cntImages"+progressBars[i].getIdMap()); progressBars[i].progressReset(); } } } OpenLayers.GreaseOl.GreaseProgressBar=OpenLayers.Class ({},{ idForm:null, idBar:null, idMap:null, timeout:null, serviziToRefresh:new Array(), timeoutID:null, initialize: function(idFormIn,idBarIn,idMapIn,timeoutIn) { this.idForm=idFormIn; this.idBar=idBarIn; this.idMap=idMapIn; this.timeout=timeoutIn; this.serviziToRefresh=new Array(); this.timeoutID=null; }, destroy: function() { this.idForm=null; this.idBar=null; this.idMap=null; this.timeout=null; this.serviziToRefresh=null; this.timeoutID=null; }, clone: function (obj) { obj = new OpenLayers.GreaseOl.GreaseProgressBar(this.idForm,this.idBar,this.idMap,this.timeout); return obj; }, forceHideProgress: function () { // gisJQuery(document.getElementById(this.idForm+":"+this.idBar+"_progressBarBlock")).hide(); // this.serviziToRefresh=new Array(); // if (this.timeout>0) { // window.clearTimeout(this.timeoutID); // } // this.proressOn=true; }, getIdMap: function () { return this.idMap; }, accendiProgress: function () { //var elemento=document.getElementById(this.idForm+":"+this.idBar+"_progressBarBlock"); var elemento=document.getElementById("loadmappa"); if (gisJQuery(elemento).css('display')=='none') { try { gisJQuery("#loadmappa").css('display','block'); } catch (err) { //console.error(err); } if (this.timeout>0) { this.timeoutID=window.setTimeout( 'resetProgressBars(\''+this.idMap+'\');' , this.timeout); } } }, showProgress : function () { /* var a=document.getElementById(this.idForm+":elencoServiziId_"+this.idMap).value; var tmpToRefresh=new Array(); if (a== undefined || a==null || a.trim()=="") { tmpToRefresh=new Array(); } else { tmpToRefresh=a.split('|'); } for (var countRfh=0;countRfh0) this.accendiProgress(); */ }, progressReset: function (){ // this.forceHideProgressB(); //gisJQuery(document.getElementById(this.idForm+":"+this.idBar+"_progressBarBlock")).hide(); gisJQuery("#loadmappa").css('display','none'); this.serviziToRefresh=new Array(); if (this.timeout>0) { window.clearTimeout(this.timeoutID); } this.proressOn=true; }, addClientService : function (idClientService) { this.serviziToRefresh[this.serviziToRefresh.length]=idClientService; if (this.serviziToRefresh.length>0) this.accendiProgress(); }, hideProgress : function (idServizio) { var serviziTMP=new Array(); for (var i=0;i"+servizioCorrente); //alert("aggiornaLayerGrease"); var stato='ko'; var mappaCur=null; for (var i =0;i0) { for (var markerCount=0;markerCount0) { for (var markerCount=0;markerCount