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,34 +70,38 @@ function iniciaAtlas(combow,atlasId) | ||
| 70 | var localTitulo = document.getElementById("tituloAtlas"); | 70 | var localTitulo = document.getElementById("tituloAtlas"); |
| 71 | var monta = function (retorno) | 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 | if(retorno.data.tipoguias == "") | 75 | if(retorno.data.tipoguias == "") |
| 76 | - retorno.data.tipoguias = "combo"; | 76 | + {retorno.data.tipoguias = "combo"} |
| 77 | + | ||
| 78 | + var pai = document.getElementById("guiasAtlas"); | ||
| 77 | if(pai){ | 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 | //coloca as guias com barra de rolagem | 81 | //coloca as guias com barra de rolagem |
| 80 | if (retorno.data.tipoguias == "expandida") | 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 | pai.style.width=i3GEO.parametros.w; | 85 | pai.style.width=i3GEO.parametros.w; |
| 84 | pai.style.height="35px"; | 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 | if (retorno.data.tipoguias == "combo") | 91 | if (retorno.data.tipoguias == "combo") |
| 88 | { | 92 | { |
| 89 | - pai.style.textAlign="left"; | 93 | + pai.style.textAlign="left" |
| 90 | ins = "Escolha a prancha: <select onchange='abrePrancha(this.value)' "; | 94 | ins = "Escolha a prancha: <select onchange='abrePrancha(this.value)' "; |
| 91 | if(combow > 0) | 95 | if(combow > 0) |
| 92 | {ins += "style=width:"+combow+"px ";} | 96 | {ins += "style=width:"+combow+"px ";} |
| 93 | ins += ">"; | 97 | ins += ">"; |
| 94 | - ins += "<option value=''>---</option>"; | 98 | + ins += "<option value=''>---</option>" |
| 95 | } | 99 | } |
| 96 | if (pai) | 100 | if (pai) |
| 97 | { | 101 | { |
| 98 | if(pai.className == "") | 102 | if(pai.className == "") |
| 99 | {pai.className = "yui-navset";} | 103 | {pai.className = "yui-navset";} |
| 100 | - i = 0; | 104 | + var i = 0; |
| 101 | do | 105 | do |
| 102 | { | 106 | { |
| 103 | if (pranchas[i]) | 107 | if (pranchas[i]) |
| @@ -105,23 +109,24 @@ function iniciaAtlas(combow,atlasId) | @@ -105,23 +109,24 @@ function iniciaAtlas(combow,atlasId) | ||
| 105 | //monta as guias das pranchas | 109 | //monta as guias das pranchas |
| 106 | if (retorno.data.tipoguias == "combo") | 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 | else | 114 | else |
| 111 | { | 115 | { |
| 112 | ins += '<li><a href="#"><em><div onclick="abrePrancha(\''+pranchas[i].id+'\')" id=guiaAtlas'+i+' style=text-align:center;font-size:10px;left:0px; >'; | 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 | if(pranchas[i].icone != "") | 118 | if(pranchas[i].icone != "") |
| 114 | { | 119 | { |
| 115 | - icone = pranchas[i].icone; | 120 | + var icone = pranchas[i].icone; |
| 116 | } | 121 | } |
| 117 | ins += "<img src='"+icone+"'/> "; | 122 | ins += "<img src='"+icone+"'/> "; |
| 118 | ins += pranchas[i].titulo+'</div></em></a></li>'; | 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 | while(pranchas[i]) | 128 | while(pranchas[i]) |
| 124 | - if (retorno.data.tipoguias == "combo"){ins += "</select>";} | 129 | + if (retorno.data.tipoguias == "combo"){ins += "</select>"} |
| 125 | else | 130 | else |
| 126 | {ins += "</ul>";} | 131 | {ins += "</ul>";} |
| 127 | pai.innerHTML = ins; | 132 | pai.innerHTML = ins; |
| @@ -129,18 +134,17 @@ function iniciaAtlas(combow,atlasId) | @@ -129,18 +134,17 @@ function iniciaAtlas(combow,atlasId) | ||
| 129 | } | 134 | } |
| 130 | if (localTitulo) | 135 | if (localTitulo) |
| 131 | { | 136 | { |
| 132 | - icone = i3GEO.configura.locaplic+"/imagens/branco.gif"; | 137 | + var icone = i3GEO.configura.locaplic+"/imagens/branco.gif"; |
| 133 | if (retorno.data.icone != "") | 138 | if (retorno.data.icone != "") |
| 134 | - {icone = retorno.data.icone;} | 139 | + {var icone = retorno.data.icone;} |
| 135 | localTitulo.innerHTML = retorno.data.titulo; | 140 | localTitulo.innerHTML = retorno.data.titulo; |
| 136 | - | ||
| 137 | } | 141 | } |
| 138 | if (retorno.data.link != "") | 142 | if (retorno.data.link != "") |
| 139 | {wdocaf(retorno.data.w+"px",retorno.data.h+"px",retorno.data.link,"center","","Info");} | 143 | {wdocaf(retorno.data.w+"px",retorno.data.h+"px",retorno.data.link,"center","","Info");} |
| 140 | if(retorno.data.pranchadefault != "") | 144 | if(retorno.data.pranchadefault != "") |
| 141 | - {abrePrancha(retorno.data.pranchadefault);} | 145 | + {abrePrancha(retorno.data.pranchadefault)} |
| 142 | i3GEO.mapa.ajustaPosicao(); | 146 | i3GEO.mapa.ajustaPosicao(); |
| 143 | - }; | 147 | + } |
| 144 | var p = i3GEO.configura.locaplic+"/classesphp/atlas_controle.php?funcao=pegaListaDePranchas&g_sid="+i3GEO.configura.sid; | 148 | var p = i3GEO.configura.locaplic+"/classesphp/atlas_controle.php?funcao=pegaListaDePranchas&g_sid="+i3GEO.configura.sid; |
| 145 | if(atlasId) | 149 | if(atlasId) |
| 146 | {p += "&atlasId="+atlasId;} | 150 | {p += "&atlasId="+atlasId;} |
| @@ -165,7 +169,7 @@ Pega a lista de Atlas e características principais de cada um. | @@ -165,7 +169,7 @@ Pega a lista de Atlas e características principais de cada um. | ||
| 165 | */ | 169 | */ |
| 166 | function pegaListaDeAtlas() | 170 | function pegaListaDeAtlas() |
| 167 | { | 171 | { |
| 168 | - var p,local = document.getElementById("listaAtlas"); | 172 | + var local = document.getElementById("listaAtlas"); |
| 169 | if (local) | 173 | if (local) |
| 170 | { | 174 | { |
| 171 | var monta = function (retorno) | 175 | var monta = function (retorno) |
| @@ -202,13 +206,13 @@ function pegaListaDeAtlas() | @@ -202,13 +206,13 @@ function pegaListaDeAtlas() | ||
| 202 | texto += "<div class='descricao' >Link: "+inicia+"</div><br></td>"; | 206 | texto += "<div class='descricao' >Link: "+inicia+"</div><br></td>"; |
| 203 | texto += "</tr>"; | 207 | texto += "</tr>"; |
| 204 | } | 208 | } |
| 205 | - i = i + 1; | 209 | + var i = i + 1; |
| 206 | } | 210 | } |
| 207 | while(listaAtlas[i]) | 211 | while(listaAtlas[i]) |
| 208 | local.innerHTML = texto+"</table>"; | 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 | cpObjAtlas.call(p,"pegaListaDeAtlas",monta); | 216 | cpObjAtlas.call(p,"pegaListaDeAtlas",monta); |
| 213 | } | 217 | } |
| 214 | else | 218 | else |
| @@ -242,20 +246,26 @@ function abrePrancha(id) | @@ -242,20 +246,26 @@ function abrePrancha(id) | ||
| 242 | { | 246 | { |
| 243 | if(id == ""){return;} | 247 | if(id == ""){return;} |
| 244 | i3GEO.janela.abreAguarde("Atlas","Atlas"); | 248 | i3GEO.janela.abreAguarde("Atlas","Atlas"); |
| 245 | - var p,monta = function(retorno) | 249 | + var monta = function(retorno) |
| 246 | { | 250 | { |
| 247 | i3GEO.janela.fechaAguarde("Atlas"); | 251 | i3GEO.janela.fechaAguarde("Atlas"); |
| 248 | if(retorno.data.link != "") | 252 | if(retorno.data.link != "") |
| 249 | { | 253 | { |
| 250 | wdocaf(retorno.data.w+"px",retorno.data.h+"px",retorno.data.link,"center","","Info"); | 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 | if(retorno.data.mapexten != "") | 264 | if(retorno.data.mapexten != "") |
| 255 | {i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,"nenhum",retorno.data.mapexten);} | 265 | {i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,"nenhum",retorno.data.mapexten);} |
| 256 | i3GEO.atualiza(); | 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 | cpObjAtlas.call(p,"abrePrancha",monta); | 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,8 +275,8 @@ Abre o mapa atualmente aberto no i3geo utilizando a interface padrão. | ||
| 265 | */ | 275 | */ |
| 266 | function atlas2i3geo() | 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 | window.location=nova; | 281 | window.location=nova; |
| 272 | } | 282 | } |
| 273 | \ No newline at end of file | 283 | \ No newline at end of file |