Commit 9a0b32e349b25e1b4befda81a6bb3657687be521

Authored by Edmar Moretti
1 parent fa2b0993

Correção na seleção

classesjs/classe_interface.js
@@ -1565,16 +1565,16 @@ i3GEO.Interface = { @@ -1565,16 +1565,16 @@ i3GEO.Interface = {
1565 if(!indice){ 1565 if(!indice){
1566 //nao utilize !== aqui 1566 //nao utilize !== aqui
1567 if(camada.status != 0){ 1567 if(camada.status != 0){
1568 - i3GEO.Interface.googlemaps.insereLayer(camada.name,0); 1568 + i3GEO.Interface.googlemaps.insereLayer(camada.name,0,camada.cache);
1569 } 1569 }
1570 } 1570 }
1571 } 1571 }
1572 }, 1572 },
1573 - criaImageMap: function(nomeLayer){ 1573 + criaImageMap: function(nomeLayer,cache){
1574 var i3GEOTileO = "",s; 1574 var i3GEOTileO = "",s;
1575 s = "i3GEOTileO = new google.maps.ImageMapType({ "+ 1575 s = "i3GEOTileO = new google.maps.ImageMapType({ "+
1576 "getTileUrl: function(coord, zoom) {" + 1576 "getTileUrl: function(coord, zoom) {" +
1577 - " var url = '" + i3GEO.configura.locaplic +"/classesphp/mapa_googlemaps.php?g_sid=" + i3GEO.configura.sid + 1577 + " var url = '" + i3GEO.configura.locaplic +"/classesphp/mapa_googlemaps.php?g_sid=" + i3GEO.configura.sid + "&cache=" + cache +
1578 "&Z=' + zoom + '&X=' + coord.x + '&Y=' + coord.y + '&layer=" + nomeLayer + i3GEO.Interface.googlemaps.PARAMETROSLAYER +'&r='+Math.random()+"';" + 1578 "&Z=' + zoom + '&X=' + coord.x + '&Y=' + coord.y + '&layer=" + nomeLayer + i3GEO.Interface.googlemaps.PARAMETROSLAYER +'&r='+Math.random()+"';" +
1579 " return url+'&nd='+i3GEO.Interface.googlemaps.posfixo; " + 1579 " return url+'&nd='+i3GEO.Interface.googlemaps.posfixo; " +
1580 "}, "+ 1580 "}, "+
@@ -1585,8 +1585,8 @@ i3GEO.Interface = { @@ -1585,8 +1585,8 @@ i3GEO.Interface = {
1585 eval(s); 1585 eval(s);
1586 return i3GEOTileO; 1586 return i3GEOTileO;
1587 }, 1587 },
1588 - insereLayer: function(nomeLayer,indice){  
1589 - var i = i3GEO.Interface.googlemaps.criaImageMap(nomeLayer); 1588 + insereLayer: function(nomeLayer,indice,cache){
  1589 + var i = i3GEO.Interface.googlemaps.criaImageMap(nomeLayer,cache);
1590 i3GeoMap.overlayMapTypes.insertAt(indice, i); 1590 i3GeoMap.overlayMapTypes.insertAt(indice, i);
1591 }, 1591 },
1592 registraEventos: function(){ 1592 registraEventos: function(){
classesphp/mapa_googlemaps.php
@@ -95,6 +95,14 @@ $cachedir = $_SESSION["cachedir"]; @@ -95,6 +95,14 @@ $cachedir = $_SESSION["cachedir"];
95 $x = $_GET["X"]; 95 $x = $_GET["X"];
96 $y = $_GET["Y"]; 96 $y = $_GET["Y"];
97 $z = $_GET["Z"]; 97 $z = $_GET["Z"];
  98 +
  99 +$qyfile = dirname($map_fileX)."/".$_GET["layer"].".php";
  100 +$qy = file_exists($qyfile);
  101 +
  102 +if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){
  103 + carregaCacheImagem($_SESSION["cachedir"],$_SESSION["map_file"],$_GET["tms"]);
  104 +}
  105 +
98 $n = pow(2,$z); 106 $n = pow(2,$z);
99 $lon1 = $x / $n * 360.0 - 180.0; 107 $lon1 = $x / $n * 360.0 - 180.0;
100 $lat2 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); 108 $lat2 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n))));
@@ -119,8 +127,7 @@ $_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]); @@ -119,8 +127,7 @@ $_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]);
119 127
120 $mapa = ms_newMapObj($map_fileX); 128 $mapa = ms_newMapObj($map_fileX);
121 $ret = $mapa->extent; 129 $ret = $mapa->extent;
122 -$qyfile = dirname($map_fileX)."/".$_GET["layer"].".php";  
123 -$qy = file_exists($qyfile); 130 +
124 $cache = false; 131 $cache = false;
125 if(!isset($_GET["telaR"])){ 132 if(!isset($_GET["telaR"])){
126 //no caso de projecoes remotas, o mapfile nao´e alterado 133 //no caso de projecoes remotas, o mapfile nao´e alterado
@@ -216,8 +223,8 @@ else{ @@ -216,8 +223,8 @@ else{
216 foreach ($shp as $indx) 223 foreach ($shp as $indx)
217 {$mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} 224 {$mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);}
218 $qm = $mapa->querymap; 225 $qm = $mapa->querymap;
219 - $qm->set("width",$map_size[0]);  
220 - $qm->set("height",$map_size[1]); 226 + $qm->set("width",255);
  227 + $qm->set("height",255);
221 $img = $mapa->drawQuery(); 228 $img = $mapa->drawQuery();
222 } 229 }
223 else{ 230 else{
classesphp/mapa_openlayers.php
@@ -81,12 +81,19 @@ if(isset($_GET["tms"])){ @@ -81,12 +81,19 @@ if(isset($_GET["tms"])){
81 $lat2 = ($y+1) / $n * 180.0 - 90.0; 81 $lat2 = ($y+1) / $n * 180.0 - 90.0;
82 $_GET["BBOX"] = $lon1." ".$lat1." ".$lon2." ".$lat2; 82 $_GET["BBOX"] = $lon1." ".$lat1." ".$lon2." ".$lat2;
83 } 83 }
84 -if($_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ 84 +$map_fileX = $_SESSION["map_file"];
  85 +//
  86 +//resolve o problema da seleção na versão nova do mapserver
  87 +//
  88 +$qyfile = dirname($map_fileX)."/".$_GET["layer"].".php";
  89 +$qy = file_exists($qyfile);
  90 +
  91 +if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){
85 carregaCacheImagem($_SESSION["cachedir"],$_SESSION["map_file"],$_GET["tms"]); 92 carregaCacheImagem($_SESSION["cachedir"],$_SESSION["map_file"],$_GET["tms"]);
86 } 93 }
87 // 94 //
88 //map_fileX e para o caso register_globals = On no PHP.INI 95 //map_fileX e para o caso register_globals = On no PHP.INI
89 -$map_fileX = $_SESSION["map_file"]; 96 +
90 if(isset($_GET["tipolayer"]) && $_GET["tipolayer"] == "fundo"){ 97 if(isset($_GET["tipolayer"]) && $_GET["tipolayer"] == "fundo"){
91 $map_fileX = str_replace(".map","fundo.map",$map_fileX); 98 $map_fileX = str_replace(".map","fundo.map",$map_fileX);
92 } 99 }
@@ -98,11 +105,7 @@ if(isset($_GET["BBOX"])){ @@ -98,11 +105,7 @@ if(isset($_GET["BBOX"])){
98 } 105 }
99 $_GET["TIPOIMAGEM"] = trim($_GET["TIPOIMAGEM"]); 106 $_GET["TIPOIMAGEM"] = trim($_GET["TIPOIMAGEM"]);
100 $mapa = ms_newMapObj($map_fileX); 107 $mapa = ms_newMapObj($map_fileX);
101 -//  
102 -//resolve o problema da seleção na versão nova do mapserver  
103 -//  
104 -$qyfile = dirname($map_fileX)."/".$_GET["layer"].".php";  
105 -$qy = file_exists($qyfile); 108 +
106 // 109 //
107 //processa os layers do mapfile 110 //processa os layers do mapfile
108 // 111 //