Commit fdab6249b121625b4c72884c3d0c39511ed7abeb
1 parent
6a432abe
Exists in
master
and in
7 other branches
Concluída a revisão das funcionalidades da árvore de camadas para a interface Google Maps
Showing
19 changed files
with
253 additions
and
67 deletions
Show diff stats
classesjs/classe_arvoredecamadas.js
... | ... | @@ -1272,7 +1272,7 @@ i3GEO.arvoreDeCamadas = { |
1272 | 1272 | if(ltema.escondido !== "sim"){ |
1273 | 1273 | temp = eval("ltema."+propriedade); |
1274 | 1274 | if(operador === "igual"){ |
1275 | - if(temp === valor) | |
1275 | + if(temp == valor) | |
1276 | 1276 | {resultado.push(ltema);} |
1277 | 1277 | } |
1278 | 1278 | if(operador === "diferente"){ |
... | ... | @@ -1285,5 +1285,36 @@ i3GEO.arvoreDeCamadas = { |
1285 | 1285 | while(i < nelementos); |
1286 | 1286 | } |
1287 | 1287 | return resultado; |
1288 | - } | |
1288 | + }, | |
1289 | + /* | |
1290 | + Function: alteraPropCamadas | |
1291 | + | |
1292 | + Altera o valor de uma propriedade de um tema do objeto i3GEO.arvoreDeCamadas.CAMADAS | |
1293 | + | |
1294 | + Parameters: | |
1295 | + | |
1296 | + propriedade {string} - propriedade que será modificada | |
1297 | + | |
1298 | + valor - novo valor | |
1299 | + | |
1300 | + camada {string} - código da camada | |
1301 | + */ | |
1302 | + alteraPropCamadas: function(propriedade,valor,camada){ | |
1303 | + if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.alteraPropCamadas()");} | |
1304 | + var resultado = [], | |
1305 | + i = 0, | |
1306 | + temp, | |
1307 | + nelementos = i3GEO.arvoreDeCamadas.CAMADAS.length, | |
1308 | + ltema; | |
1309 | + if (nelementos > 0){ | |
1310 | + do{ | |
1311 | + ltema = i3GEO.arvoreDeCamadas.CAMADAS[i]; | |
1312 | + if(ltema.name == camada){ | |
1313 | + eval("ltema."+propriedade+"='"+valor+"';"); | |
1314 | + } | |
1315 | + i++; | |
1316 | + } | |
1317 | + while(i < nelementos); | |
1318 | + } | |
1319 | + } | |
1289 | 1320 | }; | ... | ... |
classesjs/classe_calculo.js
... | ... | @@ -100,12 +100,12 @@ i3GEO.calculo = { |
100 | 100 | */ |
101 | 101 | dd2tela: function (vx,vy,docmapa,ext,cellsize){ |
102 | 102 | try{ |
103 | - var pos,latlng,xyn,dc,imgext,c,xy,mapType; | |
103 | + var pos,latlng,xyn,dc,imgext,c,xy; | |
104 | 104 | if(i3GEO.Interface.ATUAL == "googlemaps"){ |
105 | 105 | pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); |
106 | - mapType = i3GeoMap.mapTypes[i3GeoMap.getMapTypeId()]; | |
107 | - xyn = mapType.projection.fromLatLngToPoint(new google.maps.LatLng(vy,vx)); | |
106 | + xyn = i3GeoMapOverlay.getProjection().fromLatLngToContainerPixel(new google.maps.LatLng(vy,vx)); | |
108 | 107 | xy = []; |
108 | + console.info(xyn.x); | |
109 | 109 | return [(xyn.x)+pos[0],(xyn.y)+pos[1]]; |
110 | 110 | } |
111 | 111 | if(i3GEO.Interface.ATUAL == "openlayers" && docmapa.id != "mapaReferencia"){ | ... | ... |
classesjs/classe_interface.js
... | ... | @@ -910,9 +910,15 @@ i3GEO.Interface = { |
910 | 910 | if(layers.length > 0){ |
911 | 911 | layers[0].setVisibility(obj.checked); |
912 | 912 | if(obj.checked) |
913 | - {ligar = obj.value;} | |
913 | + { | |
914 | + ligar = obj.value; | |
915 | + i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value); | |
916 | + } | |
914 | 917 | else |
915 | - {desligar = obj.value;} | |
918 | + { | |
919 | + desligar = obj.value; | |
920 | + i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value); | |
921 | + } | |
916 | 922 | i3GEO.php.ligatemas(temp,desligar,ligar); |
917 | 923 | } |
918 | 924 | }, |
... | ... | @@ -1039,7 +1045,8 @@ i3GEO.Interface = { |
1039 | 1045 | |
1040 | 1046 | i3GEO.Interface.ATUAL = "googlemaps" |
1041 | 1047 | |
1042 | - Cria o objeto i3GeoMap que pode receber os métodos da API | |
1048 | + Cria o objeto i3GeoMap que pode receber os métodos da API. | |
1049 | + Cria também o objeto i3GeoMapOverlay do tipo Overlay, utilizado para cálculos ou para receber elementos gráficos. | |
1043 | 1050 | */ |
1044 | 1051 | googlemaps:{ |
1045 | 1052 | /* |
... | ... | @@ -1158,10 +1165,14 @@ i3GEO.Interface = { |
1158 | 1165 | i3GeoMap.setMapTypeId(i3GEO.Interface.googlemaps.TIPOMAPA); |
1159 | 1166 | sw = new google.maps.LatLng(ret[1],ret[0]); |
1160 | 1167 | ne = new google.maps.LatLng(ret[3],ret[2]); |
1161 | - i3GEO.Interface.googlemaps.registraEventos(); | |
1162 | 1168 | i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne)); |
1163 | 1169 | i3GEO.Interface.googlemaps.criaLayers(); |
1170 | + i3GeoMapOverlay = new google.maps.OverlayView(); | |
1171 | + i3GeoMapOverlay.draw = function() {}; | |
1172 | + i3GeoMapOverlay.setMap(i3GeoMap); | |
1164 | 1173 | |
1174 | + i3GEO.Interface.googlemaps.registraEventos(); | |
1175 | + | |
1165 | 1176 | i3GEO.gadgets.mostraInserirKml(); |
1166 | 1177 | i3GEO.Interface.googlemaps.ativaBotoes(); |
1167 | 1178 | i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA)); |
... | ... | @@ -1179,7 +1190,6 @@ i3GEO.Interface = { |
1179 | 1190 | //i3GEO.arvoreDeCamadas.CAMADAS é definido na inicialização (classe_i3geo) |
1180 | 1191 | // |
1181 | 1192 | i3GEO.arvoreDeCamadas.ATIVATEMA = "i3GEO.Interface.googlemaps.ligaDesliga(this)"; |
1182 | - | |
1183 | 1193 | i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,i3GEO.configura.sid,i3GEO.configura.locaplic); |
1184 | 1194 | i3GEO.Interface.googlemaps.adicionaListaKml(); |
1185 | 1195 | }; |
... | ... | @@ -1225,6 +1235,9 @@ i3GEO.Interface = { |
1225 | 1235 | i3GEO.Interface.googlemaps.recalcPar(); |
1226 | 1236 | i3GEO.eventos.navegaMapa(); |
1227 | 1237 | }); |
1238 | + google.maps.event.addListener(i3GeoMap, "tilesloaded", function() { | |
1239 | + i3GEO.Interface.googlemaps.recalcPar(); | |
1240 | + }); | |
1228 | 1241 | google.maps.event.addListener(i3GeoMap, "zoom_changed", function() { |
1229 | 1242 | i3GEO.Interface.googlemaps.recalcPar(); |
1230 | 1243 | g_operacao = ""; |
... | ... | @@ -1233,11 +1246,10 @@ i3GEO.Interface = { |
1233 | 1246 | }); |
1234 | 1247 | pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA)); |
1235 | 1248 | google.maps.event.addListener(i3GeoMap, "mousemove", function(ponto) { |
1236 | - var teladms,tela,mapType; | |
1249 | + var teladms,tela; | |
1237 | 1250 | ponto = ponto.latLng; |
1238 | 1251 | teladms = i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat()); |
1239 | - mapType = i3GeoMap.mapTypes[i3GeoMap.getMapTypeId()]; | |
1240 | - tela = mapType.projection.fromLatLngToPoint(ponto); | |
1252 | + tela = i3GeoMapOverlay.getProjection().fromLatLngToContainerPixel(ponto); | |
1241 | 1253 | objposicaocursor = { |
1242 | 1254 | ddx: ponto.lng(), |
1243 | 1255 | ddy: ponto.lat(), |
... | ... | @@ -1255,6 +1267,7 @@ i3GEO.Interface = { |
1255 | 1267 | try{ |
1256 | 1268 | i3GeoMap.overlayMapTypes.forEach( |
1257 | 1269 | function(elemento, number){ |
1270 | + //alert(nomeLayer+" "+elemento.name) | |
1258 | 1271 | if(elemento.name == nomeLayer) |
1259 | 1272 | {i = number;} |
1260 | 1273 | //console.error(i+" "+elemento.name+" "+nomeLayer); |
... | ... | @@ -1263,7 +1276,50 @@ i3GEO.Interface = { |
1263 | 1276 | return i; |
1264 | 1277 | } |
1265 | 1278 | catch(e){ |
1266 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
1279 | + return false; | |
1280 | + } | |
1281 | + }, | |
1282 | + retornaObjetoLayer: function(nomeLayer){ | |
1283 | + var i = false; | |
1284 | + try{ | |
1285 | + i3GeoMap.overlayMapTypes.forEach( | |
1286 | + function(elemento, number){ | |
1287 | + if(elemento.name == nomeLayer) | |
1288 | + {i = elemento;} | |
1289 | + } | |
1290 | + ); | |
1291 | + return i; | |
1292 | + } | |
1293 | + catch(e){ | |
1294 | + return false; | |
1295 | + } | |
1296 | + }, | |
1297 | + retornaDivLayer: function(nomeLayer){ | |
1298 | + var i = false, | |
1299 | + divmapa = $i("googlemapsdiv"), | |
1300 | + divlayer, | |
1301 | + divs, | |
1302 | + j, | |
1303 | + ndivs; | |
1304 | + try{ | |
1305 | + i3GeoMap.overlayMapTypes.forEach( | |
1306 | + function(elemento, number){ | |
1307 | + if(elemento.name == nomeLayer){ | |
1308 | + divlayer = divmapa.firstChild; | |
1309 | + divlayer = divlayer.firstChild; | |
1310 | + divlayer = divlayer.firstChild; | |
1311 | + divs = divlayer.getElementsByTagName("div"); | |
1312 | + ndivs = divs.length; | |
1313 | + for(j=0;j<ndivs;j++){ | |
1314 | + if(divs[j].style.zIndex == number) | |
1315 | + {i = divs[j];} | |
1316 | + } | |
1317 | + } | |
1318 | + } | |
1319 | + ); | |
1320 | + return i; | |
1321 | + } | |
1322 | + catch(e){ | |
1267 | 1323 | return false; |
1268 | 1324 | } |
1269 | 1325 | }, |
... | ... | @@ -1272,15 +1328,21 @@ i3GEO.Interface = { |
1272 | 1328 | temp = function(){}, |
1273 | 1329 | desligar = "", |
1274 | 1330 | ligar = ""; |
1331 | + //alert(indice+" "+obj.value) | |
1275 | 1332 | if(obj.checked && !indice){ |
1276 | 1333 | ligar = obj.value; |
1277 | 1334 | i3GEO.Interface.googlemaps.insereLayer(obj.value,0); |
1335 | + i3GEO.arvoreDeCamadas.alteraPropCamadas("status","2",obj.value); | |
1278 | 1336 | } |
1279 | 1337 | else{ |
1280 | - desligar = obj.value; | |
1281 | - i3GeoMap.overlayMapTypes.removeAt(indice); | |
1338 | + if(indice !== false){ | |
1339 | + desligar = obj.value; | |
1340 | + i3GeoMap.overlayMapTypes.removeAt(indice); | |
1341 | + i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value); | |
1342 | + } | |
1282 | 1343 | } |
1283 | - i3GEO.php.ligatemas(temp,desligar,ligar); | |
1344 | + if(desligar != "" || ligar != "") | |
1345 | + {i3GEO.php.ligatemas(temp,desligar,ligar);} | |
1284 | 1346 | }, |
1285 | 1347 | bbox: function(){ |
1286 | 1348 | var bd,so,ne,bbox; |
... | ... | @@ -1309,15 +1371,23 @@ i3GEO.Interface = { |
1309 | 1371 | i3GEO.Interface.googlemaps.redesenha(); |
1310 | 1372 | }, |
1311 | 1373 | recalcPar: function(){ |
1312 | - var bounds,sw,ne; | |
1313 | - g_operacao = ""; | |
1314 | - g_tipoacao = ""; | |
1315 | - bounds = i3GeoMap.getBounds(); | |
1316 | - if(bounds){ | |
1317 | - sw = bounds.getSouthWest(); | |
1318 | - ne = bounds.getNorthEast(); | |
1319 | - i3GEO.parametros.mapexten = sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat(); | |
1320 | - i3GEO.parametros.mapscale = i3GEO.Interface.googlemaps.calcescala(); | |
1374 | + try{ | |
1375 | + var bounds,sw,ne; | |
1376 | + g_operacao = ""; | |
1377 | + g_tipoacao = ""; | |
1378 | + //bounds = i3GeoMap.getBounds(); | |
1379 | + sw = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(0,i3GEO.parametros.h)); | |
1380 | + ne = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(new google.maps.Point(i3GEO.parametros.w,0)); | |
1381 | + //if(bounds){ | |
1382 | + //sw = bounds.getSouthWest(); | |
1383 | + //ne = bounds.getNorthEast(); | |
1384 | + i3GEO.parametros.mapexten = sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat(); | |
1385 | + i3GEO.parametros.mapscale = i3GEO.Interface.googlemaps.calcescala(); | |
1386 | + //} | |
1387 | + } | |
1388 | + catch(e){ | |
1389 | + i3GEO.parametros.mapexten = "0 0 0 0"; | |
1390 | + i3GEO.parametros.mapscale = 0; | |
1321 | 1391 | } |
1322 | 1392 | }, |
1323 | 1393 | calcescala:function(){ |
... | ... | @@ -1337,11 +1407,14 @@ i3GEO.Interface = { |
1337 | 1407 | var pol,ret,pt1,pt2,sw,ne,z; |
1338 | 1408 | pol = mapexten; |
1339 | 1409 | ret = pol.split(" "); |
1410 | + // | |
1411 | + //verifica se é geo | |
1412 | + // | |
1340 | 1413 | pt1 = (( (ret[0] * -1) - (ret[2] * -1) ) / 2) + ret[0] *1; |
1341 | 1414 | pt2 = (((ret[1] - ret[3]) / 2)* -1) + ret[1] *1; |
1342 | - sw = new google.maps.LatLng(ret[1],ret[0]); | |
1343 | - ne = new google.maps.LatLng(ret[3],ret[2]); | |
1344 | - i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne)); | |
1415 | + sw = new google.maps.LatLng(ret[1],ret[0]); | |
1416 | + ne = new google.maps.LatLng(ret[3],ret[2]); | |
1417 | + i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne)); | |
1345 | 1418 | }, |
1346 | 1419 | pan2ponto: function(x,y){ |
1347 | 1420 | i3GeoMap.panTo(new google.maps.LatLng(x,y)); | ... | ... |
classesjs/classe_navega.js
... | ... | @@ -1147,7 +1147,7 @@ i3GEO.navega = { |
1147 | 1147 | i3GEO.janela.fechaAguarde("ajaxdestaca"); |
1148 | 1148 | }; |
1149 | 1149 | i3GEO.janela.abreAguarde("ajaxdestaca","Aguarde...gerando imagem"); |
1150 | - i3GEO.php.geradestaque(temp,i3GEO.navega.destacaTema.TEMA); | |
1150 | + i3GEO.php.geradestaque(temp,i3GEO.navega.destacaTema.TEMA,i3GEO.parametros.mapexten); | |
1151 | 1151 | }, |
1152 | 1152 | /* |
1153 | 1153 | Function: desativa | ... | ... |
classesjs/classe_php.js
... | ... | @@ -559,9 +559,9 @@ i3GEO.php = { |
559 | 559 | |
560 | 560 | <GERADESTAQUE> |
561 | 561 | */ |
562 | - geradestaque: function(funcao,tema){ | |
562 | + geradestaque: function(funcao,tema,ext){ | |
563 | 563 | i3GEO.php.verifica(); |
564 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=geradestaque&tema="+tema+"&g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.parametros.mapexten; | |
564 | + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=geradestaque&tema="+tema+"&g_sid="+i3GEO.configura.sid+"&ext="+ext; | |
565 | 565 | cpJSON.call(p,"geradestaque",funcao); |
566 | 566 | }, |
567 | 567 | /* | ... | ... |
classesjs/classe_tema.js
... | ... | @@ -49,6 +49,7 @@ i3GEO.tema = { |
49 | 49 | g_operacao = "excluitema"; |
50 | 50 | //remove o tema do DOM e seus filhos |
51 | 51 | var layer, |
52 | + indice, | |
52 | 53 | p = document.getElementById("idx"+tema).parentNode.parentNode.parentNode; |
53 | 54 | do |
54 | 55 | {p.removeChild(p.childNodes[0]);} |
... | ... | @@ -63,6 +64,10 @@ i3GEO.tema = { |
63 | 64 | layer = i3geoOL.getLayersByName(tema)[0]; |
64 | 65 | i3geoOL.removeLayer(layer); |
65 | 66 | } |
67 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | |
68 | + indice = i3GEO.Interface.googlemaps.retornaIndiceLayer(tema); | |
69 | + i3GeoMap.overlayMapTypes.removeAt(indice); | |
70 | + } | |
66 | 71 | }, |
67 | 72 | /* |
68 | 73 | Function: fonte |
... | ... | @@ -202,7 +207,7 @@ i3GEO.tema = { |
202 | 207 | */ |
203 | 208 | mudatransp: function(idtema){ |
204 | 209 | if(typeof(console) !== 'undefined'){console.info("i3GEO.tema.mudatransp()");} |
205 | - i3GEO.mapa.ativaTema(tema); | |
210 | + i3GEO.mapa.ativaTema(idtema); | |
206 | 211 | g_operacao = "transparencia"; |
207 | 212 | var valor, |
208 | 213 | temp = function(retorno){ |
... | ... | @@ -233,7 +238,7 @@ i3GEO.tema = { |
233 | 238 | */ |
234 | 239 | mudanome: function(idtema){ |
235 | 240 | if(typeof(console) !== 'undefined'){console.info("i3GEO.tema.mudanome()");} |
236 | - i3GEO.mapa.ativaTema(tema); | |
241 | + i3GEO.mapa.ativaTema(idtema); | |
237 | 242 | g_operacao = "mudanome"; |
238 | 243 | var valor; |
239 | 244 | if($i("nn"+idtema)) | ... | ... |
classesphp/classe_alteraclasse.php
... | ... | @@ -74,7 +74,7 @@ $map_file - Endereço do mapfile no servidor. |
74 | 74 | |
75 | 75 | $tema - nome do tema |
76 | 76 | */ |
77 | - function __construct($map_file,$tema="",$locaplic="") | |
77 | + function __construct($map_file,$tema="",$locaplic="",$ext="") | |
78 | 78 | { |
79 | 79 | //error_reporting(E_ALL); |
80 | 80 | if (file_exists($locaplic."/funcoes_gerais.php")) |
... | ... | @@ -88,6 +88,11 @@ $tema - nome do tema |
88 | 88 | if($tema != "" && @$this->mapa->getlayerbyname($tema)) |
89 | 89 | $this->layer = $this->mapa->getlayerbyname($tema); |
90 | 90 | $this->nome = $tema; |
91 | + if($ext && $ext != ""){ | |
92 | + $e = explode(" ",$ext); | |
93 | + $extatual = $this->mapa->extent; | |
94 | + $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3]))); | |
95 | + } | |
91 | 96 | } |
92 | 97 | /* |
93 | 98 | function: salva | ... | ... |
classesphp/classe_atributos.php
... | ... | @@ -129,13 +129,19 @@ xmin ymin xmax ymax separados por espaço. |
129 | 129 | $prjMapa = $this->mapa->getProjection(); |
130 | 130 | $prjTema = $this->layer->getProjection(); |
131 | 131 | $ret = $shape->bounds; |
132 | - //reprojeta o retangulo | |
133 | - if (($prjTema != "") && ($prjMapa != $prjTema)) | |
132 | + // | |
133 | + //verifica se o retangulo está ou não em coordenadas geográficas | |
134 | + // | |
135 | + if($ret->minx > 180 || $ret->minx < -180) | |
134 | 136 | { |
135 | - $projInObj = ms_newprojectionobj($prjTema); | |
136 | - $projOutObj = ms_newprojectionobj($prjMapa); | |
137 | - $ret->project($projInObj, $projOutObj); | |
138 | - } | |
137 | + //reprojeta o retangulo | |
138 | + if (($prjTema != "") && ($prjMapa != $prjTema)) | |
139 | + { | |
140 | + $projInObj = ms_newprojectionobj($prjTema); | |
141 | + $projOutObj = ms_newprojectionobj($prjMapa); | |
142 | + $ret->project($projInObj, $projOutObj); | |
143 | + } | |
144 | + } | |
139 | 145 | $ext = $ret->minx." ".$ret->miny." ".$ret->maxx." ".$ret->maxy; |
140 | 146 | if (($shape->type == MS_SHP_POINT) || ($shape->type == 0)) |
141 | 147 | { | ... | ... |
classesphp/classe_temas.php
... | ... | @@ -436,6 +436,7 @@ $testa - Testa o filtro e retorna uma imagem. |
436 | 436 | function insereFiltro($filtro,$testa="") |
437 | 437 | { |
438 | 438 | if(!$this->layer){return "erro";} |
439 | + $this->layer->setmetadata("cache",""); | |
439 | 440 | $fil = $this->layer->getFilterString(); |
440 | 441 | $filtro = str_replace("|","'",$filtro); |
441 | 442 | if ($this->layer->connectiontype == MS_POSTGIS) | ... | ... |
classesphp/classe_toponimia.php
... | ... | @@ -158,6 +158,7 @@ $tipo Tipo teste| |
158 | 158 | $novolayer->set("name",$nomer); |
159 | 159 | $novolayer->set("group",""); |
160 | 160 | $novolayer->set("type",MS_LAYER_ANNOTATION); |
161 | + $novolayer->setmetadata("cache",""); | |
161 | 162 | $nclasses = $novolayer->numclasses; |
162 | 163 | for ($i=0; $i < $nclasses; ++$i) |
163 | 164 | { | ... | ... |
classesphp/funcoes_gerais.php
... | ... | @@ -1185,12 +1185,11 @@ function pegaValoresM($mapa,$layer,$itens,$exclui="nulo",$selecionados="nao",$ch |
1185 | 1185 | } |
1186 | 1186 | $layer->close(); |
1187 | 1187 | } |
1188 | - $valores = array(); | |
1188 | + $valores = array(); | |
1189 | 1189 | if (@$layer->queryByrect($mapa->extent) == MS_SUCCESS) |
1190 | 1190 | { |
1191 | 1191 | $sopen = $layer->open(); |
1192 | 1192 | if($sopen == MS_FAILURE){return "erro";} |
1193 | - | |
1194 | 1193 | $res_count = $layer->getNumresults(); |
1195 | 1194 | for ($i=0;$i<$res_count;++$i) |
1196 | 1195 | { | ... | ... |
classesphp/graficos.php
... | ... | @@ -371,10 +371,15 @@ function iniciaParGrafico($gw,$gh,$res,$dir_tmp,$gfile_name,$margem,$margemexter |
371 | 371 | $rcode[] = 'screen(1, new=FALSE)'; |
372 | 372 | return $rcode; |
373 | 373 | } |
374 | -function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,$percentual) | |
374 | +function iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,$percentual,$ext="") | |
375 | 375 | { |
376 | 376 | //pega os valores |
377 | 377 | $map = ms_newMapObj($map_file); |
378 | + if($ext && $ext != ""){ | |
379 | + $e = explode(" ",$ext); | |
380 | + $extatual = $map->extent; | |
381 | + $extatual->setextent((min($e[0],$e[2])),(min($e[1],$e[3])),(max($e[0],$e[2])),(max($e[1],$e[3]))); | |
382 | + } | |
378 | 383 | $selecionados = "sim"; |
379 | 384 | $qyfile = str_replace(".map",".qy",$map_file); |
380 | 385 | if (file_exists($qyfile)) | ... | ... |
classesphp/mapa_controle.php
... | ... | @@ -1052,6 +1052,8 @@ Gera uma imagem que será utilizada para destacar um determinado tema. |
1052 | 1052 | */ |
1053 | 1053 | case "GERADESTAQUE": |
1054 | 1054 | include_once("classe_temas.php"); |
1055 | + if(isset($ext) && $ext != "" && $interface == "googlemaps") | |
1056 | + {$ext = projetaExt($map_file,$ext);} | |
1055 | 1057 | $m = new Temas($map_file,$tema,"",$ext); |
1056 | 1058 | $retorno = $m->geraDestaque(); |
1057 | 1059 | break; |
... | ... | @@ -1294,7 +1296,9 @@ Altera uma classe de um tema, aplicando uma nova classificação ou modificando pa |
1294 | 1296 | case "ALTERACLASSE": |
1295 | 1297 | include_once("classe_alteraclasse.php"); |
1296 | 1298 | copiaSeguranca($map_file); |
1297 | - $m = new Alteraclasse($map_file,$tema); | |
1299 | + if(isset($ext) && $ext != "" && $interface == "googlemaps") | |
1300 | + {$ext = projetaExt($map_file,$ext);} | |
1301 | + $m = new Alteraclasse($map_file,$tema,"",$ext); | |
1298 | 1302 | if ($opcao == "adicionaclasse") |
1299 | 1303 | {$retorno = $m->adicionaclasse();} |
1300 | 1304 | if ($opcao == "valorunico") |
... | ... | @@ -1507,11 +1511,13 @@ Pega os dados necessários para a geração dos gráficos da ferramenta seleção |
1507 | 1511 | */ |
1508 | 1512 | case "GRAFICOSELECAO": |
1509 | 1513 | include_once("graficos.php"); |
1514 | + if(isset($ext) && $ext != "" && $interface == "googlemaps") | |
1515 | + {$ext = projetaExt($map_file,$ext);} | |
1510 | 1516 | if(!isset($exclui)) |
1511 | 1517 | {$exclui = "";} |
1512 | 1518 | if(!isset($tipo)) |
1513 | 1519 | {$tipo = "nenhum";} |
1514 | - $retorno = iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,false); | |
1520 | + $retorno = iniciaDadosGrafico($map_file,$tema,$exclui,$itemclasses,$itemvalores,$tipo,false,$ext); | |
1515 | 1521 | break; |
1516 | 1522 | |
1517 | 1523 | /* |
... | ... | @@ -1614,6 +1620,8 @@ Pega os dados de um tema para geração do gráfico de linha do tempo. |
1614 | 1620 | */ |
1615 | 1621 | case "DADOSLINHADOTEMPO": |
1616 | 1622 | include_once("graficos.php"); |
1623 | + if(isset($ext) && $ext != "" && $interface == "googlemaps") | |
1624 | + {$ext = projetaExt($map_file,$ext);} | |
1617 | 1625 | if(!isset($ext)) |
1618 | 1626 | {$ext = "";} |
1619 | 1627 | $retorno = dadosLinhaDoTempo($map_file,$tema,$ext); |
... | ... | @@ -1902,6 +1910,8 @@ Procura valores em uma tabela que aderem a uma palavra de busca. |
1902 | 1910 | case "LISTAVALORESITENS": |
1903 | 1911 | include_once("classe_atributos.php"); |
1904 | 1912 | if(!isset($tema)){$tema = "";} |
1913 | + if(isset($ext) && $ext != "" && $interface == "googlemaps") | |
1914 | + {$ext = projetaExt($map_file,$ext);} | |
1905 | 1915 | $m = new Atributos($map_file,$tema,"",$ext); |
1906 | 1916 | $retorno = $m->buscaRegistros($palavra,$lista,$tipo,$onde); |
1907 | 1917 | break; |
... | ... | @@ -1934,7 +1944,9 @@ Identifica elementos no mapa. |
1934 | 1944 | include_once("classe_atributos.php"); |
1935 | 1945 | $m = new Atributos($map_file,$tema); |
1936 | 1946 | if(!isset($ext)) |
1937 | - {$ext = "";} | |
1947 | + {$ext = "";} | |
1948 | + if(isset($ext) && $ext != "" && $interface == "googlemaps") | |
1949 | + {$ext = projetaExt($map_file,$ext);} | |
1938 | 1950 | $retorno = $m->identifica2($opcao,$xy,$resolucao,$ext,$listaDeTemas); |
1939 | 1951 | break; |
1940 | 1952 | |
... | ... | @@ -1984,6 +1996,8 @@ Pega todos os valores dos itens de uma tabela de um tema. |
1984 | 1996 | <Atributos->listaRegistros> |
1985 | 1997 | */ |
1986 | 1998 | case "LISTAREGISTROS": |
1999 | + if(isset($ext) && $ext != "" && $interface == "googlemaps") | |
2000 | + {$ext = projetaExt($map_file,$ext);} | |
1987 | 2001 | include_once("classe_atributos.php"); |
1988 | 2002 | $m = new Atributos($map_file,$tema,"",$ext); |
1989 | 2003 | if(!isset($tipo)){$tipo = "";} |
... | ... | @@ -2044,6 +2058,8 @@ Muda a extensão geográfica do mapa. |
2044 | 2058 | copiaSeguranca($map_file); |
2045 | 2059 | if (!isset($ext) || $ext == "" || $ext == " "){$ext="-76.512593 -39.392568 -29.585185 9.490149";} |
2046 | 2060 | $m = new Navegacao($map_file); |
2061 | + if(isset($ext) && $ext != "" && $interface == "googlemaps") | |
2062 | + {$ext = projetaExt($map_file,$ext);} | |
2047 | 2063 | $m->mudaExtensao($ext); |
2048 | 2064 | $m->salva(); |
2049 | 2065 | redesenhaMapa(); |
... | ... | @@ -2426,6 +2442,8 @@ Seleciona elementos utilizando um retângulo. |
2426 | 2442 | foreach($temas as $tema) |
2427 | 2443 | { |
2428 | 2444 | $m = new Selecao($map_file,$tema); |
2445 | + if(isset($ext) && $ext != "" && $interface == "googlemaps") | |
2446 | + {$ext = projetaExt($map_file,$ext);} | |
2429 | 2447 | $ok[] = $m->selecaoBOX($tipo,$ext); |
2430 | 2448 | } |
2431 | 2449 | redesenhaMapa(); |
... | ... | @@ -2678,6 +2696,37 @@ if (!connection_aborted()) |
2678 | 2696 | else |
2679 | 2697 | {exit();} |
2680 | 2698 | /* |
2699 | +Function: projetaExt | |
2700 | + | |
2701 | +Projeta uma string com coordenadas geográficas para coordenadas métricas | |
2702 | + | |
2703 | +Parametros: | |
2704 | + | |
2705 | +$map_file {string} | |
2706 | + | |
2707 | +$ext {string} - extensão geográfica com valores separados por espaço | |
2708 | + | |
2709 | +Return: | |
2710 | + | |
2711 | +{string} | |
2712 | +*/ | |
2713 | +function projetaExt($map_file,$ext) | |
2714 | +{ | |
2715 | + $extA = explode(" ",$ext); | |
2716 | + $mapa = ms_newMapObj($map_file); | |
2717 | + if($extA[0] < 180 && $extA[0] > -180) | |
2718 | + { | |
2719 | + $rect = ms_newRectObj(); | |
2720 | + $rect->setextent($extA[0],$extA[1],$extA[2],$extA[3]); | |
2721 | + $prjMapa = $mapa->getProjection(); | |
2722 | + $projInObj = ms_newprojectionobj("proj=latlong"); | |
2723 | + $projOutObj = ms_newprojectionobj($prjMapa); | |
2724 | + $rect->project($projInObj, $projOutObj); | |
2725 | + $ext = $rect->minx." ".$rect->miny." ".$rect->maxx." ".$rect->maxy; | |
2726 | + } | |
2727 | + return $ext; | |
2728 | +} | |
2729 | +/* | |
2681 | 2730 | Function: alteraclassesPost |
2682 | 2731 | |
2683 | 2732 | Altera as classes de um tema aplicando novos parâmetros como nome e expressão. | ... | ... |
ferramentas/busca/index.js.php
ferramentas/cortina/index.js.php
... | ... | @@ -98,6 +98,8 @@ i3GEOF.cortina = { |
98 | 98 | tema {string} - codigo do tema |
99 | 99 | */ |
100 | 100 | criaJanelaFlutuante: function(tema){ |
101 | + if(arguments.length == 0) | |
102 | + {tema = i3GEO.temaAtivo;} | |
101 | 103 | var janela,divid,temp,titulo; |
102 | 104 | i3GEOF.cortina.tema = tema; |
103 | 105 | //cria a janela flutuante |
... | ... | @@ -119,7 +121,13 @@ i3GEOF.cortina = { |
119 | 121 | i3GEOF.cortina.aguarde = $i("i3GEOF.cortina_imagemCabecalho").style; |
120 | 122 | i3GEOF.cortina.inicia(divid); |
121 | 123 | temp = function(){ |
122 | - i3geoOL.getLayersByName(tema)[0].div.style.clip = ""; | |
124 | + if(i3GEO.Interface.ATUAL === "openlayers") | |
125 | + {i3geoOL.getLayersByName(tema)[0].div.style.clip = "";} | |
126 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | |
127 | + var divlayer = i3GEO.Interface.googlemaps.retornaDivLayer(tema); | |
128 | + divlayer.style.clip = ""; | |
129 | + } | |
130 | + | |
123 | 131 | }; |
124 | 132 | YAHOO.util.Event.addListener(janela[0].close, "click", temp); |
125 | 133 | }, |
... | ... | @@ -137,6 +145,10 @@ i3GEOF.cortina = { |
137 | 145 | estilo = layer.div.style; |
138 | 146 | //rect (top, right, bottom, left) |
139 | 147 | } |
148 | + if(i3GEO.Interface.ATUAL === "googlemaps"){ | |
149 | + layer = i3GEO.Interface.googlemaps.retornaDivLayer(i3GEOF.cortina.tema); | |
150 | + estilo = layer.style; | |
151 | + } | |
140 | 152 | estilo.clip = "rect(0px,"+i3GEO.parametros.w+"px,"+i3GEO.parametros.h+"px,0px)"; |
141 | 153 | slider.setValue(0,false); |
142 | 154 | slider.subscribe("change", function(offsetFromStart) { | ... | ... |
ferramentas/graficointerativo/index.js.php
... | ... | @@ -191,7 +191,7 @@ i3GEOF.graficointerativo = { |
191 | 191 | "", |
192 | 192 | false, |
193 | 193 | "ligados" |
194 | - ); | |
194 | + ); | |
195 | 195 | new YAHOO.widget.Button( |
196 | 196 | "i3GEOgraficointerativobotao1", |
197 | 197 | {onclick:{fn: i3GEOF.graficointerativo.obterDados}} |
... | ... | @@ -331,9 +331,9 @@ i3GEOF.graficointerativo = { |
331 | 331 | if(i3GEO.Interface.ATUAL !== "googlemaps"){ |
332 | 332 | i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo.obterDados()"); |
333 | 333 | } |
334 | - if(i3GEO.Interface.ATUAL === "googlemaps"){ | |
335 | - GEvent.removeListener(graficointerativoDragend); | |
336 | - GEvent.removeListener(graficointerativoZoomend); | |
334 | + if(i3GEO.Interface.ATUAL == "googlemaps"){ | |
335 | + google.maps.event.removeListener(graficointerativoDragend); | |
336 | + google.maps.event.removeListener(graficointerativoZoomend); | |
337 | 337 | } |
338 | 338 | }; |
339 | 339 | YAHOO.util.Event.addListener(janela[0].close, "click", temp); |
... | ... | @@ -432,7 +432,7 @@ i3GEOF.graficointerativo = { |
432 | 432 | x = $i("i3GEOgraficointerativoComboXid").value, |
433 | 433 | y = $i("i3GEOgraficointerativoComboYid").value, |
434 | 434 | excluir = $i("i3GEOgraficointerativoexcluir").value, |
435 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=graficoSelecao&tema="+tema+"&itemclasses="+x+"&itemvalores="+y+"&exclui="+excluir, | |
435 | + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=graficoSelecao&tema="+tema+"&itemclasses="+x+"&itemvalores="+y+"&exclui="+excluir+"&ext="+i3GEO.parametros.mapexten, | |
436 | 436 | cp = new cpaint(), |
437 | 437 | tipo = "soma", |
438 | 438 | monta; | ... | ... |
ferramentas/legenda/index.js.php
... | ... | @@ -431,7 +431,7 @@ i3GEOF.legenda = { |
431 | 431 | i3GEO.arvoreDeCamadas.atualizaLegenda(i3GEOF.legenda.tema); |
432 | 432 | i3GEOF.legenda.aguarde.visibility = "hidden"; |
433 | 433 | }; |
434 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=alteraclasses"; | |
434 | + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=alteraclasses&ext="+i3GEO.parametros.mapexten; | |
435 | 435 | cp = new cpaint(); |
436 | 436 | cp.set_transfer_mode('POST'); |
437 | 437 | cp.set_response_type("JSON"); |
... | ... | @@ -470,7 +470,7 @@ i3GEOF.legenda = { |
470 | 470 | adicionaClasse: function(){ |
471 | 471 | if(i3GEOF.legenda.aguarde.visibility === "visible") |
472 | 472 | {return;} |
473 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=adicionaclasse"+"&tema="+i3GEOF.legenda.tema, | |
473 | + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&opcao=adicionaclasse"+"&tema="+i3GEOF.legenda.tema+"&ext="+i3GEO.parametros.mapexten, | |
474 | 474 | cp = new cpaint(); |
475 | 475 | cp.set_response_type("JSON"); |
476 | 476 | cp.call(p,"alteraclasse",i3GEOF.legenda.mostralegenda); |
... | ... | @@ -612,7 +612,7 @@ i3GEOF.legenda = { |
612 | 612 | if(i3GEOF.legenda.aguarde.visibility === "visible") |
613 | 613 | {return;} |
614 | 614 | i3GEOF.legenda.aguarde.visibility = "visible"; |
615 | - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&opcao=simbolounico", | |
615 | + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&opcao=simbolounico&ext="+i3GEO.parametros.mapexten, | |
616 | 616 | cp = new cpaint(), |
617 | 617 | fim = function(){ |
618 | 618 | i3GEO.atualiza(); |
... | ... | @@ -639,7 +639,7 @@ i3GEOF.legenda = { |
639 | 639 | if(i3GEOF.legenda.aguarde.visibility === "visible") |
640 | 640 | {return;} |
641 | 641 | var item = $i("i3GEOlegendaSelItem").value, |
642 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=valorunico&ignorar="+$i("i3GEOlegendaignorar").value, | |
642 | + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=valorunico&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+i3GEO.parametros.mapexten, | |
643 | 643 | cp = new cpaint(), |
644 | 644 | fim = function(){ |
645 | 645 | i3GEO.atualiza(); |
... | ... | @@ -671,7 +671,7 @@ i3GEOF.legenda = { |
671 | 671 | {return;} |
672 | 672 | var item = $i("i3GEOlegendaSelItem").value, |
673 | 673 | nclasses = $i("i3GEOlegendanclasses").value, |
674 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&nclasses="+nclasses+"&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=intervalosiguais&ignorar="+$i("i3GEOlegendaignorar").value, | |
674 | + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&nclasses="+nclasses+"&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=intervalosiguais&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+i3GEO.parametros.mapexten, | |
675 | 675 | cp = new cpaint(), |
676 | 676 | fim = function(){ |
677 | 677 | i3GEO.atualiza(); |
... | ... | @@ -702,7 +702,7 @@ i3GEOF.legenda = { |
702 | 702 | {return;} |
703 | 703 | var item = $i("i3GEOlegendaSelItem").value, |
704 | 704 | nclasses = $i("i3GEOlegendanclasses").value, |
705 | - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=quartis&ignorar="+$i("i3GEOlegendaignorar").value, | |
705 | + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=alteraclasse&tema="+i3GEOF.legenda.tema+"&item="+item+"&opcao=quartis&ignorar="+$i("i3GEOlegendaignorar").value+"&ext="+i3GEO.parametros.mapexten, | |
706 | 706 | cp = new cpaint(); |
707 | 707 | fim = function(){ |
708 | 708 | i3GEO.atualiza(); | ... | ... |
ferramentas/tabela/index.js.php
... | ... | @@ -324,8 +324,8 @@ i3GEOF.tabela = { |
324 | 324 | i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.tabela.pegaRegistros()"); |
325 | 325 | } |
326 | 326 | if(i3GEO.Interface.ATUAL === "googlemaps"){ |
327 | - GEvent.removeListener(tabelaDragend); | |
328 | - GEvent.removeListener(tabelaZoomend); | |
327 | + google.maps.event.removeListener(tabelaDragend); | |
328 | + google.maps.event.removeListener(tabelaZoomend); | |
329 | 329 | } |
330 | 330 | }; |
331 | 331 | YAHOO.util.Event.addListener(janela[0].close, "click", temp); |
... | ... | @@ -353,8 +353,8 @@ i3GEOF.tabela = { |
353 | 353 | i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.tabela.pegaRegistros()"); |
354 | 354 | } |
355 | 355 | if(i3GEO.Interface.ATUAL === "googlemaps"){ |
356 | - tabelaDragend = GEvent.addListener(i3GeoMap, "dragend", function() {i3GEOF.tabela.pegaRegistros();}); | |
357 | - tabelaZoomend = GEvent.addListener(i3GeoMap, "zoomend", function() {i3GEOF.tebela.pegaRegistros();}); | |
356 | + tabelaDragend = google.maps.event.addListener(i3GeoMap, "dragend", function() {i3GEOF.tabela.pegaRegistros();}); | |
357 | + tabelaZoomend = google.maps.event.addListener(i3GeoMap, "zoomend", function() {i3GEOF.tebela.pegaRegistros();}); | |
358 | 358 | } |
359 | 359 | } |
360 | 360 | else{ |
... | ... | @@ -362,8 +362,8 @@ i3GEOF.tabela = { |
362 | 362 | i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.tabela.pegaRegistros()"); |
363 | 363 | } |
364 | 364 | if(i3GEO.Interface.ATUAL === "googlemaps"){ |
365 | - GEvent.removeListener(tabelaDragend); | |
366 | - GEvent.removeListener(tabelaZoomend); | |
365 | + google.maps.event.removeListener(tabelaDragend); | |
366 | + google.maps.event.removeListener(tabelaZoomend); | |
367 | 367 | } |
368 | 368 | } |
369 | 369 | }, |
... | ... | @@ -741,7 +741,6 @@ i3GEOF.tabela = { |
741 | 741 | {onclick:{fn: function(){ |
742 | 742 | i3GEO.mapa.ativaTema(i3GEOF.tabela.tema); |
743 | 743 | i3GEO.analise.dialogo.graficoInterativo(); |
744 | - | |
745 | 744 | } |
746 | 745 | }} |
747 | 746 | ); | ... | ... |
menutemas/admin.db
No preview for this file type