Commit 0625955c40e67202fe1de931db2fd2d4ba452a07
1 parent
b57a8e7f
Exists in
master
and in
7 other branches
Opção da arvore de camadas pemrite agora destacar os temas q não estão na abrang…
…encia ëspacial do mapa
Showing
8 changed files
with
151 additions
and
9 deletions
Show diff stats
aplicmap/geral1.map
aplicmap/geral1windows.map
classesjs/classe_analise.js
| ... | ... | @@ -323,6 +323,8 @@ i3GEO.analise = { |
| 323 | 323 | YAHOO.util.Event.removeListener(YAHOO.janelaDocamede.xp.panel.close, "click"); |
| 324 | 324 | i3GEO.eventos.MOUSECLIQUE.remove("i3GEO.analise.medeDistancia.clique()"); |
| 325 | 325 | i3GEO.eventos.MOUSEMOVE.remove("i3GEO.analise.medeDistancia.movimento()"); |
| 326 | + i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.analise.medeDistancia.fechaJanela()"); | |
| 327 | + | |
| 326 | 328 | if($i("mostradistancia_c")){document.body.removeChild($i("mostradistancia_c"));} |
| 327 | 329 | i3GEO.barraDeBotoes.ativaBotoes(); |
| 328 | 330 | }, |
| ... | ... | @@ -570,6 +572,7 @@ i3GEO.analise = { |
| 570 | 572 | YAHOO.util.Event.removeListener(YAHOO.janelaDocaarea.xp.panel.close, "click"); |
| 571 | 573 | i3GEO.eventos.MOUSECLIQUE.remove("i3GEO.analise.medeArea.clique()"); |
| 572 | 574 | i3GEO.eventos.MOUSEMOVE.remove("i3GEO.analise.medeArea.movimento()"); |
| 575 | + i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.analise.medeArea.fechaJanela()"); | |
| 573 | 576 | if($i("mostraarea_c")){document.body.removeChild($i("mostraarea_c"));} |
| 574 | 577 | i3GEO.barraDeBotoes.ativaBotoes(); |
| 575 | 578 | }, | ... | ... |
classesjs/classe_arvoredecamadas.js
| ... | ... | @@ -47,6 +47,20 @@ Exemplos: |
| 47 | 47 | */ |
| 48 | 48 | i3GEO.arvoreDeCamadas = { |
| 49 | 49 | /* |
| 50 | + Propriedade: VERIFICAABRANGENCIATEMAS | |
| 51 | + | |
| 52 | + Verifica ou não se um tema da árvore está dentro da abrangência do mapa atual | |
| 53 | + | |
| 54 | + A verificação só é feita se o tema possuir a extensão geográfica registrada (veja o sistema de administração) | |
| 55 | + | |
| 56 | + Default: | |
| 57 | + {true} | |
| 58 | + | |
| 59 | + Type: | |
| 60 | + {boolean} | |
| 61 | + */ | |
| 62 | + VERIFICAABRANGENCIATEMAS: true, | |
| 63 | + /* | |
| 50 | 64 | Propriedade: finaliza |
| 51 | 65 | |
| 52 | 66 | Nome de uma função que será executada após a árvore ter sido montada |
| ... | ... | @@ -248,7 +262,9 @@ i3GEO.arvoreDeCamadas = { |
| 248 | 262 | |
| 249 | 263 | "iconetema":"", |
| 250 | 264 | |
| 251 | - "permitecomentario":"" | |
| 265 | + "permitecomentario":"", | |
| 266 | + | |
| 267 | + "exttema":"" | |
| 252 | 268 | } |
| 253 | 269 | ] |
| 254 | 270 | |
| ... | ... | @@ -508,6 +524,10 @@ i3GEO.arvoreDeCamadas = { |
| 508 | 524 | if(i3GEO.temaAtivo !== ""){ |
| 509 | 525 | i3GEO.mapa.ativaTema(i3GEO.temaAtivo); |
| 510 | 526 | } |
| 527 | + i3GEO.arvoreDeCamadas.verificaAbrangenciaTemas(); | |
| 528 | + if(i3GEO.arvoreDeCamadas.VERIFICAABRANGENCIATEMAS == true && i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.arvoreDeCamadas.verificaAbrangenciaTemas()") < 0) | |
| 529 | + {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.arvoreDeCamadas.verificaAbrangenciaTemas()");} | |
| 530 | + | |
| 511 | 531 | }, |
| 512 | 532 | /* |
| 513 | 533 | Function: ativaDragDrop |
| ... | ... | @@ -1020,9 +1040,9 @@ i3GEO.arvoreDeCamadas = { |
| 1020 | 1040 | {estilo = "cursor:move;vertical-align:top;";} |
| 1021 | 1041 | |
| 1022 | 1042 | if(i3GEO.arvoreDeCamadas.AGUARDALEGENDA) |
| 1023 | - {html += " <span style='"+estilo+"' onclick=\"i3GEO.tema.mostralegendajanela('"+tema.name+"','"+tema.tema+"','abrejanela');\" onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t7a")+"','');i3GEO.tema.mostralegendajanela('"+tema.name+"','"+tema.tema+"','ativatimer');\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('');i3GEO.tema.mostralegendajanela('"+tema.name+"','','desativatimer');\" >"+tema.tema+"</span>";} | |
| 1043 | + {html += " <span id='ArvoreTituloTema"+tema.name+"' style='"+estilo+"' onclick=\"i3GEO.tema.mostralegendajanela('"+tema.name+"','"+tema.tema+"','abrejanela');\" onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t7a")+"','');i3GEO.tema.mostralegendajanela('"+tema.name+"','"+tema.tema+"','ativatimer');\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('');i3GEO.tema.mostralegendajanela('"+tema.name+"','','desativatimer');\" >"+tema.tema+"</span>";} | |
| 1024 | 1044 | else |
| 1025 | - {html += " <span style='"+estilo+"' onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t7")+"','')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" >"+tema.tema+"</span>";} | |
| 1045 | + {html += " <span id='ArvoreTituloTema"+tema.name+"' style='"+estilo+"' onmouseover=\"javascript:i3GEO.ajuda.mostraJanela('"+$trad("t7")+"','')\" onmouseout=\"javascript:i3GEO.ajuda.mostraJanela('')\" >"+tema.tema+"</span>";} | |
| 1026 | 1046 | |
| 1027 | 1047 | html += "</p>"; |
| 1028 | 1048 | return(html); |
| ... | ... | @@ -1359,5 +1379,38 @@ i3GEO.arvoreDeCamadas = { |
| 1359 | 1379 | } |
| 1360 | 1380 | while(i < nelementos); |
| 1361 | 1381 | } |
| 1362 | - } | |
| 1382 | + }, | |
| 1383 | + verificaAbrangenciaTemas: function(){ | |
| 1384 | + if(typeof(console) !== 'undefined'){console.info("i3GEO.arvoreDeCamadas.verificaAbrangenciaTemas()");} | |
| 1385 | + if(i3GEO.arvoreDeCamadas.VERIFICAABRANGENCIATEMAS == false) | |
| 1386 | + {return} | |
| 1387 | + try{ | |
| 1388 | + var resultado = [], | |
| 1389 | + i = 0, | |
| 1390 | + temp, | |
| 1391 | + nelementos = i3GEO.arvoreDeCamadas.CAMADAS.length, | |
| 1392 | + ltema, | |
| 1393 | + intersec, | |
| 1394 | + node; | |
| 1395 | + if (nelementos > 0){ | |
| 1396 | + do{ | |
| 1397 | + ltema = i3GEO.arvoreDeCamadas.CAMADAS[i]; | |
| 1398 | + temp = ltema.exttema; | |
| 1399 | + if(temp != ""){ | |
| 1400 | + intersec = i3GEO.util.intersectaBox(temp,i3GEO.parametros.mapexten); | |
| 1401 | + node = $i("ArvoreTituloTema"+ltema.name); | |
| 1402 | + if(intersec == false){ | |
| 1403 | + node.style.color = "gray"; | |
| 1404 | + } | |
| 1405 | + else{ | |
| 1406 | + node.style.color = "black"; | |
| 1407 | + } | |
| 1408 | + } | |
| 1409 | + i++; | |
| 1410 | + } | |
| 1411 | + while(i < nelementos); | |
| 1412 | + } | |
| 1413 | + } | |
| 1414 | + catch(e){} | |
| 1415 | + } | |
| 1363 | 1416 | }; | ... | ... |
classesjs/classe_interface.js
| ... | ... | @@ -908,14 +908,14 @@ i3GEO.Interface = { |
| 908 | 908 | }, |
| 909 | 909 | loadStartLayer: function(event){ |
| 910 | 910 | i3GEO.Interface.STATUS.atualizando.push(event.object.name); |
| 911 | - var i = $i("arrastar_"+event.object.name); | |
| 911 | + var i = $i("ArvoreTituloTema"+event.object.name); | |
| 912 | 912 | if(i){ |
| 913 | 913 | i.style.backgroundColor = "RGB(240,240,240)"; |
| 914 | 914 | } |
| 915 | 915 | }, |
| 916 | 916 | loadStopLayer: function(event){ |
| 917 | 917 | i3GEO.Interface.STATUS.atualizando.remove(event.object.name); |
| 918 | - var i = $i("arrastar_"+event.object.name); | |
| 918 | + var i = $i("ArvoreTituloTema"+event.object.name); | |
| 919 | 919 | if(i){ |
| 920 | 920 | i.style.backgroundColor = ""; |
| 921 | 921 | } | ... | ... |
classesjs/classe_util.js
| ... | ... | @@ -1953,12 +1953,87 @@ i3GEO.util = { |
| 1953 | 1953 | var js = i3GEO.configura.locaplic+"/ferramentas/"+dir+"/index.js.php"; |
| 1954 | 1954 | i3GEO.util.scriptTag(js,"i3GEOF."+nome+".criaJanelaFlutuante()","i3GEOF."+nome+"_script"); |
| 1955 | 1955 | }, |
| 1956 | + /* | |
| 1957 | + Function: bookmark | |
| 1958 | + | |
| 1959 | + Cria os botões de bookmark em redes sociais | |
| 1960 | + | |
| 1961 | + Gera o HTML contendo as tags IMG com os links | |
| 1962 | + | |
| 1963 | + Parametro: | |
| 1964 | + | |
| 1965 | + link {string} - link que será marcado | |
| 1966 | + | |
| 1967 | + Return: | |
| 1968 | + | |
| 1969 | + HTML com os botões | |
| 1970 | + */ | |
| 1956 | 1971 | bookmark: function(link){ |
| 1957 | 1972 | ins = "<img src='"+i3GEO.configura.locaplic+"/imagens/delicious.gif' onclick='javascript:window.open(\"http://del.icio.us/post?url="+link+"\")' title='Delicious'/> "; |
| 1958 | 1973 | ins += "<img src='"+i3GEO.configura.locaplic+"/imagens/digg.gif' onclick='javascript:window.open(\"http://digg.com/submit/post?url="+link+"\")' title='Digg'/> "; |
| 1959 | 1974 | ins += "<img src='"+i3GEO.configura.locaplic+"/imagens/facebook.gif' onclick='javascript:window.open(\"http://www.facebook.com/sharer.php?u="+link+"\")' title='Facebook'/> "; |
| 1960 | 1975 | ins += "<img src='"+i3GEO.configura.locaplic+"/imagens/stumbleupon.gif' onclick='javascript:window.open(\"http://www.stumbleupon.com/submit?url="+link+"\")' title='StumbleUpon'/>"; |
| 1961 | 1976 | return ins; |
| 1977 | + }, | |
| 1978 | + /* | |
| 1979 | + Function: intersectaBox | |
| 1980 | + | |
| 1981 | + Verifica se um retângulo está dentro de outro retângulo | |
| 1982 | + | |
| 1983 | + Parametros: | |
| 1984 | + | |
| 1985 | + box1 - retângulo que será verificado | |
| 1986 | + | |
| 1987 | + box2 - retângulo de referência | |
| 1988 | + | |
| 1989 | + Return: | |
| 1990 | + | |
| 1991 | + boolean | |
| 1992 | + */ | |
| 1993 | + intersectaBox: function(box1,box2){ | |
| 1994 | + var box1 = box1.split(" "), | |
| 1995 | + box2 = box2.split(" "), | |
| 1996 | + box1i = box2, | |
| 1997 | + box2i = box1, | |
| 1998 | + coordx, | |
| 1999 | + coordy, | |
| 2000 | + i; | |
| 2001 | + coordx = box1[0]*1; | |
| 2002 | + coordy = box1[1]*1; | |
| 2003 | + if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) | |
| 2004 | + coordx = box1[0]*1; | |
| 2005 | + coordy = box1[3]*1; | |
| 2006 | + if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) | |
| 2007 | + {return true;} | |
| 2008 | + coordx = box1[2]*1; | |
| 2009 | + coordy = box1[3]*1; | |
| 2010 | + if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) | |
| 2011 | + {return true;} | |
| 2012 | + coordx = box1[2]*1; | |
| 2013 | + coordy = box1[1]*1; | |
| 2014 | + if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) | |
| 2015 | + {return true;} | |
| 2016 | + | |
| 2017 | + box1 = box1i; | |
| 2018 | + box2 = box2i; | |
| 2019 | + | |
| 2020 | + coordx = box1[0]*1; | |
| 2021 | + coordy = box1[1]*1; | |
| 2022 | + if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) | |
| 2023 | + coordx = box1[0]*1; | |
| 2024 | + coordy = box1[3]*1; | |
| 2025 | + if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) | |
| 2026 | + {return true;} | |
| 2027 | + coordx = box1[2]*1; | |
| 2028 | + coordy = box1[3]*1; | |
| 2029 | + if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) | |
| 2030 | + {return true;} | |
| 2031 | + coordx = box1[2]*1; | |
| 2032 | + coordy = box1[1]*1; | |
| 2033 | + if(coordx >= box2[0]*1 && coordx <= box2[2]*1 && coordy >= box2[1]*1 && coordy <= box2[3]*1) | |
| 2034 | + {return true;} | |
| 2035 | + | |
| 2036 | + return false; | |
| 1962 | 2037 | } |
| 1963 | 2038 | }; |
| 1964 | 2039 | ... | ... |
classesphp/classe_mapa.php
| ... | ... | @@ -197,9 +197,16 @@ string - javascript com os parametros |
| 197 | 197 | // |
| 198 | 198 | //verifica se o tema pode receber a operação de zoom para o tema |
| 199 | 199 | // |
| 200 | - $zoomtema = "sim"; | |
| 201 | 200 | if (($ct != 1) && ($oLayer->getmetadata("extensao") == "")) |
| 202 | - {$zoomtema = "nao";} | |
| 201 | + { | |
| 202 | + $zoomtema = "nao"; | |
| 203 | + $exttema = ""; | |
| 204 | + } | |
| 205 | + else | |
| 206 | + { | |
| 207 | + $zoomtema = "sim"; | |
| 208 | + $exttema = $oLayer->getmetadata("extensao"); | |
| 209 | + } | |
| 203 | 210 | // |
| 204 | 211 | //verifica se existe restrição de escala |
| 205 | 212 | // |
| ... | ... | @@ -244,7 +251,8 @@ string - javascript com os parametros |
| 244 | 251 | "escondido"=>strtolower($escondido), |
| 245 | 252 | "iconetema"=>($oLayer->getmetadata("iconetema")), |
| 246 | 253 | "classe"=>($oLayer->getmetadata("classe")), |
| 247 | - "permitecomentario"=>$permitecomentario | |
| 254 | + "permitecomentario"=>$permitecomentario, | |
| 255 | + "exttema"=>$exttema | |
| 248 | 256 | ); |
| 249 | 257 | } |
| 250 | 258 | } | ... | ... |
interface/openlayers.htm
| ... | ... | @@ -207,6 +207,7 @@ i3GEO.Interface.ATIVAMENUCONTEXTO = false; |
| 207 | 207 | i3GEO.arvoreDeTemas.TIPOBOTAO = "radio"; |
| 208 | 208 | i3GEO.arvoreDeTemas.ATIVATEMAIMEDIATO = true; |
| 209 | 209 | i3GEO.arvoreDeTemas.OPCOESADICIONAIS.comentarios = true; |
| 210 | +i3GEO.arvoreDeCamadas.VERIFICAABRANGENCIATEMAS = true; | |
| 210 | 211 | // |
| 211 | 212 | //esta é uma variável interna do OpenLayers que define o endereço do diretório onde estão as imagens usadas nos ícones |
| 212 | 213 | // | ... | ... |