Commit 42e1d860d5c6c44b07f0498236abad859e1a439c

Authored by Edmar Moretti
1 parent fe8b41ee

--no commit message

classesjs/classe_ajuda.js
@@ -147,18 +147,17 @@ i3GEO.ajuda = { @@ -147,18 +147,17 @@ i3GEO.ajuda = {
147 */ 147 */
148 abreJanela: function(){ 148 abreJanela: function(){
149 try { 149 try {
150 - var nx = "";  
151 - var ny = ""; 150 + var nx,ny,pos,corpo,texto,janela;
152 if(i3GEO.ajuda.ATIVAJANELA === false){return;} 151 if(i3GEO.ajuda.ATIVAJANELA === false){return;}
153 if (!$i("janelaMenTexto")){ 152 if (!$i("janelaMenTexto")){
154 - var corpo = $i(i3GEO.Interface.IDCORPO); 153 + corpo = $i(i3GEO.Interface.IDCORPO);
155 if(corpo){ 154 if(corpo){
156 - var pos = YAHOO.util.Dom.getXY(corpo); 155 + pos = YAHOO.util.Dom.getXY(corpo);
157 nx = pos[0] - 267; 156 nx = pos[0] - 267;
158 ny = i3GEO.parametros.h - 70; 157 ny = i3GEO.parametros.h - 70;
159 } 158 }
160 - var texto = '<div id="janelaMenTexto" style="text-align:left;font-size:10px;color:rgb(80,80,80)">'+i3GEO.ajuda.MENSAGEMPADRAO+'</div>';  
161 - var janela = i3GEO.janela.cria("262","auto","",nx,ny,"&nbsp;","i3geo_janelaMensagens",false); 159 + texto = '<div id="janelaMenTexto" style="text-align:left;font-size:10px;color:rgb(80,80,80)">'+i3GEO.ajuda.MENSAGEMPADRAO+'</div>';
  160 + janela = i3GEO.janela.cria("262","auto","",nx,ny,"&nbsp;","i3geo_janelaMensagens",false);
162 janela[2].innerHTML = texto; 161 janela[2].innerHTML = texto;
163 YAHOO.util.Event.addListener(janela[0].close, "click", i3GEO.ajuda.fechaJanela); 162 YAHOO.util.Event.addListener(janela[0].close, "click", i3GEO.ajuda.fechaJanela);
164 i3GEO.ajuda.ativaCookie(); 163 i3GEO.ajuda.ativaCookie();
@@ -193,6 +192,7 @@ i3GEO.ajuda = { @@ -193,6 +192,7 @@ i3GEO.ajuda = {
193 será utilizado a variável i3GEO.parametros.mensagens 192 será utilizado a variável i3GEO.parametros.mensagens
194 */ 193 */
195 ativaLetreiro: function(mensagem){ 194 ativaLetreiro: function(mensagem){
  195 + var l;
196 if($i(i3GEO.ajuda.DIVLETREIRO)) 196 if($i(i3GEO.ajuda.DIVLETREIRO))
197 { 197 {
198 if(arguments.length === 0) 198 if(arguments.length === 0)
@@ -202,7 +202,7 @@ i3GEO.ajuda = { @@ -202,7 +202,7 @@ i3GEO.ajuda = {
202 try 202 try
203 {clearTimeout(i3GEO.ajuda.tempoLetreiro);} 203 {clearTimeout(i3GEO.ajuda.tempoLetreiro);}
204 catch(e){i3GEO.ajuda.tempoLetreiro = "";} 204 catch(e){i3GEO.ajuda.tempoLetreiro = "";}
205 - var l= $i(i3GEO.ajuda.DIVLETREIRO); 205 + l = $i(i3GEO.ajuda.DIVLETREIRO);
206 if(l.style.display=="none"){return;} 206 if(l.style.display=="none"){return;}
207 l.style.cursor="pointer"; 207 l.style.cursor="pointer";
208 if(mensagem === ""){ 208 if(mensagem === ""){
@@ -258,14 +258,15 @@ i3GEO.ajuda = { @@ -258,14 +258,15 @@ i3GEO.ajuda = {
258 texto {String} - texto a ser mostrado 258 texto {String} - texto a ser mostrado
259 */ 259 */
260 mostraJanela: function(texto){ 260 mostraJanela: function(texto){
261 - var j = $i(i3GEO.ajuda.DIVAJUDA); 261 + var j,k;
  262 + j = $i(i3GEO.ajuda.DIVAJUDA);
262 if(j){ 263 if(j){
263 if (texto === ""){j.innerHTML="-";} 264 if (texto === ""){j.innerHTML="-";}
264 else 265 else
265 {j.innerHTML= texto;} 266 {j.innerHTML= texto;}
266 } 267 }
267 else{ 268 else{
268 - var k = $i("janelaMenTexto"); 269 + k = $i("janelaMenTexto");
269 if(k && i3GEO.ajuda.TRANSICAOSUAVE){ 270 if(k && i3GEO.ajuda.TRANSICAOSUAVE){
270 j = $i("i3geo_janelaMensagens"); 271 j = $i("i3geo_janelaMensagens");
271 if(texto !== ""){ 272 if(texto !== ""){
classesjs/classe_analise.js
@@ -187,10 +187,11 @@ i3GEO.analise = { @@ -187,10 +187,11 @@ i3GEO.analise = {
187 Cria a janela para mostrar os resultados da medição 187 Cria a janela para mostrar os resultados da medição
188 */ 188 */
189 criaJanela: function(){ 189 criaJanela: function(){
  190 + var novoel,ins,imagemxy;
190 if (!$i("mostradistancia")){ 191 if (!$i("mostradistancia")){
191 - var novoel = document.createElement("div"); 192 + novoel = document.createElement("div");
192 novoel.id = "mostradistancia"; 193 novoel.id = "mostradistancia";
193 - var ins = '<div class="hd" >&nbsp; <a class=ajuda_usuario target=_blank href="'+i3GEO.configura.locaplic+'/ajuda_usuario.php?idcategoria=6&idajuda=50" >&nbsp;&nbsp;&nbsp;</a></div>'; 194 + ins = '<div class="hd" >&nbsp; <a class=ajuda_usuario target=_blank href="'+i3GEO.configura.locaplic+'/ajuda_usuario.php?idcategoria=6&idajuda=50" >&nbsp;&nbsp;&nbsp;</a></div>';
194 ins += '<div class="bd" style="text-align:left;padding:3px;" >'; 195 ins += '<div class="bd" style="text-align:left;padding:3px;" >';
195 ins += '<div style="text-align:left;padding:3px;" id="mostradistancia_calculo" ></div>'; 196 ins += '<div style="text-align:left;padding:3px;" id="mostradistancia_calculo" ></div>';
196 ins += '<div style="text-align:left;font-size:10px" >'; 197 ins += '<div style="text-align:left;font-size:10px" >';
@@ -211,7 +212,7 @@ i3GEO.analise = { @@ -211,7 +212,7 @@ i3GEO.analise = {
211 YAHOO.namespace("janelaDocamede.xp"); 212 YAHOO.namespace("janelaDocamede.xp");
212 YAHOO.janelaDocamede.xp.panel = new YAHOO.widget.Panel("mostradistancia", {width:300,fixedcenter: false, constraintoviewport: true, underlay:"none", close:true, visible:true, draggable:true, modal:false } ); 213 YAHOO.janelaDocamede.xp.panel = new YAHOO.widget.Panel("mostradistancia", {width:300,fixedcenter: false, constraintoviewport: true, underlay:"none", close:true, visible:true, draggable:true, modal:false } );
213 YAHOO.janelaDocamede.xp.panel.render(); 214 YAHOO.janelaDocamede.xp.panel.render();
214 - var imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); 215 + imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));
215 YAHOO.janelaDocamede.xp.panel.moveTo(imagemxy[0]+150,imagemxy[1]); 216 YAHOO.janelaDocamede.xp.panel.moveTo(imagemxy[0]+150,imagemxy[1]);
216 YAHOO.util.Event.addListener(YAHOO.janelaDocamede.xp.panel.close, "click", i3GEO.analise.medeDistancia.fechaJanela); 217 YAHOO.util.Event.addListener(YAHOO.janelaDocamede.xp.panel.close, "click", i3GEO.analise.medeDistancia.fechaJanela);
217 }, 218 },
@@ -234,8 +235,9 @@ i3GEO.analise = { @@ -234,8 +235,9 @@ i3GEO.analise = {
234 Adiciona uma marca na tela e realiza o cálculo de distância dos pontos inseridos 235 Adiciona uma marca na tela e realiza o cálculo de distância dos pontos inseridos
235 */ 236 */
236 clique: function(){ 237 clique: function(){
  238 + var n,d;
237 if (g_tipoacao == "mede"){ 239 if (g_tipoacao == "mede"){
238 - var n = pontosdistobj.xpt.length; 240 + n = pontosdistobj.xpt.length;
239 pontosdistobj.xpt[n] = objposicaocursor.ddx; 241 pontosdistobj.xpt[n] = objposicaocursor.ddx;
240 pontosdistobj.ypt[n] = objposicaocursor.ddy; 242 pontosdistobj.ypt[n] = objposicaocursor.ddy;
241 pontosdistobj.xtela[n] = objposicaocursor.telax; 243 pontosdistobj.xtela[n] = objposicaocursor.telax;
@@ -251,7 +253,7 @@ i3GEO.analise = { @@ -251,7 +253,7 @@ i3GEO.analise = {
251 } 253 }
252 catch(e){window.status=n+" erro ao desenhar a linha base "+e.message;} 254 catch(e){window.status=n+" erro ao desenhar a linha base "+e.message;}
253 if (n > 0){ 255 if (n > 0){
254 - var d = parseInt(i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy),10); 256 + d = parseInt(i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy),10);
255 pontosdistobj.dist[n] = d + pontosdistobj.dist[n-1]; 257 pontosdistobj.dist[n] = d + pontosdistobj.dist[n-1];
256 if($i("pararraios") && $i("pararraios").checked === true ){ 258 if($i("pararraios") && $i("pararraios").checked === true ){
257 i3GEO.desenho.aplica("insereCirculo","",n); 259 i3GEO.desenho.aplica("insereCirculo","",n);
@@ -271,26 +273,27 @@ i3GEO.analise = { @@ -271,26 +273,27 @@ i3GEO.analise = {
271 Realiza os cálculos e desenho da linha conforme o usuário movimenta o mouse 273 Realiza os cálculos e desenho da linha conforme o usuário movimenta o mouse
272 */ 274 */
273 movimento: function(){ 275 movimento: function(){
  276 + var n,d,r,decimal,da,mostra;
274 if (g_tipoacao == "mede"){ 277 if (g_tipoacao == "mede"){
275 if($i("mostradistancia")) 278 if($i("mostradistancia"))
276 {$i("mostradistancia").style.display="block";} 279 {$i("mostradistancia").style.display="block";}
277 - var n = pontosdistobj.xpt.length; 280 + n = pontosdistobj.xpt.length;
278 if (n > 0){ 281 if (n > 0){
279 - var d = i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy);  
280 - var r = i3GEO.calculo.direcao(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); 282 + d = i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy);
  283 + r = i3GEO.calculo.direcao(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy);
281 r = i3GEO.calculo.dd2dms(r,r); 284 r = i3GEO.calculo.dd2dms(r,r);
282 r = r[0]; 285 r = r[0];
283 if (i3GEO.parametros.mapscale > 500000) 286 if (i3GEO.parametros.mapscale > 500000)
284 {d = parseInt(d,10);} 287 {d = parseInt(d,10);}
285 else{ 288 else{
286 - d= d + ""; 289 + d = d + "";
287 d = d.split("."); 290 d = d.split(".");
288 - var decimal = d[1].substr(0,3); 291 + decimal = d[1].substr(0,3);
289 d = d[0]+"."+decimal; 292 d = d[0]+"."+decimal;
290 d = d * 1; 293 d = d * 1;
291 } 294 }
292 - var da = d + pontosdistobj.dist[n-1];  
293 - var mostra = $i("mostradistancia_calculo"); 295 + da = d + pontosdistobj.dist[n-1];
  296 + mostra = $i("mostradistancia_calculo");
294 if (mostra){ 297 if (mostra){
295 mostra.innerHTML = " Dist acum.= "+da+" atual= "+d+" km <br> Direção (DMS)= "+r; 298 mostra.innerHTML = " Dist acum.= "+da+" atual= "+d+" km <br> Direção (DMS)= "+r;
296 } 299 }
@@ -319,6 +322,7 @@ i3GEO.analise = { @@ -319,6 +322,7 @@ i3GEO.analise = {
319 São registrados os eventos de clique sobre o mapa e fechamento da janela de resultados 322 São registrados os eventos de clique sobre o mapa e fechamento da janela de resultados
320 */ 323 */
321 inicia: function(){ 324 inicia: function(){
  325 + var temp;
322 i3GEO.analise.medeArea.criaJanela(); 326 i3GEO.analise.medeArea.criaJanela();
323 if (g_tipoacao != "area"){ 327 if (g_tipoacao != "area"){
324 $i("mostraarea_calculo").innerHTML = ""; 328 $i("mostraarea_calculo").innerHTML = "";
@@ -327,7 +331,7 @@ i3GEO.analise = { @@ -327,7 +331,7 @@ i3GEO.analise = {
327 if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.analise.medeArea.movimento()") < 0) 331 if(i3GEO.eventos.MOUSEMOVE.toString().search("i3GEO.analise.medeArea.movimento()") < 0)
328 {i3GEO.eventos.MOUSEMOVE.push("i3GEO.analise.medeArea.movimento()");} 332 {i3GEO.eventos.MOUSEMOVE.push("i3GEO.analise.medeArea.movimento()");}
329 YAHOO.util.Event.addListener(YAHOO.janelaDocaarea.xp.panel.close, "click", i3GEO.analise.medeArea.fechaJanela); 333 YAHOO.util.Event.addListener(YAHOO.janelaDocaarea.xp.panel.close, "click", i3GEO.analise.medeArea.fechaJanela);
330 - var temp = function(retorno){ 334 + temp = function(retorno){
331 i3GEO.janela.fechaAguarde("i3GEO.atualiza"); 335 i3GEO.janela.fechaAguarde("i3GEO.atualiza");
332 g_areapixel = retorno.data; 336 g_areapixel = retorno.data;
333 if (g_areapixel < 0) 337 if (g_areapixel < 0)
@@ -356,10 +360,11 @@ i3GEO.analise = { @@ -356,10 +360,11 @@ i3GEO.analise = {
356 Cria a janela para mostrar os resultados da medição 360 Cria a janela para mostrar os resultados da medição
357 */ 361 */
358 criaJanela: function(){ 362 criaJanela: function(){
  363 + var novoel,ins,imagemxy;
359 if (!$i("mostraarea")){ 364 if (!$i("mostraarea")){
360 - var novoel = document.createElement("div"); 365 + novoel = document.createElement("div");
361 novoel.id = "mostraarea"; 366 novoel.id = "mostraarea";
362 - var ins = "<div class='hd' >&Aacute;rea aproximada <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=51' >&nbsp;&nbsp;&nbsp;</a></div>"; 367 + ins = "<div class='hd' >&Aacute;rea aproximada <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=6&idajuda=51' >&nbsp;&nbsp;&nbsp;</a></div>";
363 ins += '<div class="bd" style="text-align:left;padding:3px;" >'; 368 ins += '<div class="bd" style="text-align:left;padding:3px;" >';
364 ins += '<div style="text-align:left;padding:3px;font-size:10px" id="mostraarea_calculo" ></div>'; 369 ins += '<div style="text-align:left;padding:3px;font-size:10px" id="mostraarea_calculo" ></div>';
365 ins+= '</div>'; 370 ins+= '</div>';
@@ -370,7 +375,7 @@ i3GEO.analise = { @@ -370,7 +375,7 @@ i3GEO.analise = {
370 YAHOO.namespace("janelaDocaarea.xp"); 375 YAHOO.namespace("janelaDocaarea.xp");
371 YAHOO.janelaDocaarea.xp.panel = new YAHOO.widget.Panel("mostraarea", {width:220,fixedcenter: false, constraintoviewport: true, underlay:"none", close:true, visible:true, draggable:true, modal:false } ); 376 YAHOO.janelaDocaarea.xp.panel = new YAHOO.widget.Panel("mostraarea", {width:220,fixedcenter: false, constraintoviewport: true, underlay:"none", close:true, visible:true, draggable:true, modal:false } );
372 YAHOO.janelaDocaarea.xp.panel.render(); 377 YAHOO.janelaDocaarea.xp.panel.render();
373 - var imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); 378 + imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));
374 YAHOO.janelaDocaarea.xp.panel.moveTo(imagemxy[0]+150,imagemxy[1]); 379 YAHOO.janelaDocaarea.xp.panel.moveTo(imagemxy[0]+150,imagemxy[1]);
375 }, 380 },
376 /* 381 /*
@@ -391,8 +396,9 @@ i3GEO.analise = { @@ -391,8 +396,9 @@ i3GEO.analise = {
391 Adiciona uma marca na tela e realiza o cálculo de distância dos pontos inseridos 396 Adiciona uma marca na tela e realiza o cálculo de distância dos pontos inseridos
392 */ 397 */
393 clique: function(){ 398 clique: function(){
  399 + var n,m;
394 if (g_tipoacao == "area"){ 400 if (g_tipoacao == "area"){
395 - var n = pontosdistobj.xpt.length; 401 + n = pontosdistobj.xpt.length;
396 pontosdistobj.xpt[n] = objposicaocursor.ddx; 402 pontosdistobj.xpt[n] = objposicaocursor.ddx;
397 pontosdistobj.ypt[n] = objposicaocursor.ddy; 403 pontosdistobj.ypt[n] = objposicaocursor.ddy;
398 pontosdistobj.xtela[n] = objposicaocursor.telax; 404 pontosdistobj.xtela[n] = objposicaocursor.telax;
@@ -417,11 +423,9 @@ i3GEO.analise = { @@ -417,11 +423,9 @@ i3GEO.analise = {
417 {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n]);} 423 {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n]);}
418 } 424 }
419 catch(e){} 425 catch(e){}
420 - var m = i3GEO.calculo.area(pontosdistobj,g_areapixel); 426 + m = i3GEO.calculo.area(pontosdistobj,g_areapixel);
421 if($i("mostraarea_calculo")) 427 if($i("mostraarea_calculo"))
422 - {  
423 - $i("mostraarea_calculo").innerHTML = "<br>m2</b>= "+m.toFixed(2)+"<br><b>km2</b>= "+(m/1000000).toFixed(2)+"<br><b>ha</b>= "+(m/10000).toFixed(2);  
424 - } 428 + {$i("mostraarea_calculo").innerHTML = "<br>m2</b>= "+m.toFixed(2)+"<br><b>km2</b>= "+(m/1000000).toFixed(2)+"<br><b>ha</b>= "+(m/10000).toFixed(2);}
425 if (n > 3){ 429 if (n > 3){
426 //var d = parseInt(i3GEO.util.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy)); 430 //var d = parseInt(i3GEO.util.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy));
427 //pontosdistobj.dist[n] = d + pontosdistobj.dist[n-1]; 431 //pontosdistobj.dist[n] = d + pontosdistobj.dist[n-1];
@@ -435,23 +439,24 @@ i3GEO.analise = { @@ -435,23 +439,24 @@ i3GEO.analise = {
435 Realiza os cálculos e desenho da linha conforme o usuário movimenta o mouse 439 Realiza os cálculos e desenho da linha conforme o usuário movimenta o mouse
436 */ 440 */
437 movimento: function(){ 441 movimento: function(){
  442 + var n,d,decimal,da;
438 if (g_tipoacao == "area"){ 443 if (g_tipoacao == "area"){
439 - var n = pontosdistobj.xpt.length; 444 + n = pontosdistobj.xpt.length;
440 if (n > 0){ 445 if (n > 0){
441 // 446 //
442 //conforme a escala, os dados são arredondados 447 //conforme a escala, os dados são arredondados
443 // 448 //
444 - var d = i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy); 449 + d = i3GEO.calculo.distancia(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],objposicaocursor.ddx,objposicaocursor.ddy);
445 if (i3GEO.parametros.mapscale > 500000) 450 if (i3GEO.parametros.mapscale > 500000)
446 {d = parseInt(d,10);} 451 {d = parseInt(d,10);}
447 else{ 452 else{
448 d= d + ""; 453 d= d + "";
449 d = d.split("."); 454 d = d.split(".");
450 - var decimal = d[1].substr(0,3); 455 + decimal = d[1].substr(0,3);
451 d = d[0]+"."+decimal; 456 d = d[0]+"."+decimal;
452 d = d * 1; 457 d = d * 1;
453 } 458 }
454 - var da = d + pontosdistobj.dist[n-1]; 459 + da = d + pontosdistobj.dist[n-1];
455 // 460 //
456 //desenha as linhas na tela com o objeto richdraw 461 //desenha as linhas na tela com o objeto richdraw
457 // 462 //
classesjs/classe_arvoredecamadas.js
@@ -276,40 +276,39 @@ i3GEO.arvoreDeCamadas = { @@ -276,40 +276,39 @@ i3GEO.arvoreDeCamadas = {
276 */ 276 */
277 atualiza: function(temas){ 277 atualiza: function(temas){
278 if(this.comparaTemas(temas,this.CAMADAS)){return;} 278 if(this.comparaTemas(temas,this.CAMADAS)){return;}
279 - //YAHOO.log("Atualizando a árvore de camadas", "i3geo"); 279 + var currentIconMode,newVal,root,tempNode,titulo,d,c,ltema,temaNode,i,j;
280 if(!document.getElementById(i3GEO.arvoreDeCamadas.IDHTML)){return;} 280 if(!document.getElementById(i3GEO.arvoreDeCamadas.IDHTML)){return;}
281 document.getElementById(i3GEO.arvoreDeCamadas.IDHTML).innerHTML = ""; 281 document.getElementById(i3GEO.arvoreDeCamadas.IDHTML).innerHTML = "";
282 this.CAMADAS = temas; 282 this.CAMADAS = temas;
283 - var currentIconMode;  
284 YAHOO.example.treeExample = function(){ 283 YAHOO.example.treeExample = function(){
285 function changeIconMode(){ 284 function changeIconMode(){
286 - var newVal = parseInt(this.value,10); 285 + newVal = parseInt(this.value,10);
287 if (newVal != currentIconMode) 286 if (newVal != currentIconMode)
288 {currentIconMode = newVal;} 287 {currentIconMode = newVal;}
289 buildTree(); 288 buildTree();
290 } 289 }
291 function buildTree(){ 290 function buildTree(){
292 i3GEO.arvoreDeCamadas.ARVORE = new YAHOO.widget.TreeView(i3GEO.arvoreDeCamadas.IDHTML); 291 i3GEO.arvoreDeCamadas.ARVORE = new YAHOO.widget.TreeView(i3GEO.arvoreDeCamadas.IDHTML);
293 - var root = i3GEO.arvoreDeCamadas.ARVORE.getRoot();  
294 - var tempNode = new YAHOO.widget.TextNode('', root, false); 292 + root = i3GEO.arvoreDeCamadas.ARVORE.getRoot();
  293 + tempNode = new YAHOO.widget.TextNode('', root, false);
295 tempNode.isLeaf = false; 294 tempNode.isLeaf = false;
296 tempNode.enableHighlight = false; 295 tempNode.enableHighlight = false;
297 } 296 }
298 buildTree(); 297 buildTree();
299 }(); 298 }();
300 - var root = i3GEO.arvoreDeCamadas.ARVORE.getRoot();  
301 - var titulo = "<table><tr><td><b>"+$trad("a7")+"</b></td><td>"; 299 + root = i3GEO.arvoreDeCamadas.ARVORE.getRoot();
  300 + titulo = "<table><tr><td><b>"+$trad("a7")+"</b></td><td>";
302 if(i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true) 301 if(i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true)
303 {titulo += "<img id='i3geo_lixeira' title='"+$trad("t2")+"' src='"+i3GEO.util.$im("branco.gif")+"' />";} 302 {titulo += "<img id='i3geo_lixeira' title='"+$trad("t2")+"' src='"+i3GEO.util.$im("branco.gif")+"' />";}
304 titulo += "</td></tr></table>"; 303 titulo += "</td></tr></table>";
305 - var d = {html:titulo};  
306 - var tempNode = new YAHOO.widget.HTMLNode(d, root, true,true); 304 + d = {html:titulo};
  305 + tempNode = new YAHOO.widget.HTMLNode(d, root, true,true);
307 tempNode.enableHighlight = false; 306 tempNode.enableHighlight = false;
308 - var c = temas.length;  
309 - for (var i=0, j=c; i<j; i++){  
310 - var ltema = temas[i]; 307 + c = temas.length;
  308 + for (i=0, j=c; i<j; i++){
  309 + ltema = temas[i];
311 d = {html:i3GEO.arvoreDeCamadas.montaTextoTema(ltema),id:temas[i].name,tipo:"tema"}; 310 d = {html:i3GEO.arvoreDeCamadas.montaTextoTema(ltema),id:temas[i].name,tipo:"tema"};
312 - var temaNode = new YAHOO.widget.HTMLNode(d, tempNode, i3GEO.arvoreDeCamadas.EXPANDIDA,true); 311 + temaNode = new YAHOO.widget.HTMLNode(d, tempNode, i3GEO.arvoreDeCamadas.EXPANDIDA,true);
313 temaNode.setDynamicLoad(i3GEO.arvoreDeCamadas.montaOpcoes, currentIconMode); 312 temaNode.setDynamicLoad(i3GEO.arvoreDeCamadas.montaOpcoes, currentIconMode);
314 temaNode.expanded = false; 313 temaNode.expanded = false;
315 temaNode.enableHighlight = false; 314 temaNode.enableHighlight = false;
@@ -335,24 +334,23 @@ i3GEO.arvoreDeCamadas = { @@ -335,24 +334,23 @@ i3GEO.arvoreDeCamadas = {
335 Ativa a funcionalidade de arrastar um tema para mudar sua ordem de desenho ou excluir do mapa 334 Ativa a funcionalidade de arrastar um tema para mudar sua ordem de desenho ou excluir do mapa
336 */ 335 */
337 ativaDragDrop: function(){ 336 ativaDragDrop: function(){
338 - //YAHOO.log("Ativando drag-drop da árvore de camadas", "i3geo");  
339 - var Dom = YAHOO.util.Dom;  
340 - var Event = YAHOO.util.Event;  
341 - var DDM = YAHOO.util.DragDropMgr; 337 + var Dom,Event,DDM;
  338 + Dom = YAHOO.util.Dom;
  339 + Event = YAHOO.util.Event;
  340 + DDM = YAHOO.util.DragDropMgr;
342 YAHOO.example.DDList = ""; 341 YAHOO.example.DDList = "";
343 - YAHOO.example.DDApp =  
344 - { 342 + YAHOO.example.DDApp = {
345 init: function() 343 init: function()
346 { 344 {
  345 + var ddtarget,i,ltema,ddlist;
347 if($i("i3geo_lixeira") && i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true) 346 if($i("i3geo_lixeira") && i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true)
348 - {var ddtarget = new YAHOO.util.DDTarget("i3geo_lixeira");}  
349 - var lista = i3GEO.arvoreDeCamadas.CAMADAS;  
350 - var i = lista.length-1;  
351 - if (i >= 0){ 347 + {ddtarget = new YAHOO.util.DDTarget("i3geo_lixeira");}
  348 + i = i3GEO.arvoreDeCamadas.CAMADAS.length-1;
  349 + if (i3GEO.arvoreDeCamadas.CAMADAS.length-1 >= 0){
352 do{ 350 do{
353 - var ltema = lista[i]; 351 + ltema = i3GEO.arvoreDeCamadas.CAMADAS[i];
354 if($i("arrastar_"+ltema.name)) 352 if($i("arrastar_"+ltema.name))
355 - {var ddlist = new YAHOO.example.DDList("arrastar_"+ltema.name);} 353 + {ddlist = new YAHOO.example.DDList("arrastar_"+ltema.name);}
356 } 354 }
357 while(i--); 355 while(i--);
358 } 356 }
@@ -361,18 +359,18 @@ i3GEO.arvoreDeCamadas = { @@ -361,18 +359,18 @@ i3GEO.arvoreDeCamadas = {
361 YAHOO.example.DDList = function(id, sGroup, config) { 359 YAHOO.example.DDList = function(id, sGroup, config) {
362 YAHOO.example.DDList.superclass.constructor.call(this, id, sGroup, config); 360 YAHOO.example.DDList.superclass.constructor.call(this, id, sGroup, config);
363 this.logger = this.logger || YAHOO; 361 this.logger = this.logger || YAHOO;
364 - var el = this.getDragEl();  
365 - Dom.setStyle(el, "opacity", 0.67); // The proxy is slightly transparent 362 + Dom.setStyle(this.getDragEl(), "opacity", 0.67); // The proxy is slightly transparent
366 this.goingUp = false; 363 this.goingUp = false;
367 this.lastY = 0; 364 this.lastY = 0;
368 }; 365 };
369 YAHOO.extend( 366 YAHOO.extend(
370 YAHOO.example.DDList, YAHOO.util.DDProxy, { 367 YAHOO.example.DDList, YAHOO.util.DDProxy, {
371 startDrag: function(x, y){ 368 startDrag: function(x, y){
  369 + var dragEl,clickEl;
372 this.logger.log(this.id + " startDrag"); 370 this.logger.log(this.id + " startDrag");
373 // make the proxy look like the source element 371 // make the proxy look like the source element
374 - var dragEl = this.getDragEl();  
375 - var clickEl = this.getEl(); 372 + dragEl = this.getDragEl();
  373 + clickEl = this.getEl();
376 Dom.setStyle(clickEl, "visibility", "hidden"); 374 Dom.setStyle(clickEl, "visibility", "hidden");
377 dragEl.innerHTML = clickEl.innerHTML; 375 dragEl.innerHTML = clickEl.innerHTML;
378 Dom.setStyle(dragEl, "color", Dom.getStyle(clickEl, "color")); 376 Dom.setStyle(dragEl, "color", Dom.getStyle(clickEl, "color"));
@@ -381,11 +379,12 @@ i3GEO.arvoreDeCamadas = { @@ -381,11 +379,12 @@ i3GEO.arvoreDeCamadas = {
381 Dom.setStyle(dragEl, "z-index", "5000"); 379 Dom.setStyle(dragEl, "z-index", "5000");
382 }, 380 },
383 endDrag: function(e){ 381 endDrag: function(e){
384 - var srcEl = this.getEl();  
385 - var proxy = this.getDragEl(); 382 + var srcEl,proxy,a,thisid,proxyid;
  383 + srcEl = this.getEl();
  384 + proxy = this.getDragEl();
386 // Show the proxy element and animate it to the src element's location 385 // Show the proxy element and animate it to the src element's location
387 Dom.setStyle(proxy, "visibility", ""); 386 Dom.setStyle(proxy, "visibility", "");
388 - var a = new YAHOO.util.Motion( 387 + a = new YAHOO.util.Motion(
389 proxy,{ 388 proxy,{
390 points: 389 points:
391 {to: Dom.getXY(srcEl)} 390 {to: Dom.getXY(srcEl)}
@@ -393,8 +392,8 @@ i3GEO.arvoreDeCamadas = { @@ -393,8 +392,8 @@ i3GEO.arvoreDeCamadas = {
393 0.2, 392 0.2,
394 YAHOO.util.Easing.easeOut 393 YAHOO.util.Easing.easeOut
395 ); 394 );
396 - var proxyid = proxy.id;  
397 - var thisid = this.id; 395 + proxyid = proxy.id;
  396 + thisid = this.id;
398 // Hide the proxy and show the source element when finished with the animation 397 // Hide the proxy and show the source element when finished with the animation
399 a.onComplete.subscribe( 398 a.onComplete.subscribe(
400 function(){ 399 function(){
@@ -407,16 +406,17 @@ i3GEO.arvoreDeCamadas = { @@ -407,16 +406,17 @@ i3GEO.arvoreDeCamadas = {
407 {$i("i3geo_lixeira").style.border = "0px solid blue";} 406 {$i("i3geo_lixeira").style.border = "0px solid blue";}
408 }, 407 },
409 onDragDrop: function(e, id){ 408 onDragDrop: function(e, id){
  409 + var pt,region,tema,destEl,els,lista,noid;
410 if (DDM.interactionInfo.drop.length === 1){ 410 if (DDM.interactionInfo.drop.length === 1){
411 - var pt = DDM.interactionInfo.point;  
412 - var region = DDM.interactionInfo.sourceRegion; 411 + pt = DDM.interactionInfo.point;
  412 + region = DDM.interactionInfo.sourceRegion;
413 if (!region.intersect(pt)){ 413 if (!region.intersect(pt)){
414 DDM.refreshCache(); 414 DDM.refreshCache();
415 //exclui tema 415 //exclui tema
416 if(DDM.getDDById(id).id == "i3geo_lixeira"){ 416 if(DDM.getDDById(id).id == "i3geo_lixeira"){
417 if(i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true){ 417 if(i3GEO.arvoreDeCamadas.ARRASTARLIXEIRA === true){
418 i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o1")); 418 i3GEO.janela.abreAguarde("ajaxCorpoMapa",$trad("o1"));
419 - var tema = (this.getEl()).id.split("arrastar_")[1]; 419 + tema = (this.getEl()).id.split("arrastar_")[1];
420 i3GEO.contadorAtualiza++; 420 i3GEO.contadorAtualiza++;
421 i3GEO.php.excluitema(i3GEO.atualiza,tema); 421 i3GEO.php.excluitema(i3GEO.atualiza,tema);
422 i3GEO.temaAtivo = ""; 422 i3GEO.temaAtivo = "";
@@ -426,11 +426,11 @@ i3GEO.arvoreDeCamadas = { @@ -426,11 +426,11 @@ i3GEO.arvoreDeCamadas = {
426 else{ 426 else{
427 if(i3GEO.arvoreDeCamadas.ARRASTARORDEM === true){ 427 if(i3GEO.arvoreDeCamadas.ARRASTARORDEM === true){
428 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); 428 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));
429 - var destEl = Dom.get(id);  
430 - var noid = id.split("arrastar_")[1]; 429 + destEl = Dom.get(id);
  430 + noid = id.split("arrastar_")[1];
431 destEl.appendChild(this.getEl()); 431 destEl.appendChild(this.getEl());
432 - var els = i3GEO.arvoreDeCamadas.listaLigadosDesligados();  
433 - var lista = els[2].join(","); 432 + els = i3GEO.arvoreDeCamadas.listaLigadosDesligados();
  433 + lista = els[2].join(",");
434 i3GEO.contadorAtualiza++; 434 i3GEO.contadorAtualiza++;
435 i3GEO.php.reordenatemas(i3GEO.atualiza,lista); 435 i3GEO.php.reordenatemas(i3GEO.atualiza,lista);
436 } 436 }
@@ -440,7 +440,8 @@ i3GEO.arvoreDeCamadas = { @@ -440,7 +440,8 @@ i3GEO.arvoreDeCamadas = {
440 }, 440 },
441 onDrag: function(e){ 441 onDrag: function(e){
442 // Keep track of the direction of the drag for use during onDragOver 442 // Keep track of the direction of the drag for use during onDragOver
443 - var y = Event.getPageY(e); 443 + var y;
  444 + y = Event.getPageY(e);
444 if (y < this.lastY) 445 if (y < this.lastY)
445 {this.goingUp = true;} 446 {this.goingUp = true;}
446 else 447 else
@@ -449,8 +450,9 @@ i3GEO.arvoreDeCamadas = { @@ -449,8 +450,9 @@ i3GEO.arvoreDeCamadas = {
449 this.lastY = y; 450 this.lastY = y;
450 }, 451 },
451 onDragOver: function(e, id) { 452 onDragOver: function(e, id) {
452 - var srcEl = this.getEl();  
453 - var destEl = Dom.get(id); 453 + var srcEl,destEl;
  454 + srcEl = this.getEl();
  455 + destEl = Dom.get(id);
454 // We are only concerned with list items, we ignore the dragover 456 // We are only concerned with list items, we ignore the dragover
455 // notifications for the list. 457 // notifications for the list.
456 if ($i("i3geo_lixeira") && id == "i3geo_lixeira") 458 if ($i("i3geo_lixeira") && id == "i3geo_lixeira")
@@ -476,12 +478,13 @@ i3GEO.arvoreDeCamadas = { @@ -476,12 +478,13 @@ i3GEO.arvoreDeCamadas = {
476 */ 478 */
477 montaOpcoes: function(node){ 479 montaOpcoes: function(node){
478 //YAHOO.log("Montando as opções da árvore de camadas", "i3geo"); 480 //YAHOO.log("Montando as opções da árvore de camadas", "i3geo");
479 - var idtema = node.data.id;  
480 - var ltema = i3GEO.arvoreDeCamadas.pegaTema(idtema);  
481 - var d,conteudo,opcoesNode; 481 + var d,conteudo,opcoesNode,idtema,ltema,farol,mfarol,tnome,iconesNode;
  482 + idtema = node.data.id;
  483 + ltema = i3GEO.arvoreDeCamadas.pegaTema(idtema);
  484 +
482 if(i3GEO.arvoreDeCamadas.OPCOESICONES === true){ 485 if(i3GEO.arvoreDeCamadas.OPCOESICONES === true){
483 - var farol = "maisamarelo.png";  
484 - var mfarol = ""; 486 + farol = "maisamarelo.png";
  487 + mfarol = "";
485 if (ltema.escala*1 < i3GEO.parametros.mapscale*1){ 488 if (ltema.escala*1 < i3GEO.parametros.mapscale*1){
486 farol = "maisverde.png"; 489 farol = "maisverde.png";
487 mfarol = $trad("t9"); 490 mfarol = $trad("t9");
@@ -503,7 +506,7 @@ i3GEO.arvoreDeCamadas = { @@ -503,7 +506,7 @@ i3GEO.arvoreDeCamadas = {
503 if( (ltema.zoomtema == "sim") && (i3GEO.Interface.ATUAL != "flamingo")) 506 if( (ltema.zoomtema == "sim") && (i3GEO.Interface.ATUAL != "flamingo"))
504 {tnome += "&nbsp;<img class='extent' src='"+i3GEO.util.$im("branco.gif") +"' title='"+$trad("t17")+"' onclick='i3GEO.tema.zoom(\""+ltema.name+"\")' onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t18")+"','')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" />";} 507 {tnome += "&nbsp;<img class='extent' src='"+i3GEO.util.$im("branco.gif") +"' title='"+$trad("t17")+"' onclick='i3GEO.tema.zoom(\""+ltema.name+"\")' onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t18")+"','')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" />";}
505 d = {html:tnome}; 508 d = {html:tnome};
506 - var iconesNode = new YAHOO.widget.HTMLNode(d, node, false,true); 509 + iconesNode = new YAHOO.widget.HTMLNode(d, node, false,true);
507 iconesNode.enableHighlight = false; 510 iconesNode.enableHighlight = false;
508 iconesNode.isLeaf = true; 511 iconesNode.isLeaf = true;
509 } 512 }
@@ -535,9 +538,9 @@ i3GEO.arvoreDeCamadas = { @@ -535,9 +538,9 @@ i3GEO.arvoreDeCamadas = {
535 */ 538 */
536 mostraOpcoes: function(node){ 539 mostraOpcoes: function(node){
537 //YAHOO.log("Mostrando as opções da árvore de camadas", "i3geo"); 540 //YAHOO.log("Mostrando as opções da árvore de camadas", "i3geo");
538 - var idtema = node.data.idopcoes;  
539 - var ltema = i3GEO.arvoreDeCamadas.pegaTema(idtema);  
540 - var tnome,d,n; 541 + var idtema,ltema,tnome,d,n;
  542 + idtema = node.data.idopcoes;
  543 + ltema = i3GEO.arvoreDeCamadas.pegaTema(idtema);
541 if(navm) 544 if(navm)
542 {tnome = "<span onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t19")+"','')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" >"+$trad("t20")+"</span> <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=42' >&nbsp;&nbsp;&nbsp;</a>"+$inputText("","","tr"+ltema.name,"","3",ltema.transparency)+"&nbsp;<a class='tic' onclick='i3GEO.tema.mudatransp(\""+ltema.name+"\")' href='#' /a>";} 545 {tnome = "<span onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t19")+"','')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" >"+$trad("t20")+"</span> <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=5&idajuda=42' >&nbsp;&nbsp;&nbsp;</a>"+$inputText("","","tr"+ltema.name,"","3",ltema.transparency)+"&nbsp;<a class='tic' onclick='i3GEO.tema.mudatransp(\""+ltema.name+"\")' href='#' /a>";}
543 else 546 else
@@ -596,9 +599,10 @@ i3GEO.arvoreDeCamadas = { @@ -596,9 +599,10 @@ i3GEO.arvoreDeCamadas = {
596 node {String} - objeto node da árvore (YUI) que receberá o novo nó 599 node {String} - objeto node da árvore (YUI) que receberá o novo nó
597 */ 600 */
598 adicionaOpcaoTema:function(dica,titulo,onclick,node){ 601 adicionaOpcaoTema:function(dica,titulo,onclick,node){
599 - var tnome = "<a href='#' onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+dica+"','');\" onclick="+onclick+">"+titulo+" </a>";  
600 - var d = {html:tnome};  
601 - var n = new YAHOO.widget.HTMLNode(d, node, false,true); 602 + var tnome,d,n;
  603 + tnome = "<a href='#' onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+dica+"','');\" onclick="+onclick+">"+titulo+" </a>";
  604 + d = {html:tnome};
  605 + n = new YAHOO.widget.HTMLNode(d, node, false,true);
602 n.enableHighlight = false; 606 n.enableHighlight = false;
603 n.isLeaf = true; 607 n.isLeaf = true;
604 }, 608 },
@@ -613,12 +617,13 @@ i3GEO.arvoreDeCamadas = { @@ -613,12 +617,13 @@ i3GEO.arvoreDeCamadas = {
613 */ 617 */
614 mostraLegenda: function(node){ 618 mostraLegenda: function(node){
615 //YAHOO.log("Mostrando a legenda da árvore de camadas", "i3geo"); 619 //YAHOO.log("Mostrando a legenda da árvore de camadas", "i3geo");
616 - var idtema = node.data.idlegenda;  
617 - var ltema = i3GEO.arvoreDeCamadas.pegaTema(idtema);  
618 - var tabela,linhas,re,i;  
619 - var retorna = function(retorno){ 620 + var idtema,ltema,retorna;
  621 + idtema = node.data.idlegenda;
  622 + ltema = i3GEO.arvoreDeCamadas.pegaTema(idtema);
  623 + retorna = function(retorno){
  624 + var original,i,re,tabela,linhas,linha,colunas,id,exp,incluir,d,nodeLeg,elementos,nelementos,inputs,desativar,nindices;
620 if(retorno.data.legenda){ 625 if(retorno.data.legenda){
621 - var original = retorno; 626 + original = retorno;
622 retorno = retorno.data.legenda; 627 retorno = retorno.data.legenda;
623 if (retorno[0]){ 628 if (retorno[0]){
624 if ((navn) && (!retorno[0].imagem)){tabela = retorno;} 629 if ((navn) && (!retorno[0].imagem)){tabela = retorno;}
@@ -635,13 +640,13 @@ i3GEO.arvoreDeCamadas = { @@ -635,13 +640,13 @@ i3GEO.arvoreDeCamadas = {
635 if (linhas.length > 1){ 640 if (linhas.length > 1){
636 linhas = retorno.split("|"); 641 linhas = retorno.split("|");
637 tabela = "<table>"; 642 tabela = "<table>";
638 - var linha = linhas.length-1; 643 + linha = linhas.length-1;
639 if(linha >= 0){ 644 if(linha >= 0){
640 do{ 645 do{
641 - var colunas = linhas[linha].split("#");  
642 - var id = colunas[0]+"-"+colunas[1]; 646 + colunas = linhas[linha].split("#");
  647 + id = colunas[0]+"-"+colunas[1];
643 re = new RegExp("'", "g"); 648 re = new RegExp("'", "g");
644 - var exp = colunas[3].replace(re,'"'); 649 + exp = colunas[3].replace(re,'"');
645 tabela += "<tr style='border-top:1px solid rgb(240,240,240);'><td><img src='"+colunas[4]+"' </td><td style='text-align:left'>"+colunas[2]+"</td></tr>"; 650 tabela += "<tr style='border-top:1px solid rgb(240,240,240);'><td><img src='"+colunas[4]+"' </td><td style='text-align:left'>"+colunas[2]+"</td></tr>";
646 } 651 }
647 while(linha--); 652 while(linha--);
@@ -652,18 +657,18 @@ i3GEO.arvoreDeCamadas = { @@ -652,18 +657,18 @@ i3GEO.arvoreDeCamadas = {
652 } 657 }
653 } 658 }
654 else {tabela = "<img src='"+retorno.data[0].imagem+"' />";} //o tema é um wms 659 else {tabela = "<img src='"+retorno.data[0].imagem+"' />";} //o tema é um wms
655 - var incluir = "<div style='text-align:left' id='"+idtema+"verdiv"+"'>"+tabela+"</div>";  
656 - var d = {html:incluir};  
657 - var nodeLeg = new YAHOO.widget.HTMLNode(d, node, false,false); 660 + incluir = "<div style='text-align:left' id='"+idtema+"verdiv"+"'>"+tabela+"</div>";
  661 + d = {html:incluir};
  662 + nodeLeg = new YAHOO.widget.HTMLNode(d, node, false,false);
658 nodeLeg.enableHighlight = false; 663 nodeLeg.enableHighlight = false;
659 node.loadComplete(); 664 node.loadComplete();
660 // 665 //
661 //desliga os checkbox que foram desativados 666 //desliga os checkbox que foram desativados
662 //pega os objetos input 667 //pega os objetos input
663 // 668 //
664 - var elementos = document.getElementById(idtema+"verdiv").getElementsByTagName("input");  
665 - var nelementos = elementos.length;  
666 - var inputs = []; 669 + elementos = document.getElementById(idtema+"verdiv").getElementsByTagName("input");
  670 + nelementos = elementos.length;
  671 + inputs = [];
667 i = 0; 672 i = 0;
668 if (nelementos > 0){ 673 if (nelementos > 0){
669 do{ 674 do{
@@ -673,8 +678,8 @@ i3GEO.arvoreDeCamadas = { @@ -673,8 +678,8 @@ i3GEO.arvoreDeCamadas = {
673 while(i < nelementos); 678 while(i < nelementos);
674 } 679 }
675 if(original.data.desativar){ 680 if(original.data.desativar){
676 - var desativar = original.data.desativar;  
677 - var nindices = desativar.length; 681 + desativar = original.data.desativar;
  682 + nindices = desativar.length;
678 i = 0; 683 i = 0;
679 if (nindices > 0){ 684 if (nindices > 0){
680 do{ 685 do{
@@ -703,9 +708,10 @@ i3GEO.arvoreDeCamadas = { @@ -703,9 +708,10 @@ i3GEO.arvoreDeCamadas = {
703 */ 708 */
704 atualizaLegenda: function(idtema){ 709 atualizaLegenda: function(idtema){
705 //YAHOO.log("Atualizando a legenda da árvore de camadas", "i3geo"); 710 //YAHOO.log("Atualizando a legenda da árvore de camadas", "i3geo");
  711 + var node;
706 if(document.getElementById(idtema+"verdiv")) 712 if(document.getElementById(idtema+"verdiv"))
707 { 713 {
708 - var node = i3GEO.arvoreDeCamadas.ARVORE.getNodeByProperty("idlegenda",idtema); 714 + node = i3GEO.arvoreDeCamadas.ARVORE.getNodeByProperty("idlegenda",idtema);
709 if(node) 715 if(node)
710 { 716 {
711 i3GEO.arvoreDeCamadas.ARVORE.removeChildren(node); 717 i3GEO.arvoreDeCamadas.ARVORE.removeChildren(node);
@@ -749,10 +755,11 @@ i3GEO.arvoreDeCamadas = { @@ -749,10 +755,11 @@ i3GEO.arvoreDeCamadas = {
749 {String} - texto formatado 755 {String} - texto formatado
750 */ 756 */
751 montaTextoTema: function(tema){ 757 montaTextoTema: function(tema){
752 - var ck = ""; 758 + var ck,html;
753 if(tema.status == 2){ck = ' CHECKED ';} 759 if(tema.status == 2){ck = ' CHECKED ';}
754 - var html = "";  
755 - html += "<p id='arrastar_"+tema.name+"' style='text-align:left;font-size:11px;' ><input class=inputsb style='cursor:pointer;' onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t3")+"','ligadesliga')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" type='checkbox' name=\"layer\" value='"+tema.name+"' "+ ck ; 760 + else
  761 + {ck = "";}
  762 + html = "<p id='arrastar_"+tema.name+"' style='text-align:left;font-size:11px;' ><input class=inputsb style='cursor:pointer;' onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t3")+"','ligadesliga')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" type='checkbox' name=\"layer\" value='"+tema.name+"' "+ ck ;
756 763
757 if(i3GEO.arvoreDeCamadas.ATIVATEMA !== "") 764 if(i3GEO.arvoreDeCamadas.ATIVATEMA !== "")
758 {html += "onclick=\""+i3GEO.arvoreDeCamadas.ATIVATEMA+"\"";} 765 {html += "onclick=\""+i3GEO.arvoreDeCamadas.ATIVATEMA+"\"";}
@@ -789,12 +796,13 @@ i3GEO.arvoreDeCamadas = { @@ -789,12 +796,13 @@ i3GEO.arvoreDeCamadas = {
789 atualizaFarol: function(mapscale) 796 atualizaFarol: function(mapscale)
790 { 797 {
791 //YAHOO.log("Atualizando o farol da árvore de camadas", "i3geo"); 798 //YAHOO.log("Atualizando o farol da árvore de camadas", "i3geo");
792 - var farol = "maisamarelo.png";  
793 - var l = i3GEO.arvoreDeCamadas.CAMADAS.length-1; 799 + var farol,l,ltema,escala;
  800 + farol = "maisamarelo.png";
  801 + l = i3GEO.arvoreDeCamadas.CAMADAS.length-1;
794 if (l >= 0){ 802 if (l >= 0){
795 do{ 803 do{
796 - var ltema = i3GEO.arvoreDeCamadas.CAMADAS[l];  
797 - var escala = ltema.escala; 804 + ltema = i3GEO.arvoreDeCamadas.CAMADAS[l];
  805 + escala = ltema.escala;
798 if (escala*1 < mapscale*1) 806 if (escala*1 < mapscale*1)
799 {farol = "maisverde.png";} 807 {farol = "maisverde.png";}
800 if (escala*1 > mapscale*1) 808 if (escala*1 > mapscale*1)
@@ -802,7 +810,7 @@ i3GEO.arvoreDeCamadas = { @@ -802,7 +810,7 @@ i3GEO.arvoreDeCamadas = {
802 if (escala*1 === 0) 810 if (escala*1 === 0)
803 {farol = "maisamarelo.png";} 811 {farol = "maisamarelo.png";}
804 if ($i("farol"+ltema.name)){ 812 if ($i("farol"+ltema.name)){
805 - $i("farol"+ltema.name).src = g_locaplic+"/imagens/"+farol; 813 + $i("farol"+ltema.name).src = i3GEO.configura.locaplic+"/imagens/"+farol;
806 } 814 }
807 } 815 }
808 while(l--); 816 while(l--);
@@ -816,11 +824,12 @@ i3GEO.arvoreDeCamadas = { @@ -816,11 +824,12 @@ i3GEO.arvoreDeCamadas = {
816 */ 824 */
817 aplicaTemas: function(){ 825 aplicaTemas: function(){
818 //YAHOO.log("Mudando status ligado/desligado de um tema", "i3geo"); 826 //YAHOO.log("Mudando status ligado/desligado de um tema", "i3geo");
819 - var t = i3GEO.arvoreDeCamadas.listaLigadosDesligados(); 827 + var t,temp;
  828 + t = i3GEO.arvoreDeCamadas.listaLigadosDesligados();
820 // 829 //
821 //zera o contador de tempo 830 //zera o contador de tempo
822 // 831 //
823 - var temp = function(){ 832 + temp = function(){
824 i3GEO.atualiza(); 833 i3GEO.atualiza();
825 i3GEO.janela.fechaAguarde("redesenha"); 834 i3GEO.janela.fechaAguarde("redesenha");
826 }; 835 };
@@ -838,19 +847,20 @@ i3GEO.arvoreDeCamadas = { @@ -838,19 +847,20 @@ i3GEO.arvoreDeCamadas = {
838 {Array} - array com os códigos dos temas [0]=ligados [1]=desligados [2]=todos na ordem encontrada 847 {Array} - array com os códigos dos temas [0]=ligados [1]=desligados [2]=todos na ordem encontrada
839 */ 848 */
840 listaLigadosDesligados: function(){ 849 listaLigadosDesligados: function(){
841 - var nos = i3GEO.arvoreDeCamadas.ARVORE.getNodesByProperty("tipo","tema");  
842 - var ligados = [];  
843 - var desligados = [];  
844 - var todos = [];  
845 - var n = nos.length;  
846 - var i=0; 850 + var nos,ligados,desligados,todos,n,i,no,cs,csn,j,c;
  851 + nos = i3GEO.arvoreDeCamadas.ARVORE.getNodesByProperty("tipo","tema");
  852 + ligados = [];
  853 + desligados = [];
  854 + todos = [];
  855 + n = nos.length;
  856 + i=0;
847 do{ 857 do{
848 try{ 858 try{
849 - var no = nos[i].getEl();  
850 - var cs = no.getElementsByTagName("input");  
851 - var csn = cs.length; 859 + no = nos[i].getEl();
  860 + cs = no.getElementsByTagName("input");
  861 + csn = cs.length;
852 for(j=0;j<csn;j++){ 862 for(j=0;j<csn;j++){
853 - var c = cs[j]; 863 + c = cs[j];
854 if(c.name=="layer"){ 864 if(c.name=="layer"){
855 if(c.checked === true) 865 if(c.checked === true)
856 {ligados.push(c.value);} 866 {ligados.push(c.value);}
@@ -863,8 +873,7 @@ i3GEO.arvoreDeCamadas = { @@ -863,8 +873,7 @@ i3GEO.arvoreDeCamadas = {
863 } catch(e){i++;} 873 } catch(e){i++;}
864 } 874 }
865 while(i<n); 875 while(i<n);
866 - var lista = [ligados,desligados,todos];  
867 - return (lista); 876 + return ([ligados,desligados,todos]);
868 }, 877 },
869 /* 878 /*
870 Function: comparaTemas 879 Function: comparaTemas
@@ -883,12 +892,16 @@ i3GEO.arvoreDeCamadas = { @@ -883,12 +892,16 @@ i3GEO.arvoreDeCamadas = {
883 */ 892 */
884 comparaTemas: function(novo,atual){ 893 comparaTemas: function(novo,atual){
885 try{ 894 try{
886 - var novon = novo.length;  
887 - if(novon != atual.length){return (false);} 895 + var novon = novo.length,i;
  896 + if(novon != atual.length)
  897 + {return (false);}
888 for (i=0;i<novon;i++){ 898 for (i=0;i<novon;i++){
889 - if(novo[i].name != atual[i].name){return (false);}  
890 - if(novo[i].tema != atual[i].tema){return (false);}  
891 - if(novo[i].sel != atual[i].sel){return (false);} 899 + if(novo[i].name != atual[i].name)
  900 + {return (false);}
  901 + if(novo[i].tema != atual[i].tema)
  902 + {return (false);}
  903 + if(novo[i].sel != atual[i].sel)
  904 + {return (false);}
892 } 905 }
893 return(true); 906 return(true);
894 } 907 }
@@ -908,10 +921,12 @@ i3GEO.arvoreDeCamadas = { @@ -908,10 +921,12 @@ i3GEO.arvoreDeCamadas = {
908 {JSON} 921 {JSON}
909 */ 922 */
910 pegaTema: function pegatema(idtema){ 923 pegaTema: function pegatema(idtema){
911 - var c = i3GEO.arvoreDeCamadas.CAMADAS.length; 924 + var c,i;
  925 + c = i3GEO.arvoreDeCamadas.CAMADAS.length;
912 for (i=0; i<c; i++){ 926 for (i=0; i<c; i++){
913 - if(i3GEO.arvoreDeCamadas.CAMADAS[i].name == idtema)  
914 - {var ltema = i3GEO.arvoreDeCamadas.CAMADAS[i];return (ltema);} 927 + if(i3GEO.arvoreDeCamadas.CAMADAS[i].name == idtema){
  928 + return (i3GEO.arvoreDeCamadas.CAMADAS[i]);
  929 + }
915 } 930 }
916 } 931 }
917 }; 932 };
classesjs/classe_arvoredetemas.js
@@ -277,21 +277,25 @@ i3GEO.arvoreDeTemas = { @@ -277,21 +277,25 @@ i3GEO.arvoreDeTemas = {
277 */ 277 */
278 listaWMS: function(){ 278 listaWMS: function(){
279 var monta = function(retorno){ 279 var monta = function(retorno){
280 - var node = i3GEO.arvoreDeTemas.ARVORE.getNodeByProperty("idwms","raiz");  
281 - var raiz = retorno.data.canais;  
282 - var nraiz = raiz.length;  
283 - var cor = "rgb(51, 102, 102)";  
284 - for (var i=0;i<nraiz; i++){  
285 - var html = "<span style='color:"+cor+"' title='"+raiz[i].description+"'> "+raiz[i].title; 280 + var node,raiz,nraiz,cor,i,html,tempNode;
  281 + node = i3GEO.arvoreDeTemas.ARVORE.getNodeByProperty("idwms","raiz");
  282 + raiz = retorno.data.canais;
  283 + nraiz = raiz.length;
  284 + cor = "rgb(51, 102, 102)";
  285 + for (i=0;i<nraiz; i++){
  286 + html = "<span style='color:"+cor+"' title='"+raiz[i].description+"'> "+raiz[i].title;
286 if(raiz[i].nacessos > 0){ 287 if(raiz[i].nacessos > 0){
287 - var quali = (raiz[i].nacessosok * 100) / (raiz[i].nacessos*1);  
288 - html += " ("+quali+"%)</span>"; 288 + html += " ("+((raiz[i].nacessosok * 100) / (raiz[i].nacessos*1))+"%)</span>";
289 } 289 }
290 else 290 else
291 {html += " (% de acessos não definido)</span>";} 291 {html += " (% de acessos não definido)</span>";}
292 html += "<hr>"; 292 html += "<hr>";
293 - var d = {html:html,id_ws:raiz[i].id_ws,url:raiz[i].link,nivel:0};  
294 - var tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 293 + tempNode = new YAHOO.widget.HTMLNode(
  294 + {html:html,id_ws:raiz[i].id_ws,url:raiz[i].link,nivel:0},
  295 + node,
  296 + false,
  297 + true
  298 + );
295 tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.listaLayersWMS, 1); 299 tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.listaLayersWMS, 1);
296 tempNode.enableHighlight = false; 300 tempNode.enableHighlight = false;
297 if(cor == "rgb(51, 102, 102)") 301 if(cor == "rgb(51, 102, 102)")
@@ -310,27 +314,51 @@ i3GEO.arvoreDeTemas = { @@ -310,27 +314,51 @@ i3GEO.arvoreDeTemas = {
310 listaLayersWMS: function(node){ 314 listaLayersWMS: function(node){
311 //node = no; 315 //node = no;
312 var monta = function(retorno){ 316 var monta = function(retorno){
313 - var n = 0; 317 + var n,cor,i,cabeca,tempNode,ns,j,tempNodeS;
  318 + n = 0;
314 try{n = retorno.data.length;} 319 try{n = retorno.data.length;}
315 catch(m){node.loadComplete();return;} 320 catch(m){node.loadComplete();return;}
316 - var cor = "rgb(51, 102, 102)";  
317 - var html = "";  
318 - var d = "";  
319 - for(var i=0;i<n; i++){  
320 - var cabeca = retorno.data[i].nome+" - "+retorno.data[i].titulo; 321 + cor = "rgb(51, 102, 102)";
  322 + html = "";
  323 + for(i=0;i<n; i++){
  324 + cabeca = retorno.data[i].nome+" - "+retorno.data[i].titulo;
321 if (cabeca != "undefined - undefined"){ 325 if (cabeca != "undefined - undefined"){
322 - html = "<span style='color:"+cor+"' >"+cabeca;  
323 - d = {html:html,url:node.data.url,nivel:(node.data.nivel*1 + 1),id_ws:"",layer:retorno.data[i].nome};  
324 - var tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 326 + tempNode = new YAHOO.widget.HTMLNode(
  327 + {
  328 + html:"<span style='color:"+cor+"' >"+cabeca,
  329 + url:node.data.url,
  330 + nivel:(node.data.nivel*1 + 1),
  331 + id_ws:"",
  332 + layer:retorno.data[i].nome
  333 + },
  334 + node,
  335 + false,
  336 + true
  337 + );
325 tempNode.enableHighlight = false; 338 tempNode.enableHighlight = false;
326 if(!retorno.data[i].estilos) 339 if(!retorno.data[i].estilos)
327 {tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.listaLayersWMS, 1);} 340 {tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.listaLayersWMS, 1);}
328 if(retorno.data[i].estilos){ 341 if(retorno.data[i].estilos){
329 - var ns = retorno.data[i].estilos.length;  
330 - for (var j=0;j<ns; j++){  
331 - html = i3GEO.arvoreDeTemas.montaTextoTemaWMS(node.data.url,retorno.data[i].nome,retorno.data[i].estilos[j].nome,retorno.data[i].estilos[j].titulo,retorno.data[i].srs.toString(),retorno.data[i].formatsinfo.toString(),retorno.data[i].version.toString(),retorno.data[i].formats.toString(),cor);  
332 - d = {html:html};  
333 - var tempNodeS = new YAHOO.widget.HTMLNode(d, tempNode, false,true); 342 + ns = retorno.data[i].estilos.length;
  343 + for (j=0;j<ns; j++){
  344 + tempNodeS = new YAHOO.widget.HTMLNode(
  345 + {
  346 + html:i3GEO.arvoreDeTemas.montaTextoTemaWMS(
  347 + node.data.url,
  348 + retorno.data[i].nome,
  349 + retorno.data[i].estilos[j].nome,
  350 + retorno.data[i].estilos[j].titulo,
  351 + retorno.data[i].srs.toString(),
  352 + retorno.data[i].formatsinfo.toString(),
  353 + retorno.data[i].version.toString(),
  354 + retorno.data[i].formats.toString(),
  355 + cor
  356 + )
  357 + },
  358 + tempNode,
  359 + false,
  360 + true
  361 + );
334 tempNode.isleaf = true; 362 tempNode.isleaf = true;
335 tempNodeS.enableHighlight = false; 363 tempNodeS.enableHighlight = false;
336 } 364 }
@@ -350,12 +378,13 @@ i3GEO.arvoreDeTemas = { @@ -350,12 +378,13 @@ i3GEO.arvoreDeTemas = {
350 Monta o texto que será mostrado ao lado de cada layer de um WMS, permitindo incluir o layer no mapa. 378 Monta o texto que será mostrado ao lado de cada layer de um WMS, permitindo incluir o layer no mapa.
351 */ 379 */
352 montaTextoTemaWMS: function(servico,layer,estilo,titulo,proj,formatoinfo,versao,formatoimg,cor){ 380 montaTextoTemaWMS: function(servico,layer,estilo,titulo,proj,formatoinfo,versao,formatoimg,cor){
353 - var html = "<td style='vertical-align:top;padding-top:5px;'><span ><input style='cursor:pointer;border:solid 0 white;' ";  
354 - var temp = function(){ 381 + var html,temp,adiciona;
  382 + html = "<td style='vertical-align:top;padding-top:5px;'><span ><input style='cursor:pointer;border:solid 0 white;' ";
  383 + temp = function(){
355 i3GEO.janela.fechaAguarde("ajaxredesenha"); 384 i3GEO.janela.fechaAguarde("ajaxredesenha");
356 i3GEO.atualiza(); 385 i3GEO.atualiza();
357 }; 386 };
358 - var adiciona = "javascript:i3GEO.janela.abreAguarde(\"ajaxredesenha\",\""+$trad("o1")+"\");this.checked=false;i3GEO.php.adicionaTemaWMS("+temp+","; 387 + adiciona = "javascript:i3GEO.janela.abreAguarde(\"ajaxredesenha\",\""+$trad("o1")+"\");this.checked=false;i3GEO.php.adicionaTemaWMS("+temp+",";
359 adiciona += "\""+servico+"\","; 388 adiciona += "\""+servico+"\",";
360 adiciona += "\""+layer+"\","; 389 adiciona += "\""+layer+"\",";
361 adiciona += "\""+estilo+"\","; 390 adiciona += "\""+estilo+"\",";
@@ -393,14 +422,15 @@ i3GEO.arvoreDeTemas = { @@ -393,14 +422,15 @@ i3GEO.arvoreDeTemas = {
393 */ 422 */
394 listaMenus: function(g_sid,g_locaplic,funcao) { 423 listaMenus: function(g_sid,g_locaplic,funcao) {
395 var retorno = function(retorno) { 424 var retorno = function(retorno) {
  425 + var c,m,i,k,jj,j;
396 if(i3GEO.arvoreDeTemas.IDSMENUS.length === 0) 426 if(i3GEO.arvoreDeTemas.IDSMENUS.length === 0)
397 - {i3GEO.arvoreDeTemas.MENUS = retorno.data;} 427 + {i3GEO.arvoreDeTemas.MENUS = retorno.data;}
398 else{ 428 else{
399 i3GEO.arvoreDeTemas.MENUS = []; 429 i3GEO.arvoreDeTemas.MENUS = [];
400 - var c = retorno.data.length;  
401 - var m = i3GEO.arvoreDeTemas.IDSMENUS.length;  
402 - for (var i=0, j=c; i<j; i++){  
403 - for (var k=0, jj=m; k<jj; k++){ 430 + c = retorno.data.length;
  431 + m = i3GEO.arvoreDeTemas.IDSMENUS.length;
  432 + for (i=0, j=c; i<j; i++){
  433 + for (k=0, jj=m; k<jj; k++){
404 if(retorno.data[i].idmenu == i3GEO.arvoreDeTemas.IDSMENUS[k]) 434 if(retorno.data[i].idmenu == i3GEO.arvoreDeTemas.IDSMENUS[k])
405 {i3GEO.arvoreDeTemas.MENUS.push(retorno.data[i]);} 435 {i3GEO.arvoreDeTemas.MENUS.push(retorno.data[i]);}
406 } 436 }
@@ -434,10 +464,10 @@ i3GEO.arvoreDeTemas = { @@ -434,10 +464,10 @@ i3GEO.arvoreDeTemas = {
434 if(funcao !== "") 464 if(funcao !== "")
435 {funcao.call();} 465 {funcao.call();}
436 }; 466 };
437 - var listasgrupos = "nao";  
438 if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD || i3GEO.arvoreDeTemas.FILTRAOGC) 467 if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD || i3GEO.arvoreDeTemas.FILTRAOGC)
439 - {listasgrupos = "sim";}  
440 - i3GEO.php.pegalistadegrupos(retorno,id_menu,listasgrupos); 468 + {i3GEO.php.pegalistadegrupos(retorno,id_menu,"sim");}
  469 + else
  470 + {i3GEO.php.pegalistadegrupos(retorno,id_menu,"nao");}
441 }, 471 },
442 /* 472 /*
443 Function: listaSubGrupos 473 Function: listaSubGrupos
@@ -595,28 +625,26 @@ i3GEO.arvoreDeTemas = { @@ -595,28 +625,26 @@ i3GEO.arvoreDeTemas = {
595 A opção de carga dinâmica dos nós filhos é definida para a montagem dos grupos. 625 A opção de carga dinâmica dos nós filhos é definida para a montagem dos grupos.
596 */ 626 */
597 montaArvore: function() { 627 montaArvore: function() {
598 - var currentIconMode; 628 + var newVal,currentIconMode,d,tempNode,retorno,nomeSis,root,insp,outrasOpcoes,dados,c,i,j,conteudo;
599 YAHOO.example.treeExample = function(){ 629 YAHOO.example.treeExample = function(){
600 function changeIconMode(){ 630 function changeIconMode(){
601 - var newVal = parseInt(this.value,10); 631 + newVal = parseInt(this.value,10);
602 if (newVal != currentIconMode) 632 if (newVal != currentIconMode)
603 {currentIconMode = newVal;} 633 {currentIconMode = newVal;}
604 buildTree(); 634 buildTree();
605 } 635 }
606 function buildTree(){ 636 function buildTree(){
607 i3GEO.arvoreDeTemas.ARVORE = new YAHOO.widget.TreeView(i3GEO.arvoreDeTemas.IDHTML); 637 i3GEO.arvoreDeTemas.ARVORE = new YAHOO.widget.TreeView(i3GEO.arvoreDeTemas.IDHTML);
608 - var root = i3GEO.arvoreDeTemas.ARVORE.getRoot();  
609 - var tempNode = new YAHOO.widget.TextNode('', root, false); 638 + tempNode = new YAHOO.widget.TextNode('',root,false);
610 tempNode.isLeaf = false; 639 tempNode.isLeaf = false;
611 tempNode.enableHighlight = false; 640 tempNode.enableHighlight = false;
612 } 641 }
613 buildTree(); 642 buildTree();
614 }(); 643 }();
615 - var d,tempNode,conteudo,retorno,nomeSis;  
616 - var root = i3GEO.arvoreDeTemas.ARVORE.getRoot();  
617 //opção de busca de temas 644 //opção de busca de temas
  645 + root = i3GEO.arvoreDeTemas.ARVORE.getRoot();
618 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.incluibusca === true){ 646 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.incluibusca === true){
619 - var insp = "<br><br><table><tr>"; 647 + insp = "<br><br><table><tr>";
620 insp += "<td><span style='font-size:12px'>&nbsp;"+$trad("a1")+" <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=31' >&nbsp;&nbsp;&nbsp;</a></span></td>"; 648 insp += "<td><span style='font-size:12px'>&nbsp;"+$trad("a1")+" <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=31' >&nbsp;&nbsp;&nbsp;</a></span></td>";
621 insp += "<td><input onclick='javascript:this.select();' class='digitar' type='text' id='i3geo_buscatema' size='15' value='' /></td>"; 649 insp += "<td><input onclick='javascript:this.select();' class='digitar' type='text' id='i3geo_buscatema' size='15' value='' /></td>";
622 insp += "<td><img class='tic' "; 650 insp += "<td><img class='tic' ";
@@ -625,32 +653,50 @@ i3GEO.arvoreDeTemas = { @@ -625,32 +653,50 @@ i3GEO.arvoreDeTemas = {
625 {insp += "style='top:4px;'";} 653 {insp += "style='top:4px;'";}
626 insp += " title='"+$trad("a1")+"' src='"+i3GEO.util.$im("branco.gif")+"' onclick='i3GEO.arvoreDeTemas.buscaTema(document.getElementById(\"i3geo_buscatema\").value)' style='cursor:pointer;top:2px;position:relative;' /></td>"; 654 insp += " title='"+$trad("a1")+"' src='"+i3GEO.util.$im("branco.gif")+"' onclick='i3GEO.arvoreDeTemas.buscaTema(document.getElementById(\"i3geo_buscatema\").value)' style='cursor:pointer;top:2px;position:relative;' /></td>";
627 insp += "</tr></table>&nbsp;"; 655 insp += "</tr></table>&nbsp;";
628 - d = {html:insp};  
629 - tempNode = new YAHOO.widget.HTMLNode(d, root, false,false); 656 + tempNode = new YAHOO.widget.HTMLNode(
  657 + {html:insp},
  658 + root,
  659 + false,
  660 + false
  661 + );
630 tempNode.enableHighlight = false; 662 tempNode.enableHighlight = false;
631 } 663 }
632 //icones com as outras opções 664 //icones com as outras opções
633 //conforme definido em i3GEO.arvoreDeTemas.OPCOESADICIONAIS 665 //conforme definido em i3GEO.arvoreDeTemas.OPCOESADICIONAIS
634 - var outrasOpcoes = i3GEO.arvoreDeTemas.outrasOpcoesHTML(); 666 + outrasOpcoes = i3GEO.arvoreDeTemas.outrasOpcoesHTML();
635 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.idonde !== "") 667 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.idonde !== "")
636 {document.getElementById(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.idonde).innerHTML = outrasOpcoes;} 668 {document.getElementById(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.idonde).innerHTML = outrasOpcoes;}
637 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.incluiArvore === true){ 669 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.incluiArvore === true){
638 - d = {html:outrasOpcoes+"&nbsp;<br>"};  
639 - tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); 670 + tempNode = new YAHOO.widget.HTMLNode(
  671 + {html:outrasOpcoes+"&nbsp;<br>"},
  672 + root,
  673 + false,
  674 + true
  675 + );
640 tempNode.enableHighlight = false; 676 tempNode.enableHighlight = false;
641 tempNode.isLeaf = true; 677 tempNode.isLeaf = true;
642 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.navegacaoDir === true){ 678 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.navegacaoDir === true){
643 retorno = function(){ 679 retorno = function(){
644 - conteudo = "&nbsp;"+$trad("a6")+" <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=32' >&nbsp;&nbsp;&nbsp;</a>";  
645 - d = {html:conteudo};  
646 - tempNode = new YAHOO.widget.HTMLNode(d,root, false,true); 680 + var drives,iglt,ig,drive;
  681 + tempNode = new YAHOO.widget.HTMLNode(
  682 + {
  683 + html:"&nbsp;"+$trad("a6")+" <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=32' >&nbsp;&nbsp;&nbsp;</a>"
  684 + },
  685 + root,
  686 + false,
  687 + true
  688 + );
647 tempNode.enableHighlight = false; 689 tempNode.enableHighlight = false;
648 - var drives = i3GEO.arvoreDeTemas.DRIVES;  
649 - var iglt = drives.length;  
650 - var ig=0; 690 + drives = i3GEO.arvoreDeTemas.DRIVES;
  691 + iglt = drives.length;
  692 + ig=0;
651 do{ 693 do{
652 - d = {html:drives[ig].nome,caminho:drives[ig].caminho};  
653 - var drive = new YAHOO.widget.HTMLNode(d, tempNode, false,true); 694 + drive = new YAHOO.widget.HTMLNode(
  695 + {html:drives[ig].nome,caminho:drives[ig].caminho},
  696 + tempNode,
  697 + false,
  698 + true
  699 + );
654 drive.enableHighlight = false; 700 drive.enableHighlight = false;
655 drive.setDynamicLoad(i3GEO.arvoreDeTemas.montaDir, 1); 701 drive.setDynamicLoad(i3GEO.arvoreDeTemas.montaDir, 1);
656 ig++; 702 ig++;
@@ -664,42 +710,63 @@ i3GEO.arvoreDeTemas = { @@ -664,42 +710,63 @@ i3GEO.arvoreDeTemas = {
664 //opções para abrir o sistema de administração 710 //opções para abrir o sistema de administração
665 // 711 //
666 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.navegacaoDir === true){ 712 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.navegacaoDir === true){
667 - conteudo = "<a href='../admin' target=blank >Sistema de administração</a>";  
668 - d = {html:conteudo,idmenu:""};  
669 - tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); 713 + tempNode = new YAHOO.widget.HTMLNode(
  714 + {
  715 + html:"<a href='../admin' target=blank >Sistema de administração</a>",
  716 + idmenu:""
  717 + },
  718 + root,
  719 + false,
  720 + true
  721 + );
670 tempNode.enableHighlight = false; 722 tempNode.enableHighlight = false;
671 - conteudo = "<a href='../admin/html/arvore.html' target=blank >Editor de menus</a>";  
672 - d = {html:conteudo,idmenu:""};  
673 - tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); 723 + tempNode = new YAHOO.widget.HTMLNode(
  724 + {
  725 + html:"<a href='../admin/html/arvore.html' target=blank >Editor de menus</a>",
  726 + idmenu:""
  727 + },
  728 + root,
  729 + false,
  730 + true
  731 + );
674 tempNode.enableHighlight = false; 732 tempNode.enableHighlight = false;
675 } 733 }
676 // 734 //
677 //wms 735 //wms
678 // 736 //
679 if(i3GEO.arvoreDeTemas.INCLUIWMS === true){ 737 if(i3GEO.arvoreDeTemas.INCLUIWMS === true){
680 - conteudo = "<b>&nbsp;OGC-WMS</b>"+" <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=33' >&nbsp;&nbsp;&nbsp;</a>";  
681 - d = {html:conteudo,idwms:"raiz"};  
682 - tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); 738 + tempNode = new YAHOO.widget.HTMLNode(
  739 + {
  740 + html:"<b>&nbsp;OGC-WMS</b>"+" <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=33' >&nbsp;&nbsp;&nbsp;</a>",
  741 + idwms:"raiz"
  742 + },
  743 + root,
  744 + false,
  745 + true
  746 + );
683 tempNode.enableHighlight = false; 747 tempNode.enableHighlight = false;
684 tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.listaWMS, 1); 748 tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.listaWMS, 1);
685 } 749 }
686 // 750 //
687 //adiciona na árvore a raiz de cada menu 751 //adiciona na árvore a raiz de cada menu
688 // 752 //
689 - var dados = i3GEO.arvoreDeTemas.MENUS;  
690 - var c = dados.length;  
691 - for (var i=0, j=c; i<j; i++) 753 + dados = i3GEO.arvoreDeTemas.MENUS;
  754 + c = dados.length;
  755 + for (i=0, j=c; i<j; i++)
692 { 756 {
693 - var desc = dados[i].desc;  
694 if(!dados[i].nomemenu) 757 if(!dados[i].nomemenu)
695 {dados[i].nomemenu = dados[i].idmenu;} 758 {dados[i].nomemenu = dados[i].idmenu;}
696 if(!dados[i].publicado){dados[i].publicado = "sim";} 759 if(!dados[i].publicado){dados[i].publicado = "sim";}
697 if(dados[i].publicado.toLowerCase() != "nao") 760 if(dados[i].publicado.toLowerCase() != "nao")
698 - {conteudo = "<b>&nbsp;<span title='"+desc+"'>"+dados[i].nomemenu+"</span>";} 761 + {conteudo = "<b>&nbsp;<span title='"+(dados[i].desc)+"'>"+dados[i].nomemenu+"</span>";}
699 else 762 else
700 {conteudo = "<b>&nbsp;<span title='nao publicado' style=color:red; >"+dados[i].nomemenu+"</span>";} 763 {conteudo = "<b>&nbsp;<span title='nao publicado' style=color:red; >"+dados[i].nomemenu+"</span>";}
701 - d = {html:conteudo,idmenu:dados[i].idmenu};  
702 - tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); 764 + tempNode = new YAHOO.widget.HTMLNode(
  765 + {html:conteudo,idmenu:dados[i].idmenu},
  766 + root,
  767 + false,
  768 + true
  769 + );
703 tempNode.enableHighlight = false; 770 tempNode.enableHighlight = false;
704 tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.montaGrupos, currentIconMode); 771 tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.montaGrupos, currentIconMode);
705 if(dados[i].status == "aberto") 772 if(dados[i].status == "aberto")
@@ -707,34 +774,45 @@ i3GEO.arvoreDeTemas = { @@ -707,34 +774,45 @@ i3GEO.arvoreDeTemas = {
707 } 774 }
708 if(i3GEO.arvoreDeTemas.INCLUISISTEMAS){ 775 if(i3GEO.arvoreDeTemas.INCLUISISTEMAS){
709 retorno = function(){ 776 retorno = function(){
  777 + var sis,iglt,tempNode,ig,nomeSis,sisNode,funcoes,tempf,ig2,abre,nomeFunc,funcNode;
710 try{ 778 try{
711 - var sis = i3GEO.arvoreDeTemas.SISTEMAS;  
712 - var iglt = sis.length;  
713 - conteudo = "<b>Sistemas</b>"+" <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=34' >&nbsp;&nbsp;&nbsp;</a>";  
714 - d = {html:conteudo};  
715 - tempNode = new YAHOO.widget.HTMLNode(d,root, false,true); 779 + sis = i3GEO.arvoreDeTemas.SISTEMAS;
  780 + iglt = sis.length;
  781 + tempNode = new YAHOO.widget.HTMLNode(
  782 + {
  783 + html:"<b>Sistemas</b>"+" <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=34' >&nbsp;&nbsp;&nbsp;</a>"
  784 + },
  785 + root,
  786 + false,
  787 + true
  788 + );
716 tempNode.enableHighlight = false; 789 tempNode.enableHighlight = false;
717 }catch(e){i3GEO.arvoreDeTemas.ARVORE.draw();return;} 790 }catch(e){i3GEO.arvoreDeTemas.ARVORE.draw();return;}
718 - var ig=0; 791 + ig=0;
719 do{ 792 do{
720 nomeSis = sis[ig].NOME; 793 nomeSis = sis[ig].NOME;
721 if(sis[ig].PUBLICADO){ 794 if(sis[ig].PUBLICADO){
722 if(sis[ig].PUBLICADO == "NAO" || sis[ig].PUBLICADO == "nao") 795 if(sis[ig].PUBLICADO == "NAO" || sis[ig].PUBLICADO == "nao")
723 {nomeSis = "<s>"+sis[ig].NOME+"</s>";} 796 {nomeSis = "<s>"+sis[ig].NOME+"</s>";}
724 } 797 }
725 - d = {html:nomeSis};  
726 - var sisNode = new YAHOO.widget.HTMLNode(d, tempNode, false,true); 798 + sisNode = new YAHOO.widget.HTMLNode(
  799 + {html:nomeSis},
  800 + tempNode,
  801 + false,
  802 + true
  803 + );
727 sisNode.enableHighlight = false; 804 sisNode.enableHighlight = false;
728 - var funcoes = sis[ig].FUNCOES;  
729 - var tempf = funcoes.length;  
730 - for (var ig2=0;ig2<tempf;ig2++){  
731 - var executar = funcoes[ig2].ABRIR;  
732 - var w = funcoes[ig2].W;  
733 - var h = funcoes[ig2].H;  
734 - var abre = "i3GEO.janela.cria('"+w+"px','"+h+"px','"+executar+"','','','Sistemas')";  
735 - var nomeFunc = "<a href='#' onclick=\""+abre+"\">"+funcoes[ig2].NOME+"</a>";  
736 - d = {html:nomeFunc};  
737 - var funcNode = new YAHOO.widget.HTMLNode(d, sisNode, false,true); 805 + funcoes = sis[ig].FUNCOES;
  806 + tempf = funcoes.length;
  807 + for (ig2=0;ig2<tempf;ig2++){
  808 + abre = "i3GEO.janela.cria('"+(funcoes[ig2].W)+"px','"+(funcoes[ig2].H)+"px','"+(funcoes[ig2].ABRIR)+"','','','Sistemas')";
  809 + nomeFunc = "<a href='#' onclick=\""+abre+"\">"+funcoes[ig2].NOME+"</a>";
  810 + funcNode = new YAHOO.widget.HTMLNode(
  811 + {html:nomeFunc},
  812 + sisNode,
  813 + false,
  814 + true
  815 + );
738 funcNode.enableHighlight = false; 816 funcNode.enableHighlight = false;
739 funcNode.isLeaf = true; 817 funcNode.isLeaf = true;
740 } 818 }
@@ -757,12 +835,12 @@ i3GEO.arvoreDeTemas = { @@ -757,12 +835,12 @@ i3GEO.arvoreDeTemas = {
757 A opção de carga dinâmica dos nós filhos é definida para a montagem dos sub-grupos. 835 A opção de carga dinâmica dos nós filhos é definida para a montagem dos sub-grupos.
758 */ 836 */
759 montaGrupos: function(node){ 837 montaGrupos: function(node){
760 - var mostra,d,tempNode,i;  
761 var temp=function(){ 838 var temp=function(){
762 - var grupos = i3GEO.arvoreDeTemas.GRUPOS.grupos;  
763 - var c = grupos.length - 3;  
764 - var raiz = grupos[c].temasraiz;  
765 - var nraiz = raiz.length; 839 + var grupos,c,raiz,nraiz,mostra,html,i,d;
  840 + grupos = i3GEO.arvoreDeTemas.GRUPOS.grupos;
  841 + c = grupos.length - 3;
  842 + raiz = grupos[c].temasraiz;
  843 + nraiz = raiz.length;
766 for (i=0;i<nraiz; i++){ 844 for (i=0;i<nraiz; i++){
767 mostra = true; 845 mostra = true;
768 if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD && raiz[i].download == "nao") 846 if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD && raiz[i].download == "nao")
@@ -770,9 +848,12 @@ i3GEO.arvoreDeTemas = { @@ -770,9 +848,12 @@ i3GEO.arvoreDeTemas = {
770 if(i3GEO.arvoreDeTemas.FILTRAOGC && raiz[i].ogc == "nao") 848 if(i3GEO.arvoreDeTemas.FILTRAOGC && raiz[i].ogc == "nao")
771 {mostra = false;} 849 {mostra = false;}
772 if(mostra){ 850 if(mostra){
773 - var html = i3GEO.arvoreDeTemas.montaTextoTema("gray",raiz[i]);  
774 - d = {html:html};  
775 - tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 851 + tempNode = new YAHOO.widget.HTMLNode(
  852 + {html:i3GEO.arvoreDeTemas.montaTextoTema("gray",raiz[i])},
  853 + node,
  854 + false,
  855 + true
  856 + );
776 tempNode.enableHighlight = false; 857 tempNode.enableHighlight = false;
777 tempNode.isLeaf = true; 858 tempNode.isLeaf = true;
778 } 859 }
@@ -814,23 +895,25 @@ i3GEO.arvoreDeTemas = { @@ -814,23 +895,25 @@ i3GEO.arvoreDeTemas = {
814 A opção de carga dinâmica dos nós filhos é definida para a montagem dos temas. 895 A opção de carga dinâmica dos nós filhos é definida para a montagem dos temas.
815 */ 896 */
816 montaSubGrupos: function(node){ 897 montaSubGrupos: function(node){
817 - var i,mostra,d,tempNode;  
818 var temp=function(){ 898 var temp=function(){
819 - var subgrupos = i3GEO.arvoreDeTemas.SUBGRUPOS.subgrupo;  
820 - var c = subgrupos.length;  
821 - var raiz = i3GEO.arvoreDeTemas.SUBGRUPOS.temasgrupo;  
822 - var nraiz = raiz.length; 899 + var i,c,mostra,d,html,tempNode,nraiz,subgrupos,raiz;
  900 + subgrupos = i3GEO.arvoreDeTemas.SUBGRUPOS.subgrupo;
  901 + c = subgrupos.length;
  902 + raiz = i3GEO.arvoreDeTemas.SUBGRUPOS.temasgrupo;
  903 + nraiz = raiz.length;
823 for (i=0;i<nraiz; i++){ 904 for (i=0;i<nraiz; i++){
824 mostra = true; 905 mostra = true;
825 if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD && raiz[i].download == "nao") 906 if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD && raiz[i].download == "nao")
826 {mostra = false;} 907 {mostra = false;}
827 if(i3GEO.arvoreDeTemas.FILTRAOGC && raiz[i].ogc == "nao") 908 if(i3GEO.arvoreDeTemas.FILTRAOGC && raiz[i].ogc == "nao")
828 {mostra = false;} 909 {mostra = false;}
829 -  
830 if(mostra){ 910 if(mostra){
831 - var html = i3GEO.arvoreDeTemas.montaTextoTema("gray",raiz[i]);  
832 - d = {html:html};  
833 - tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 911 + tempNode = new YAHOO.widget.HTMLNode(
  912 + {html:i3GEO.arvoreDeTemas.montaTextoTema("gray",raiz[i])},
  913 + node,
  914 + false,
  915 + true
  916 + );
834 tempNode.enableHighlight = false; 917 tempNode.enableHighlight = false;
835 tempNode.isLeaf = true; 918 tempNode.isLeaf = true;
836 } 919 }
@@ -871,13 +954,14 @@ i3GEO.arvoreDeTemas = { @@ -871,13 +954,14 @@ i3GEO.arvoreDeTemas = {
871 Monta a lista de temas de um nó. 954 Monta a lista de temas de um nó.
872 */ 955 */
873 montaTemas: function(node){ 956 montaTemas: function(node){
874 - var i,cor; 957 +
875 var temp=function(){ 958 var temp=function(){
876 - var temas = i3GEO.arvoreDeTemas.TEMAS.temas;  
877 - var c = temas.length; 959 + var i,cor,temas,c,mostra,tempNode;
  960 + temas = i3GEO.arvoreDeTemas.TEMAS.temas;
  961 + c = temas.length;
878 cor = "rgb(51, 102, 102)"; 962 cor = "rgb(51, 102, 102)";
879 for (i=0;i<c; i++){ 963 for (i=0;i<c; i++){
880 - var mostra = true; 964 + mostra = true;
881 if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD && temas[i].download == "nao") 965 if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD && temas[i].download == "nao")
882 {mostra = false;} 966 {mostra = false;}
883 if(i3GEO.arvoreDeTemas.FILTRAOGC && temas[i].ogc == "nao") 967 if(i3GEO.arvoreDeTemas.FILTRAOGC && temas[i].ogc == "nao")
@@ -888,9 +972,19 @@ i3GEO.arvoreDeTemas = { @@ -888,9 +972,19 @@ i3GEO.arvoreDeTemas = {
888 temas[i].nome = "<span title='nao publicado' style=color:red; >"+temas[i].nome+"</span>"; 972 temas[i].nome = "<span title='nao publicado' style=color:red; >"+temas[i].nome+"</span>";
889 } 973 }
890 } 974 }
891 - var htmli = i3GEO.arvoreDeTemas.montaTextoTema(cor,temas[i]);  
892 - var d = {nacessos:temas[i].nacessos,html:htmli,idtema:temas[i].tid,fonte:temas[i].link,ogc:temas[i].ogc,kmz:temas[i].kmz};  
893 - var tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 975 + tempNode = new YAHOO.widget.HTMLNode(
  976 + {
  977 + nacessos:temas[i].nacessos,
  978 + html:i3GEO.arvoreDeTemas.montaTextoTema(cor,temas[i]),
  979 + idtema:temas[i].tid,
  980 + fonte:temas[i].link,
  981 + ogc:temas[i].ogc,
  982 + kmz:temas[i].kmz
  983 + },
  984 + node,
  985 + false,
  986 + true
  987 + );
894 //tempNode.nowrap = true; 988 //tempNode.nowrap = true;
895 tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.propTemas, 1); 989 tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.propTemas, 1);
896 tempNode.isLeaf = false; 990 tempNode.isLeaf = false;
@@ -914,27 +1008,37 @@ i3GEO.arvoreDeTemas = { @@ -914,27 +1008,37 @@ i3GEO.arvoreDeTemas = {
914 node {node} - nó onde será criada a lista 1008 node {node} - nó onde será criada a lista
915 */ 1009 */
916 montaDir: function(node){ 1010 montaDir: function(node){
917 - var ig,d,conteudo;  
918 var montaLista = function(retorno) 1011 var montaLista = function(retorno)
919 { 1012 {
920 - var dirs = retorno.data.diretorios; 1013 + var ig,d,conteudo,dirs,tempNode,arquivos,nodeSHP;
  1014 + dirs = retorno.data.diretorios;
921 for (ig=0;ig<dirs.length;ig++) 1015 for (ig=0;ig<dirs.length;ig++)
922 { 1016 {
923 - conteudo = dirs[ig];  
924 - d = {html:conteudo,caminho:node.data.caminho+"/"+conteudo};  
925 - var tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 1017 + tempNode = new YAHOO.widget.HTMLNode(
  1018 + {
  1019 + html:dirs[ig],
  1020 + caminho:node.data.caminho+"/"+conteudo
  1021 + },
  1022 + node,
  1023 + false,
  1024 + true
  1025 + );
926 tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.montaDir, 1); 1026 tempNode.setDynamicLoad(i3GEO.arvoreDeTemas.montaDir, 1);
927 tempNode.enableHighlight = false; 1027 tempNode.enableHighlight = false;
928 } 1028 }
929 - var arquivos = retorno.data.arquivos; 1029 + arquivos = retorno.data.arquivos;
930 for (ig=0;ig<arquivos.length;ig++) 1030 for (ig=0;ig<arquivos.length;ig++)
931 { 1031 {
932 conteudo = arquivos[ig]; 1032 conteudo = arquivos[ig];
933 if(conteudo.search(".img") > 1 || conteudo.search(".tif") > 1 || conteudo.search(".TIF") > 1 || conteudo.search(".shp") > 1 || conteudo.search(".SHP") > 1) 1033 if(conteudo.search(".img") > 1 || conteudo.search(".tif") > 1 || conteudo.search(".TIF") > 1 || conteudo.search(".shp") > 1 || conteudo.search(".SHP") > 1)
934 { 1034 {
935 conteudo = "<a href='#' title='"+$trad("g2")+"' onclick='i3GEO.util.adicionaSHP(\""+node.data.caminho+"/"+conteudo+"\")' >"+conteudo+"</a>"; 1035 conteudo = "<a href='#' title='"+$trad("g2")+"' onclick='i3GEO.util.adicionaSHP(\""+node.data.caminho+"/"+conteudo+"\")' >"+conteudo+"</a>";
936 - d = {html:conteudo,caminho:node.data.caminho+"/"+conteudo};  
937 - var nodeSHP = new YAHOO.widget.HTMLNode(d, node, false,true); 1036 + nodeSHP = new YAHOO.widget.HTMLNode(
  1037 + {html:conteudo,caminho:node.data.caminho+"/"+conteudo},
  1038 + node,
  1039 + false,
  1040 + true
  1041 + );
938 nodeSHP.enableHighlight = false; 1042 nodeSHP.enableHighlight = false;
939 nodeSHP.isLeaf = true; 1043 nodeSHP.isLeaf = true;
940 } 1044 }
@@ -979,21 +1083,26 @@ i3GEO.arvoreDeTemas = { @@ -979,21 +1083,26 @@ i3GEO.arvoreDeTemas = {
979 node - {Object} - objeto com o nó que foi clicado 1083 node - {Object} - objeto com o nó que foi clicado
980 */ 1084 */
981 propTemas: function(node){ 1085 propTemas: function(node){
982 - var g_locaplic = i3GEO.arvoreDeTemas.LOCAPLIC;  
983 - var d,tempNode,html; 1086 + var d,tempNode,html,lkmini,lkmini1,lkgrcode,lkgrcode1,n,ogc;
984 if(node.data.fonte !== "" && node.data.fonte != " "){ 1087 if(node.data.fonte !== "" && node.data.fonte != " "){
985 - html = "<a title='' href='"+node.data.fonte+"' target='_blank' >Fonte</a>";  
986 - d = {html:html};  
987 - tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 1088 + tempNode = new YAHOO.widget.HTMLNode(
  1089 + {html:"<a title='' href='"+node.data.fonte+"' target='_blank' >Fonte</a>"},
  1090 + node,
  1091 + false,
  1092 + true
  1093 + );
988 tempNode.enableHighlight = false; 1094 tempNode.enableHighlight = false;
989 tempNode.isLeaf = true; 1095 tempNode.isLeaf = true;
990 } 1096 }
991 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.mini === true){ 1097 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.mini === true){
992 - var lkmini = g_locaplic+"/testamapfile.php?map="+node.data.idtema+".map&tipo=mini";  
993 - var lkmini1 = g_locaplic+"/testamapfile.php?map="+node.data.idtema+".map&tipo=grande";  
994 - html = "<a title='' onmouseover='i3GEO.ajuda.mostraJanela(\"<img src="+lkmini+" />\")' href='"+lkmini1+"' target='blank' >Miniatura</a>";  
995 - d = {html:html};  
996 - tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 1098 + lkmini = i3GEO.arvoreDeTemas.LOCAPLIC+"/testamapfile.php?map="+node.data.idtema+".map&tipo=mini";
  1099 + lkmini1 = i3GEO.arvoreDeTemas.LOCAPLIC+"/testamapfile.php?map="+node.data.idtema+".map&tipo=grande";
  1100 + tempNode = new YAHOO.widget.HTMLNode(
  1101 + {html:"<a title='' onmouseover='i3GEO.ajuda.mostraJanela(\"<img src="+lkmini+" />\")' href='"+lkmini1+"' target='blank' >Miniatura</a>"},
  1102 + node,
  1103 + false,
  1104 + true
  1105 + );
997 tempNode.enableHighlight = false; 1106 tempNode.enableHighlight = false;
998 tempNode.isLeaf = true; 1107 tempNode.isLeaf = true;
999 } 1108 }
@@ -1002,37 +1111,45 @@ i3GEO.arvoreDeTemas = { @@ -1002,37 +1111,45 @@ i3GEO.arvoreDeTemas = {
1002 html = "<a href='#' title='' onclick='i3GEO.tema.dialogo.abreKml(\""+node.data.idtema+"\",\"kml\")' >Kml</a>"; 1111 html = "<a href='#' title='' onclick='i3GEO.tema.dialogo.abreKml(\""+node.data.idtema+"\",\"kml\")' >Kml</a>";
1003 if (node.data.kmz == "sim") 1112 if (node.data.kmz == "sim")
1004 {html = "<a href='#' title='' onclick='i3GEO.tema.dialogo.abreKml(\""+node.data.idtema+"\",\"kmz\")' >Kml</a>";} 1113 {html = "<a href='#' title='' onclick='i3GEO.tema.dialogo.abreKml(\""+node.data.idtema+"\",\"kmz\")' >Kml</a>";}
1005 -  
1006 - d = {html:html};  
1007 - tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 1114 + tempNode = new YAHOO.widget.HTMLNode(
  1115 + {html:html},
  1116 + node,
  1117 + false,
  1118 + true
  1119 + );
1008 tempNode.enableHighlight = false; 1120 tempNode.enableHighlight = false;
1009 tempNode.isLeaf = true; 1121 tempNode.isLeaf = true;
1010 } 1122 }
1011 - var ogc = g_locaplic+"/ogc.php?tema="+node.data.idtema+"&service=wms&request=getcapabilities";  
1012 - html = "<a title='' href='"+ogc+"' target='blank' >WMS - OGC</a>";  
1013 - d = {html:html};  
1014 - tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 1123 + ogc = i3GEO.arvoreDeTemas.LOCAPLIC+"/ogc.php?tema="+node.data.idtema+"&service=wms&request=getcapabilities";
  1124 + tempNode = new YAHOO.widget.HTMLNode(
  1125 + {html:"<a title='' href='"+ogc+"' target='blank' >WMS - OGC</a>"},
  1126 + node,
  1127 + false,
  1128 + true
  1129 + );
1015 tempNode.enableHighlight = false; 1130 tempNode.enableHighlight = false;
1016 tempNode.isLeaf = true; 1131 tempNode.isLeaf = true;
1017 } 1132 }
1018 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.qrcode === true){ 1133 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.qrcode === true){
1019 - var lkgrcode = g_locaplic+"/pacotes/qrcode/php/qr_html.php?d="+g_locaplic+"/mobile/index.php?temasa="+node.data.idtema;  
1020 - var lkgrcode1 = g_locaplic+"/pacotes/qrcode/php/qr_img.php?d="+g_locaplic+"/mobile/index.php?temasa="+node.data.idtema;  
1021 - html = "<a title='' onmouseover='i3GEO.ajuda.mostraJanela(\"<img src="+lkgrcode1+" />\")' href='"+lkgrcode+"' target='blank' >Qrcode</a>";  
1022 - d = {html:html};  
1023 - tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 1134 + lkgrcode = i3GEO.arvoreDeTemas.LOCAPLIC+"/pacotes/qrcode/php/qr_html.php?d="+i3GEO.arvoreDeTemas.LOCAPLIC+"/mobile/index.php?temasa="+node.data.idtema;
  1135 + lkgrcode1 = i3GEO.arvoreDeTemas.LOCAPLIC+"/pacotes/qrcode/php/qr_img.php?d="+i3GEO.arvoreDeTemas.LOCAPLIC+"/mobile/index.php?temasa="+node.data.idtema;
  1136 + tempNode = new YAHOO.widget.HTMLNode(
  1137 + {html:"<a title='' onmouseover='i3GEO.ajuda.mostraJanela(\"<img src="+lkgrcode1+" />\")' href='"+lkgrcode+"' target='blank' >Qrcode</a>"},
  1138 + node,
  1139 + false,
  1140 + true
  1141 + );
1024 tempNode.enableHighlight = false; 1142 tempNode.enableHighlight = false;
1025 tempNode.isLeaf = true; 1143 tempNode.isLeaf = true;
1026 } 1144 }
1027 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.estrelas === true){ 1145 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.estrelas === true){
1028 - var n = parseInt(node.data.nacessos / (i3GEO.arvoreDeTemas.FATORESTRELA*1),10); 1146 + n = parseInt(node.data.nacessos / (i3GEO.arvoreDeTemas.FATORESTRELA*1),10);
1029 if(n >= 5){n = 5;} 1147 if(n >= 5){n = 5;}
1030 if(n > 0) 1148 if(n > 0)
1031 {html = "<img src='"+i3GEO.util.$im("e"+n+".png")+"'/>";} 1149 {html = "<img src='"+i3GEO.util.$im("e"+n+".png")+"'/>";}
1032 else 1150 else
1033 {html = "<img src='"+i3GEO.util.$im("e0.png")+"'/>";} 1151 {html = "<img src='"+i3GEO.util.$im("e0.png")+"'/>";}
1034 - d = {html:html};  
1035 - tempNode = new YAHOO.widget.HTMLNode(d, node, false,true); 1152 + tempNode = new YAHOO.widget.HTMLNode({html:html}, node, false,true);
1036 tempNode.enableHighlight = false; 1153 tempNode.enableHighlight = false;
1037 tempNode.isLeaf = true; 1154 tempNode.isLeaf = true;
1038 } 1155 }
@@ -1048,8 +1165,7 @@ i3GEO.arvoreDeTemas = { @@ -1048,8 +1165,7 @@ i3GEO.arvoreDeTemas = {
1048 {String} - html gerado 1165 {String} - html gerado
1049 */ 1166 */
1050 outrasOpcoesHTML: function(){ 1167 outrasOpcoesHTML: function(){
1051 - var ins = "";  
1052 - var t = 0; 1168 + var ins = "",t = 0;
1053 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.refresh === true){ 1169 if(i3GEO.arvoreDeTemas.OPCOESADICIONAIS.refresh === true){
1054 ins += "<td><img class='refresh' onclick='i3GEO.arvoreDeTemas.atualiza()' src='"+i3GEO.util.$im("branco.gif")+"' style='cursor:pointer;text-align:left' title='Refresh'/><td>"; 1170 ins += "<td><img class='refresh' onclick='i3GEO.arvoreDeTemas.atualiza()' src='"+i3GEO.util.$im("branco.gif")+"' style='cursor:pointer;text-align:left' title='Refresh'/><td>";
1055 t += 20; 1171 t += 20;
@@ -1090,10 +1206,11 @@ i3GEO.arvoreDeTemas = { @@ -1090,10 +1206,11 @@ i3GEO.arvoreDeTemas = {
1090 Desmarca todos os checkbox dos temas marcados na árvore. 1206 Desmarca todos os checkbox dos temas marcados na árvore.
1091 */ 1207 */
1092 desativaCheckbox: function(){ 1208 desativaCheckbox: function(){
1093 - var o = document.getElementById(i3GEO.arvoreDeTemas.ARVORE.id);  
1094 - var inputs = o.getElementsByTagName("input");  
1095 - var n = inputs.length;  
1096 - var i=0; 1209 + var o,inputs,n,i;
  1210 + o = document.getElementById(i3GEO.arvoreDeTemas.ARVORE.id);
  1211 + inputs = o.getElementsByTagName("input");
  1212 + n = inputs.length;
  1213 + i=0;
1097 do{ 1214 do{
1098 inputs[i].checked = false; 1215 inputs[i].checked = false;
1099 i++; 1216 i++;
@@ -1109,11 +1226,12 @@ i3GEO.arvoreDeTemas = { @@ -1109,11 +1226,12 @@ i3GEO.arvoreDeTemas = {
1109 {Array} - array com os códigos dos temas 1226 {Array} - array com os códigos dos temas
1110 */ 1227 */
1111 listaTemasAtivos: function(){ 1228 listaTemasAtivos: function(){
1112 - var o = document.getElementById(i3GEO.arvoreDeTemas.ARVORE.id);  
1113 - var inputs = o.getElementsByTagName("input");  
1114 - var n = inputs.length;  
1115 - var i=0;  
1116 - var lista = []; 1229 + var o,inputs,n,i,lista;
  1230 + o = document.getElementById(i3GEO.arvoreDeTemas.ARVORE.id);
  1231 + inputs = o.getElementsByTagName("input");
  1232 + n = inputs.length;
  1233 + i=0;
  1234 + lista = [];
1117 do{ 1235 do{
1118 if(inputs[i].checked === true) 1236 if(inputs[i].checked === true)
1119 {lista.push(inputs[i].value);} 1237 {lista.push(inputs[i].value);}
@@ -1132,26 +1250,25 @@ i3GEO.arvoreDeTemas = { @@ -1132,26 +1250,25 @@ i3GEO.arvoreDeTemas = {
1132 palavra {String} 1250 palavra {String}
1133 */ 1251 */
1134 buscaTema: function(palavra){ 1252 buscaTema: function(palavra){
1135 - var procurar = i3GEO.util.removeAcentos(palavra);  
1136 - var mostra,tempNode,d;  
1137 - var resultadoProcurar = function(retorno) 1253 + var busca,root,nodePalavra;
  1254 + resultadoProcurar = function(retorno)
1138 { 1255 {
  1256 + var mostra,tempNode,d,conta,ig,ngSgrupo,tempn,sg,ngTema,tempng,st,lk;
1139 if(!retorno.data) 1257 if(!retorno.data)
1140 {alert("Ocorreu um erro");} 1258 {alert("Ocorreu um erro");}
1141 else{ 1259 else{
1142 retorno = retorno.data; 1260 retorno = retorno.data;
1143 - var conta = 0; 1261 + conta = 0;
1144 if ((retorno != "erro") && (retorno !== undefined)){ 1262 if ((retorno != "erro") && (retorno !== undefined)){
1145 - var ig = retorno.length-1; 1263 + ig = retorno.length-1;
1146 if(ig >= 0){ 1264 if(ig >= 0){
1147 do{ 1265 do{
1148 - var ngSgrupo = retorno[ig].subgrupos;  
1149 - var tempn = ngSgrupo.length;  
1150 - for (var sg=0;sg<tempn;sg++){  
1151 - var nomeSgrupo = ngSgrupo[sg].subgrupo;  
1152 - var ngTema = ngSgrupo[sg].temas;  
1153 - var tempng = ngTema.length;  
1154 - for (var st=0;st<tempng;st++){ 1266 + ngSgrupo = retorno[ig].subgrupos;
  1267 + tempn = ngSgrupo.length;
  1268 + for (sg=0;sg<tempn;sg++){
  1269 + ngTema = ngSgrupo[sg].temas;
  1270 + tempng = ngTema.length;
  1271 + for (st=0;st<tempng;st++){
1155 mostra = true; 1272 mostra = true;
1156 if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD && ngTema[st].download == "nao") 1273 if(i3GEO.arvoreDeTemas.FILTRADOWNLOAD && ngTema[st].download == "nao")
1157 {mostra = false;} 1274 {mostra = false;}
@@ -1160,10 +1277,9 @@ i3GEO.arvoreDeTemas = { @@ -1160,10 +1277,9 @@ i3GEO.arvoreDeTemas = {
1160 1277
1161 if(mostra){ 1278 if(mostra){
1162 d = i3GEO.arvoreDeTemas.montaTextoTema("gray",ngTema[st]); 1279 d = i3GEO.arvoreDeTemas.montaTextoTema("gray",ngTema[st]);
1163 - var lk = "";  
1164 if ( ngTema[st].link != " ") 1280 if ( ngTema[st].link != " ")
1165 {lk = "<a href='"+ngTema[st].link+"' target='blank'>&nbsp;fonte</a>";} 1281 {lk = "<a href='"+ngTema[st].link+"' target='blank'>&nbsp;fonte</a>";}
1166 - d += "<td style='text-allign:left'> ("+nomeSgrupo+") "+lk+"</td>"; 1282 + d += "<td style='text-allign:left'> ("+(ngSgrupo[sg].subgrupo)+") "+lk+"</td>";
1167 tempNode = new YAHOO.widget.HTMLNode(d, nodePalavra, false,true); 1283 tempNode = new YAHOO.widget.HTMLNode(d, nodePalavra, false,true);
1168 tempNode.isLeaf = true; 1284 tempNode.isLeaf = true;
1169 tempNode.enableHighlight = false; 1285 tempNode.enableHighlight = false;
@@ -1187,23 +1303,26 @@ i3GEO.arvoreDeTemas = { @@ -1187,23 +1303,26 @@ i3GEO.arvoreDeTemas = {
1187 // 1303 //
1188 //funcao que será executada para buscar os temas 1304 //funcao que será executada para buscar os temas
1189 // 1305 //
1190 - var busca = function(){  
1191 - i3GEO.php.procurartemas(resultadoProcurar,procurar); 1306 + busca = function(){
  1307 + i3GEO.php.procurartemas(resultadoProcurar,i3GEO.util.removeAcentos(palavra));
1192 }; 1308 };
1193 // 1309 //
1194 //recolhe todos os nós e acrescenta um novo 1310 //recolhe todos os nós e acrescenta um novo
1195 // 1311 //
1196 i3GEO.arvoreDeTemas.ARVORE.collapseAll(); 1312 i3GEO.arvoreDeTemas.ARVORE.collapseAll();
1197 - var root = i3GEO.arvoreDeTemas.ARVORE.getRoot(); 1313 + root = i3GEO.arvoreDeTemas.ARVORE.getRoot();
1198 if(!i3GEO.arvoreDeTemas.ARVORE.getNodeByProperty("id","temasEncontrados")){ 1314 if(!i3GEO.arvoreDeTemas.ARVORE.getNodeByProperty("id","temasEncontrados")){
1199 - d = {html:"Temas encontrados",id:"temasEncontrados"};  
1200 - tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); 1315 + tempNode = new YAHOO.widget.HTMLNode(
  1316 + {html:"Temas encontrados",id:"temasEncontrados"},
  1317 + root,
  1318 + false,
  1319 + true
  1320 + );
1201 tempNode.enableHighlight = false; 1321 tempNode.enableHighlight = false;
1202 } 1322 }
1203 else 1323 else
1204 {tempNode = i3GEO.arvoreDeTemas.ARVORE.getNodeByProperty("id","temasEncontrados");} 1324 {tempNode = i3GEO.arvoreDeTemas.ARVORE.getNodeByProperty("id","temasEncontrados");}
1205 - d = {html:palavra};  
1206 - nodePalavra = new YAHOO.widget.HTMLNode(d, tempNode, false,true); 1325 + nodePalavra = new YAHOO.widget.HTMLNode({html:palavra}, tempNode, false,true);
1207 nodePalavra.enableHighlight = false; 1326 nodePalavra.enableHighlight = false;
1208 i3GEO.arvoreDeTemas.ARVORE.draw(); 1327 i3GEO.arvoreDeTemas.ARVORE.draw();
1209 tempNode.expand(); 1328 tempNode.expand();
@@ -1216,6 +1335,7 @@ i3GEO.arvoreDeTemas = { @@ -1216,6 +1335,7 @@ i3GEO.arvoreDeTemas = {
1216 Adiciona ao mapa os temas selecionados na árvore 1335 Adiciona ao mapa os temas selecionados na árvore
1217 */ 1336 */
1218 adicionaTemas: function(){ 1337 adicionaTemas: function(){
  1338 + var tsl,temp;
1219 // 1339 //
1220 //zera o contador de tempo 1340 //zera o contador de tempo
1221 // 1341 //
@@ -1225,14 +1345,14 @@ i3GEO.arvoreDeTemas = { @@ -1225,14 +1345,14 @@ i3GEO.arvoreDeTemas = {
1225 // 1345 //
1226 //pega os temas ativados na árvore de menus 1346 //pega os temas ativados na árvore de menus
1227 // 1347 //
1228 - var tsl = i3GEO.arvoreDeTemas.listaTemasAtivos(); 1348 + tsl = i3GEO.arvoreDeTemas.listaTemasAtivos();
1229 i3GEO.arvoreDeTemas.desativaCheckbox(); 1349 i3GEO.arvoreDeTemas.desativaCheckbox();
1230 // 1350 //
1231 //se forem encontrados temas ativos na árvore de menus, o mapa é redesenhado com a adição de novos temas 1351 //se forem encontrados temas ativos na árvore de menus, o mapa é redesenhado com a adição de novos temas
1232 // 1352 //
1233 if(tsl.length > 0){ 1353 if(tsl.length > 0){
1234 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1")); 1354 i3GEO.janela.abreAguarde("i3GEO.atualiza",$trad("o1"));
1235 - var temp = function(retorno){ 1355 + temp = function(retorno){
1236 i3GEO.janela.fechaAguarde("i3GEO.atualiza"); 1356 i3GEO.janela.fechaAguarde("i3GEO.atualiza");
1237 if(retorno.data.erro){ 1357 if(retorno.data.erro){
1238 alert(retorno.data.erro); 1358 alert(retorno.data.erro);
@@ -1285,9 +1405,10 @@ i3GEO.arvoreDeTemas = { @@ -1285,9 +1405,10 @@ i3GEO.arvoreDeTemas = {
1285 comboMenus: function(locaplic,funcaoOnchange,idDestino,idCombo,largura,altura){ 1405 comboMenus: function(locaplic,funcaoOnchange,idDestino,idCombo,largura,altura){
1286 i3GEO.configura.locaplic = locaplic; 1406 i3GEO.configura.locaplic = locaplic;
1287 var combo = function (retorno){ 1407 var combo = function (retorno){
1288 - var ob = retorno.data;  
1289 - var ins = "<select id='"+idCombo+"' SIZE="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"(this.value)' ><option value='' >Escolha um menu:</option>";  
1290 - for (var ig=0;ig<ob.length; ig++){ 1408 + var ob,ins,ig;
  1409 + ob = retorno.data;
  1410 + ins = "<select id='"+idCombo+"' SIZE="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"(this.value)' ><option value='' >Escolha um menu:</option>";
  1411 + for (ig=0;ig<ob.length; ig++){
1291 if(ob[ig].publicado != "nao" && ob[ig].publicado != "NAO"){ 1412 if(ob[ig].publicado != "nao" && ob[ig].publicado != "NAO"){
1292 if(ob[ig].nomemenu) 1413 if(ob[ig].nomemenu)
1293 {ins += "<option value="+ob[ig].idmenu+" >"+ob[ig].nomemenu+"</option>";} 1414 {ins += "<option value="+ob[ig].idmenu+" >"+ob[ig].nomemenu+"</option>";}
@@ -1323,8 +1444,9 @@ i3GEO.arvoreDeTemas = { @@ -1323,8 +1444,9 @@ i3GEO.arvoreDeTemas = {
1323 comboGruposMenu: function(locaplic,funcaoOnchange,idDestino,idCombo,largura,altura,id_menu){ 1444 comboGruposMenu: function(locaplic,funcaoOnchange,idDestino,idCombo,largura,altura,id_menu){
1324 i3GEO.configura.locaplic = locaplic; 1445 i3GEO.configura.locaplic = locaplic;
1325 var combo = function (retorno){ 1446 var combo = function (retorno){
1326 - var obGrupos = retorno.data;  
1327 - var ins = "<select id='"+idCombo+"' SIZE="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"(this.value)' ><option value='' >Escolha um grupo:</option>"; 1447 + var obGrupos,ins,ig;
  1448 + obGrupos = retorno.data;
  1449 + ins = "<select id='"+idCombo+"' SIZE="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"(this.value)' ><option value='' >Escolha um grupo:</option>";
1328 for (ig=0;ig<obGrupos.grupos.length; ig++){ 1450 for (ig=0;ig<obGrupos.grupos.length; ig++){
1329 if(obGrupos.grupos[ig].nome) 1451 if(obGrupos.grupos[ig].nome)
1330 {ins += "<option value="+obGrupos.grupos[ig].id_n1+" >"+obGrupos.grupos[ig].nome+"</option>";} 1452 {ins += "<option value="+obGrupos.grupos[ig].id_n1+" >"+obGrupos.grupos[ig].nome+"</option>";}
@@ -1359,9 +1481,10 @@ i3GEO.arvoreDeTemas = { @@ -1359,9 +1481,10 @@ i3GEO.arvoreDeTemas = {
1359 comboSubGruposMenu: function(locaplic,funcaoOnchange,idDestino,idCombo,idGrupo,largura,altura){ 1481 comboSubGruposMenu: function(locaplic,funcaoOnchange,idDestino,idCombo,idGrupo,largura,altura){
1360 if(idGrupo !== ""){ 1482 if(idGrupo !== ""){
1361 var combo = function(retorno){ 1483 var combo = function(retorno){
1362 - var ins = "<select id='"+idCombo+"' size="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"("+idGrupo+",this.value)' ><option value='' >Escolha um sub-grupo:</option>"; 1484 + var ins,sg,ig;
  1485 + ins = "<select id='"+idCombo+"' size="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"("+idGrupo+",this.value)' ><option value='' >Escolha um sub-grupo:</option>";
1363 if (retorno.data.subgrupo){ 1486 if (retorno.data.subgrupo){
1364 - var sg = retorno.data.subgrupo; 1487 + sg = retorno.data.subgrupo;
1365 for (ig=0;ig<sg.length; ig++){ 1488 for (ig=0;ig<sg.length; ig++){
1366 ins += "<option value="+sg[ig].id_n2+" >"+sg[ig].nome+"</option>"; 1489 ins += "<option value="+sg[ig].id_n2+" >"+sg[ig].nome+"</option>";
1367 } 1490 }
@@ -1400,9 +1523,10 @@ i3GEO.arvoreDeTemas = { @@ -1400,9 +1523,10 @@ i3GEO.arvoreDeTemas = {
1400 */ 1523 */
1401 comboTemasMenu: function(locaplic,funcaoOnchange,idDestino,idCombo,idGrupo,idSubGrupo,largura,altura,id_menu){ 1524 comboTemasMenu: function(locaplic,funcaoOnchange,idDestino,idCombo,idGrupo,idSubGrupo,largura,altura,id_menu){
1402 var combo = function(retorno){ 1525 var combo = function(retorno){
1403 - var ins = "<select id='"+idCombo+"' size="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"("+idGrupo+","+idSubGrupo+",this.value)' ><option value='' >Escolha um tema:</option>"; 1526 + var ins,sg,ig;
  1527 + ins = "<select id='"+idCombo+"' size="+altura+" style=width:"+largura+"px onchange='"+funcaoOnchange+"("+idGrupo+","+idSubGrupo+",this.value)' ><option value='' >Escolha um tema:</option>";
1404 if (retorno.data.temas[i]){ 1528 if (retorno.data.temas[i]){
1405 - var sg = retorno.data.temas; 1529 + sg = retorno.data.temas;
1406 for (ig=0;ig<sg.length; ig++){ 1530 for (ig=0;ig<sg.length; ig++){
1407 ins += "<option value="+sg[ig].tid+" >"+sg[ig].nome+"</option>"; 1531 ins += "<option value="+sg[ig].tid+" >"+sg[ig].nome+"</option>";
1408 } 1532 }
@@ -1448,10 +1572,15 @@ i3GEO.arvoreDeTemas = { @@ -1448,10 +1572,15 @@ i3GEO.arvoreDeTemas = {
1448 Abre a janela para adicionar temas tendo como fonte um web service do tipo wms-t (time) 1572 Abre a janela para adicionar temas tendo como fonte um web service do tipo wms-t (time)
1449 */ 1573 */
1450 conectarwmst: function(){ 1574 conectarwmst: function(){
1451 - var l = 400;  
1452 - var a = 350;  
1453 - if(i3GEO.parametros.w){l = i3GEO.parametros.w + 150;}  
1454 - if(i3GEO.parametros.h){a = i3GEO.parametros.h + 200;} 1575 + var l,a;
  1576 + if(i3GEO.parametros.w)
  1577 + {l = i3GEO.parametros.w + 150;}
  1578 + else
  1579 + {l = 400;}
  1580 + if(i3GEO.parametros.h)
  1581 + {a = i3GEO.parametros.h + 200;}
  1582 + else
  1583 + {a = 350;}
1455 i3GEO.janela.cria(l/2 + "px",a/2 + "px",i3GEO.configura.locaplic+"/ferramentas/wmstime/index.htm","","","Conexão WMS-T <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=76' >&nbsp;&nbsp;&nbsp;</a>"); 1584 i3GEO.janela.cria(l/2 + "px",a/2 + "px",i3GEO.configura.locaplic+"/ferramentas/wmstime/index.htm","","","Conexão WMS-T <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=4&idajuda=76' >&nbsp;&nbsp;&nbsp;</a>");
1456 }, 1585 },
1457 /* 1586 /*
classesjs/classe_barradebotoes.js
@@ -190,9 +190,9 @@ i3GEO.barraDeBotoes = { @@ -190,9 +190,9 @@ i3GEO.barraDeBotoes = {
190 icone {String} - id do icone que será ativado. Esse id é o mesmo definido em LISTABOTOES 190 icone {String} - id do icone que será ativado. Esse id é o mesmo definido em LISTABOTOES
191 */ 191 */
192 ativaIcone: function(icone){ 192 ativaIcone: function(icone){
  193 + var estilo,temp,ist,cor,ko;
193 i3GEO.barraDeBotoes.BOTAOCLICADO = icone; 194 i3GEO.barraDeBotoes.BOTAOCLICADO = icone;
194 - var ko = i3GEO.barraDeBotoes.LISTABOTOES.length-1;  
195 - var estilo,temp,ist,cor; 195 + ko = i3GEO.barraDeBotoes.LISTABOTOES.length-1;
196 if(i3GEO.barraDeBotoes.COMPORTAMENTO == "padrao"){ 196 if(i3GEO.barraDeBotoes.COMPORTAMENTO == "padrao"){
197 if(ko >= 0){ 197 if(ko >= 0){
198 do{ 198 do{
@@ -281,11 +281,12 @@ i3GEO.barraDeBotoes = { @@ -281,11 +281,12 @@ i3GEO.barraDeBotoes = {
281 O nome do botao deve estar em LISTABOTOES na propriedade iddiv 281 O nome do botao deve estar em LISTABOTOES na propriedade iddiv
282 */ 282 */
283 ativaBotoes:function(padrao){ 283 ativaBotoes:function(padrao){
  284 + var l,b;
284 if(arguments.length === 0) 285 if(arguments.length === 0)
285 {padrao = i3GEO.barraDeBotoes.BOTAOPADRAO;} 286 {padrao = i3GEO.barraDeBotoes.BOTAOPADRAO;}
286 i3GEO.barraDeBotoes.BOTAOCLICADO = padrao; 287 i3GEO.barraDeBotoes.BOTAOCLICADO = padrao;
287 - var l = i3GEO.barraDeBotoes.LISTABOTOES;  
288 - var b = l.length-1; 288 + l = i3GEO.barraDeBotoes.LISTABOTOES;
  289 + b = l.length-1;
289 if (b >= 0){ 290 if (b >= 0){
290 do{ 291 do{
291 if ($i(l[b].iddiv)){ 292 if ($i(l[b].iddiv)){
@@ -340,10 +341,10 @@ i3GEO.barraDeBotoes = { @@ -340,10 +341,10 @@ i3GEO.barraDeBotoes = {
340 y {Numeric} - posição y (pixels) da barra em relação ao mapa 341 y {Numeric} - posição y (pixels) da barra em relação ao mapa
341 */ 342 */
342 inicializaBarra:function(idconteudo,idconteudonovo,barraZoom,x,y){ 343 inicializaBarra:function(idconteudo,idconteudonovo,barraZoom,x,y){
343 - var numerobotoes,i,temp,elementos,nelementos,e;  
344 - var wj = "36px";  
345 - var recuo = "0px";  
346 - var novoel = document.createElement("div"); 344 + var tipo,mostra,numerobotoes,i,temp,elementos,nelementos,e,wj,recuo,novoel,alturadisponivel;
  345 + wj = "36px";
  346 + recuo = "0px";
  347 + novoel = document.createElement("div");
347 novoel.id = idconteudonovo; 348 novoel.id = idconteudonovo;
348 novoel.style.display="block"; 349 novoel.style.display="block";
349 if(i3GEO.barraDeBotoes.SOICONES === false){ 350 if(i3GEO.barraDeBotoes.SOICONES === false){
@@ -396,7 +397,7 @@ i3GEO.barraDeBotoes = { @@ -396,7 +397,7 @@ i3GEO.barraDeBotoes = {
396 if(elementos[0].id == "sobeferramentas"){ 397 if(elementos[0].id == "sobeferramentas"){
397 try{ 398 try{
398 elementos = $i(idconteudonovo+"_").getElementsByTagName("div"); 399 elementos = $i(idconteudonovo+"_").getElementsByTagName("div");
399 - var alturadisponivel = i3GEO.parametros.h - 4; 400 + alturadisponivel = i3GEO.parametros.h - 4;
400 numerobotoes = parseInt(alturadisponivel / 30,10); 401 numerobotoes = parseInt(alturadisponivel / 30,10);
401 nelementos = elementos.length; 402 nelementos = elementos.length;
402 i = 0; 403 i = 0;
@@ -451,8 +452,8 @@ i3GEO.barraDeBotoes = { @@ -451,8 +452,8 @@ i3GEO.barraDeBotoes = {
451 if(elementos[1].style.display == "inline" && elementos[1].id === "") 452 if(elementos[1].style.display == "inline" && elementos[1].id === "")
452 {return;} 453 {return;}
453 if(nelementos > 0){ 454 if(nelementos > 0){
454 - var mostra = elementos[0];  
455 - var i = 0; 455 + mostra = elementos[0];
  456 + i = 0;
456 do{ 457 do{
457 if(elementos[i].style){ 458 if(elementos[i].style){
458 if(elementos[i].style.display == "inline" && elementos[i].id === "") 459 if(elementos[i].style.display == "inline" && elementos[i].id === "")
@@ -481,7 +482,7 @@ i3GEO.barraDeBotoes = { @@ -481,7 +482,7 @@ i3GEO.barraDeBotoes = {
481 } 482 }
482 if($i("desceferramentas")){ 483 if($i("desceferramentas")){
483 $i("desceferramentas").onclick = function(){ 484 $i("desceferramentas").onclick = function(){
484 - var tipo = "inline"; 485 + tipo = "inline";
485 if($i(idconteudonovo+"_")){ 486 if($i(idconteudonovo+"_")){
486 elementos = $i(idconteudonovo+"_").getElementsByTagName("div"); 487 elementos = $i(idconteudonovo+"_").getElementsByTagName("div");
487 if(elementos[elementos.length - 1].style.display == tipo) 488 if(elementos[elementos.length - 1].style.display == tipo)
@@ -541,9 +542,10 @@ i3GEO.barraDeBotoes = { @@ -541,9 +542,10 @@ i3GEO.barraDeBotoes = {
541 idbarra - {string} id da barra de botões onde o evento será ativado 542 idbarra - {string} id da barra de botões onde o evento será ativado
542 */ 543 */
543 ativaMenuContexto: function(idbarra){ 544 ativaMenuContexto: function(idbarra){
  545 + var oFieldContextMenuItemData,oFieldContextMenu,onFieldMenuRender,id;
544 function executar(a,b,c) 546 function executar(a,b,c)
545 {eval(c);} 547 {eval(c);}
546 - var oFieldContextMenuItemData = [ 548 + oFieldContextMenuItemData = [
547 { text: "&nbsp;<span class='container-close'></span>"}, 549 { text: "&nbsp;<span class='container-close'></span>"},
548 { text: "Fechar barra", onclick: { fn: executar, obj: "i3GEO.barraDeBotoes.fecha('"+idbarra+"')" } }, 550 { text: "Fechar barra", onclick: { fn: executar, obj: "i3GEO.barraDeBotoes.fecha('"+idbarra+"')" } },
549 { text: "Barra normal", onclick: { fn: executar, obj:"i3GEO.barraDeBotoes.AUTOALTURA=false;i3GEO.barraDeBotoes.PERMITEFECHAR=true;i3GEO.barraDeBotoes.PERMITEDESLOCAR=true;i3GEO.barraDeBotoes.recria('"+idbarra+"')" } }, 551 { text: "Barra normal", onclick: { fn: executar, obj:"i3GEO.barraDeBotoes.AUTOALTURA=false;i3GEO.barraDeBotoes.PERMITEFECHAR=true;i3GEO.barraDeBotoes.PERMITEDESLOCAR=true;i3GEO.barraDeBotoes.recria('"+idbarra+"')" } },
@@ -551,14 +553,14 @@ i3GEO.barraDeBotoes = { @@ -551,14 +553,14 @@ i3GEO.barraDeBotoes = {
551 { text: "Remove transição", onclick: { fn: executar, obj:"i3GEO.barraDeBotoes.TRANSICAOSUAVE=false;" } }, 553 { text: "Remove transição", onclick: { fn: executar, obj:"i3GEO.barraDeBotoes.TRANSICAOSUAVE=false;" } },
552 { text: "Ativa transição", onclick: { fn: executar, obj:"i3GEO.barraDeBotoes.TRANSICAOSUAVE=true;" } } 554 { text: "Ativa transição", onclick: { fn: executar, obj:"i3GEO.barraDeBotoes.TRANSICAOSUAVE=true;" } }
553 ]; 555 ];
554 - var oFieldContextMenu = new YAHOO.widget.ContextMenu( 556 + oFieldContextMenu = new YAHOO.widget.ContextMenu(
555 "contexto_"+idbarra,{ 557 "contexto_"+idbarra,{
556 trigger: idbarra, 558 trigger: idbarra,
557 itemdata: oFieldContextMenuItemData, 559 itemdata: oFieldContextMenuItemData,
558 lazyload: true 560 lazyload: true
559 } 561 }
560 ); 562 );
561 - var onFieldMenuRender = function(){ 563 + onFieldMenuRender = function(){
562 eval("var id = 'contexto_"+idbarra+"'"); 564 eval("var id = 'contexto_"+idbarra+"'");
563 $i(id).style.zIndex = 50000; 565 $i(id).style.zIndex = 50000;
564 }; 566 };
@@ -579,10 +581,11 @@ i3GEO.barraDeBotoes = { @@ -579,10 +581,11 @@ i3GEO.barraDeBotoes = {
579 as barras Se não for definido, todas as barras serão reativadas 581 as barras Se não for definido, todas as barras serão reativadas
580 */ 582 */
581 reativa: function(indice){ 583 reativa: function(indice){
  584 + var n,i;
582 if(arguments.length == 1) 585 if(arguments.length == 1)
583 {i3GEO.barraDeBotoes.BARRAS[indice].show();} 586 {i3GEO.barraDeBotoes.BARRAS[indice].show();}
584 else{ 587 else{
585 - var n = i3GEO.barraDeBotoes.BARRAS.length; 588 + n = i3GEO.barraDeBotoes.BARRAS.length;
586 for(i=0;i<n;i++) 589 for(i=0;i<n;i++)
587 {i3GEO.barraDeBotoes.BARRAS[i].show();} 590 {i3GEO.barraDeBotoes.BARRAS[i].show();}
588 } 591 }
@@ -597,20 +600,21 @@ i3GEO.barraDeBotoes = { @@ -597,20 +600,21 @@ i3GEO.barraDeBotoes = {
597 id {String} - id da barra 600 id {String} - id da barra
598 */ 601 */
599 recria: function(id){ 602 recria: function(id){
600 - var n = i3GEO.barraDeBotoes.BARRAS.length; 603 + var n,temp,novoel,barraZoom,x,y;
  604 + n = i3GEO.barraDeBotoes.BARRAS.length;
601 for(i=0;i<n;i++){ 605 for(i=0;i<n;i++){
602 if(i3GEO.barraDeBotoes.BARRAS[i].id == id){ 606 if(i3GEO.barraDeBotoes.BARRAS[i].id == id){
603 //remove o menu de contexto 607 //remove o menu de contexto
604 - var temp = $i("contexto_"+id); 608 + temp = $i("contexto_"+id);
605 if(temp){ 609 if(temp){
606 temp.parentNode.removeChild(temp); 610 temp.parentNode.removeChild(temp);
607 } 611 }
608 - var novoel = document.createElement("div"); 612 + novoel = document.createElement("div");
609 novoel.id = "barraTemporaria"+i; 613 novoel.id = "barraTemporaria"+i;
610 novoel.innerHTML = $i(i3GEO.barraDeBotoes.BARRAS[i].id+"_").innerHTML; 614 novoel.innerHTML = $i(i3GEO.barraDeBotoes.BARRAS[i].id+"_").innerHTML;
611 document.body.appendChild(novoel); 615 document.body.appendChild(novoel);
612 //verifica se tem o slide de zoom 616 //verifica se tem o slide de zoom
613 - var barraZoom = false; 617 + barraZoom = false;
614 temp = $i("vertMaisZoom"); 618 temp = $i("vertMaisZoom");
615 if(temp){ 619 if(temp){
616 if(navm) 620 if(navm)
@@ -620,8 +624,8 @@ i3GEO.barraDeBotoes = { @@ -620,8 +624,8 @@ i3GEO.barraDeBotoes = {
620 if(temp.id == id) 624 if(temp.id == id)
621 {barraZoom = true;} 625 {barraZoom = true;}
622 } 626 }
623 - var x = parseInt($i(i3GEO.barraDeBotoes.BARRAS[i].id+"_c").style.left,10);  
624 - var y = parseInt($i(i3GEO.Interface.IDCORPO).style.top,10)+10;//parseInt($i(i3GEO.barraDeBotoes.BARRAS[i].id+"_c").style.top); 627 + x = parseInt($i(i3GEO.barraDeBotoes.BARRAS[i].id+"_c").style.left,10);
  628 + y = parseInt($i(i3GEO.Interface.IDCORPO).style.top,10)+10;//parseInt($i(i3GEO.barraDeBotoes.BARRAS[i].id+"_c").style.top);
625 i3GEO.barraDeBotoes.BARRAS[i].destroy(); 629 i3GEO.barraDeBotoes.BARRAS[i].destroy();
626 i3GEO.barraDeBotoes.inicializaBarra(novoel.id,i3GEO.barraDeBotoes.BARRAS[i].id+"x",barraZoom,x,y); 630 i3GEO.barraDeBotoes.inicializaBarra(novoel.id,i3GEO.barraDeBotoes.BARRAS[i].id+"x",barraZoom,x,y);
627 } 631 }
classesjs/classe_calculo.js
@@ -58,15 +58,16 @@ i3GEO.calculo = { @@ -58,15 +58,16 @@ i3GEO.calculo = {
58 { 58 {
59 //YAHOO.log("dms2dd", "i3geo"); 59 //YAHOO.log("dms2dd", "i3geo");
60 //converte dms em dd 60 //converte dms em dd
61 - var sinal = 'positivo'; 61 + var sinal,spm,mpg,dd;
  62 + sinal = 'positivo';
62 if (cd < 0) 63 if (cd < 0)
63 { 64 {
64 cd = cd * -1; 65 cd = cd * -1;
65 sinal = 'negativo'; 66 sinal = 'negativo';
66 } 67 }
67 - var spm = cs / 3600;  
68 - var mpg = cm / 60;  
69 - var dd = (cd * 1) + (mpg * 1) + (spm * 1); 68 + spm = cs / 3600;
  69 + mpg = cm / 60;
  70 + dd = (cd * 1) + (mpg * 1) + (spm * 1);
70 if (sinal == 'negativo') 71 if (sinal == 'negativo')
71 {dd = dd * -1;} 72 {dd = dd * -1;}
72 //YAHOO.log("Fim dms2dd", "i3geo"); 73 //YAHOO.log("Fim dms2dd", "i3geo");
@@ -97,11 +98,11 @@ i3GEO.calculo = { @@ -97,11 +98,11 @@ i3GEO.calculo = {
97 */ 98 */
98 dd2tela: function (vx,vy,docmapa,ext,cellsize){ 99 dd2tela: function (vx,vy,docmapa,ext,cellsize){
99 try{ 100 try{
100 - var pos; 101 + var pos,latlng,xyn,dc,imgext,c,xy;
101 if(i3GEO.Interface.ATUAL == "googlemaps"){ 102 if(i3GEO.Interface.ATUAL == "googlemaps"){
102 pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); 103 pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));
103 - var latlng = new GLatLng(vy,vx);  
104 - var xyn = i3GeoMap.fromLatLngToContainerPixel(latlng); 104 + latlng = new GLatLng(vy,vx);
  105 + xyn = i3GeoMap.fromLatLngToContainerPixel(latlng);
105 xy = []; 106 xy = [];
106 return [(xyn.x)+pos[0],(xyn.y)+pos[1]]; 107 return [(xyn.x)+pos[0],(xyn.y)+pos[1]];
107 } 108 }
@@ -120,13 +121,13 @@ i3GEO.calculo = { @@ -120,13 +121,13 @@ i3GEO.calculo = {
120 121
121 if(!docmapa) 122 if(!docmapa)
122 {docmapa = window.document;} 123 {docmapa = window.document;}
123 - var dc = docmapa; 124 + dc = docmapa;
124 pos = i3GEO.util.pegaPosicaoObjeto(dc); 125 pos = i3GEO.util.pegaPosicaoObjeto(dc);
125 - var imgext = ext; //i3GEO.parametros.mapexten; 126 + imgext = ext; //i3GEO.parametros.mapexten;
126 imgext = imgext.split(" "); 127 imgext = imgext.split(" ");
127 vx = (vx * 1) - (imgext[0] * 1); 128 vx = (vx * 1) - (imgext[0] * 1);
128 vy = (vy * -1) + (imgext[3] * 1); 129 vy = (vy * -1) + (imgext[3] * 1);
129 - var c = cellsize * 1; 130 + c = cellsize * 1;
130 //var xy = []; 131 //var xy = [];
131 return [(vx / c) + pos[0],(vy / c) + pos[1]]; 132 return [(vx / c) + pos[0],(vy / c) + pos[1]];
132 } 133 }
@@ -148,66 +149,46 @@ i3GEO.calculo = { @@ -148,66 +149,46 @@ i3GEO.calculo = {
148 {Array} - Array com o valor de x [0] e y [1] no formato dd mm ss 149 {Array} - Array com o valor de x [0] e y [1] no formato dd mm ss
149 */ 150 */
150 dd2dms: function(x,y){ 151 dd2dms: function(x,y){
151 - var restod,mx,sx,mm,restos,my,sy;  
152 - var m = 0;  
153 - var s = 0;  
154 - var dx = parseInt(x,10); 152 + var restod,mx,sx,mm,restos,my,sy,s,dx,dy;
  153 + dx = parseInt(x,10);
155 if (dx > 0) 154 if (dx > 0)
156 {restod = x - dx;} 155 {restod = x - dx;}
157 if (dx < 0) 156 if (dx < 0)
158 {restod = (x * -1) - (dx * -1);} 157 {restod = (x * -1) - (dx * -1);}
159 - dx = dx;  
160 if (restod !== 0){ 158 if (restod !== 0){
161 mm = restod * 60; 159 mm = restod * 60;
162 - m = parseInt(restod * 60,10);  
163 - restos = mm - m;  
164 - mx = m; 160 + mx = parseInt(restod * 60,10);
  161 + restos = mm - mx;
165 if (restos !== 0){ 162 if (restos !== 0){
166 s = restos * 60; 163 s = restos * 60;
167 s = (s+"_").substring(0,5); 164 s = (s+"_").substring(0,5);
168 sx = s; 165 sx = s;
169 } 166 }
170 - else{s = "00.00";}  
171 } 167 }
172 else{ 168 else{
173 mx = "00"; 169 mx = "00";
174 sx = "00.00"; 170 sx = "00.00";
175 } 171 }
176 - if (m.length == 2){m = "0"+m+"";}  
177 - if (s*1 < 10){s = "0"+s;}  
178 - var xv = dx+" "+mx+" "+sx;  
179 - m = 0;  
180 - s = 0;  
181 - var dy = parseInt(y,10); 172 + dy = parseInt(y,10);
182 if (dy > 0) 173 if (dy > 0)
183 {restod = y - dy;} 174 {restod = y - dy;}
184 if (dy < 0) 175 if (dy < 0)
185 {restod = (y * -1) - (dy * -1);} 176 {restod = (y * -1) - (dy * -1);}
186 - dy = dy;  
187 if (restod !== 0){ 177 if (restod !== 0){
188 mm = restod * 60; 178 mm = restod * 60;
189 - m = parseInt(restod * 60,10);  
190 - restos = mm - m;  
191 - my = m; 179 + my = parseInt(restod * 60,10);
  180 + restos = mm - my;
192 if (restos !== 0){ 181 if (restos !== 0){
193 s = restos * 60; 182 s = restos * 60;
194 s = (s+"_").substring(0,5); 183 s = (s+"_").substring(0,5);
195 sy = s; 184 sy = s;
196 } 185 }
197 - else { s = "00.00";}  
198 } 186 }
199 else{ 187 else{
200 my = "00"; 188 my = "00";
201 sy = "00.00"; 189 sy = "00.00";
202 } 190 }
203 - if (m.length == 2){m = "0"+m;}  
204 - if (s*1 < 10)  
205 - {s = "0"+s;}  
206 - var yv = dy+" "+my+" "+sy;  
207 - var res = [];  
208 - res[0] = xv;  
209 - res[1] = yv;  
210 - return res; 191 + return [dx+" "+mx+" "+sx,dy+" "+my+" "+sy];
211 }, 192 },
212 /* 193 /*
213 Function: tela2dd 194 Function: tela2dd
@@ -231,6 +212,7 @@ i3GEO.calculo = { @@ -231,6 +212,7 @@ i3GEO.calculo = {
231 tela2dd: function(xfign,yfign,g_celula,imgext){ 212 tela2dd: function(xfign,yfign,g_celula,imgext){
232 try 213 try
233 { 214 {
  215 + var amext,longdd,latdd;
234 if (navm){ 216 if (navm){
235 xfign = xfign - 2.2; 217 xfign = xfign - 2.2;
236 yfign = yfign - 2.7; 218 yfign = yfign - 2.7;
@@ -239,15 +221,10 @@ i3GEO.calculo = { @@ -239,15 +221,10 @@ i3GEO.calculo = {
239 xfign = xfign - 0.12; 221 xfign = xfign - 0.12;
240 yfign = yfign - 1.05; 222 yfign = yfign - 1.05;
241 } 223 }
242 - var nx = g_celula * xfign;  
243 - var ny = g_celula * yfign;  
244 - var amext = imgext.split(" ");  
245 - var longdd = (amext[0] * 1) + nx;  
246 - var latdd = (amext[3] * 1) - ny;  
247 - var res = [];  
248 - res[0] = longdd;  
249 - res[1] = latdd;  
250 - return (res); 224 + amext = imgext.split(" ");
  225 + longdd = (amext[0] * 1) + (g_celula * xfign);
  226 + latdd = (amext[3] * 1) - (g_celula * yfign);
  227 + return [longdd,latdd];
251 } 228 }
252 catch(e){return(0);} 229 catch(e){return(0);}
253 }, 230 },
@@ -274,16 +251,16 @@ i3GEO.calculo = { @@ -274,16 +251,16 @@ i3GEO.calculo = {
274 {Numeric} 251 {Numeric}
275 */ 252 */
276 area: function(pontos,pixel){ 253 area: function(pontos,pixel){
277 - var $polygon_area; 254 + var $polygon_area,$i,$array_length;
278 try{ 255 try{
279 if(pontos.xpt.length > 2){ 256 if(pontos.xpt.length > 2){
280 - var $array_length = pontos.xpt.length; 257 + $array_length = pontos.xpt.length;
281 pontos.xtela.push(pontos.xtela[0]); 258 pontos.xtela.push(pontos.xtela[0]);
282 pontos.ytela.push(pontos.ytela[0]); 259 pontos.ytela.push(pontos.ytela[0]);
283 pontos.xtela.push(pontos.xtela[0]); 260 pontos.xtela.push(pontos.xtela[0]);
284 pontos.ytela.push(pontos.ytela[1]); 261 pontos.ytela.push(pontos.ytela[1]);
285 $polygon_area = 0; 262 $polygon_area = 0;
286 - for (var $i=0;$i <= $array_length;$i++) 263 + for ($i=0;$i <= $array_length;$i++)
287 {$polygon_area += ((pontos.xtela[$i] * pontos.ytela[$i+1])-(pontos.ytela[$i] * pontos.xtela[$i+1]));} 264 {$polygon_area += ((pontos.xtela[$i] * pontos.ytela[$i+1])-(pontos.ytela[$i] * pontos.xtela[$i+1]));}
288 $polygon_area = Math.abs($polygon_area) / 2; 265 $polygon_area = Math.abs($polygon_area) / 2;
289 } 266 }
@@ -318,14 +295,14 @@ i3GEO.calculo = { @@ -318,14 +295,14 @@ i3GEO.calculo = {
318 {Numeric} 295 {Numeric}
319 */ 296 */
320 distancia: function(lon1,lat1,lon2,lat2){ 297 distancia: function(lon1,lat1,lon2,lat2){
321 - var R = 6371; // km  
322 - var dLat = ((lat2-lat1))* Math.PI / 180;  
323 - var dLon = ((lon2-lon1)) * Math.PI / 180;  
324 - var a = Math.sin(dLat/2) * Math.sin(dLat/2) + 298 + var dLat,dLon,a,c,d;
  299 + dLat = ((lat2-lat1))* Math.PI / 180;
  300 + dLon = ((lon2-lon1)) * Math.PI / 180;
  301 + a = Math.sin(dLat/2) * Math.sin(dLat/2) +
325 Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) * 302 Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
326 Math.sin(dLon/2) * Math.sin(dLon/2); 303 Math.sin(dLon/2) * Math.sin(dLon/2);
327 - var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));  
328 - var d = R * c; 304 + c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
  305 + d = 6371 * c;
329 return d; 306 return d;
330 }, 307 },
331 /* 308 /*
@@ -353,13 +330,14 @@ i3GEO.calculo = { @@ -353,13 +330,14 @@ i3GEO.calculo = {
353 {Numeric} 330 {Numeric}
354 */ 331 */
355 direcao: function(lon1,lat1,lon2,lat2){ 332 direcao: function(lon1,lat1,lon2,lat2){
  333 + var dLon,y,x,r;
356 lat1 = lat1 * (Math.PI / 180); 334 lat1 = lat1 * (Math.PI / 180);
357 lat2 = lat2 * (Math.PI / 180); 335 lat2 = lat2 * (Math.PI / 180);
358 - var dLon = (lon2-lon1) * (Math.PI / 180);  
359 - var y = Math.sin(dLon) * Math.cos(lat2);  
360 - var x = Math.cos(lat1)*Math.sin(lat2) - 336 + dLon = (lon2-lon1) * (Math.PI / 180);
  337 + y = Math.sin(dLon) * Math.cos(lat2);
  338 + x = Math.cos(lat1)*Math.sin(lat2) -
361 Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon); 339 Math.sin(lat1)*Math.cos(lat2)*Math.cos(dLon);
362 - var r = Math.atan2(y, x); 340 + r = Math.atan2(y, x);
363 r = r * 180 / Math.PI; 341 r = r * 180 / Math.PI;
364 r = r + 360; 342 r = r + 360;
365 return r % 360; 343 return r % 360;
@@ -391,17 +369,17 @@ i3GEO.calculo = { @@ -391,17 +369,17 @@ i3GEO.calculo = {
391 {Array} 369 {Array}
392 */ 370 */
393 destinoDD: function(lon,lat,d,direcao){ 371 destinoDD: function(lon,lat,d,direcao){
394 - var R = 6371; // earth's mean radius in km  
395 - var lat1 = lat * (Math.PI / 180);  
396 - var lon1 = lon * (Math.PI / 180);  
397 - var brng = direcao * (Math.PI / 180);  
398 - var lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) + Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng) );  
399 - var lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2)); 372 + var R,lat1,lon1,brng,lat2,lon2;
  373 + R = 6371; // earth's mean radius in km
  374 + lat1 = lat * (Math.PI / 180);
  375 + lon1 = lon * (Math.PI / 180);
  376 + brng = direcao * (Math.PI / 180);
  377 + lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) + Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng) );
  378 + lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1),Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));
400 lon2 = (lon2+Math.PI)%(2*Math.PI) - Math.PI; // normalise to -180...+180 379 lon2 = (lon2+Math.PI)%(2*Math.PI) - Math.PI; // normalise to -180...+180
401 if (isNaN(lat2) || isNaN(lon2)) 380 if (isNaN(lat2) || isNaN(lon2))
402 {return null;} 381 {return null;}
403 - var resultado = [(lon2 * 180 / Math.PI),(lat2 * 180 / Math.PI)];  
404 - return resultado; 382 + return [(lon2 * 180 / Math.PI),(lat2 * 180 / Math.PI)];
405 }, 383 },
406 /* 384 /*
407 Function: rect2ext 385 Function: rect2ext
@@ -421,7 +399,7 @@ i3GEO.calculo = { @@ -421,7 +399,7 @@ i3GEO.calculo = {
421 {Array} - extensão, xmin, ymin, xmax, ymax 399 {Array} - extensão, xmin, ymin, xmax, ymax
422 */ 400 */
423 rect2ext: function(idrect,mapext,pixel){ 401 rect2ext: function(idrect,mapext,pixel){
424 - var bx,bxs,xfig,yfig,nx,ny,pix,piy; 402 + var bx,bxs,xfig,yfig,nx,ny,pix,piy,pos,amext,dx,dy,x1,y1,x2,y2;
425 eval ('pix = parseInt(document.getElementById("'+idrect+'").style.' + g_tipoleft + ")"); 403 eval ('pix = parseInt(document.getElementById("'+idrect+'").style.' + g_tipoleft + ")");
426 eval ('piy = parseInt(document.getElementById("'+idrect+'").style.' + g_tipotop + ")"); 404 eval ('piy = parseInt(document.getElementById("'+idrect+'").style.' + g_tipotop + ")");
427 if($i(idrect)){ 405 if($i(idrect)){
@@ -430,29 +408,27 @@ i3GEO.calculo = { @@ -430,29 +408,27 @@ i3GEO.calculo = {
430 } 408 }
431 else 409 else
432 {alert("Box nao encontrado");return;} 410 {alert("Box nao encontrado");return;}
433 - var pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); 411 + pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));
434 xfig = pix + (parseInt(bxs.width,10)) - pos[0]; 412 xfig = pix + (parseInt(bxs.width,10)) - pos[0];
435 yfig = piy + (parseInt(bxs.height,10)) - pos[1]; 413 yfig = piy + (parseInt(bxs.height,10)) - pos[1];
436 - var amext = mapext.split(" ");  
437 - var dx = ((amext[0] * -1) - (amext[2] * -1)) / -1;  
438 - var dy = ((amext[1] * 1) - (amext[3] * 1)) / -1; 414 + amext = mapext.split(" ");
  415 + dx = ((amext[0] * -1) - (amext[2] * -1)) / -1;
  416 + dy = ((amext[1] * 1) - (amext[3] * 1)) / -1;
439 if (dy < 0) 417 if (dy < 0)
440 {dy=dy * -1;} 418 {dy=dy * -1;}
441 nx = pixel * xfig; 419 nx = pixel * xfig;
442 ny = pixel * yfig; 420 ny = pixel * yfig;
443 - var x1 = (amext[0] * 1) + nx;  
444 - var y1 = (amext[3] * 1) - ny; 421 + x1 = (amext[0] * 1) + nx;
  422 + y1 = (amext[3] * 1) - ny;
445 xfig = pix - pos[0]; 423 xfig = pix - pos[0];
446 yfig = piy - pos[1]; 424 yfig = piy - pos[1];
447 if (dy < 0) 425 if (dy < 0)
448 {dy=dy * -1;} 426 {dy=dy * -1;}
449 nx = pixel * xfig; 427 nx = pixel * xfig;
450 ny = pixel * yfig; 428 ny = pixel * yfig;
451 - var x2 = (amext[0] * 1) + nx;  
452 - var y2 = (amext[3] * 1) - ny;  
453 - var v = x2+" "+y2+" "+x1+" "+y1;  
454 - var res = [v,x1,y1,x2,y2];  
455 - return (res); 429 + x2 = (amext[0] * 1) + nx;
  430 + y2 = (amext[3] * 1) - ny;
  431 + return [x2+" "+y2+" "+x1+" "+y1,x1,y1,x2,y2];
456 }, 432 },
457 /* 433 /*
458 Function: ext2rect 434 Function: ext2rect
@@ -476,19 +452,20 @@ i3GEO.calculo = { @@ -476,19 +452,20 @@ i3GEO.calculo = {
476 {Array} - width,heigth,top,left 452 {Array} - width,heigth,top,left
477 */ 453 */
478 ext2rect: function(idrect,mapext,boxext,pixel,documento){ 454 ext2rect: function(idrect,mapext,boxext,pixel,documento){
479 - var rectbox = boxext.split(" ");  
480 - var rectmap = mapext.split(" ");  
481 - var xyMin = i3GEO.calculo.dd2tela(rectbox[0],rectbox[1],documento,boxext,pixel);  
482 - var xyMax = i3GEO.calculo.dd2tela(rectbox[2],rectbox[3],documento,boxext,pixel);  
483 - var w = xyMax[0]-xyMin[0];  
484 - var h = xyMin[1]-xyMax[1];  
485 - var tl = i3GEO.calculo.dd2tela(rectbox[0],rectbox[3],documento,mapext,pixel);  
486 - var pos = i3GEO.util.pegaPosicaoObjeto(documento);  
487 - var t = tl[1] - pos[1];  
488 - var l = tl[0] - pos[0];  
489 - var d = "block"; 455 + var rectbox,rectmap,xyMin,xyMax,w,h,tl,pos,t,l,d,box;
  456 + rectbox = boxext.split(" ");
  457 + rectmap = mapext.split(" ");
  458 + xyMin = i3GEO.calculo.dd2tela(rectbox[0],rectbox[1],documento,boxext,pixel);
  459 + xyMax = i3GEO.calculo.dd2tela(rectbox[2],rectbox[3],documento,boxext,pixel);
  460 + w = xyMax[0]-xyMin[0];
  461 + h = xyMin[1]-xyMax[1];
  462 + tl = i3GEO.calculo.dd2tela(rectbox[0],rectbox[3],documento,mapext,pixel);
  463 + pos = i3GEO.util.pegaPosicaoObjeto(documento);
  464 + t = tl[1] - pos[1];
  465 + l = tl[0] - pos[0];
  466 + d = "block";
490 if($i(idrect)){ 467 if($i(idrect)){
491 - var box = $i(idrect); 468 + box = $i(idrect);
492 box.style.width = w; 469 box.style.width = w;
493 box.style.height = h; 470 box.style.height = h;
494 box.style.top = t + "px"; 471 box.style.top = t + "px";