Commit e235970523598d1719ba6c1797b3afa83298928b
1 parent
4c3d0844
Exists in
master
and in
7 other branches
correção no uso de atlas
Showing
2 changed files
with
42 additions
and
31 deletions
Show diff stats
classesjs/atlas.js
| ... | ... | @@ -70,34 +70,38 @@ function iniciaAtlas(combow,atlasId) |
| 70 | 70 | var localTitulo = document.getElementById("tituloAtlas"); |
| 71 | 71 | var monta = function (retorno) |
| 72 | 72 | { |
| 73 | - var ins = "",icone = "",pranchas,i, | |
| 74 | - pai = document.getElementById("guiasAtlas"); | |
| 73 | + if(retorno.data == undefined) | |
| 74 | + {return;} | |
| 75 | 75 | if(retorno.data.tipoguias == "") |
| 76 | - retorno.data.tipoguias = "combo"; | |
| 76 | + {retorno.data.tipoguias = "combo"} | |
| 77 | + | |
| 78 | + var pai = document.getElementById("guiasAtlas"); | |
| 77 | 79 | if(pai){ |
| 78 | - ins = '<ul class="yui-nav" style="border-width:0pt 0pt 2px;border-color:rgb(240,240,240)">'; | |
| 80 | + var ins = '<ul class="yui-nav" style="border-width:0pt 0pt 2px;border-color:rgb(240,240,240)">'; | |
| 79 | 81 | //coloca as guias com barra de rolagem |
| 80 | 82 | if (retorno.data.tipoguias == "expandida") |
| 81 | 83 | { |
| 82 | - ins = '<ul class="yui-nav" style="width:2000px;border-width:0pt 0pt 2px;border-color:rgb(240,240,240)">'; | |
| 84 | + var ins = '<ul class="yui-nav" style="width:2000px;border-width:0pt 0pt 2px;border-color:rgb(240,240,240)">'; | |
| 83 | 85 | pai.style.width=i3GEO.parametros.w; |
| 84 | 86 | pai.style.height="35px"; |
| 87 | + //pai.style.overflow=""; | |
| 85 | 88 | } |
| 86 | - pranchas = retorno.data.pranchas; | |
| 89 | + var texto = ""; | |
| 90 | + var pranchas = retorno.data.pranchas; | |
| 87 | 91 | if (retorno.data.tipoguias == "combo") |
| 88 | 92 | { |
| 89 | - pai.style.textAlign="left"; | |
| 93 | + pai.style.textAlign="left" | |
| 90 | 94 | ins = "Escolha a prancha: <select onchange='abrePrancha(this.value)' "; |
| 91 | 95 | if(combow > 0) |
| 92 | 96 | {ins += "style=width:"+combow+"px ";} |
| 93 | 97 | ins += ">"; |
| 94 | - ins += "<option value=''>---</option>"; | |
| 98 | + ins += "<option value=''>---</option>" | |
| 95 | 99 | } |
| 96 | 100 | if (pai) |
| 97 | 101 | { |
| 98 | 102 | if(pai.className == "") |
| 99 | 103 | {pai.className = "yui-navset";} |
| 100 | - i = 0; | |
| 104 | + var i = 0; | |
| 101 | 105 | do |
| 102 | 106 | { |
| 103 | 107 | if (pranchas[i]) |
| ... | ... | @@ -105,23 +109,24 @@ function iniciaAtlas(combow,atlasId) |
| 105 | 109 | //monta as guias das pranchas |
| 106 | 110 | if (retorno.data.tipoguias == "combo") |
| 107 | 111 | { |
| 108 | - ins += "<option value='"+pranchas[i].id+"'>"+pranchas[i].titulo+"</option>"; | |
| 112 | + ins += "<option value='"+pranchas[i].id+"'>"+pranchas[i].titulo+"</option>" | |
| 109 | 113 | } |
| 110 | 114 | else |
| 111 | 115 | { |
| 112 | 116 | ins += '<li><a href="#"><em><div onclick="abrePrancha(\''+pranchas[i].id+'\')" id=guiaAtlas'+i+' style=text-align:center;font-size:10px;left:0px; >'; |
| 117 | + var icone = i3GEO.configura.locaplic+"/imagens/branco.gif"; | |
| 113 | 118 | if(pranchas[i].icone != "") |
| 114 | 119 | { |
| 115 | - icone = pranchas[i].icone; | |
| 120 | + var icone = pranchas[i].icone; | |
| 116 | 121 | } |
| 117 | 122 | ins += "<img src='"+icone+"'/> "; |
| 118 | 123 | ins += pranchas[i].titulo+'</div></em></a></li>'; |
| 119 | 124 | } |
| 120 | 125 | } |
| 121 | - i = i + 1; | |
| 126 | + var i = i + 1; | |
| 122 | 127 | } |
| 123 | 128 | while(pranchas[i]) |
| 124 | - if (retorno.data.tipoguias == "combo"){ins += "</select>";} | |
| 129 | + if (retorno.data.tipoguias == "combo"){ins += "</select>"} | |
| 125 | 130 | else |
| 126 | 131 | {ins += "</ul>";} |
| 127 | 132 | pai.innerHTML = ins; |
| ... | ... | @@ -129,18 +134,17 @@ function iniciaAtlas(combow,atlasId) |
| 129 | 134 | } |
| 130 | 135 | if (localTitulo) |
| 131 | 136 | { |
| 132 | - icone = i3GEO.configura.locaplic+"/imagens/branco.gif"; | |
| 137 | + var icone = i3GEO.configura.locaplic+"/imagens/branco.gif"; | |
| 133 | 138 | if (retorno.data.icone != "") |
| 134 | - {icone = retorno.data.icone;} | |
| 139 | + {var icone = retorno.data.icone;} | |
| 135 | 140 | localTitulo.innerHTML = retorno.data.titulo; |
| 136 | - | |
| 137 | 141 | } |
| 138 | 142 | if (retorno.data.link != "") |
| 139 | 143 | {wdocaf(retorno.data.w+"px",retorno.data.h+"px",retorno.data.link,"center","","Info");} |
| 140 | 144 | if(retorno.data.pranchadefault != "") |
| 141 | - {abrePrancha(retorno.data.pranchadefault);} | |
| 145 | + {abrePrancha(retorno.data.pranchadefault)} | |
| 142 | 146 | i3GEO.mapa.ajustaPosicao(); |
| 143 | - }; | |
| 147 | + } | |
| 144 | 148 | var p = i3GEO.configura.locaplic+"/classesphp/atlas_controle.php?funcao=pegaListaDePranchas&g_sid="+i3GEO.configura.sid; |
| 145 | 149 | if(atlasId) |
| 146 | 150 | {p += "&atlasId="+atlasId;} |
| ... | ... | @@ -165,7 +169,7 @@ Pega a lista de Atlas e características principais de cada um. |
| 165 | 169 | */ |
| 166 | 170 | function pegaListaDeAtlas() |
| 167 | 171 | { |
| 168 | - var p,local = document.getElementById("listaAtlas"); | |
| 172 | + var local = document.getElementById("listaAtlas"); | |
| 169 | 173 | if (local) |
| 170 | 174 | { |
| 171 | 175 | var monta = function (retorno) |
| ... | ... | @@ -202,13 +206,13 @@ function pegaListaDeAtlas() |
| 202 | 206 | texto += "<div class='descricao' >Link: "+inicia+"</div><br></td>"; |
| 203 | 207 | texto += "</tr>"; |
| 204 | 208 | } |
| 205 | - i = i + 1; | |
| 209 | + var i = i + 1; | |
| 206 | 210 | } |
| 207 | 211 | while(listaAtlas[i]) |
| 208 | 212 | local.innerHTML = texto+"</table>"; |
| 209 | - document.getElementById("tituloinstituicao").innerHTML = retorno.data.tituloinstituicao; | |
| 210 | - }; | |
| 211 | - p = i3GEO.configura.locaplic+"/classesphp/atlas_controle.php?funcao=pegaListaDeAtlas"; | |
| 213 | + document.getElementById("tituloinstituicao").innerHTML = retorno.data.tituloinstituicao | |
| 214 | + } | |
| 215 | + var p = i3GEO.configura.locaplic+"/classesphp/atlas_controle.php?funcao=pegaListaDeAtlas"; | |
| 212 | 216 | cpObjAtlas.call(p,"pegaListaDeAtlas",monta); |
| 213 | 217 | } |
| 214 | 218 | else |
| ... | ... | @@ -242,20 +246,26 @@ function abrePrancha(id) |
| 242 | 246 | { |
| 243 | 247 | if(id == ""){return;} |
| 244 | 248 | i3GEO.janela.abreAguarde("Atlas","Atlas"); |
| 245 | - var p,monta = function(retorno) | |
| 249 | + var monta = function(retorno) | |
| 246 | 250 | { |
| 247 | 251 | i3GEO.janela.fechaAguarde("Atlas"); |
| 248 | 252 | if(retorno.data.link != "") |
| 249 | 253 | { |
| 250 | 254 | wdocaf(retorno.data.w+"px",retorno.data.h+"px",retorno.data.link,"center","","Info"); |
| 251 | 255 | } |
| 252 | - if(i3GEO.Interface.ATUAL == "googlemaps") | |
| 253 | - {i3GEO.Interface.googlemaps.removeTodosLayers();} | |
| 256 | + try{ | |
| 257 | + if(i3GEO.Interface.ATUAL == "googlemaps") | |
| 258 | + {i3GEO.Interface.googlemaps.removeTodosLayers();} | |
| 259 | + if(i3GEO.Interface.ATUAL == "openlayers") | |
| 260 | + {i3GEO.Interface.openlayers.removeTodosOsLayers();} | |
| 261 | + } | |
| 262 | + catch(e){} | |
| 263 | + i3GEO.arvoreDeCamadas.CAMADAS = []; | |
| 254 | 264 | if(retorno.data.mapexten != "") |
| 255 | 265 | {i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,"nenhum",retorno.data.mapexten);} |
| 256 | 266 | i3GEO.atualiza(); |
| 257 | - }; | |
| 258 | - p = i3GEO.configura.locaplic+"/classesphp/atlas_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=abrePrancha&pranchaId="+id; | |
| 267 | + } | |
| 268 | + var p = i3GEO.configura.locaplic+"/classesphp/atlas_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=abrePrancha&pranchaId="+id; | |
| 259 | 269 | cpObjAtlas.call(p,"abrePrancha",monta); |
| 260 | 270 | } |
| 261 | 271 | /* |
| ... | ... | @@ -265,8 +275,8 @@ Abre o mapa atualmente aberto no i3geo utilizando a interface padrão. |
| 265 | 275 | */ |
| 266 | 276 | function atlas2i3geo() |
| 267 | 277 | { |
| 268 | - var atual = window.location.href, | |
| 269 | - nova = atual.replace("atlas",'aplicmap'); | |
| 270 | - nova = nova.replace("#",''); | |
| 278 | + var atual = window.location.href; | |
| 279 | + var nova = atual.replace("atlas",'aplicmap'); | |
| 280 | + var nova = nova.replace("#",''); | |
| 271 | 281 | window.location=nova; |
| 272 | 282 | } |
| 273 | 283 | \ No newline at end of file | ... | ... |