Commit 3dc1e0838c3b1e2f49699cf7aa6cf82eeaa10806
1 parent
4e6c4c65
Exists in
master
and in
7 other branches
Inclusão das funções que salvam e recuperam graficos no mapfile em uso
Showing
11 changed files
with
1645 additions
and
1344 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/php/mapas.php
| ... | ... | @@ -23,7 +23,7 @@ Este programa é distribuído na expectativa de que seja útil |
| 23 | 23 | porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita |
| 24 | 24 | de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. |
| 25 | 25 | Consulte a Licença Pública Geral do GNU para mais detalhes. |
| 26 | -Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 26 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 27 | 27 | GNU junto com este programa; se não, escreva para a |
| 28 | 28 | Free Software Foundation, Inc., no endereço |
| 29 | 29 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
| ... | ... | @@ -36,7 +36,7 @@ Parametros: |
| 36 | 36 | |
| 37 | 37 | O parâmetro principal é "funcao", que define qual operação será executada, por exemplo, mapas.php?funcao=pegamapas. |
| 38 | 38 | |
| 39 | -Cada operação possuí seus próprios parâmetros, que devem ser enviados também na requisição da operação. | |
| 39 | +Cada operação possuí seus próprios parâmetros, que devem ser enviados também na requisição da operação. | |
| 40 | 40 | |
| 41 | 41 | */ |
| 42 | 42 | |
| ... | ... | @@ -162,7 +162,7 @@ switch (strtoupper($funcao)) |
| 162 | 162 | |
| 163 | 163 | titulo {string} - titulo do mapa |
| 164 | 164 | |
| 165 | - mapfile {string} - mapfile na pasta temporária | |
| 165 | + mapfile {string} - mapfile na pasta temporária | |
| 166 | 166 | |
| 167 | 167 | Retorno: |
| 168 | 168 | |
| ... | ... | @@ -174,7 +174,7 @@ switch (strtoupper($funcao)) |
| 174 | 174 | break; |
| 175 | 175 | } |
| 176 | 176 | function salvaMapfile(){ |
| 177 | - global $esquemaadmin,$nome_mapa,$arqmapfile,$url,$id_mapa,$preferenciasbase64,$geometriasbase64; | |
| 177 | + global $esquemaadmin,$nome_mapa,$arqmapfile,$url,$id_mapa,$preferenciasbase64,$geometriasbase64,$graficosbase64; | |
| 178 | 178 | //as preferencias sao criadas via javascript e guardadas junto com o mapa |
| 179 | 179 | try{ |
| 180 | 180 | // |
| ... | ... | @@ -186,9 +186,10 @@ function salvaMapfile(){ |
| 186 | 186 | //o parser para reconstruir os valores e feito em javascript, no cliente |
| 187 | 187 | // |
| 188 | 188 | $customizacoesinit = array(); |
| 189 | - if(isset($preferenciasbase64) || isset($geometriasbase64)){ | |
| 189 | + if(isset($preferenciasbase64) || isset($geometriasbase64) || isset($graficosbase64)){ | |
| 190 | 190 | $customizacoesinit[] = '"preferenciasbase64":"'.$preferenciasbase64.'"'; |
| 191 | 191 | $customizacoesinit[] = '"geometriasbase64":"'.$geometriasbase64.'"'; |
| 192 | + $customizacoesinit[] = '"graficosbase64":"'.$graficosbase64.'"'; | |
| 192 | 193 | $m = ms_newMapObj($arqmapfile); |
| 193 | 194 | $m->setmetadata("CUSTOMIZACOESINIT",'{'.implode(",",$customizacoesinit).'}'); |
| 194 | 195 | $m->save($arqmapfile); | ... | ... |
classesjs/classe_i3geo.js
| ... | ... | @@ -341,6 +341,7 @@ var i3GEO = { |
| 341 | 341 | // |
| 342 | 342 | //obtem os parametros que foram armazenados ao salvar o mapa |
| 343 | 343 | //caso o mapa atual tenha sido recuperado do banco de dados |
| 344 | + //os parametros sao armazenados em base64 no objeto metadata do mapfile | |
| 344 | 345 | // |
| 345 | 346 | if(retorno.data.customizacoesinit){ |
| 346 | 347 | preferencias = YAHOO.lang.JSON.parse(retorno.data.customizacoesinit); |
| ... | ... | @@ -390,8 +391,15 @@ var i3GEO = { |
| 390 | 391 | //caso o mapa atual tenha sido recuperado do banco de dados |
| 391 | 392 | // |
| 392 | 393 | if(retorno.data.customizacoesinit){ |
| 393 | - temp = i3GEO.util.base64decode(preferencias.geometriasbase64); | |
| 394 | - i3GEO.mapa.desCompactaLayerGrafico(temp); | |
| 394 | + //recupera os layers graficos | |
| 395 | + if(preferencias.geometriasbase64 && preferencias.geometriasbase64 != ""){ | |
| 396 | + temp = i3GEO.util.base64decode(preferencias.geometriasbase64); | |
| 397 | + i3GEO.mapa.desCompactaLayerGrafico(temp); | |
| 398 | + } | |
| 399 | + //recupera os graficos | |
| 400 | + if(preferencias.graficosbase64 && preferencias.graficosbase64 != ""){ | |
| 401 | + i3GEO.mapa.restauraGraficos(preferencias.graficosbase64); | |
| 402 | + } | |
| 395 | 403 | } |
| 396 | 404 | } |
| 397 | 405 | else | ... | ... |
classesjs/classe_mapa.js
| ... | ... | @@ -35,1162 +35,1219 @@ GNU junto com este programa; se não, escreva para a |
| 35 | 35 | Free Software Foundation, Inc., no endereço |
| 36 | 36 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
| 37 | 37 | |
| 38 | -*/ | |
| 39 | -if(typeof(i3GEO) === 'undefined'){ | |
| 38 | + */ | |
| 39 | +if (typeof (i3GEO) === 'undefined') { | |
| 40 | 40 | var i3GEO = {}; |
| 41 | 41 | } |
| 42 | -i3GEO.mapa = { | |
| 43 | - /* | |
| 44 | - Propriedade: TEMASINICIAISLIGADOS | |
| 45 | - | |
| 46 | - Lista indicando quais temas serao adicionados ao mapa na inicializacao | |
| 47 | - | |
| 48 | - Esse valor e utilizado para completar a variavel mashuppar utilizada por i3GEO. | |
| 49 | - | |
| 50 | - Os temas sao aqueles que aparecem em i3geo/temas | |
| 51 | - | |
| 52 | - Type: | |
| 53 | - {string} | |
| 54 | - | |
| 55 | - Default: | |
| 56 | - {} | |
| 57 | - */ | |
| 58 | - TEMASINICIAISLIGADOS: "", | |
| 59 | - /* | |
| 60 | - Propriedade: TEMASINICIAISLIGADOS | |
| 61 | - | |
| 62 | - Lista indicando quais temas serao ligados na inicializacao | |
| 63 | - | |
| 64 | - Esse valor e utilizado para completar a variavel mashuppar utilizada por i3GEO. | |
| 65 | - | |
| 66 | - Os temas sao aqueles que aparecem em i3geo/temas | |
| 67 | - | |
| 68 | - Type: | |
| 69 | - {string} | |
| 70 | - | |
| 71 | - Default: | |
| 72 | - {} | |
| 73 | - */ | |
| 74 | - TEMASINICIAIS: "", | |
| 75 | - /* | |
| 76 | - Propriedade: AUTORESIZE | |
| 77 | - | |
| 78 | - Indica se o tamanho do mapa sera ajustado toda vez que o navegador for redimensionado | |
| 79 | - | |
| 80 | - Type: | |
| 81 | - {boolean} | |
| 82 | - | |
| 83 | - Default: | |
| 84 | - {false} | |
| 85 | - */ | |
| 86 | - AUTORESIZE: false, | |
| 87 | - /* | |
| 88 | - Armazena o nome dos objetos geoXml adicionados ao mapa pela API do google maps | |
| 89 | - | |
| 90 | - Tipo: | |
| 91 | - {Array} | |
| 92 | - */ | |
| 93 | - GEOXML: [], | |
| 94 | - /* | |
| 95 | - Function: insereDobraPagina | |
| 96 | - | |
| 97 | - Insere o icone do tipo "dobra de pagina" que permite alterar o renderizador do mapa | |
| 98 | - | |
| 99 | - Parametros: | |
| 100 | - | |
| 101 | - tipo {string} - tipo de icone googlemaps|openlayers | |
| 102 | - | |
| 103 | - imagem {string} - endereco da imagem que sera utilizada no icone | |
| 104 | - */ | |
| 105 | - insereDobraPagina: function(tipo,imagem){ | |
| 106 | - var novoel = $i("i3GEOdobraPagina"); | |
| 107 | - if(!novoel){ | |
| 108 | - novoel = document.createElement("img"); | |
| 109 | - } | |
| 110 | - novoel.src = imagem; | |
| 111 | - novoel.id = "i3GEOdobraPagina"; | |
| 112 | - if(tipo === "googlemaps"){ | |
| 113 | - novoel.onclick = function(evt){ | |
| 114 | - i3GEO.Interface.atual2gm.inicia(); | |
| 115 | - }; | |
| 116 | - } | |
| 117 | - if(tipo === "openlayers"){ | |
| 118 | - novoel.onclick = function(evt){ | |
| 119 | - i3GEO.Interface.atual2ol.inicia(); | |
| 120 | - }; | |
| 121 | - } | |
| 122 | - novoel.style.cursor = "pointer"; | |
| 123 | - novoel.style.position = "absolute"; | |
| 124 | - novoel.style.top = i3GEO.parametros.h - 35 + "px"; | |
| 125 | - novoel.style.zIndex = "50000"; | |
| 126 | - novoel.style.left = i3GEO.parametros.w - 35 + "px"; | |
| 127 | - $i(i3GEO.Interface.IDMAPA).appendChild(novoel); | |
| 128 | - YAHOO.util.Event.addListener("i3GEOdobraPagina", "click", YAHOO.util.Event.stopPropagation); | |
| 129 | - YAHOO.util.Event.addListener("i3GEOdobraPagina", "click", YAHOO.util.Event.preventDefault); | |
| 130 | - }, | |
| 131 | - /* | |
| 132 | - Reposiciona o icone do tipo "dobra de pagina" | |
| 133 | - */ | |
| 134 | - reposicionaDobraPagina: function(){ | |
| 135 | - var novoel = $i("i3GEOdobraPagina"); | |
| 136 | - if(!novoel){ | |
| 137 | - return; | |
| 138 | - } | |
| 139 | - novoel.style.top = i3GEO.parametros.h - 35 + "px"; | |
| 140 | - novoel.style.left = i3GEO.parametros.w - 35 + "px"; | |
| 141 | - }, | |
| 142 | - /* | |
| 143 | - Ativa o redimensionamento automatico do mapa sempre que o navegador for redimensionado | |
| 144 | - | |
| 145 | - e definido como um evento do elemento window | |
| 146 | - */ | |
| 147 | - ativaAutoResize: function(){ | |
| 148 | - window.onresize = function(){ | |
| 149 | - var Dw,Dh, r = false; | |
| 150 | - Dw = YAHOO.util.Dom.getViewportWidth(); | |
| 151 | - Dh = YAHOO.util.Dom.getViewportHeight(); | |
| 152 | - if(Math.abs(Dw - i3GEO.tamanhodoc[0]) > 50){ | |
| 153 | - r = true; | |
| 42 | +i3GEO.mapa = | |
| 43 | + { | |
| 44 | + /* | |
| 45 | + * Propriedade: TEMASINICIAISLIGADOS | |
| 46 | + * | |
| 47 | + * Lista indicando quais temas serao adicionados ao mapa na inicializacao | |
| 48 | + * | |
| 49 | + * Esse valor e utilizado para completar a variavel mashuppar utilizada por i3GEO. | |
| 50 | + * | |
| 51 | + * Os temas sao aqueles que aparecem em i3geo/temas | |
| 52 | + * | |
| 53 | + * Type: {string} | |
| 54 | + * | |
| 55 | + * Default: {} | |
| 56 | + */ | |
| 57 | + TEMASINICIAISLIGADOS : "", | |
| 58 | + /* | |
| 59 | + * Propriedade: TEMASINICIAISLIGADOS | |
| 60 | + * | |
| 61 | + * Lista indicando quais temas serao ligados na inicializacao | |
| 62 | + * | |
| 63 | + * Esse valor e utilizado para completar a variavel mashuppar utilizada por i3GEO. | |
| 64 | + * | |
| 65 | + * Os temas sao aqueles que aparecem em i3geo/temas | |
| 66 | + * | |
| 67 | + * Type: {string} | |
| 68 | + * | |
| 69 | + * Default: {} | |
| 70 | + */ | |
| 71 | + TEMASINICIAIS : "", | |
| 72 | + /* | |
| 73 | + * Propriedade: AUTORESIZE | |
| 74 | + * | |
| 75 | + * Indica se o tamanho do mapa sera ajustado toda vez que o navegador for redimensionado | |
| 76 | + * | |
| 77 | + * Type: {boolean} | |
| 78 | + * | |
| 79 | + * Default: {false} | |
| 80 | + */ | |
| 81 | + AUTORESIZE : false, | |
| 82 | + /* | |
| 83 | + * Armazena o nome dos objetos geoXml adicionados ao mapa pela API do google maps | |
| 84 | + * | |
| 85 | + * Tipo: {Array} | |
| 86 | + */ | |
| 87 | + GEOXML : [], | |
| 88 | + /* | |
| 89 | + * Function: insereDobraPagina | |
| 90 | + * | |
| 91 | + * Insere o icone do tipo "dobra de pagina" que permite alterar o renderizador do mapa | |
| 92 | + * | |
| 93 | + * Parametros: | |
| 94 | + * | |
| 95 | + * tipo {string} - tipo de icone googlemaps|openlayers | |
| 96 | + * | |
| 97 | + * imagem {string} - endereco da imagem que sera utilizada no icone | |
| 98 | + */ | |
| 99 | + insereDobraPagina : function(tipo, imagem) { | |
| 100 | + var novoel = $i("i3GEOdobraPagina"); | |
| 101 | + if (!novoel) { | |
| 102 | + novoel = document.createElement("img"); | |
| 154 | 103 | } |
| 155 | - if(Math.abs(Dh - i3GEO.tamanhodoc[1]) > 50){ | |
| 156 | - r = true; | |
| 104 | + novoel.src = imagem; | |
| 105 | + novoel.id = "i3GEOdobraPagina"; | |
| 106 | + if (tipo === "googlemaps") { | |
| 107 | + novoel.onclick = function(evt) { | |
| 108 | + i3GEO.Interface.atual2gm.inicia(); | |
| 109 | + }; | |
| 157 | 110 | } |
| 158 | - if(r === false) | |
| 159 | - {return;} | |
| 160 | - i3GEO.tamanhodoc = [Dw,Dh]; | |
| 161 | - setTimeout(function(){ | |
| 162 | - i3GEO.reCalculaTamanho(); | |
| 163 | - i3GEO.barraDeBotoes.recria("i3geo_barra2"); | |
| 164 | - if(i3GEO.Interface.TABLET === true) | |
| 165 | - {i3GEO.guias.escondeGuias();return;} | |
| 166 | - if(i3GEO.guias.TIPO === "movel") | |
| 167 | - {i3GEO.guias.guiaMovel.reposiciona();} | |
| 168 | - else | |
| 169 | - {i3GEO.guias.ajustaAltura();} | |
| 170 | - i3GEO.mapa.reposicionaDobraPagina(); | |
| 171 | - },2000); | |
| 172 | - }; | |
| 173 | - }, | |
| 174 | - /* | |
| 175 | - Ajusta o posicionamento do corpo do mapa | |
| 176 | - | |
| 177 | - Esse ajuste e necessario na inicializacao, uma vez que o mapa utiliza style.position='absolute' | |
| 178 | - | |
| 179 | - Parameters: | |
| 180 | - | |
| 181 | - elemento {String} - id do elemento HTML que devera ser ajustado e que contem o mapa | |
| 182 | - */ | |
| 183 | - ajustaPosicao: function(elemento){ | |
| 184 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.ajustaPosicao()");} | |
| 185 | - if(arguments.length === 0){return;} | |
| 186 | - var imagemxi = 0, | |
| 187 | - imagemyi = 0, | |
| 188 | - dc = $i(elemento), | |
| 189 | - c; | |
| 190 | - if(!dc){return;} | |
| 191 | - try{ | |
| 192 | - while ((dc.offsetParent) && (dc.offsetParent.id !== "i3geo")){ | |
| 193 | - dc = dc.offsetParent; | |
| 194 | - imagemxi += dc.offsetLeft; | |
| 195 | - imagemyi += dc.offsetTop; | |
| 111 | + if (tipo === "openlayers") { | |
| 112 | + novoel.onclick = function(evt) { | |
| 113 | + i3GEO.Interface.atual2ol.inicia(); | |
| 114 | + }; | |
| 196 | 115 | } |
| 197 | - c = $i(i3GEO.Interface.IDCORPO); | |
| 198 | - if (c){ | |
| 199 | - c.style.position="absolute"; | |
| 200 | - if(navm) | |
| 201 | - {$left(i3GEO.Interface.IDCORPO,imagemxi - 1);} | |
| 202 | - else | |
| 203 | - {$left(i3GEO.Interface.IDCORPO,imagemxi);} | |
| 204 | - $top(i3GEO.Interface.IDCORPO,imagemyi); | |
| 116 | + novoel.style.cursor = "pointer"; | |
| 117 | + novoel.style.position = "absolute"; | |
| 118 | + novoel.style.top = i3GEO.parametros.h - 35 + "px"; | |
| 119 | + novoel.style.zIndex = "50000"; | |
| 120 | + novoel.style.left = i3GEO.parametros.w - 35 + "px"; | |
| 121 | + $i(i3GEO.Interface.IDMAPA).appendChild(novoel); | |
| 122 | + YAHOO.util.Event.addListener("i3GEOdobraPagina", "click", YAHOO.util.Event.stopPropagation); | |
| 123 | + YAHOO.util.Event.addListener("i3GEOdobraPagina", "click", YAHOO.util.Event.preventDefault); | |
| 124 | + }, | |
| 125 | + /* | |
| 126 | + * Reposiciona o icone do tipo "dobra de pagina" | |
| 127 | + */ | |
| 128 | + reposicionaDobraPagina : function() { | |
| 129 | + var novoel = $i("i3GEOdobraPagina"); | |
| 130 | + if (!novoel) { | |
| 131 | + return; | |
| 205 | 132 | } |
| 206 | - } | |
| 207 | - catch(e){i3GEO.janela.tempoMsg("Ocorreu um erro. i3GEO.mapa.ajustaPosicao "+e);} | |
| 208 | - }, | |
| 209 | - /* | |
| 210 | - Function: ativaTema | |
| 211 | - | |
| 212 | - Altera a variavel i3GEO.temaAtivo e atualiza a interface em funcao do novo tema que for ativado | |
| 213 | - | |
| 214 | - O tema anteriormente ativo tem sua cor alterada para a cor normal e o novo tema e destacado com uma cor diferente | |
| 215 | - | |
| 216 | - Executa tambem as funcoes armazenadas em i3GEO.eventos.ATIVATEMA | |
| 217 | - | |
| 218 | - Parametros: | |
| 219 | - | |
| 220 | - codigo {string} - codigo da camada | |
| 221 | - */ | |
| 222 | - ativaTema: function(codigo){ | |
| 223 | - if(codigo){ | |
| 224 | - if(codigo === "") | |
| 225 | - {return;} | |
| 226 | - if(i3GEO.temaAtivo !== "") | |
| 227 | - {i3GEO.util.defineValor("ArvoreTituloTema"+i3GEO.temaAtivo,"style.color","");} | |
| 228 | - i3GEO.temaAtivo = codigo; | |
| 229 | - i3GEO.util.defineValor("ArvoreTituloTema"+codigo,"style.color","brown"); | |
| 230 | - } | |
| 231 | - }, | |
| 232 | - /* | |
| 233 | - Function: ativaLogo | |
| 234 | - | |
| 235 | - Ativa ou desativa a logo marca. | |
| 236 | - */ | |
| 237 | - ativaLogo: function(){ | |
| 238 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.ativaLogo()");} | |
| 239 | - if(i3GEO.Interface.ATUAL === "googlemaps") | |
| 240 | - {alert($trad("x21"));return;} | |
| 241 | - i3GEO.php.ativalogo(i3GEO.atualiza); | |
| 242 | - var cr = $i("i3GEOcopyright"); | |
| 243 | - if(cr){ | |
| 244 | - if(cr.style.display === "block") | |
| 245 | - {cr.style.display = "none";} | |
| 246 | - else | |
| 247 | - {cr.style.display = "block";} | |
| 248 | - } | |
| 249 | - }, | |
| 250 | - /* | |
| 251 | - Verifica se ocorreu algum problema na atualizacao do corpo do mapa e inicia o processo de tentativa de recuperacao | |
| 252 | - | |
| 253 | - Parametro: | |
| 254 | - | |
| 255 | - retorno {string} - objeto recebido da funcao PHP de atualizacao do mapa | |
| 256 | - */ | |
| 257 | - verifica:function(retorno){ | |
| 258 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.verifica()");} | |
| 259 | - try{ | |
| 260 | - if(retorno.data) | |
| 261 | - {retorno = retorno.data;} | |
| 262 | - if (retorno.variaveis) | |
| 263 | - {retorno = retorno.variaveis;} | |
| 264 | - if ((retorno === "erro") || (typeof(retorno) === 'undefined')){ | |
| 265 | - i3GEO.mapa.ajustaPosicao(); | |
| 266 | - i3GEO.janela.fechaAguarde(); | |
| 267 | - i3GEO.mapa.recupera.inicia(); | |
| 133 | + novoel.style.top = i3GEO.parametros.h - 35 + "px"; | |
| 134 | + novoel.style.left = i3GEO.parametros.w - 35 + "px"; | |
| 135 | + }, | |
| 136 | + /* | |
| 137 | + * Ativa o redimensionamento automatico do mapa sempre que o navegador for redimensionado | |
| 138 | + * | |
| 139 | + * e definido como um evento do elemento window | |
| 140 | + */ | |
| 141 | + ativaAutoResize : function() { | |
| 142 | + window.onresize = function() { | |
| 143 | + var Dw, Dh, r = false; | |
| 144 | + Dw = YAHOO.util.Dom.getViewportWidth(); | |
| 145 | + Dh = YAHOO.util.Dom.getViewportHeight(); | |
| 146 | + if (Math.abs(Dw - i3GEO.tamanhodoc[0]) > 50) { | |
| 147 | + r = true; | |
| 148 | + } | |
| 149 | + if (Math.abs(Dh - i3GEO.tamanhodoc[1]) > 50) { | |
| 150 | + r = true; | |
| 151 | + } | |
| 152 | + if (r === false) { | |
| 153 | + return; | |
| 154 | + } | |
| 155 | + i3GEO.tamanhodoc = [ | |
| 156 | + Dw, | |
| 157 | + Dh | |
| 158 | + ]; | |
| 159 | + setTimeout(function() { | |
| 160 | + i3GEO.reCalculaTamanho(); | |
| 161 | + i3GEO.barraDeBotoes.recria("i3geo_barra2"); | |
| 162 | + if (i3GEO.Interface.TABLET === true) { | |
| 163 | + i3GEO.guias.escondeGuias(); | |
| 164 | + return; | |
| 165 | + } | |
| 166 | + if (i3GEO.guias.TIPO === "movel") { | |
| 167 | + i3GEO.guias.guiaMovel.reposiciona(); | |
| 168 | + } else { | |
| 169 | + i3GEO.guias.ajustaAltura(); | |
| 170 | + } | |
| 171 | + i3GEO.mapa.reposicionaDobraPagina(); | |
| 172 | + }, 2000); | |
| 173 | + }; | |
| 174 | + }, | |
| 175 | + /* | |
| 176 | + * Ajusta o posicionamento do corpo do mapa | |
| 177 | + * | |
| 178 | + * Esse ajuste e necessario na inicializacao, uma vez que o mapa utiliza style.position='absolute' | |
| 179 | + * | |
| 180 | + * Parameters: | |
| 181 | + * | |
| 182 | + * elemento {String} - id do elemento HTML que devera ser ajustado e que contem o mapa | |
| 183 | + */ | |
| 184 | + ajustaPosicao : function(elemento) { | |
| 185 | + if (typeof (console) !== 'undefined') { | |
| 186 | + console.info("i3GEO.mapa.ajustaPosicao()"); | |
| 268 | 187 | } |
| 269 | - i3GEO.mapa.recupera.TENTATIVA = 0; | |
| 270 | - } | |
| 271 | - catch(e){ | |
| 272 | - if(i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps"){ | |
| 273 | - i3GEO.janela.fechaAguarde(); | |
| 188 | + if (arguments.length === 0) { | |
| 274 | 189 | return; |
| 275 | 190 | } |
| 276 | - if(this.recupera.TENTATIVA === 0){ | |
| 277 | - i3GEO.janela.tempoMsg("Erro no mapa. Sera feita uma tentativa de recuperacao."); | |
| 278 | - i3GEO.mapa.recupera.inicia(); | |
| 191 | + var imagemxi = 0, imagemyi = 0, dc = $i(elemento), c; | |
| 192 | + if (!dc) { | |
| 193 | + return; | |
| 279 | 194 | } |
| 280 | - else{ | |
| 281 | - i3GEO.janela.tempoMsg("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa."); | |
| 282 | - if (this.recupera.TENTATIVA === 1){ | |
| 283 | - this.recupera.TENTATIVA = 2; | |
| 284 | - i3GEO.php.reiniciaMapa(i3GEO.atualiza); | |
| 195 | + try { | |
| 196 | + while ((dc.offsetParent) && (dc.offsetParent.id !== "i3geo")) { | |
| 197 | + dc = dc.offsetParent; | |
| 198 | + imagemxi += dc.offsetLeft; | |
| 199 | + imagemyi += dc.offsetTop; | |
| 285 | 200 | } |
| 201 | + c = $i(i3GEO.Interface.IDCORPO); | |
| 202 | + if (c) { | |
| 203 | + c.style.position = "absolute"; | |
| 204 | + if (navm) { | |
| 205 | + $left(i3GEO.Interface.IDCORPO, imagemxi - 1); | |
| 206 | + } else { | |
| 207 | + $left(i3GEO.Interface.IDCORPO, imagemxi); | |
| 208 | + } | |
| 209 | + $top(i3GEO.Interface.IDCORPO, imagemyi); | |
| 210 | + } | |
| 211 | + } catch (e) { | |
| 212 | + i3GEO.janela.tempoMsg("Ocorreu um erro. i3GEO.mapa.ajustaPosicao " + e); | |
| 286 | 213 | } |
| 287 | - if(typeof(console) !== 'undefined'){console.error("i3GEO.mapa.verifica "+e);} | |
| 288 | - } | |
| 289 | - }, | |
| 290 | - /* | |
| 291 | - Tenta recuperar o mapa caso ocorra algum problema | |
| 292 | - | |
| 293 | - O i3Geo mantem sempre uma copia do arquivo mapfile em uso. Essa funcao tenta | |
| 294 | - usar essa copia para restaurar o funcionamento do mapa | |
| 295 | - */ | |
| 296 | - recupera:{ | |
| 297 | - /* | |
| 298 | - Armazena a quantidade de tentativas de recuperacao que foram feitas | |
| 299 | - | |
| 300 | - Tipo: | |
| 301 | - {Integer} | |
| 302 | - */ | |
| 303 | - TENTATIVA: 0, | |
| 214 | + }, | |
| 304 | 215 | /* |
| 305 | - Inicia a tentativa de recuperacao | |
| 306 | - */ | |
| 307 | - inicia: function(){ | |
| 308 | - i3GEO.mapa.ajustaPosicao(); | |
| 309 | - i3GEO.janela.fechaAguarde(); | |
| 310 | - if(this.recupera.TENTATIVA === 0){ | |
| 311 | - this.recupera.TENTATIVA++; | |
| 312 | - this.recupera.restaura(); | |
| 216 | + * Function: ativaTema | |
| 217 | + * | |
| 218 | + * Altera a variavel i3GEO.temaAtivo e atualiza a interface em funcao do novo tema que for ativado | |
| 219 | + * | |
| 220 | + * O tema anteriormente ativo tem sua cor alterada para a cor normal e o novo tema e destacado com uma cor diferente | |
| 221 | + * | |
| 222 | + * Executa tambem as funcoes armazenadas em i3GEO.eventos.ATIVATEMA | |
| 223 | + * | |
| 224 | + * Parametros: | |
| 225 | + * | |
| 226 | + * codigo {string} - codigo da camada | |
| 227 | + */ | |
| 228 | + ativaTema : function(codigo) { | |
| 229 | + if (codigo) { | |
| 230 | + if (codigo === "") { | |
| 231 | + return; | |
| 232 | + } | |
| 233 | + if (i3GEO.temaAtivo !== "") { | |
| 234 | + i3GEO.util.defineValor("ArvoreTituloTema" + i3GEO.temaAtivo, "style.color", ""); | |
| 235 | + } | |
| 236 | + i3GEO.temaAtivo = codigo; | |
| 237 | + i3GEO.util.defineValor("ArvoreTituloTema" + codigo, "style.color", "brown"); | |
| 313 | 238 | } |
| 314 | 239 | }, |
| 315 | 240 | /* |
| 316 | - Restaura o mapa para a copia de seguranca existente no servidor | |
| 317 | - */ | |
| 318 | - restaura: function(){ | |
| 319 | - i3GEO.php.recuperamapa(i3GEO.atualiza); | |
| 320 | - } | |
| 321 | - }, | |
| 322 | - /* | |
| 323 | - Classe: i3GEO.mapa.legendaHTML | |
| 324 | - | |
| 325 | - Controla a obtencao da legenda do mapa formatada em HTML. | |
| 326 | - | |
| 327 | - util para mostrar a legenda na tela | |
| 328 | - */ | |
| 329 | - legendaHTML:{ | |
| 330 | - /* | |
| 331 | - Propriedade: incluiBotaoLibera | |
| 332 | - | |
| 333 | - Define se na legenda sera incluido o botao para liberar a legenda e inclui-la em uma janela flutuante | |
| 334 | - | |
| 335 | - Tipo: | |
| 336 | - {boolean} | |
| 337 | - | |
| 338 | - Default: | |
| 339 | - {true} | |
| 340 | - */ | |
| 341 | - incluiBotaoLibera: false, | |
| 342 | - /* | |
| 343 | - Armazena o id definido na criacao da legenda | |
| 344 | - */ | |
| 345 | - ID: "", | |
| 346 | - /* | |
| 347 | - * Armazena a lista de camadas que devem ficar escondidas na legenda | |
| 241 | + * Function: ativaLogo | |
| 242 | + * | |
| 243 | + * Ativa ou desativa a logo marca. | |
| 348 | 244 | */ |
| 349 | - CAMADASSEMLEGENDA: [], | |
| 350 | - /* | |
| 351 | - Function: cria | |
| 352 | - | |
| 353 | - Cria a legenda HTML | |
| 354 | - | |
| 355 | - O elemento HTML definido em ID deve ter style=display:block | |
| 356 | - | |
| 357 | - A legenda e incluida no id definido. Se id for igual a "", sera apenas definido o evento de atualizacao, | |
| 358 | - permitindo que seja criada a janela flutuante, por exemplo: | |
| 359 | - | |
| 360 | - i3GEO.mapa.legendaHTML.cria(""); | |
| 361 | - i3GEO.mapa.legendaHTML.libera(); | |
| 362 | - | |
| 363 | - Parametros: | |
| 364 | - | |
| 365 | - id {String} - id do elemento que recebera a legenda | |
| 366 | - */ | |
| 367 | - cria: function(id){ | |
| 368 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.legendaHTML.cria()");} | |
| 369 | - if(arguments.length === 0) | |
| 370 | - {id = "";} | |
| 371 | - i3GEO.mapa.legendaHTML.ID = id; | |
| 372 | - if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.mapa.legendaHTML.atualiza()") < 0) | |
| 373 | - {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.mapa.legendaHTML.atualiza()");} | |
| 374 | - i3GEO.mapa.legendaHTML.atualiza(); | |
| 245 | + ativaLogo : function() { | |
| 246 | + if (typeof (console) !== 'undefined') { | |
| 247 | + console.info("i3GEO.mapa.ativaLogo()"); | |
| 248 | + } | |
| 249 | + if (i3GEO.Interface.ATUAL === "googlemaps") { | |
| 250 | + alert($trad("x21")); | |
| 251 | + return; | |
| 252 | + } | |
| 253 | + i3GEO.php.ativalogo(i3GEO.atualiza); | |
| 254 | + var cr = $i("i3GEOcopyright"); | |
| 255 | + if (cr) { | |
| 256 | + if (cr.style.display === "block") { | |
| 257 | + cr.style.display = "none"; | |
| 258 | + } else { | |
| 259 | + cr.style.display = "block"; | |
| 260 | + } | |
| 261 | + } | |
| 375 | 262 | }, |
| 376 | 263 | /* |
| 377 | - Function: atualiza | |
| 378 | - | |
| 379 | - Atualiza o elemento HTML do mapa utilizado para mostrar a legenda | |
| 380 | - */ | |
| 381 | - atualiza: function(){ | |
| 382 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.legendaHTML.atualiza()");} | |
| 383 | - var idleg = $i("wlegenda_corpo"), | |
| 384 | - temp = function(retorno){ | |
| 385 | - var legenda = "",ins,re; | |
| 386 | - re = new RegExp("<img src='' />", "g"); | |
| 387 | - if (retorno.data !== "erro" && retorno.data !== undefined ){ | |
| 388 | - legenda = "<div onclick='i3GEO.mapa.legendaHTML.mostraTodosOsTemas()' style=cursor:pointer;font-size:10px;text-align:left; >Mostra tudo</div><br>"+retorno.data.legenda; | |
| 389 | - } | |
| 390 | - if(legenda != "" && idleg){ | |
| 391 | - ins = ""; | |
| 392 | - if(i3GEO.mapa.legendaHTML.incluiBotaoLibera === true){ | |
| 393 | - ins += '<div style="cursor: pointer; text-align: left; font-size: 10px; display: block; height: 35px;" onclick="i3GEO.mapa.legendaHTML.libera()"><img id="soltaLeg" src="../imagens/branco.gif" title="clique para liberar" style="margin: 5px; position: relative;"> <p style="position: relative; left: -35px; top: -22px;">'+$trad("x11")+'</p></div>'; | |
| 394 | - } | |
| 395 | - legenda = legenda.replace(re,""); | |
| 396 | - ins += "<div id='corpoLegi' >"+ legenda + "</div>"; | |
| 397 | - | |
| 398 | - idleg.innerHTML = legenda; | |
| 399 | - } | |
| 400 | - i3GEO.mapa.legendaHTML.escondeTemasMarcados(); | |
| 401 | - }; | |
| 402 | - if (idleg && idleg.style.display === "block"){ | |
| 403 | - //para o caso da legenda ja estar aberta | |
| 404 | - if(i3GEO.mapa.legendaHTML.ID !== ""){ | |
| 405 | - idleg = $i(i3GEO.mapa.legendaHTML.ID); | |
| 406 | - if(idleg){ | |
| 407 | - idleg.innerHTML = ""; | |
| 408 | - } | |
| 409 | - } | |
| 410 | - idleg = $i("wlegenda_corpo"); | |
| 411 | - i3GEO.mapa.legendaHTML.obtem(temp); | |
| 264 | + * Verifica se ocorreu algum problema na atualizacao do corpo do mapa e inicia o processo de tentativa de recuperacao | |
| 265 | + * | |
| 266 | + * Parametro: | |
| 267 | + * | |
| 268 | + * retorno {string} - objeto recebido da funcao PHP de atualizacao do mapa | |
| 269 | + */ | |
| 270 | + verifica : function(retorno) { | |
| 271 | + if (typeof (console) !== 'undefined') { | |
| 272 | + console.info("i3GEO.mapa.verifica()"); | |
| 412 | 273 | } |
| 413 | - else{ | |
| 414 | - if(idleg){ | |
| 415 | - idleg.innerHTML = ""; | |
| 274 | + try { | |
| 275 | + if (retorno.data) { | |
| 276 | + retorno = retorno.data; | |
| 277 | + } | |
| 278 | + if (retorno.variaveis) { | |
| 279 | + retorno = retorno.variaveis; | |
| 280 | + } | |
| 281 | + if ((retorno === "erro") || (typeof (retorno) === 'undefined')) { | |
| 282 | + i3GEO.mapa.ajustaPosicao(); | |
| 283 | + i3GEO.janela.fechaAguarde(); | |
| 284 | + i3GEO.mapa.recupera.inicia(); | |
| 416 | 285 | } |
| 417 | - if(i3GEO.mapa.legendaHTML.ID !== ""){ | |
| 418 | - idleg = $i(i3GEO.mapa.legendaHTML.ID); | |
| 419 | - if(idleg && idleg.style.display === "block"){ | |
| 420 | - i3GEO.mapa.legendaHTML.obtem(temp); | |
| 286 | + i3GEO.mapa.recupera.TENTATIVA = 0; | |
| 287 | + } catch (e) { | |
| 288 | + if (i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps") { | |
| 289 | + i3GEO.janela.fechaAguarde(); | |
| 290 | + return; | |
| 291 | + } | |
| 292 | + if (this.recupera.TENTATIVA === 0) { | |
| 293 | + i3GEO.janela.tempoMsg("Erro no mapa. Sera feita uma tentativa de recuperacao."); | |
| 294 | + i3GEO.mapa.recupera.inicia(); | |
| 295 | + } else { | |
| 296 | + i3GEO.janela.tempoMsg("Recuperacao impossivel. Sera feita uma tentativa de reiniciar o mapa."); | |
| 297 | + if (this.recupera.TENTATIVA === 1) { | |
| 298 | + this.recupera.TENTATIVA = 2; | |
| 299 | + i3GEO.php.reiniciaMapa(i3GEO.atualiza); | |
| 421 | 300 | } |
| 422 | 301 | } |
| 302 | + if (typeof (console) !== 'undefined') { | |
| 303 | + console.error("i3GEO.mapa.verifica " + e); | |
| 304 | + } | |
| 423 | 305 | } |
| 424 | 306 | }, |
| 425 | 307 | /* |
| 426 | - Faz a chamada em AJAX que gera a legenda | |
| 427 | - | |
| 428 | - O resultado e processado pela funcao passada como parametro | |
| 429 | - | |
| 430 | - Parametro: | |
| 431 | - | |
| 432 | - funcao {function} - funcao que recebera o resultado da chamada AJAX. O objeto CPAINT e enviado como parametro. | |
| 433 | - */ | |
| 434 | - obtem: function(funcao){ | |
| 435 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.legendaHTML.obtem()");} | |
| 436 | - i3GEO.php.criaLegendaHTML(funcao,"",i3GEO.configura.templateLegenda); | |
| 437 | - }, | |
| 438 | - /* | |
| 439 | - Liga ou desliga um unico tema. Utilizado pela legenda HTML, permitindo que um tema seja processado diretamente na legenda. | |
| 440 | - | |
| 441 | - Parametro: | |
| 442 | - | |
| 443 | - inputbox {object) - objeto do tipo input checkbox com a propriedade value indicando o codigo do tema que sera processado | |
| 444 | - */ | |
| 445 | - ativaDesativaTema: function(inputbox){ | |
| 446 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.legendaHTML.ativaDesativaTema()");} | |
| 447 | - var temp = function(){ | |
| 448 | - //i3GEO.contadorAtualiza++; | |
| 449 | - i3GEO.php.corpo(i3GEO.atualiza,i3GEO.configura.tipoimagem); | |
| 450 | - i3GEO.arvoreDeCamadas.atualiza(""); | |
| 451 | - i3GEO.janela.fechaAguarde("redesenha"); | |
| 452 | - }; | |
| 453 | - if(!inputbox.checked) | |
| 454 | - {i3GEO.php.ligatemas(temp,inputbox.value,"");} | |
| 455 | - else | |
| 456 | - {i3GEO.php.ligatemas(temp,"",inputbox.value);} | |
| 457 | - }, | |
| 458 | - escondeTema: function(tema){ | |
| 459 | - var d = $i("legendaLayer_"+tema); | |
| 460 | - if(d){ | |
| 461 | - d.style.display = "none"; | |
| 462 | - i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA.push(tema); | |
| 463 | - } | |
| 464 | - }, | |
| 465 | - escondeTemasMarcados: function(){ | |
| 466 | - var temas = i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA, | |
| 467 | - n = temas.length, | |
| 468 | - i,temp; | |
| 469 | - for(i=0;i<n;i++){ | |
| 470 | - temp = $i(temas[i]); | |
| 471 | - if(temp){ | |
| 472 | - temp.style.display = "none"; | |
| 308 | + * Tenta recuperar o mapa caso ocorra algum problema | |
| 309 | + * | |
| 310 | + * O i3Geo mantem sempre uma copia do arquivo mapfile em uso. Essa funcao tenta usar essa copia para restaurar o funcionamento do | |
| 311 | + * mapa | |
| 312 | + */ | |
| 313 | + recupera : { | |
| 314 | + /* | |
| 315 | + * Armazena a quantidade de tentativas de recuperacao que foram feitas | |
| 316 | + * | |
| 317 | + * Tipo: {Integer} | |
| 318 | + */ | |
| 319 | + TENTATIVA : 0, | |
| 320 | + /* | |
| 321 | + * Inicia a tentativa de recuperacao | |
| 322 | + */ | |
| 323 | + inicia : function() { | |
| 324 | + i3GEO.mapa.ajustaPosicao(); | |
| 325 | + i3GEO.janela.fechaAguarde(); | |
| 326 | + if (this.recupera.TENTATIVA === 0) { | |
| 327 | + this.recupera.TENTATIVA++; | |
| 328 | + this.recupera.restaura(); | |
| 473 | 329 | } |
| 330 | + }, | |
| 331 | + /* | |
| 332 | + * Restaura o mapa para a copia de seguranca existente no servidor | |
| 333 | + */ | |
| 334 | + restaura : function() { | |
| 335 | + i3GEO.php.recuperamapa(i3GEO.atualiza); | |
| 474 | 336 | } |
| 475 | 337 | }, |
| 476 | - mostraTodosOsTemas: function(){ | |
| 477 | - i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA = []; | |
| 478 | - i3GEO.mapa.legendaHTML.atualiza(); | |
| 479 | - }, | |
| 480 | 338 | /* |
| 481 | - Function: libera | |
| 482 | - | |
| 483 | - Libera a legenda criando uma janela flutuante sobre o mapa | |
| 484 | - | |
| 485 | - Parametros: | |
| 339 | + * Classe: i3GEO.mapa.legendaHTML | |
| 340 | + * | |
| 341 | + * Controla a obtencao da legenda do mapa formatada em HTML. | |
| 342 | + * | |
| 343 | + * util para mostrar a legenda na tela | |
| 344 | + */ | |
| 345 | + legendaHTML : { | |
| 346 | + /* | |
| 347 | + * Propriedade: incluiBotaoLibera | |
| 348 | + * | |
| 349 | + * Define se na legenda sera incluido o botao para liberar a legenda e inclui-la em uma janela flutuante | |
| 350 | + * | |
| 351 | + * Tipo: {boolean} | |
| 352 | + * | |
| 353 | + * Default: {true} | |
| 354 | + */ | |
| 355 | + incluiBotaoLibera : false, | |
| 356 | + /* | |
| 357 | + * Armazena o id definido na criacao da legenda | |
| 358 | + */ | |
| 359 | + ID : "", | |
| 360 | + /* | |
| 361 | + * Armazena a lista de camadas que devem ficar escondidas na legenda | |
| 362 | + */ | |
| 363 | + CAMADASSEMLEGENDA : [], | |
| 364 | + /* | |
| 365 | + * Function: cria | |
| 366 | + * | |
| 367 | + * Cria a legenda HTML | |
| 368 | + * | |
| 369 | + * O elemento HTML definido em ID deve ter style=display:block | |
| 370 | + * | |
| 371 | + * A legenda e incluida no id definido. Se id for igual a "", sera apenas definido o evento de atualizacao, permitindo que seja | |
| 372 | + * criada a janela flutuante, por exemplo: | |
| 373 | + * | |
| 374 | + * i3GEO.mapa.legendaHTML.cria(""); i3GEO.mapa.legendaHTML.libera(); | |
| 375 | + * | |
| 376 | + * Parametros: | |
| 377 | + * | |
| 378 | + * id {String} - id do elemento que recebera a legenda | |
| 379 | + */ | |
| 380 | + cria : function(id) { | |
| 381 | + if (typeof (console) !== 'undefined') { | |
| 382 | + console.info("i3GEO.mapa.legendaHTML.cria()"); | |
| 383 | + } | |
| 384 | + if (arguments.length === 0) { | |
| 385 | + id = ""; | |
| 386 | + } | |
| 387 | + i3GEO.mapa.legendaHTML.ID = id; | |
| 388 | + if (i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.mapa.legendaHTML.atualiza()") < 0) { | |
| 389 | + i3GEO.eventos.NAVEGAMAPA.push("i3GEO.mapa.legendaHTML.atualiza()"); | |
| 390 | + } | |
| 391 | + i3GEO.mapa.legendaHTML.atualiza(); | |
| 392 | + }, | |
| 393 | + /* | |
| 394 | + * Function: atualiza | |
| 395 | + * | |
| 396 | + * Atualiza o elemento HTML do mapa utilizado para mostrar a legenda | |
| 397 | + */ | |
| 398 | + atualiza : function() { | |
| 399 | + if (typeof (console) !== 'undefined') { | |
| 400 | + console.info("i3GEO.mapa.legendaHTML.atualiza()"); | |
| 401 | + } | |
| 402 | + var idleg = $i("wlegenda_corpo"), temp = | |
| 403 | + function(retorno) { | |
| 404 | + var legenda = "", ins, re; | |
| 405 | + re = new RegExp("<img src='' />", "g"); | |
| 406 | + if (retorno.data !== "erro" && retorno.data !== undefined) { | |
| 407 | + legenda = | |
| 408 | + "<div onclick='i3GEO.mapa.legendaHTML.mostraTodosOsTemas()' style=cursor:pointer;font-size:10px;text-align:left; >Mostra tudo</div><br>" | |
| 409 | + + retorno.data.legenda; | |
| 410 | + } | |
| 411 | + if (legenda != "" && idleg) { | |
| 412 | + ins = ""; | |
| 413 | + if (i3GEO.mapa.legendaHTML.incluiBotaoLibera === true) { | |
| 414 | + ins += | |
| 415 | + '<div style="cursor: pointer; text-align: left; font-size: 10px; display: block; height: 35px;" onclick="i3GEO.mapa.legendaHTML.libera()"><img id="soltaLeg" src="../imagens/branco.gif" title="clique para liberar" style="margin: 5px; position: relative;"> <p style="position: relative; left: -35px; top: -22px;">' | |
| 416 | + + $trad("x11") + '</p></div>'; | |
| 417 | + } | |
| 418 | + legenda = legenda.replace(re, ""); | |
| 419 | + ins += "<div id='corpoLegi' >" + legenda + "</div>"; | |
| 486 | 420 | |
| 487 | - ck - sim|nao - (opcional) inclui ou nao o checkbox que permitem desligar a camada | |
| 488 | - */ | |
| 489 | - libera: function(ck,largura,altura,topo,esquerda){ | |
| 490 | - if(!ck){ | |
| 491 | - ck = "nao"; | |
| 492 | - } | |
| 493 | - if(!largura){ | |
| 494 | - largura = 302; | |
| 495 | - } | |
| 496 | - if(!altura){ | |
| 497 | - altura = 300; | |
| 498 | - } | |
| 499 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.legendaHTML.libera()");} | |
| 500 | - var cabecalho,minimiza,janela; | |
| 501 | - if (!$i("wlegenda")){ | |
| 502 | - cabecalho = function(){ | |
| 503 | - }; | |
| 504 | - minimiza = function(){ | |
| 505 | - i3GEO.janela.minimiza("wlegenda"); | |
| 421 | + idleg.innerHTML = legenda; | |
| 422 | + } | |
| 423 | + i3GEO.mapa.legendaHTML.escondeTemasMarcados(); | |
| 424 | + }; | |
| 425 | + if (idleg && idleg.style.display === "block") { | |
| 426 | + // para o caso da legenda ja estar aberta | |
| 427 | + if (i3GEO.mapa.legendaHTML.ID !== "") { | |
| 428 | + idleg = $i(i3GEO.mapa.legendaHTML.ID); | |
| 429 | + if (idleg) { | |
| 430 | + idleg.innerHTML = ""; | |
| 431 | + } | |
| 432 | + } | |
| 433 | + idleg = $i("wlegenda_corpo"); | |
| 434 | + i3GEO.mapa.legendaHTML.obtem(temp); | |
| 435 | + } else { | |
| 436 | + if (idleg) { | |
| 437 | + idleg.innerHTML = ""; | |
| 438 | + } | |
| 439 | + if (i3GEO.mapa.legendaHTML.ID !== "") { | |
| 440 | + idleg = $i(i3GEO.mapa.legendaHTML.ID); | |
| 441 | + if (idleg && idleg.style.display === "block") { | |
| 442 | + i3GEO.mapa.legendaHTML.obtem(temp); | |
| 443 | + } | |
| 444 | + } | |
| 445 | + } | |
| 446 | + }, | |
| 447 | + /* | |
| 448 | + * Faz a chamada em AJAX que gera a legenda | |
| 449 | + * | |
| 450 | + * O resultado e processado pela funcao passada como parametro | |
| 451 | + * | |
| 452 | + * Parametro: | |
| 453 | + * | |
| 454 | + * funcao {function} - funcao que recebera o resultado da chamada AJAX. O objeto CPAINT e enviado como parametro. | |
| 455 | + */ | |
| 456 | + obtem : function(funcao) { | |
| 457 | + if (typeof (console) !== 'undefined') { | |
| 458 | + console.info("i3GEO.mapa.legendaHTML.obtem()"); | |
| 459 | + } | |
| 460 | + i3GEO.php.criaLegendaHTML(funcao, "", i3GEO.configura.templateLegenda); | |
| 461 | + }, | |
| 462 | + /* | |
| 463 | + * Liga ou desliga um unico tema. Utilizado pela legenda HTML, permitindo que um tema seja processado diretamente na legenda. | |
| 464 | + * | |
| 465 | + * Parametro: | |
| 466 | + * | |
| 467 | + * inputbox {object) - objeto do tipo input checkbox com a propriedade value indicando o codigo do tema que sera processado | |
| 468 | + */ | |
| 469 | + ativaDesativaTema : function(inputbox) { | |
| 470 | + if (typeof (console) !== 'undefined') { | |
| 471 | + console.info("i3GEO.mapa.legendaHTML.ativaDesativaTema()"); | |
| 472 | + } | |
| 473 | + var temp = function() { | |
| 474 | + // i3GEO.contadorAtualiza++; | |
| 475 | + i3GEO.php.corpo(i3GEO.atualiza, i3GEO.configura.tipoimagem); | |
| 476 | + i3GEO.arvoreDeCamadas.atualiza(""); | |
| 477 | + i3GEO.janela.fechaAguarde("redesenha"); | |
| 506 | 478 | }; |
| 507 | - janela = i3GEO.janela.cria( | |
| 508 | - largura+"px", | |
| 509 | - altura+"px", | |
| 510 | - "", | |
| 511 | - "", | |
| 512 | - "", | |
| 513 | - $trad("p3"), | |
| 514 | - "wlegenda", | |
| 515 | - false, | |
| 516 | - "hd", | |
| 517 | - cabecalho, | |
| 518 | - minimiza | |
| 519 | - ); | |
| 520 | - } | |
| 521 | - else{ | |
| 522 | - janela = YAHOO.i3GEO.janela.manager.find("wlegenda"); | |
| 523 | - janela.show(); | |
| 524 | - } | |
| 525 | - $i("wlegenda_corpo").style.backgroundColor = "white"; | |
| 479 | + if (!inputbox.checked) { | |
| 480 | + i3GEO.php.ligatemas(temp, inputbox.value, ""); | |
| 481 | + } else { | |
| 482 | + i3GEO.php.ligatemas(temp, "", inputbox.value); | |
| 483 | + } | |
| 484 | + }, | |
| 485 | + escondeTema : function(tema) { | |
| 486 | + var d = $i("legendaLayer_" + tema); | |
| 487 | + if (d) { | |
| 488 | + d.style.display = "none"; | |
| 489 | + i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA.push(tema); | |
| 490 | + } | |
| 491 | + }, | |
| 492 | + escondeTemasMarcados : function() { | |
| 493 | + var temas = i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA, n = temas.length, i, temp; | |
| 494 | + for (i = 0; i < n; i++) { | |
| 495 | + temp = $i(temas[i]); | |
| 496 | + if (temp) { | |
| 497 | + temp.style.display = "none"; | |
| 498 | + } | |
| 499 | + } | |
| 500 | + }, | |
| 501 | + mostraTodosOsTemas : function() { | |
| 502 | + i3GEO.mapa.legendaHTML.CAMADASSEMLEGENDA = []; | |
| 503 | + i3GEO.mapa.legendaHTML.atualiza(); | |
| 504 | + }, | |
| 505 | + /* | |
| 506 | + * Function: libera | |
| 507 | + * | |
| 508 | + * Libera a legenda criando uma janela flutuante sobre o mapa | |
| 509 | + * | |
| 510 | + * Parametros: | |
| 511 | + * | |
| 512 | + * ck - sim|nao - (opcional) inclui ou nao o checkbox que permitem desligar a camada | |
| 513 | + */ | |
| 514 | + libera : function(ck, largura, altura, topo, esquerda) { | |
| 515 | + if (!ck) { | |
| 516 | + ck = "nao"; | |
| 517 | + } | |
| 518 | + if (!largura) { | |
| 519 | + largura = 302; | |
| 520 | + } | |
| 521 | + if (!altura) { | |
| 522 | + altura = 300; | |
| 523 | + } | |
| 524 | + if (typeof (console) !== 'undefined') { | |
| 525 | + console.info("i3GEO.mapa.legendaHTML.libera()"); | |
| 526 | + } | |
| 527 | + var cabecalho, minimiza, janela; | |
| 528 | + if (!$i("wlegenda")) { | |
| 529 | + cabecalho = function() { | |
| 530 | + }; | |
| 531 | + minimiza = function() { | |
| 532 | + i3GEO.janela.minimiza("wlegenda"); | |
| 533 | + }; | |
| 534 | + janela = | |
| 535 | + i3GEO.janela.cria( | |
| 536 | + largura + "px", | |
| 537 | + altura + "px", | |
| 538 | + "", | |
| 539 | + "", | |
| 540 | + "", | |
| 541 | + $trad("p3"), | |
| 542 | + "wlegenda", | |
| 543 | + false, | |
| 544 | + "hd", | |
| 545 | + cabecalho, | |
| 546 | + minimiza); | |
| 547 | + } else { | |
| 548 | + janela = YAHOO.i3GEO.janela.manager.find("wlegenda"); | |
| 549 | + janela.show(); | |
| 550 | + } | |
| 551 | + $i("wlegenda_corpo").style.backgroundColor = "white"; | |
| 526 | 552 | |
| 527 | - if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.mapa.legendaHTML.atualiza()") < 0) | |
| 528 | - {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.mapa.legendaHTML.atualiza()");} | |
| 529 | - i3GEO.mapa.legendaHTML.atualiza(); | |
| 530 | - if(topo && esquerda){ | |
| 531 | - janela = YAHOO.i3GEO.janela.manager.find("wlegenda"); | |
| 532 | - janela.moveTo(esquerda,topo); | |
| 553 | + if (i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.mapa.legendaHTML.atualiza()") < 0) { | |
| 554 | + i3GEO.eventos.NAVEGAMAPA.push("i3GEO.mapa.legendaHTML.atualiza()"); | |
| 555 | + } | |
| 556 | + i3GEO.mapa.legendaHTML.atualiza(); | |
| 557 | + if (topo && esquerda) { | |
| 558 | + janela = YAHOO.i3GEO.janela.manager.find("wlegenda"); | |
| 559 | + janela.moveTo(esquerda, topo); | |
| 560 | + } | |
| 533 | 561 | } |
| 534 | - } | |
| 535 | - }, | |
| 536 | - /* | |
| 537 | - Controla a obtencao da legenda do mapa na forma de uma imagem | |
| 538 | - | |
| 539 | - e utilizado principalmente para armazenar as imagens para a funcao de | |
| 540 | - obtencao do historico do mapa | |
| 541 | - */ | |
| 542 | - legendaIMAGEM:{ | |
| 543 | - /* | |
| 544 | - Faz a chamada em AJAX que gera a legenda | |
| 545 | - | |
| 546 | - O resultado e processado pela funcao passada como parametro | |
| 547 | - | |
| 548 | - Parametro: | |
| 549 | - | |
| 550 | - funcao {function} - funcao que recebera o resultado da chamada AJAX. O objeto CPAINT e enviado como parametro. | |
| 551 | - */ | |
| 552 | - obtem: function(funcao){ | |
| 553 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.legendaIMAGEML.obtem()");} | |
| 554 | - i3GEO.php.criaLegendaImagem(funcao); | |
| 555 | - } | |
| 556 | - }, | |
| 557 | - /* | |
| 558 | - Classe: i3GEO.mapa.dialogo | |
| 559 | - | |
| 560 | - Abre as telas de dialogo das opcoes de manipulacao do mapa atual | |
| 561 | - */ | |
| 562 | - dialogo:{ | |
| 563 | - /* | |
| 564 | - Function: geolocal | |
| 565 | - | |
| 566 | - Abre a janela de dialogo da ferramenta de geolocalizacao do usuario | |
| 567 | - */ | |
| 568 | - geolocal: function(){ | |
| 569 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.geolocal()","geolocal","geolocal"); | |
| 570 | 562 | }, |
| 571 | 563 | /* |
| 572 | - Function: listaDeMapasBanco | |
| 573 | - | |
| 574 | - Lista os mapas cadastrados no sistema de administracao do i3geo | |
| 575 | - */ | |
| 576 | - listaDeMapasBanco: function(){ | |
| 577 | - if(i3GEO.guias.CONFIGURA["mapas"]){ | |
| 578 | - var janela,divid; | |
| 579 | - janela = i3GEO.janela.cria( | |
| 580 | - "200px", | |
| 581 | - "450px", | |
| 582 | - "", | |
| 583 | - "", | |
| 584 | - "", | |
| 585 | - "", | |
| 586 | - "i3GEOFsalvaMapaLista", | |
| 587 | - false, | |
| 588 | - "hd" | |
| 589 | - ); | |
| 590 | - divid = janela[2].id; | |
| 591 | - //a funcao que mostra a lista de mapas e a mesma que pode ser utilizada ao incluir a lista de mapas | |
| 592 | - //como uma guia | |
| 593 | - i3GEO.guias.CONFIGURA["mapas"].click.call(this,divid); | |
| 594 | - } | |
| 595 | - else{ | |
| 596 | - window.open(i3GEO.configura.locaplic+"/admin/rssmapas.php","_blank"); | |
| 564 | + * Controla a obtencao da legenda do mapa na forma de uma imagem | |
| 565 | + * | |
| 566 | + * e utilizado principalmente para armazenar as imagens para a funcao de obtencao do historico do mapa | |
| 567 | + */ | |
| 568 | + legendaIMAGEM : { | |
| 569 | + /* | |
| 570 | + * Faz a chamada em AJAX que gera a legenda | |
| 571 | + * | |
| 572 | + * O resultado e processado pela funcao passada como parametro | |
| 573 | + * | |
| 574 | + * Parametro: | |
| 575 | + * | |
| 576 | + * funcao {function} - funcao que recebera o resultado da chamada AJAX. O objeto CPAINT e enviado como parametro. | |
| 577 | + */ | |
| 578 | + obtem : function(funcao) { | |
| 579 | + if (typeof (console) !== 'undefined') { | |
| 580 | + console.info("i3GEO.mapa.legendaIMAGEML.obtem()"); | |
| 581 | + } | |
| 582 | + i3GEO.php.criaLegendaImagem(funcao); | |
| 597 | 583 | } |
| 598 | 584 | }, |
| 599 | 585 | /* |
| 600 | - Function: congelaMapa | |
| 601 | - | |
| 602 | - Congela a visão atual do mapa mostrando-o em uma janela flutuante | |
| 603 | - */ | |
| 604 | - congelaMapa: function(){ | |
| 605 | - var url="", | |
| 606 | - idjanela = YAHOO.util.Dom.generateId(), | |
| 607 | - cabecalho = function(){ | |
| 608 | - }, | |
| 609 | - minimiza = function(){ | |
| 586 | + * Classe: i3GEO.mapa.dialogo | |
| 587 | + * | |
| 588 | + * Abre as telas de dialogo das opcoes de manipulacao do mapa atual | |
| 589 | + */ | |
| 590 | + dialogo : { | |
| 591 | + /* | |
| 592 | + * Function: geolocal | |
| 593 | + * | |
| 594 | + * Abre a janela de dialogo da ferramenta de geolocalizacao do usuario | |
| 595 | + */ | |
| 596 | + geolocal : function() { | |
| 597 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.geolocal()", "geolocal", "geolocal"); | |
| 598 | + }, | |
| 599 | + /* | |
| 600 | + * Function: listaDeMapasBanco | |
| 601 | + * | |
| 602 | + * Lista os mapas cadastrados no sistema de administracao do i3geo | |
| 603 | + */ | |
| 604 | + listaDeMapasBanco : function() { | |
| 605 | + if (i3GEO.guias.CONFIGURA["mapas"]) { | |
| 606 | + var janela, divid; | |
| 607 | + janela = i3GEO.janela.cria("200px", "450px", "", "", "", "", "i3GEOFsalvaMapaLista", false, "hd"); | |
| 608 | + divid = janela[2].id; | |
| 609 | + // a funcao que mostra a lista de mapas e a mesma que pode ser utilizada ao incluir a lista de mapas | |
| 610 | + // como uma guia | |
| 611 | + i3GEO.guias.CONFIGURA["mapas"].click.call(this, divid); | |
| 612 | + } else { | |
| 613 | + window.open(i3GEO.configura.locaplic + "/admin/rssmapas.php", "_blank"); | |
| 614 | + } | |
| 615 | + }, | |
| 616 | + /* | |
| 617 | + * Function: congelaMapa | |
| 618 | + * | |
| 619 | + * Congela a visão atual do mapa mostrando-o em uma janela flutuante | |
| 620 | + */ | |
| 621 | + congelaMapa : function() { | |
| 622 | + var url = "", idjanela = YAHOO.util.Dom.generateId(), cabecalho = function() { | |
| 623 | + }, minimiza = function() { | |
| 610 | 624 | i3GEO.janela.minimiza(idjanela); |
| 611 | 625 | }; |
| 612 | - if(i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps"){ | |
| 613 | - url = i3GEO.configura.locaplic+"/ferramentas/congelamapa/openlayers.php?g_sid="+i3GEO.configura.sid+"&ext="+i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | |
| 626 | + if (i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps") { | |
| 627 | + url = | |
| 628 | + i3GEO.configura.locaplic + "/ferramentas/congelamapa/openlayers.php?g_sid=" + i3GEO.configura.sid + "&ext=" | |
| 629 | + + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); | |
| 630 | + i3GEO.janela.cria("500px", "350px", url, "", "", $trad("x64"), idjanela, false, "hd", cabecalho, minimiza); | |
| 631 | + } | |
| 632 | + }, | |
| 633 | + /* | |
| 634 | + * Function: metaestat | |
| 635 | + * | |
| 636 | + * Abre a janela de dialogo da ferramenta de cartogramas estatisticos METAESTAT | |
| 637 | + */ | |
| 638 | + metaestat : function() { | |
| 639 | + var temp = function() { | |
| 640 | + i3GEOF.metaestat.MULTIPARAMETROS = true; | |
| 641 | + i3GEOF.metaestat.inicia(); | |
| 642 | + }; | |
| 643 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()", "metaestat", "metaestat", "index.js", temp); | |
| 644 | + }, | |
| 645 | + /* | |
| 646 | + * Function: metaestatListaMapas | |
| 647 | + * | |
| 648 | + * Lista os mapas publicados no METAESTAT | |
| 649 | + */ | |
| 650 | + metaestatListaMapas : function() { | |
| 651 | + i3GEO.util.dialogoFerramenta( | |
| 652 | + "i3GEO.mapa.dialogo.metaestatListaMapas()", | |
| 653 | + "metaestat", | |
| 654 | + "listamapas", | |
| 655 | + "listamapas.js", | |
| 656 | + "i3GEOF.listamapas.iniciaJanelaFlutuante()"); | |
| 657 | + }, | |
| 658 | + /* | |
| 659 | + * Function: preferencias | |
| 660 | + * | |
| 661 | + * Preferencias do usuario | |
| 662 | + */ | |
| 663 | + preferencias : function() { | |
| 664 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.preferencias()", "preferencias", "preferencias"); | |
| 665 | + }, | |
| 666 | + /* | |
| 667 | + * Function: locregiao | |
| 668 | + * | |
| 669 | + * Abre a janela de dialogo da ferramenta de busca de regiao cadastrada no METAESTAT | |
| 670 | + */ | |
| 671 | + locregiao : function() { | |
| 672 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.locregiao()", "metaestat", "locregiao", "locregiao.js"); | |
| 673 | + }, | |
| 674 | + /* | |
| 675 | + * Function: filtraregiao | |
| 676 | + * | |
| 677 | + * Abre a janela de dialogo da ferramenta de busca de regioes cadastradas no METAESTAT com opcao de filtrar a regiao escolhida | |
| 678 | + */ | |
| 679 | + filtraregiao : function() { | |
| 680 | + i3GEO.util.dialogoFerramenta( | |
| 681 | + "i3GEO.mapa.dialogo.filtraregiao()", | |
| 682 | + "metaestat", | |
| 683 | + "locregiao", | |
| 684 | + "locregiao.js", | |
| 685 | + "i3GEOF.locregiao.abreComFiltro()"); | |
| 686 | + }, | |
| 687 | + /* | |
| 688 | + * Function: animacao | |
| 689 | + * | |
| 690 | + * Abre a janela de dialogo da ferramenta que permite animar o mapa atual | |
| 691 | + */ | |
| 692 | + animacao : function() { | |
| 693 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.animacao()", "animacao", "animacao"); | |
| 694 | + }, | |
| 695 | + /* | |
| 696 | + * Function: opacidade | |
| 697 | + * | |
| 698 | + * Abre a janela de dialogo da ferramenta de definicao da transparencia das camadas principais do mapa | |
| 699 | + */ | |
| 700 | + opacidade : function() { | |
| 701 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidade()", "opacidademapa", "opacidademapa"); | |
| 702 | + }, | |
| 703 | + /* | |
| 704 | + * Function: telaRemota | |
| 705 | + * | |
| 706 | + * Abre a janela de dialogo da ferramenta de configuracao de uma tela remota | |
| 707 | + */ | |
| 708 | + telaRemota : function() { | |
| 709 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.telaremota()", "telaremota", "telaremota"); | |
| 710 | + }, | |
| 711 | + /* | |
| 712 | + * Function: t3d | |
| 713 | + * | |
| 714 | + * Abre a janela de dialogo da ferramenta de geracao da visualizacao em 3d | |
| 715 | + */ | |
| 716 | + t3d : function() { | |
| 717 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.t3d()", "3d", "t3d"); | |
| 718 | + }, | |
| 719 | + /* | |
| 720 | + * Function: imprimir | |
| 721 | + * | |
| 722 | + * Abre a janela de dialogo da ferramenta que permite imprimir o mapa atual | |
| 723 | + */ | |
| 724 | + imprimir : function() { | |
| 725 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.imprimir()", "imprimir", "imprimir"); | |
| 726 | + }, | |
| 727 | + /* | |
| 728 | + * Function: mostraExten | |
| 729 | + * | |
| 730 | + * Abre a janela de dialogo da ferramenta que mostra a extensao geografica atual do mapa | |
| 731 | + */ | |
| 732 | + mostraExten : function() { | |
| 733 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mostraExten()", "mostraexten", "mostraExten"); | |
| 734 | + }, | |
| 735 | + /* | |
| 736 | + * Function: outputformat | |
| 737 | + * | |
| 738 | + * Abre a janela de dialogo da ferramenta outputformat | |
| 739 | + */ | |
| 740 | + outputformat : function() { | |
| 741 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.outputformat()", "outputformat", "outputformat"); | |
| 742 | + }, | |
| 743 | + /* | |
| 744 | + * Function: autoredesenha | |
| 745 | + * | |
| 746 | + * Abre a janela de dialogo da ferramenta opcoes_autoredesenha | |
| 747 | + */ | |
| 748 | + autoredesenha : function() { | |
| 749 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.autoredesenha()", "opcoes_autoredesenha", "opcoesTempo"); | |
| 750 | + }, | |
| 751 | + /* | |
| 752 | + * Function: salvaMapa | |
| 753 | + * | |
| 754 | + * Abre a janela de dialogo da ferramenta salvamapa | |
| 755 | + */ | |
| 756 | + salvaMapa : function() { | |
| 757 | + if (i3GEO.parametros === "") { | |
| 758 | + i3GEO.janela | |
| 759 | + .tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto."); | |
| 760 | + return; | |
| 761 | + } | |
| 762 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.salvaMapa()", "salvamapa", "salvaMapa"); | |
| 763 | + }, | |
| 764 | + /* | |
| 765 | + * Function: carregaMapa | |
| 766 | + * | |
| 767 | + * Abre a janela de dialogo da ferramenta carregamapa | |
| 768 | + */ | |
| 769 | + carregaMapa : function() { | |
| 770 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.carregaMapa()", "carregamapa", "carregaMapa"); | |
| 771 | + }, | |
| 772 | + /* | |
| 773 | + * Function: convertews | |
| 774 | + * | |
| 775 | + * Abre a janela de dialogo da ferramenta convertews | |
| 776 | + */ | |
| 777 | + convertews : function() { | |
| 778 | + if (i3GEO.parametros.mapfile === "") { | |
| 779 | + i3GEO.janela | |
| 780 | + .tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto."); | |
| 781 | + return; | |
| 782 | + } | |
| 783 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()", "convertews", "converteMapaWS"); | |
| 784 | + }, | |
| 785 | + /* | |
| 786 | + * Function: convertekml | |
| 787 | + * | |
| 788 | + * Abre a janela de dialogo da ferramenta convertemapakml | |
| 789 | + */ | |
| 790 | + convertekml : function() { | |
| 791 | + if (i3GEO.parametros.mapfile === "") { | |
| 792 | + alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto."); | |
| 793 | + return; | |
| 794 | + } | |
| 795 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertekml()", "convertemapakml", "converteMapaKml"); | |
| 796 | + }, | |
| 797 | + /* | |
| 798 | + * Function: queryMap | |
| 799 | + * | |
| 800 | + * Abre a janela de dialogo da ferramenta opcoes_querymap | |
| 801 | + */ | |
| 802 | + queryMap : function() { | |
| 803 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.queryMap()", "opcoes_querymap", "opcoesQuery"); | |
| 804 | + }, | |
| 805 | + /* | |
| 806 | + * Function: template | |
| 807 | + * | |
| 808 | + * Abre a janela de dialogo da ferramenta template | |
| 809 | + */ | |
| 810 | + template : function() { | |
| 614 | 811 | i3GEO.janela.cria( |
| 615 | - "500px", | |
| 616 | - "350px", | |
| 617 | - url, | |
| 812 | + "300px", | |
| 813 | + "400px", | |
| 814 | + i3GEO.configura.locaplic + "/ferramentas/template/index.htm", | |
| 618 | 815 | "", |
| 619 | 816 | "", |
| 620 | - $trad("x64"), | |
| 621 | - idjanela, | |
| 622 | - false, | |
| 623 | - "hd", | |
| 624 | - cabecalho, | |
| 625 | - minimiza | |
| 626 | - ); | |
| 627 | - } | |
| 628 | - }, | |
| 629 | - /* | |
| 630 | - Function: metaestat | |
| 631 | - | |
| 632 | - Abre a janela de dialogo da ferramenta de cartogramas estatisticos METAESTAT | |
| 633 | - */ | |
| 634 | - metaestat: function(){ | |
| 635 | - var temp = function(){ | |
| 636 | - i3GEOF.metaestat.MULTIPARAMETROS = true; | |
| 637 | - i3GEOF.metaestat.inicia(); | |
| 638 | - }; | |
| 639 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestat()","metaestat","metaestat","index.js",temp); | |
| 640 | - }, | |
| 641 | - /* | |
| 642 | - Function: metaestatListaMapas | |
| 643 | - | |
| 644 | - Lista os mapas publicados no METAESTAT | |
| 645 | - */ | |
| 646 | - metaestatListaMapas: function(){ | |
| 647 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.metaestatListaMapas()","metaestat","listamapas","listamapas.js","i3GEOF.listamapas.iniciaJanelaFlutuante()"); | |
| 648 | - }, | |
| 649 | - /* | |
| 650 | - Function: preferencias | |
| 651 | - | |
| 652 | - Preferencias do usuario | |
| 653 | - */ | |
| 654 | - preferencias: function(){ | |
| 655 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.preferencias()","preferencias","preferencias"); | |
| 656 | - }, | |
| 657 | - /* | |
| 658 | - Function: locregiao | |
| 659 | - | |
| 660 | - Abre a janela de dialogo da ferramenta de busca de regiao cadastrada no METAESTAT | |
| 661 | - */ | |
| 662 | - locregiao: function(){ | |
| 663 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.locregiao()","metaestat","locregiao","locregiao.js"); | |
| 664 | - }, | |
| 665 | - /* | |
| 666 | - Function: filtraregiao | |
| 667 | - | |
| 668 | - Abre a janela de dialogo da ferramenta de busca de regioes cadastradas no METAESTAT com opcao de filtrar a regiao escolhida | |
| 669 | - */ | |
| 670 | - filtraregiao: function(){ | |
| 671 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.filtraregiao()","metaestat","locregiao","locregiao.js","i3GEOF.locregiao.abreComFiltro()"); | |
| 672 | - }, | |
| 673 | - /* | |
| 674 | - Function: animacao | |
| 675 | - | |
| 676 | - Abre a janela de dialogo da ferramenta que permite animar o mapa atual | |
| 677 | - */ | |
| 678 | - animacao: function(){ | |
| 679 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.animacao()","animacao","animacao"); | |
| 680 | - }, | |
| 681 | - /* | |
| 682 | - Function: opacidade | |
| 683 | - | |
| 684 | - Abre a janela de dialogo da ferramenta de definicao da transparencia das camadas principais do mapa | |
| 685 | - */ | |
| 686 | - opacidade: function(){ | |
| 687 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opacidade()","opacidademapa","opacidademapa"); | |
| 688 | - }, | |
| 689 | - /* | |
| 690 | - Function: telaRemota | |
| 691 | - | |
| 692 | - Abre a janela de dialogo da ferramenta de configuracao de uma tela remota | |
| 693 | - */ | |
| 694 | - telaRemota: function(){ | |
| 695 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.telaremota()","telaremota","telaremota"); | |
| 696 | - }, | |
| 697 | - /* | |
| 698 | - Function: t3d | |
| 699 | - | |
| 700 | - Abre a janela de dialogo da ferramenta de geracao da visualizacao em 3d | |
| 701 | - */ | |
| 702 | - t3d: function(){ | |
| 703 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.t3d()","3d","t3d"); | |
| 704 | - }, | |
| 705 | - /* | |
| 706 | - Function: imprimir | |
| 707 | - | |
| 708 | - Abre a janela de dialogo da ferramenta que permite imprimir o mapa atual | |
| 709 | - */ | |
| 710 | - imprimir: function(){ | |
| 711 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.imprimir()","imprimir","imprimir"); | |
| 712 | - }, | |
| 713 | - /* | |
| 714 | - Function: mostraExten | |
| 715 | - | |
| 716 | - Abre a janela de dialogo da ferramenta que mostra a extensao geografica atual do mapa | |
| 717 | - */ | |
| 718 | - mostraExten: function(){ | |
| 719 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.mostraExten()","mostraexten","mostraExten"); | |
| 720 | - }, | |
| 721 | - /* | |
| 722 | - Function: outputformat | |
| 723 | - | |
| 724 | - Abre a janela de dialogo da ferramenta outputformat | |
| 725 | - */ | |
| 726 | - outputformat: function(){ | |
| 727 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.outputformat()","outputformat","outputformat"); | |
| 728 | - }, | |
| 729 | - /* | |
| 730 | - Function: autoredesenha | |
| 731 | - | |
| 732 | - Abre a janela de dialogo da ferramenta opcoes_autoredesenha | |
| 733 | - */ | |
| 734 | - autoredesenha: function(){ | |
| 735 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.autoredesenha()","opcoes_autoredesenha","opcoesTempo"); | |
| 736 | - }, | |
| 737 | - /* | |
| 738 | - Function: salvaMapa | |
| 739 | - | |
| 740 | - Abre a janela de dialogo da ferramenta salvamapa | |
| 741 | - */ | |
| 742 | - salvaMapa: function(){ | |
| 743 | - if(i3GEO.parametros === "") | |
| 744 | - {i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return;} | |
| 745 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.salvaMapa()","salvamapa","salvaMapa"); | |
| 746 | - }, | |
| 747 | - /* | |
| 748 | - Function: carregaMapa | |
| 749 | - | |
| 750 | - Abre a janela de dialogo da ferramenta carregamapa | |
| 751 | - */ | |
| 752 | - carregaMapa: function(){ | |
| 753 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.carregaMapa()","carregamapa","carregaMapa"); | |
| 754 | - }, | |
| 755 | - /* | |
| 756 | - Function: convertews | |
| 757 | - | |
| 758 | - Abre a janela de dialogo da ferramenta convertews | |
| 759 | - */ | |
| 760 | - convertews: function(){ | |
| 761 | - if(i3GEO.parametros.mapfile === "") | |
| 762 | - {i3GEO.janela.tempoMsg("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return;} | |
| 763 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertews()","convertews","converteMapaWS"); | |
| 764 | - }, | |
| 765 | - /* | |
| 766 | - Function: convertekml | |
| 767 | - | |
| 768 | - Abre a janela de dialogo da ferramenta convertemapakml | |
| 769 | - */ | |
| 770 | - convertekml: function(){ | |
| 771 | - if(i3GEO.parametros.mapfile === "") | |
| 772 | - {alert("Essa opcao nao pode ser ativada. Consulte o administrador do sistema. Mapfile nao esta exposto.");return;} | |
| 773 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.convertekml()","convertemapakml","converteMapaKml"); | |
| 774 | - }, | |
| 775 | - /* | |
| 776 | - Function: queryMap | |
| 777 | - | |
| 778 | - Abre a janela de dialogo da ferramenta opcoes_querymap | |
| 779 | - */ | |
| 780 | - queryMap: function(){ | |
| 781 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.queryMap()","opcoes_querymap","opcoesQuery"); | |
| 782 | - }, | |
| 783 | - /* | |
| 784 | - Function: template | |
| 785 | - | |
| 786 | - Abre a janela de dialogo da ferramenta template | |
| 787 | - */ | |
| 788 | - template: function() | |
| 789 | - {i3GEO.janela.cria("300px","400px",i3GEO.configura.locaplic+"/ferramentas/template/index.htm","","","Template <a class=ajuda_usuario target=_blank href='"+i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=1&idajuda=8' > </a>");}, | |
| 790 | - /* | |
| 791 | - Function: tamanho | |
| 792 | - | |
| 793 | - Abre a janela de dialogo da ferramenta opcoes_tamanho | |
| 794 | - */ | |
| 795 | - tamanho: function(){ | |
| 796 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()","opcoes_tamanho","opcoesTamanho"); | |
| 797 | - }, | |
| 798 | - /* | |
| 799 | - Function: tipoimagem | |
| 800 | - | |
| 801 | - Abre a janela de dialogo da ferramenta tipoimagem | |
| 802 | - */ | |
| 803 | - tipoimagem: function(){ | |
| 804 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()","tipoimagem","tipoimagem"); | |
| 805 | - }, | |
| 806 | - /* | |
| 807 | - Function: corFundo | |
| 808 | - | |
| 809 | - Abre a janela de dialogo da ferramenta opcoes_fundo | |
| 810 | - */ | |
| 811 | - corFundo: function(){ | |
| 812 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()","opcoes_fundo","opcoesFundo"); | |
| 813 | - }, | |
| 814 | - /* | |
| 815 | - Function: opcoesEscala | |
| 816 | - | |
| 817 | - Abre a janela de dialogo da ferramenta opcoes_escala | |
| 818 | - */ | |
| 819 | - opcoesEscala: function(){ | |
| 820 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()","opcoes_escala","opcoesEscala"); | |
| 821 | - }, | |
| 822 | - /* | |
| 823 | - Function: opcoesLegenda | |
| 824 | - | |
| 825 | - Abre a janela de dialogo da ferramenta opcoes_legenda | |
| 826 | - */ | |
| 827 | - opcoesLegenda: function(){ | |
| 828 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()","opcoes_legenda","opcoesLegenda"); | |
| 829 | - }, | |
| 830 | - /* | |
| 831 | - Function: gradeCoord | |
| 832 | - | |
| 833 | - Abre a janela de dialogo da ferramenta gradecoord | |
| 834 | - */ | |
| 835 | - gradeCoord: function(){ | |
| 836 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()","gradecoord","gradeCoord"); | |
| 837 | - }, | |
| 838 | - /* | |
| 839 | - Function: cliqueTexto | |
| 840 | - | |
| 841 | - Abre a janela de dialogo da ferramenta inseretxt | |
| 842 | - */ | |
| 843 | - cliqueTexto: function(){ | |
| 844 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()","inseretxt","inseretxt"); | |
| 845 | - }, | |
| 846 | - /* | |
| 847 | - Function: selecao | |
| 848 | - | |
| 849 | - Abre a janela de dialogo da ferramenta selecao | |
| 850 | - */ | |
| 851 | - selecao: function(){ | |
| 852 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()","selecao","selecao"); | |
| 853 | - }, | |
| 854 | - /* | |
| 855 | - Function: cliquePonto | |
| 856 | - | |
| 857 | - Abre a janela de dialogo da ferramenta inserexy2 | |
| 858 | - */ | |
| 859 | - cliquePonto: function(){ | |
| 860 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()","inserexy2","inserexy"); | |
| 861 | - }, | |
| 862 | - /* | |
| 863 | - Function: cliqueGrafico | |
| 864 | - | |
| 865 | - Abre a janela de dialogo da ferramenta inseregrafico | |
| 866 | - */ | |
| 867 | - cliqueGrafico: function(){ | |
| 868 | - i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()","inseregrafico","insereGrafico"); | |
| 869 | - }, | |
| 870 | - /* | |
| 871 | - Function: cliqueIdentificaDefault | |
| 872 | - | |
| 873 | - Abre a janela de dialogo da ferramenta identifica | |
| 874 | - | |
| 875 | - Parameters: | |
| 876 | - | |
| 877 | - x,y - opcional | |
| 878 | - | |
| 879 | - */ | |
| 880 | - cliqueIdentificaDefault: function(x,y){ | |
| 881 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.dialogo.cliqueIdentificaDefault()");} | |
| 882 | - //@FIXIT nada elegante | |
| 883 | - //evita clicar sobre a barra do googlemaps | |
| 884 | - if(objposicaocursor.imgx < 70){ | |
| 885 | - return; | |
| 886 | - } | |
| 887 | - //evita ativar a ferramenta se o botao nao estiver ativo | |
| 888 | - //e estiver no modo de clique permanente | |
| 889 | - if(i3GEO.barraDeBotoes.BOTAOCLICADO !== "identifica" && i3GEO.eventos.cliquePerm.ativo === false){ | |
| 890 | - return; | |
| 891 | - } | |
| 892 | - i3GEO.eventos.MOUSEPARADO.remove("verificaTip()"); | |
| 893 | - //na interface googleearth verifica se existe mais eventos no mouseclick | |
| 894 | - if(i3GEO.Interface.ATUAL === "googleearth" && i3GEO.eventos.MOUSECLIQUE.length > 1){ | |
| 895 | - return; | |
| 896 | - } | |
| 897 | - //javascript nao foi carregado | |
| 898 | - if(typeof(i3GEOF.identifica) === 'undefined'){ | |
| 899 | - //javascript que sera carregado | |
| 900 | - var js = i3GEO.configura.locaplic+"/ferramentas/identifica/index.js", | |
| 901 | - temp = function(){ | |
| 902 | - if(x){ | |
| 903 | - i3GEOF.identifica.criaJanelaFlutuante(x,y); | |
| 904 | - } | |
| 905 | - else{ | |
| 906 | - i3GEOF.identifica.criaJanelaFlutuante(objposicaocursor.ddx,objposicaocursor.ddy); | |
| 817 | + "Template <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic | |
| 818 | + + "/ajuda_usuario.php?idcategoria=1&idajuda=8' > </a>"); | |
| 819 | + }, | |
| 820 | + /* | |
| 821 | + * Function: tamanho | |
| 822 | + * | |
| 823 | + * Abre a janela de dialogo da ferramenta opcoes_tamanho | |
| 824 | + */ | |
| 825 | + tamanho : function() { | |
| 826 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tamanho()", "opcoes_tamanho", "opcoesTamanho"); | |
| 827 | + }, | |
| 828 | + /* | |
| 829 | + * Function: tipoimagem | |
| 830 | + * | |
| 831 | + * Abre a janela de dialogo da ferramenta tipoimagem | |
| 832 | + */ | |
| 833 | + tipoimagem : function() { | |
| 834 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.tipoimagem()", "tipoimagem", "tipoimagem"); | |
| 835 | + }, | |
| 836 | + /* | |
| 837 | + * Function: corFundo | |
| 838 | + * | |
| 839 | + * Abre a janela de dialogo da ferramenta opcoes_fundo | |
| 840 | + */ | |
| 841 | + corFundo : function() { | |
| 842 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.corFundo()", "opcoes_fundo", "opcoesFundo"); | |
| 843 | + }, | |
| 844 | + /* | |
| 845 | + * Function: opcoesEscala | |
| 846 | + * | |
| 847 | + * Abre a janela de dialogo da ferramenta opcoes_escala | |
| 848 | + */ | |
| 849 | + opcoesEscala : function() { | |
| 850 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesEscala()", "opcoes_escala", "opcoesEscala"); | |
| 851 | + }, | |
| 852 | + /* | |
| 853 | + * Function: opcoesLegenda | |
| 854 | + * | |
| 855 | + * Abre a janela de dialogo da ferramenta opcoes_legenda | |
| 856 | + */ | |
| 857 | + opcoesLegenda : function() { | |
| 858 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.opcoesLegenda()", "opcoes_legenda", "opcoesLegenda"); | |
| 859 | + }, | |
| 860 | + /* | |
| 861 | + * Function: gradeCoord | |
| 862 | + * | |
| 863 | + * Abre a janela de dialogo da ferramenta gradecoord | |
| 864 | + */ | |
| 865 | + gradeCoord : function() { | |
| 866 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.gradeCoord()", "gradecoord", "gradeCoord"); | |
| 867 | + }, | |
| 868 | + /* | |
| 869 | + * Function: cliqueTexto | |
| 870 | + * | |
| 871 | + * Abre a janela de dialogo da ferramenta inseretxt | |
| 872 | + */ | |
| 873 | + cliqueTexto : function() { | |
| 874 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueTexto()", "inseretxt", "inseretxt"); | |
| 875 | + }, | |
| 876 | + /* | |
| 877 | + * Function: selecao | |
| 878 | + * | |
| 879 | + * Abre a janela de dialogo da ferramenta selecao | |
| 880 | + */ | |
| 881 | + selecao : function() { | |
| 882 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.selecao()", "selecao", "selecao"); | |
| 883 | + }, | |
| 884 | + /* | |
| 885 | + * Function: cliquePonto | |
| 886 | + * | |
| 887 | + * Abre a janela de dialogo da ferramenta inserexy2 | |
| 888 | + */ | |
| 889 | + cliquePonto : function() { | |
| 890 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliquePonto()", "inserexy2", "inserexy"); | |
| 891 | + }, | |
| 892 | + /* | |
| 893 | + * Function: cliqueGrafico | |
| 894 | + * | |
| 895 | + * Abre a janela de dialogo da ferramenta inseregrafico | |
| 896 | + */ | |
| 897 | + cliqueGrafico : function() { | |
| 898 | + i3GEO.util.dialogoFerramenta("i3GEO.mapa.dialogo.cliqueGrafico()", "inseregrafico", "insereGrafico"); | |
| 899 | + }, | |
| 900 | + /* | |
| 901 | + * Function: cliqueIdentificaDefault | |
| 902 | + * | |
| 903 | + * Abre a janela de dialogo da ferramenta identifica | |
| 904 | + * | |
| 905 | + * Parameters: | |
| 906 | + * | |
| 907 | + * x,y - opcional | |
| 908 | + * | |
| 909 | + */ | |
| 910 | + cliqueIdentificaDefault : function(x, y) { | |
| 911 | + if (typeof (console) !== 'undefined') { | |
| 912 | + console.info("i3GEO.mapa.dialogo.cliqueIdentificaDefault()"); | |
| 913 | + } | |
| 914 | + // @FIXIT nada elegante | |
| 915 | + // evita clicar sobre a barra do googlemaps | |
| 916 | + if (objposicaocursor.imgx < 70) { | |
| 917 | + return; | |
| 918 | + } | |
| 919 | + // evita ativar a ferramenta se o botao nao estiver ativo | |
| 920 | + // e estiver no modo de clique permanente | |
| 921 | + if (i3GEO.barraDeBotoes.BOTAOCLICADO !== "identifica" && i3GEO.eventos.cliquePerm.ativo === false) { | |
| 922 | + return; | |
| 923 | + } | |
| 924 | + i3GEO.eventos.MOUSEPARADO.remove("verificaTip()"); | |
| 925 | + // na interface googleearth verifica se existe mais eventos no mouseclick | |
| 926 | + if (i3GEO.Interface.ATUAL === "googleearth" && i3GEO.eventos.MOUSECLIQUE.length > 1) { | |
| 927 | + return; | |
| 928 | + } | |
| 929 | + // javascript nao foi carregado | |
| 930 | + if (typeof (i3GEOF.identifica) === 'undefined') { | |
| 931 | + // javascript que sera carregado | |
| 932 | + var js = i3GEO.configura.locaplic + "/ferramentas/identifica/index.js", temp = function() { | |
| 933 | + if (x) { | |
| 934 | + i3GEOF.identifica.criaJanelaFlutuante(x, y); | |
| 935 | + } else { | |
| 936 | + i3GEOF.identifica.criaJanelaFlutuante(objposicaocursor.ddx, objposicaocursor.ddy); | |
| 907 | 937 | } |
| 908 | 938 | }; |
| 909 | - //carrega o script | |
| 910 | - i3GEO.util.scriptTag(js,temp,"i3GEOF.identifica_script"); | |
| 911 | - } | |
| 912 | - else{ | |
| 913 | - if(x){ | |
| 914 | - i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,x,y); | |
| 939 | + // carrega o script | |
| 940 | + i3GEO.util.scriptTag(js, temp, "i3GEOF.identifica_script"); | |
| 941 | + } else { | |
| 942 | + if (x) { | |
| 943 | + i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo, x, y); | |
| 944 | + } else { | |
| 945 | + i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo, objposicaocursor.ddx, objposicaocursor.ddy); | |
| 946 | + } | |
| 947 | + return; | |
| 915 | 948 | } |
| 916 | - else{ | |
| 917 | - i3GEOF.identifica.buscaDadosTema(i3GEO.temaAtivo,objposicaocursor.ddx,objposicaocursor.ddy); | |
| 949 | + }, | |
| 950 | + /* | |
| 951 | + * Mostra etiquetas no mapa com informacoes sobre os temas com etiquetas ativas | |
| 952 | + * | |
| 953 | + * Essa e a funcao padrao definida em i3GEO.configura | |
| 954 | + */ | |
| 955 | + verificaTipDefault : function(e) { | |
| 956 | + // evita clicar sobre a barra do googlemaps | |
| 957 | + // @FIXIT nada elegante | |
| 958 | + // console.warn(objposicaocursor.imgx) | |
| 959 | + if (objposicaocursor.imgx < 70) { | |
| 960 | + return; | |
| 918 | 961 | } |
| 919 | - return; | |
| 920 | - } | |
| 921 | - }, | |
| 922 | - /* | |
| 923 | - Mostra etiquetas no mapa com informacoes sobre os temas com etiquetas ativas | |
| 962 | + if (typeof (console) !== 'undefined') { | |
| 963 | + console.info("i3GEO.mapa.dialogo.verificaTipDefault()"); | |
| 964 | + } | |
| 965 | + if (i3GEO.barraDeBotoes.BOTAOCLICADO !== "identificaBalao" && i3GEO.eventos.cliquePerm.ativo === false) { | |
| 966 | + return; | |
| 967 | + } | |
| 968 | + // na interface googleearth verifica se existe mais eventos no mouseclick | |
| 969 | + if (i3GEO.Interface.ATUAL === "googleearth" && i3GEO.eventos.MOUSECLIQUE.length > 1) { | |
| 970 | + return; | |
| 971 | + } | |
| 972 | + var ntemas, etiquetas, j, retorna, targ = ""; | |
| 924 | 973 | |
| 925 | - Essa e a funcao padrao definida em i3GEO.configura | |
| 926 | - */ | |
| 927 | - verificaTipDefault: function(e){ | |
| 928 | - //evita clicar sobre a barra do googlemaps | |
| 929 | - //@FIXIT nada elegante | |
| 930 | - //console.warn(objposicaocursor.imgx) | |
| 931 | - if(objposicaocursor.imgx < 70){ | |
| 932 | - return; | |
| 933 | - } | |
| 934 | - if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.dialogo.verificaTipDefault()");} | |
| 935 | - if(i3GEO.barraDeBotoes.BOTAOCLICADO !== "identificaBalao" && i3GEO.eventos.cliquePerm.ativo === false){ | |
| 936 | - return; | |
| 937 | - } | |
| 938 | - //na interface googleearth verifica se existe mais eventos no mouseclick | |
| 939 | - if(i3GEO.Interface.ATUAL === "googleearth" && i3GEO.eventos.MOUSECLIQUE.length > 1){ | |
| 940 | - return; | |
| 941 | - } | |
| 942 | - var ntemas,etiquetas,j,retorna,targ = ""; | |
| 974 | + if (!e) { | |
| 975 | + e = window.event; | |
| 976 | + } | |
| 977 | + try { | |
| 978 | + if (e.target) { | |
| 979 | + targ = e.target; | |
| 980 | + } else { | |
| 981 | + if (e.srcElement) { | |
| 982 | + targ = e.srcElement; | |
| 983 | + } | |
| 984 | + } | |
| 985 | + if (targ.parentNode) { | |
| 986 | + container = targ.parentNode.id; | |
| 987 | + // alert(container); | |
| 988 | + } | |
| 943 | 989 | |
| 944 | - if (!e){ | |
| 945 | - e = window.event; | |
| 946 | - } | |
| 947 | - try{ | |
| 948 | - if (e.target){ | |
| 949 | - targ = e.target; | |
| 990 | + } catch (erro) { | |
| 991 | + targ = null; | |
| 950 | 992 | } |
| 951 | - else{ | |
| 952 | - if (e.srcElement){ | |
| 953 | - targ = e.srcElement; | |
| 993 | + | |
| 994 | + ntemas = i3GEO.arvoreDeCamadas.CAMADAS.length; | |
| 995 | + etiquetas = false; | |
| 996 | + for (j = 0; j < ntemas; j += 1) { | |
| 997 | + if (i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas !== "") { | |
| 998 | + etiquetas = true; | |
| 954 | 999 | } |
| 955 | 1000 | } |
| 956 | - if(targ.parentNode){ | |
| 957 | - container = targ.parentNode.id; | |
| 958 | - //alert(container); | |
| 1001 | + if (etiquetas === false) { | |
| 1002 | + return; | |
| 959 | 1003 | } |
| 960 | - | |
| 961 | - } | |
| 962 | - catch(erro){ targ = null;} | |
| 963 | - | |
| 964 | - ntemas = i3GEO.arvoreDeCamadas.CAMADAS.length; | |
| 965 | - etiquetas = false; | |
| 966 | - for(j=0;j<ntemas;j += 1) | |
| 967 | - {if(i3GEO.arvoreDeCamadas.CAMADAS[j].etiquetas !== "") | |
| 968 | - {etiquetas = true;}} | |
| 969 | - if(etiquetas === false) | |
| 970 | - {return;} | |
| 971 | - if(i3GEO.Interface.ATUAL === "googleearth") | |
| 972 | - {i3GEO.Interface.googleearth.aguarde.visibility = "visible";} | |
| 973 | - retorna = function(retorno){ | |
| 974 | - var classeCor,pos,temp,n,i,mostra,res,temas,ntemas,titulo,tips,j,ntips,ins,r,ds,nds,s,balloon, | |
| 975 | - configura = i3GEO.configura, | |
| 976 | - tipotip = configura.tipotip; | |
| 977 | - i = $i("i3geo_rosa"); | |
| 978 | - if(i) | |
| 979 | - {i.style.display="none";} | |
| 980 | - mostra = false; | |
| 981 | - //try{ | |
| 982 | - retorno = retorno.data; | |
| 983 | - if (retorno !== "") | |
| 984 | - { | |
| 985 | - res = ""; | |
| 986 | - temas = retorno; | |
| 987 | - if(!temas){return;} | |
| 988 | - ntemas = temas.length; | |
| 989 | - for(j=0;j<ntemas;j += 1){ | |
| 990 | - titulo = temas[j].nome; | |
| 991 | - if (tipotip === "completo" || tipotip === "balao") | |
| 992 | - {titulo = "<span class='toolTipBalaoTitulo'><b>"+titulo+"</b></span><br>";} | |
| 993 | - else | |
| 994 | - {titulo = "";} | |
| 995 | - tips = (temas[j].resultado.tips).split(","); | |
| 996 | - ntips = tips.length; | |
| 997 | - ins = ""; | |
| 998 | - ds = temas[j].resultado.dados; | |
| 999 | - if(ds !== " " && ds[0] && ds[0] != " "){ | |
| 1000 | - try{ | |
| 1001 | - nds = ds.length; | |
| 1002 | - classeCor = "toolTipBalaoTexto"; | |
| 1003 | - for(s=0;s<nds;s += 1){ | |
| 1004 | - ins += "<div class='"+classeCor+"'>"; | |
| 1005 | - for(r=0;r<ntips;r += 1){ | |
| 1006 | - try{ | |
| 1007 | - eval("var alias = ds[s]."+tips[r]+".alias"); | |
| 1008 | - eval("var valor = ds[s]."+tips[r]+".valor"); | |
| 1009 | - eval("var link = ds[s]."+tips[r]+".link"); | |
| 1010 | - eval("var img = ds[s]."+tips[r]+".img"); | |
| 1011 | - if (tipotip === "completo" || tipotip === "balao"){ | |
| 1012 | - if(valor !== "" && link === "") | |
| 1013 | - {ins += "<span>" + alias + " :" + valor + "</span><br>";} | |
| 1014 | - if(valor !== "" && link !== "") | |
| 1015 | - {ins += "<span>" + alias + " : <a style='color:blue;cursor:pointer' target=_blanck href='"+link+"' >" + valor + "</a></span><br>";} | |
| 1016 | - if(img !== "") | |
| 1017 | - {ins += img+"<br>";} | |
| 1018 | - mostra = true; | |
| 1019 | - } | |
| 1020 | - else{ | |
| 1021 | - ins += "<span>" + valor + "</span><br>"; | |
| 1022 | - mostra = true; | |
| 1004 | + if (i3GEO.Interface.ATUAL === "googleearth") { | |
| 1005 | + i3GEO.Interface.googleearth.aguarde.visibility = "visible"; | |
| 1006 | + } | |
| 1007 | + retorna = | |
| 1008 | + function(retorno) { | |
| 1009 | + var classeCor, pos, temp, n, i, mostra, res, temas, ntemas, titulo, tips, j, ntips, ins, r, ds, nds, s, balloon, configura = | |
| 1010 | + i3GEO.configura, tipotip = configura.tipotip; | |
| 1011 | + i = $i("i3geo_rosa"); | |
| 1012 | + if (i) { | |
| 1013 | + i.style.display = "none"; | |
| 1014 | + } | |
| 1015 | + mostra = false; | |
| 1016 | + // try{ | |
| 1017 | + retorno = retorno.data; | |
| 1018 | + if (retorno !== "") { | |
| 1019 | + res = ""; | |
| 1020 | + temas = retorno; | |
| 1021 | + if (!temas) { | |
| 1022 | + return; | |
| 1023 | + } | |
| 1024 | + ntemas = temas.length; | |
| 1025 | + for (j = 0; j < ntemas; j += 1) { | |
| 1026 | + titulo = temas[j].nome; | |
| 1027 | + if (tipotip === "completo" || tipotip === "balao") { | |
| 1028 | + titulo = "<span class='toolTipBalaoTitulo'><b>" + titulo + "</b></span><br>"; | |
| 1029 | + } else { | |
| 1030 | + titulo = ""; | |
| 1031 | + } | |
| 1032 | + tips = (temas[j].resultado.tips).split(","); | |
| 1033 | + ntips = tips.length; | |
| 1034 | + ins = ""; | |
| 1035 | + ds = temas[j].resultado.dados; | |
| 1036 | + if (ds !== " " && ds[0] && ds[0] != " ") { | |
| 1037 | + try { | |
| 1038 | + nds = ds.length; | |
| 1039 | + classeCor = "toolTipBalaoTexto"; | |
| 1040 | + for (s = 0; s < nds; s += 1) { | |
| 1041 | + ins += "<div class='" + classeCor + "'>"; | |
| 1042 | + for (r = 0; r < ntips; r += 1) { | |
| 1043 | + try { | |
| 1044 | + eval("var alias = ds[s]." + tips[r] + ".alias"); | |
| 1045 | + eval("var valor = ds[s]." + tips[r] + ".valor"); | |
| 1046 | + eval("var link = ds[s]." + tips[r] + ".link"); | |
| 1047 | + eval("var img = ds[s]." + tips[r] + ".img"); | |
| 1048 | + if (tipotip === "completo" || tipotip === "balao") { | |
| 1049 | + if (valor !== "" && link === "") { | |
| 1050 | + ins += "<span>" + alias + " :" + valor + "</span><br>"; | |
| 1051 | + } | |
| 1052 | + if (valor !== "" && link !== "") { | |
| 1053 | + ins += | |
| 1054 | + "<span>" + alias | |
| 1055 | + + " : <a style='color:blue;cursor:pointer' target=_blanck href='" | |
| 1056 | + + link + "' >" + valor + "</a></span><br>"; | |
| 1057 | + } | |
| 1058 | + if (img !== "") { | |
| 1059 | + ins += img + "<br>"; | |
| 1060 | + } | |
| 1061 | + mostra = true; | |
| 1062 | + } else { | |
| 1063 | + ins += "<span>" + valor + "</span><br>"; | |
| 1064 | + mostra = true; | |
| 1065 | + } | |
| 1066 | + } catch (e) { | |
| 1023 | 1067 | } |
| 1024 | 1068 | } |
| 1025 | - catch(e){} | |
| 1026 | - } | |
| 1027 | - if(classeCor === "toolTipBalaoTexto"){ | |
| 1028 | - classeCor = "toolTipBalaoTexto1"; | |
| 1069 | + if (classeCor === "toolTipBalaoTexto") { | |
| 1070 | + classeCor = "toolTipBalaoTexto1"; | |
| 1071 | + } else { | |
| 1072 | + classeCor = "toolTipBalaoTexto"; | |
| 1073 | + } | |
| 1074 | + ins += "</div>"; | |
| 1029 | 1075 | } |
| 1030 | - else{ | |
| 1031 | - classeCor = "toolTipBalaoTexto"; | |
| 1076 | + | |
| 1077 | + } catch (e) { | |
| 1078 | + if (typeof (console) !== 'undefined') { | |
| 1079 | + console.error(e); | |
| 1032 | 1080 | } |
| 1033 | - ins += "</div>"; | |
| 1034 | 1081 | } |
| 1035 | - | |
| 1036 | - | |
| 1037 | 1082 | } |
| 1038 | - catch(e){ | |
| 1039 | - if(typeof(console) !== 'undefined'){console.error(e);} | |
| 1083 | + if (ins !== "") { | |
| 1084 | + res += titulo + ins; | |
| 1040 | 1085 | } |
| 1041 | 1086 | } |
| 1042 | - if(ins !== "") | |
| 1043 | - {res += titulo + ins;} | |
| 1044 | - } | |
| 1045 | - if(!mostra){ | |
| 1046 | - if($i("tip")) | |
| 1047 | - {$i("tip").style.display="none";} | |
| 1048 | - } | |
| 1049 | - else{ | |
| 1050 | - if(tipotip !== "balao"){ | |
| 1051 | - n = i3GEO.janela.tip(); | |
| 1052 | - $i(n).style.textAlign="left"; | |
| 1053 | - $i(n).innerHTML += res; | |
| 1054 | - } | |
| 1055 | - else{ | |
| 1056 | - if(i3GEO.Interface.ATUAL === "googleearth"){ | |
| 1057 | - i3GEO.Interface.googleearth.balao(res,objposicaocursor.ddx,objposicaocursor.ddy); | |
| 1058 | - i3GEO.Interface.googleearth.aguarde.visibility = "hidden"; | |
| 1087 | + if (!mostra) { | |
| 1088 | + if ($i("tip")) { | |
| 1089 | + $i("tip").style.display = "none"; | |
| 1059 | 1090 | } |
| 1060 | - else{ | |
| 1061 | - i3GEO.util.criaPin('marcaIdentifica',configura.locaplic+"/imagens/grabber.gif","12px","12px"); | |
| 1062 | - i3GEO.janela.TIPS.push('marcaIdentifica'); | |
| 1063 | - pos = i3GEO.util.posicionaImagemNoMapa("marcaIdentifica"); | |
| 1064 | - balloon = new Balloon(); | |
| 1065 | - BalloonConfig(balloon,'GBox'); | |
| 1066 | - balloon.delayTime = 0; | |
| 1067 | - res = "<div style=text-align:left;overflow:auto;height:"+configura.alturatip+";width:"+configura.larguratip+"; >"+res+"</div>"; | |
| 1068 | - temp = $i('marcaIdentifica'); | |
| 1069 | - if(temp){ | |
| 1070 | - balloon.showTooltip(temp,res,null,null,null,pos[1],pos[0]); | |
| 1071 | - balloon.addCloseButton(); | |
| 1072 | - temp.onclick = function(e){ | |
| 1073 | - if (!e){e = window.event;} | |
| 1074 | - document.body.removeChild(balloon.getEventTarget(e)); | |
| 1075 | - balloon.hideTooltip(); | |
| 1076 | - }; | |
| 1091 | + } else { | |
| 1092 | + if (tipotip !== "balao") { | |
| 1093 | + n = i3GEO.janela.tip(); | |
| 1094 | + $i(n).style.textAlign = "left"; | |
| 1095 | + $i(n).innerHTML += res; | |
| 1096 | + } else { | |
| 1097 | + if (i3GEO.Interface.ATUAL === "googleearth") { | |
| 1098 | + i3GEO.Interface.googleearth.balao(res, objposicaocursor.ddx, objposicaocursor.ddy); | |
| 1099 | + i3GEO.Interface.googleearth.aguarde.visibility = "hidden"; | |
| 1100 | + } else { | |
| 1101 | + i3GEO.util.criaPin('marcaIdentifica', configura.locaplic + "/imagens/grabber.gif", "12px", "12px"); | |
| 1102 | + i3GEO.janela.TIPS.push('marcaIdentifica'); | |
| 1103 | + pos = i3GEO.util.posicionaImagemNoMapa("marcaIdentifica"); | |
| 1104 | + balloon = new Balloon(); | |
| 1105 | + BalloonConfig(balloon, 'GBox'); | |
| 1106 | + balloon.delayTime = 0; | |
| 1107 | + res = | |
| 1108 | + "<div style=text-align:left;overflow:auto;height:" + configura.alturatip + ";width:" | |
| 1109 | + + configura.larguratip + "; >" + res + "</div>"; | |
| 1110 | + temp = $i('marcaIdentifica'); | |
| 1111 | + if (temp) { | |
| 1112 | + balloon.showTooltip(temp, res, null, null, null, pos[1], pos[0]); | |
| 1113 | + balloon.addCloseButton(); | |
| 1114 | + temp.onclick = function(e) { | |
| 1115 | + if (!e) { | |
| 1116 | + e = window.event; | |
| 1117 | + } | |
| 1118 | + document.body.removeChild(balloon.getEventTarget(e)); | |
| 1119 | + balloon.hideTooltip(); | |
| 1120 | + }; | |
| 1077 | 1121 | |
| 1122 | + } | |
| 1078 | 1123 | } |
| 1079 | 1124 | } |
| 1080 | 1125 | } |
| 1081 | 1126 | } |
| 1127 | + if ($i(i3GEO.Interface.IDMAPA)) { | |
| 1128 | + $i(i3GEO.Interface.IDMAPA).title = ""; | |
| 1129 | + temp = "identifica"; | |
| 1130 | + if (i3GEO.Interface.ATIVAMENUCONTEXTO) { | |
| 1131 | + temp = "identifica_contexto"; | |
| 1132 | + } | |
| 1133 | + i3GEO.util.mudaCursor(configura.cursores, temp, i3GEO.Interface.IDMAPA, configura.locaplic); | |
| 1134 | + } | |
| 1135 | + }; | |
| 1136 | + xy = i3GEO.navega.centroDoMapa(); | |
| 1137 | + i3GEO.php.identifica3( | |
| 1138 | + retorna, | |
| 1139 | + objposicaocursor.ddx, | |
| 1140 | + objposicaocursor.ddy, | |
| 1141 | + "5", | |
| 1142 | + "tip", | |
| 1143 | + i3GEO.configura.locaplic, | |
| 1144 | + i3GEO.configura.sid, | |
| 1145 | + "ligados", | |
| 1146 | + i3GEO.parametros.mapexten); | |
| 1147 | + } | |
| 1148 | + }, | |
| 1149 | + /* | |
| 1150 | + * Function: compactaLayerGrafico | |
| 1151 | + * | |
| 1152 | + * Retorna uma string no formato base64 + JSON contendo as geometrias existentes no layer grafico do mapa Essas geometrias podem ser | |
| 1153 | + * criadas com o editor vetorial | |
| 1154 | + */ | |
| 1155 | + compactaLayerGrafico : function() { | |
| 1156 | + var geos = false, geometrias = [], n = 0, i, g; | |
| 1157 | + if (i3GEO.editorOL && i3GEO.desenho.layergrafico && i3GEO.desenho.layergrafico.features) { | |
| 1158 | + geos = i3GEO.desenho.layergrafico.features; | |
| 1159 | + n = geos.length; | |
| 1160 | + for (i = 0; i < n; i++) { | |
| 1161 | + g = { | |
| 1162 | + "atributos" : geos[i].attributes, | |
| 1163 | + "geometria" : geos[i].geometry.toString() | |
| 1164 | + }; | |
| 1165 | + geometrias.push(g); | |
| 1166 | + } | |
| 1167 | + } | |
| 1168 | + g = YAHOO.lang.JSON.stringify(geometrias); | |
| 1169 | + return i3GEO.util.base64encode(g); | |
| 1170 | + }, | |
| 1171 | + /* | |
| 1172 | + * Function: desCompactaLayerGrafico | |
| 1173 | + * | |
| 1174 | + * Descompacta um layer grafico criado com compactaLayerGrafico | |
| 1175 | + */ | |
| 1176 | + desCompactaLayerGrafico : function(geometrias) { | |
| 1177 | + geometrias = YAHOO.lang.JSON.parse(geometrias); | |
| 1178 | + // carrega o script do editor vetorial | |
| 1179 | + if (geometrias.length > 0) { | |
| 1180 | + var inicia = function() { | |
| 1181 | + i3GEO.barraDeBotoes.editor.ativaPainel(); | |
| 1182 | + var n = geometrias.length, i; | |
| 1183 | + for (i = 0; i < n; i++) { | |
| 1184 | + i3GEO.editorOL.adicionaFeatureWkt(geometrias[i].geometria, geometrias[i].atributos); | |
| 1082 | 1185 | } |
| 1083 | - if($i(i3GEO.Interface.IDMAPA)){ | |
| 1084 | - $i(i3GEO.Interface.IDMAPA).title = ""; | |
| 1085 | - temp = "identifica"; | |
| 1086 | - if(i3GEO.Interface.ATIVAMENUCONTEXTO) | |
| 1087 | - {temp = "identifica_contexto";} | |
| 1088 | - i3GEO.util.mudaCursor(configura.cursores,temp,i3GEO.Interface.IDMAPA,configura.locaplic); | |
| 1089 | - } | |
| 1090 | - }; | |
| 1091 | - xy = i3GEO.navega.centroDoMapa(); | |
| 1092 | - i3GEO.php.identifica3(retorna,objposicaocursor.ddx,objposicaocursor.ddy,"5","tip",i3GEO.configura.locaplic,i3GEO.configura.sid,"ligados",i3GEO.parametros.mapexten); | |
| 1093 | - } | |
| 1094 | - }, | |
| 1095 | - /* | |
| 1096 | - Function: compactaLayerGrafico | |
| 1097 | - | |
| 1098 | - Retorna uma string no formato base64 + JSON contendo as geometrias existentes no layer grafico do mapa | |
| 1099 | - Essas geometrias podem ser criadas com o editor vetorial | |
| 1100 | - */ | |
| 1101 | - compactaLayerGrafico: function(){ | |
| 1102 | - var geos = false, | |
| 1103 | - geometrias = [], | |
| 1104 | - n = 0, | |
| 1105 | - i,g; | |
| 1106 | - if(i3GEO.editorOL && i3GEO.desenho.layergrafico && i3GEO.desenho.layergrafico.features){ | |
| 1107 | - geos = i3GEO.desenho.layergrafico.features; | |
| 1108 | - n = geos.length; | |
| 1109 | - for(i = 0;i < n; i++){ | |
| 1110 | - g = { | |
| 1111 | - "atributos": geos[i].attributes, | |
| 1112 | - "geometria": geos[i].geometry.toString() | |
| 1186 | + $i(i3GEO.editorOL.layergrafico.id).style.zIndex = 5000; | |
| 1113 | 1187 | }; |
| 1114 | - geometrias.push(g); | |
| 1188 | + i3GEO.util.scriptTag(i3GEO.configura.locaplic + "/mashups/openlayers.js", inicia, "openlayers.js", true); | |
| 1115 | 1189 | } |
| 1116 | - } | |
| 1117 | - g = YAHOO.lang.JSON.stringify(geometrias); | |
| 1118 | - return i3GEO.util.base64encode(g); | |
| 1119 | - }, | |
| 1120 | - /* | |
| 1121 | - Function: desCompactaLayerGrafico | |
| 1122 | - | |
| 1123 | - Descompacta um layer grafico criado com compactaLayerGrafico | |
| 1124 | - */ | |
| 1125 | - desCompactaLayerGrafico: function(geometrias){ | |
| 1126 | - geometrias = YAHOO.lang.JSON.parse(geometrias); | |
| 1127 | - //carrega o script do editor vetorial | |
| 1128 | - if(geometrias.length > 0){ | |
| 1129 | - var inicia = function(){ | |
| 1130 | - i3GEO.barraDeBotoes.editor.ativaPainel(); | |
| 1131 | - var n = geometrias.length, | |
| 1132 | - i; | |
| 1133 | - for(i=0;i<n;i++){ | |
| 1134 | - i3GEO.editorOL.adicionaFeatureWkt(geometrias[i].geometria,geometrias[i].atributos); | |
| 1135 | - } | |
| 1136 | - $i(i3GEO.editorOL.layergrafico.id).style.zIndex = 5000; | |
| 1137 | - }; | |
| 1138 | - i3GEO.util.scriptTag( | |
| 1139 | - i3GEO.configura.locaplic+"/mashups/openlayers.js", | |
| 1140 | - inicia, | |
| 1141 | - "openlayers.js", | |
| 1142 | - true | |
| 1143 | - ); | |
| 1144 | - } | |
| 1145 | - }, | |
| 1146 | - // | |
| 1147 | - //aplica as preferencias armazenadas localmente ou vindas de um mapa salvo no banco de dados | |
| 1148 | - // | |
| 1149 | - aplicaPreferencias: function(cookies){ | |
| 1150 | - //aplica preferencias do usuario | |
| 1151 | - var props, | |
| 1152 | - nprops, | |
| 1153 | - i, | |
| 1154 | - temp = [], | |
| 1155 | - pint; | |
| 1156 | - if(!cookies){ | |
| 1157 | - cookies = i3GEO.util.pegaDadosLocal("preferenciasDoI3Geo"); | |
| 1158 | - } | |
| 1159 | - if(cookies){ | |
| 1160 | - props = cookies.split("::"); | |
| 1161 | - nprops = props.length; | |
| 1162 | - for(i=0;i<nprops;i++){ | |
| 1163 | - try{ | |
| 1164 | - temp = props[i].split("|"); | |
| 1165 | - pint = parseInt(temp[1],10); | |
| 1166 | - if(temp[1] === 'true' || temp[1] === 'false'){ | |
| 1167 | - if(temp[1] === 'true'){ | |
| 1168 | - temp[1] = true; | |
| 1190 | + }, | |
| 1191 | + /* | |
| 1192 | + * Function: restauraGraficos | |
| 1193 | + * | |
| 1194 | + * Descompacta graficos salvos no mapa atual | |
| 1195 | + */ | |
| 1196 | + restauraGraficos : function(graficos) { | |
| 1197 | + // carrega o script do editor vetorial | |
| 1198 | + if (graficos.length > 0) { | |
| 1199 | + var inicia = function() { | |
| 1200 | + i3GEOF.graficointerativo1.restauraGraficos(graficos); | |
| 1201 | + }; | |
| 1202 | + i3GEO.util.scriptTag( | |
| 1203 | + i3GEO.configura.locaplic + "/ferramentas/graficointerativo1/dependencias.php", | |
| 1204 | + inicia, | |
| 1205 | + "graficointerativo1", | |
| 1206 | + true); | |
| 1207 | + } | |
| 1208 | + }, | |
| 1209 | + // | |
| 1210 | + // aplica as preferencias armazenadas localmente ou vindas de um mapa salvo no banco de dados | |
| 1211 | + // | |
| 1212 | + aplicaPreferencias : function(cookies) { | |
| 1213 | + // aplica preferencias do usuario | |
| 1214 | + var props, nprops, i, temp = [], pint; | |
| 1215 | + if (!cookies) { | |
| 1216 | + cookies = i3GEO.util.pegaDadosLocal("preferenciasDoI3Geo"); | |
| 1217 | + } | |
| 1218 | + if (cookies) { | |
| 1219 | + props = cookies.split("::"); | |
| 1220 | + nprops = props.length; | |
| 1221 | + for (i = 0; i < nprops; i++) { | |
| 1222 | + try { | |
| 1223 | + temp = props[i].split("|"); | |
| 1224 | + pint = parseInt(temp[1], 10); | |
| 1225 | + if (temp[1] === 'true' || temp[1] === 'false') { | |
| 1226 | + if (temp[1] === 'true') { | |
| 1227 | + temp[1] = true; | |
| 1228 | + } | |
| 1229 | + if (temp[1] === 'false') { | |
| 1230 | + temp[1] = false; | |
| 1231 | + } | |
| 1232 | + eval(temp[0] + " = " + temp[1] + ";"); | |
| 1233 | + } else if (pint + "px" == temp[1]) { | |
| 1234 | + eval(temp[0] + " = '" + temp[1] + "';"); | |
| 1235 | + } else if (YAHOO.lang.isNumber(pint)) { | |
| 1236 | + eval(temp[0] + " = " + temp[1] + ";"); | |
| 1237 | + } else { | |
| 1238 | + eval(temp[0] + " = '" + temp[1] + "';"); | |
| 1169 | 1239 | } |
| 1170 | - if(temp[1] === 'false'){ | |
| 1171 | - temp[1] = false; | |
| 1240 | + // algumas propriedades usam cookies | |
| 1241 | + if (temp[0] == "i3GEO.configura.mapaRefDisplay") { | |
| 1242 | + i3GEO.util.insereCookie("i3GEO.configura.mapaRefDisplay", temp[1]); | |
| 1243 | + } | |
| 1244 | + } catch (e) { | |
| 1245 | + if (typeof (console) !== 'undefined') { | |
| 1246 | + console.warn(temp[0] + " = " + temp[1] + ";"); | |
| 1172 | 1247 | } |
| 1173 | - eval(temp[0]+" = "+temp[1]+";"); | |
| 1174 | - } | |
| 1175 | - else if(pint+"px" == temp[1]){ | |
| 1176 | - eval(temp[0]+" = '"+temp[1]+"';"); | |
| 1177 | - } | |
| 1178 | - else if(YAHOO.lang.isNumber(pint)){ | |
| 1179 | - eval(temp[0]+" = "+temp[1]+";"); | |
| 1180 | - } | |
| 1181 | - else{ | |
| 1182 | - eval(temp[0]+" = '"+temp[1]+"';"); | |
| 1183 | - } | |
| 1184 | - //algumas propriedades usam cookies | |
| 1185 | - if(temp[0] == "i3GEO.configura.mapaRefDisplay"){ | |
| 1186 | - i3GEO.util.insereCookie("i3GEO.configura.mapaRefDisplay",temp[1]); | |
| 1187 | 1248 | } |
| 1188 | 1249 | } |
| 1189 | - catch(e){ | |
| 1190 | - if(typeof(console) !== 'undefined'){console.warn(temp[0]+" = "+temp[1]+";");} | |
| 1191 | - } | |
| 1192 | 1250 | } |
| 1193 | 1251 | } |
| 1194 | - } | |
| 1195 | -}; | |
| 1196 | -//YAHOO.log("carregou classe mapa", "Classes i3geo"); | |
| 1252 | + }; | |
| 1253 | +// YAHOO.log("carregou classe mapa", "Classes i3geo"); | ... | ... |
classesjs/classe_php.js
| ... | ... | @@ -1670,7 +1670,7 @@ i3GEO.php = { |
| 1670 | 1670 | |
| 1671 | 1671 | Salva o mapfile atual no banco de dados de administracao |
| 1672 | 1672 | */ |
| 1673 | - salvaMapaBanco: function(funcao,titulo,id_mapa,preferencias,geometrias){ | |
| 1673 | + salvaMapaBanco: function(funcao,titulo,id_mapa,preferencias,geometrias,graficos){ | |
| 1674 | 1674 | //pega as preferencias do usuario tambem |
| 1675 | 1675 | if(preferencias){ |
| 1676 | 1676 | try{ |
| ... | ... | @@ -1698,6 +1698,22 @@ i3GEO.php = { |
| 1698 | 1698 | else{ |
| 1699 | 1699 | geometrias = ""; |
| 1700 | 1700 | } |
| 1701 | + //pega as ferramentas do tipo grafico | |
| 1702 | + if(graficos && i3GEOF && i3GEOF.graficointerativo1){ | |
| 1703 | + try{ | |
| 1704 | + graficos = i3GEOF.graficointerativo1.compactaConfig(); | |
| 1705 | + if(!graficos){ | |
| 1706 | + graficos = ""; | |
| 1707 | + } | |
| 1708 | + } | |
| 1709 | + catch(e){ | |
| 1710 | + graficos = ""; | |
| 1711 | + } | |
| 1712 | + } | |
| 1713 | + else{ | |
| 1714 | + graficos = ""; | |
| 1715 | + } | |
| 1716 | + | |
| 1701 | 1717 | var url = (window.location.href.split("?")[0]), |
| 1702 | 1718 | p = i3GEO.configura.locaplic+"/admin/php/mapas.php?"; |
| 1703 | 1719 | par = "funcao=salvaMapfile" + |
| ... | ... | @@ -1708,7 +1724,7 @@ i3GEO.php = { |
| 1708 | 1724 | cp = new cpaint(); |
| 1709 | 1725 | cp.set_transfer_mode('POST'); |
| 1710 | 1726 | cp.set_response_type("JSON"); |
| 1711 | - cp.call(p+par,"foo",funcao,"&preferenciasbase64=" + preferencias + "&geometriasbase64=" + geometrias); | |
| 1727 | + cp.call(p+par,"foo",funcao,"&preferenciasbase64=" + preferencias + "&geometriasbase64=" + geometrias + "&graficosbase64=" + graficos); | |
| 1712 | 1728 | }, |
| 1713 | 1729 | /* |
| 1714 | 1730 | Function: marcadores2shp | ... | ... |
classesjs/classe_util.js
| ... | ... | @@ -2882,7 +2882,7 @@ i3GEO.util = { |
| 2882 | 2882 | YAHOO.util.Connect.asyncRequest("GET", sUrl, callback); |
| 2883 | 2883 | }, |
| 2884 | 2884 | /* |
| 2885 | - Verifica se a fun��o html de armazenamento local esta disponivel no navegador | |
| 2885 | + Verifica se a funcao html de armazenamento local esta disponivel no navegador | |
| 2886 | 2886 | */ |
| 2887 | 2887 | verifica_html5_storage: function(){ |
| 2888 | 2888 | if(typeof(Storage)!=="undefined"){ | ... | ... |
classesphp/mapa_inicia.php
| ... | ... | @@ -372,7 +372,7 @@ function iniciaMapa() |
| 372 | 372 | //parametros de inicializacao armazenados com o mapa quando o usuario utiliza a opcao de salvar mapa no nbanco de dados |
| 373 | 373 | $customizacoesinit = $m->mapa->getmetadata("CUSTOMIZACOESINIT"); |
| 374 | 374 | $res["editavel"] = $m->mapa->getmetadata("EDITAVEL"); |
| 375 | - $m->mapa->setmetadata("CUSTOMIZACOESINIT",""); | |
| 375 | + //$m->mapa->setmetadata("CUSTOMIZACOESINIT",""); | |
| 376 | 376 | $m->salva(); |
| 377 | 377 | copy($map_file,(str_replace(".map","reinc.map",$map_file))); |
| 378 | 378 | copy($map_file,(str_replace(".map","seguranca.map",$map_file))); | ... | ... |
ferramentas/graficointerativo1/index.js
| 1 | 1 | /** |
| 2 | 2 | * Title: Gráfico interativo 1 |
| 3 | - * | |
| 3 | + * | |
| 4 | 4 | * Representação gráfica de dados. O gráfico é construído tendo como base os atributos de um tema |
| 5 | 5 | * e é modificado conforme o usuário navega pelo mapa. A renderização do gráfico é feito pelo |
| 6 | 6 | * navegador por meio do aplicativo openflashchart. Os dados que serão utilizados no gráfico são baseados em um |
| 7 | 7 | * elemento TABLE. Esse elemento pode ser montado com base na tabela de atributos e editada pelo usuário. Os dados podem |
| 8 | 8 | * também ser inseridos como parâmetros na inicialização da ferramenta, permitindo que o gráfico seja |
| 9 | 9 | * utilizado por outras ferramentas. |
| 10 | - * | |
| 10 | + * | |
| 11 | + * Gráficos podem ser salvos no mapa. Veja a função compactaConfig que gera uma string em base64 com as configurações em JSON | |
| 12 | + * de todos os gráficos abertos no mapa | |
| 13 | + * | |
| 14 | + * Os gráficos podem ser restaurados usando-se a função restauraGraficos | |
| 15 | + * | |
| 11 | 16 | * Veja: |
| 12 | - * | |
| 17 | + * | |
| 13 | 18 | * <i3GEO.analise.dialogo.graficointerativo1> |
| 14 | - * | |
| 19 | + * | |
| 15 | 20 | * Arquivo: |
| 16 | - * | |
| 21 | + * | |
| 17 | 22 | * i3geo/ferramentas/graficointerativo1/index.js.php |
| 18 | - * | |
| 23 | + * | |
| 19 | 24 | * Licenca: |
| 20 | - * | |
| 25 | + * | |
| 21 | 26 | * GPL2 |
| 22 | - * | |
| 27 | + * | |
| 23 | 28 | * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet |
| 24 | - * | |
| 29 | + * | |
| 25 | 30 | * Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com |
| 26 | - * | |
| 31 | + * | |
| 27 | 32 | * Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo sob os termos da Licença |
| 28 | 33 | * Pública Geral GNU conforme publicada pela Free Software Foundation; |
| 29 | - * | |
| 34 | + * | |
| 30 | 35 | * Este programa é distribuído na expectativa de que seja útil, porém, SEM NENHUMA GARANTIA; nem mesmo a |
| 31 | 36 | * garantia implícita de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença |
| 32 | 37 | * Pública Geral do GNU para mais detalhes. Você deve ter recebido uma cópia da Licença Pública Geral do |
| ... | ... | @@ -38,7 +43,7 @@ if (typeof (i3GEOF) === 'undefined') { |
| 38 | 43 | } |
| 39 | 44 | /** |
| 40 | 45 | * Classe: i3GEOF.graficointerativo1 |
| 41 | - * | |
| 46 | + * | |
| 42 | 47 | */ |
| 43 | 48 | i3GEOF.graficointerativo1 = |
| 44 | 49 | { |
| ... | ... | @@ -57,124 +62,304 @@ i3GEOF.graficointerativo1 = |
| 57 | 62 | mustacheHash : function(idjanela) { |
| 58 | 63 | return { |
| 59 | 64 | "idjanela" : idjanela, |
| 60 | - "idjanelaA" : '"'+idjanela+'"', | |
| 65 | + "idjanelaA" : '"' + idjanela + '"', | |
| 61 | 66 | "locaplic" : i3GEO.configura.locaplic, |
| 62 | - "prop": $trad("p13"), | |
| 63 | - "tipo": $trad(1, i3GEOF.graficointerativo1.dicionario), | |
| 64 | - "dados": $trad(2, i3GEOF.graficointerativo1.dicionario), | |
| 65 | - "grafico": $trad(3, i3GEOF.graficointerativo1.dicionario), | |
| 66 | - "escolhatipo": $trad(4, i3GEOF.graficointerativo1.dicionario), | |
| 67 | - "pizza2d": $trad(5, i3GEOF.graficointerativo1.dicionario), | |
| 68 | - "areasimp": $trad(6, i3GEOF.graficointerativo1.dicionario), | |
| 69 | - "distpt": $trad(7, i3GEOF.graficointerativo1.dicionario), | |
| 70 | - "linhassimp": $trad(8, i3GEOF.graficointerativo1.dicionario), | |
| 71 | - "arvore": $trad(9, i3GEOF.graficointerativo1.dicionario), | |
| 72 | - "barrasv": $trad(10, i3GEOF.graficointerativo1.dicionario), | |
| 73 | - "barrash": $trad(11, i3GEOF.graficointerativo1.dicionario), | |
| 74 | - "configgr": $trad(12, i3GEOF.graficointerativo1.dicionario), | |
| 75 | - "tema": $trad(13, i3GEOF.graficointerativo1.dicionario), | |
| 76 | - "titulo": $trad(50, i3GEOF.graficointerativo1.dicionario), | |
| 77 | - "titux": $trad(51, i3GEOF.graficointerativo1.dicionario), | |
| 78 | - "tituy":$trad(52, i3GEOF.graficointerativo1.dicionario), | |
| 79 | - "itemcx": $trad(14, i3GEOF.graficointerativo1.dicionario), | |
| 80 | - "itemcy": $trad(15, i3GEOF.graficointerativo1.dicionario), | |
| 81 | - "excluirval": $trad(16, i3GEOF.graficointerativo1.dicionario), | |
| 82 | - "geracor": $trad(17, i3GEOF.graficointerativo1.dicionario), | |
| 83 | - "obterdados": $trad(18, i3GEOF.graficointerativo1.dicionario), | |
| 84 | - "seescolher": $trad(19, i3GEOF.graficointerativo1.dicionario), | |
| 85 | - "inclinax": $trad(20, i3GEOF.graficointerativo1.dicionario), | |
| 86 | - "adlinbarras": $trad(21, i3GEOF.graficointerativo1.dicionario), | |
| 87 | - "utilizvalacum": $trad(22, i3GEOF.graficointerativo1.dicionario), | |
| 88 | - "utilizvalrelat": $trad(23, i3GEOF.graficointerativo1.dicionario), | |
| 89 | - "ordenax": $trad(24, i3GEOF.graficointerativo1.dicionario), | |
| 90 | - "naoprocessa": $trad(25, i3GEOF.graficointerativo1.dicionario), | |
| 91 | - "stacked": $trad(48, i3GEOF.graficointerativo1.dicionario), | |
| 92 | - "linhasnascols": $trad(49, i3GEOF.graficointerativo1.dicionario), | |
| 93 | - "media": $trad(27, i3GEOF.graficointerativo1.dicionario), | |
| 94 | - "tipoagregay": $trad(28, i3GEOF.graficointerativo1.dicionario), | |
| 95 | - "fatcalclarg": $trad(29, i3GEOF.graficointerativo1.dicionario), | |
| 96 | - "janelasep": $trad(30, i3GEOF.graficointerativo1.dicionario), | |
| 97 | - "soma": $trad(26, i3GEOF.graficointerativo1.dicionario), | |
| 98 | - "i3GEOgraficointerativo1Titulo": $inputText("", "", idjanela + "i3GEOgraficointerativo1Titulo", "", 40, ""), | |
| 99 | - "i3GEOgraficointerativo1TituloX": $inputText("", "", idjanela + "i3GEOgraficointerativo1TituloX", "", 40, ""), | |
| 100 | - "i3GEOgraficointerativo1TituloY": $inputText("", "", idjanela + "i3GEOgraficointerativo1TituloY", "", 40, ""), | |
| 101 | - "i3GEOgraficointerativo1excluir": $inputText("", "", idjanela + "i3GEOgraficointerativo1excluir", "", 3, "") | |
| 67 | + "prop" : $trad("p13"), | |
| 68 | + "tipo" : $trad(1, i3GEOF.graficointerativo1.dicionario), | |
| 69 | + "dados" : $trad(2, i3GEOF.graficointerativo1.dicionario), | |
| 70 | + "grafico" : $trad(3, i3GEOF.graficointerativo1.dicionario), | |
| 71 | + "escolhatipo" : $trad(4, i3GEOF.graficointerativo1.dicionario), | |
| 72 | + "pizza2d" : $trad(5, i3GEOF.graficointerativo1.dicionario), | |
| 73 | + "areasimp" : $trad(6, i3GEOF.graficointerativo1.dicionario), | |
| 74 | + "distpt" : $trad(7, i3GEOF.graficointerativo1.dicionario), | |
| 75 | + "linhassimp" : $trad(8, i3GEOF.graficointerativo1.dicionario), | |
| 76 | + "arvore" : $trad(9, i3GEOF.graficointerativo1.dicionario), | |
| 77 | + "barrasv" : $trad(10, i3GEOF.graficointerativo1.dicionario), | |
| 78 | + "barrash" : $trad(11, i3GEOF.graficointerativo1.dicionario), | |
| 79 | + "configgr" : $trad(12, i3GEOF.graficointerativo1.dicionario), | |
| 80 | + "tema" : $trad(13, i3GEOF.graficointerativo1.dicionario), | |
| 81 | + "titulo" : $trad(50, i3GEOF.graficointerativo1.dicionario), | |
| 82 | + "titux" : $trad(51, i3GEOF.graficointerativo1.dicionario), | |
| 83 | + "tituy" : $trad(52, i3GEOF.graficointerativo1.dicionario), | |
| 84 | + "itemcx" : $trad(14, i3GEOF.graficointerativo1.dicionario), | |
| 85 | + "itemcy" : $trad(15, i3GEOF.graficointerativo1.dicionario), | |
| 86 | + "excluirval" : $trad(16, i3GEOF.graficointerativo1.dicionario), | |
| 87 | + "geracor" : $trad(17, i3GEOF.graficointerativo1.dicionario), | |
| 88 | + "obterdados" : $trad(18, i3GEOF.graficointerativo1.dicionario), | |
| 89 | + "seescolher" : $trad(19, i3GEOF.graficointerativo1.dicionario), | |
| 90 | + "inclinax" : $trad(20, i3GEOF.graficointerativo1.dicionario), | |
| 91 | + "adlinbarras" : $trad(21, i3GEOF.graficointerativo1.dicionario), | |
| 92 | + "utilizvalacum" : $trad(22, i3GEOF.graficointerativo1.dicionario), | |
| 93 | + "utilizvalrelat" : $trad(23, i3GEOF.graficointerativo1.dicionario), | |
| 94 | + "ordenax" : $trad(24, i3GEOF.graficointerativo1.dicionario), | |
| 95 | + "naoprocessa" : $trad(25, i3GEOF.graficointerativo1.dicionario), | |
| 96 | + "stacked" : $trad(48, i3GEOF.graficointerativo1.dicionario), | |
| 97 | + "linhasnascols" : $trad(49, i3GEOF.graficointerativo1.dicionario), | |
| 98 | + "media" : $trad(27, i3GEOF.graficointerativo1.dicionario), | |
| 99 | + "tipoagregay" : $trad(28, i3GEOF.graficointerativo1.dicionario), | |
| 100 | + "fatcalclarg" : $trad(29, i3GEOF.graficointerativo1.dicionario), | |
| 101 | + "janelasep" : $trad(30, i3GEOF.graficointerativo1.dicionario), | |
| 102 | + "soma" : $trad(26, i3GEOF.graficointerativo1.dicionario), | |
| 103 | + "i3GEOgraficointerativo1Titulo" : $inputText("", "", idjanela + "i3GEOgraficointerativo1Titulo", "", 40, ""), | |
| 104 | + "i3GEOgraficointerativo1TituloX" : $inputText("", "", idjanela + "i3GEOgraficointerativo1TituloX", "", 40, ""), | |
| 105 | + "i3GEOgraficointerativo1TituloY" : $inputText("", "", idjanela + "i3GEOgraficointerativo1TituloY", "", 40, ""), | |
| 106 | + "i3GEOgraficointerativo1excluir" : $inputText("", "", idjanela + "i3GEOgraficointerativo1excluir", "", 3, "") | |
| 102 | 107 | }; |
| 103 | 108 | }, |
| 104 | 109 | /** |
| 105 | 110 | * Propriedade: dados |
| 106 | - * | |
| 111 | + * | |
| 107 | 112 | * Dados que serao utilizados. Pode ser passado como parametro. |
| 108 | - * | |
| 113 | + * | |
| 109 | 114 | * Default: {false} |
| 110 | 115 | */ |
| 111 | 116 | dados : false, |
| 112 | 117 | /** |
| 113 | 118 | * Propriedade: titulo |
| 114 | - * | |
| 119 | + * | |
| 115 | 120 | * Título do gráfico. Se for vazio, será obtido do nome do tema selecionado |
| 116 | 121 | */ |
| 117 | 122 | titulo : "", |
| 118 | 123 | /** |
| 119 | 124 | * Propriedade: tipo |
| 120 | - * | |
| 125 | + * | |
| 121 | 126 | * Tipo de gráfico escolhido pelo usuário. |
| 122 | 127 | */ |
| 123 | 128 | tipo : "", |
| 124 | 129 | /** |
| 125 | 130 | * Propriedade: acumula |
| 126 | - * | |
| 131 | + * | |
| 127 | 132 | * Acumula os valores ao gerar o gráfico |
| 128 | - * | |
| 133 | + * | |
| 129 | 134 | * Type: {boolean} |
| 130 | - * | |
| 135 | + * | |
| 131 | 136 | * Default: {false} |
| 132 | 137 | */ |
| 133 | 138 | acumula : false, |
| 134 | 139 | /** |
| 135 | 140 | * Propriedade: relativa |
| 136 | - * | |
| 141 | + * | |
| 137 | 142 | * Utiliza valores relativos ao criar o gráfico |
| 138 | - * | |
| 143 | + * | |
| 139 | 144 | * Type: {boolean} |
| 140 | - * | |
| 145 | + * | |
| 141 | 146 | * Default: {false} |
| 142 | 147 | */ |
| 143 | 148 | relativa : false, |
| 144 | 149 | /** |
| 145 | 150 | * Propriedade: dadospuros |
| 146 | - * | |
| 151 | + * | |
| 147 | 152 | * Não faz nenhum tipo de processamento nos dados antes de gerar o gráfico |
| 148 | - * | |
| 153 | + * | |
| 149 | 154 | * Type: {boolean} |
| 150 | - * | |
| 155 | + * | |
| 151 | 156 | * Default: {false} |
| 152 | 157 | */ |
| 153 | 158 | dadospuros : false, |
| 154 | 159 | /** |
| 155 | - * Function: iniciaDicionario | |
| 156 | - * | |
| 160 | + * iniciaDicionario (depreciado na versao 6.0) | |
| 161 | + * | |
| 157 | 162 | * Carrega o dicionário e chama a função que inicia a ferramenta |
| 158 | - * | |
| 163 | + * | |
| 159 | 164 | * O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script |
| 160 | 165 | */ |
| 161 | - iniciaDicionario : function(dados) { | |
| 162 | - i3GEOF.tabela.iniciaJanelaFlutuante(dados); | |
| 166 | + iniciaDicionario : function(parametros) { | |
| 167 | + i3GEOF.tabela.iniciaJanelaFlutuante(parametros); | |
| 168 | + }, | |
| 169 | + /** | |
| 170 | + * Configura o grafico conforme um objeto contendo parametros e opcionalmente os dados Alguns parametros possuem definicoes padrao, | |
| 171 | + * usadas quando o valor nao e passado | |
| 172 | + * | |
| 173 | + * Qualquer outro campo de formulario pode ter seu valor passado como parametro, desde que use o mesmo ID, excluindo-se do nome do | |
| 174 | + * ID o prefixo (codigo da janela) | |
| 175 | + * | |
| 176 | + * parametros {objeto} com os seguintes elementos: | |
| 177 | + * | |
| 178 | + * idjanela - id do grafico. Usado como prefixo para inserir os identificadores dos elementos DOM que fazem parte da interface do | |
| 179 | + * grafico. Se existir um elemento dom esse id, o grafico sera inserido nesse elemento | |
| 180 | + * | |
| 181 | + * tema - codigo do tema existente no mapa e que sera a fonte para os dados | |
| 182 | + * | |
| 183 | + * atualiza true|false - a janela sera atualizada na navegacao do mapa ou nao | |
| 184 | + * | |
| 185 | + * dados - dados que comporao o mapa. Caso nao existam, serao obtidos de tema | |
| 186 | + * | |
| 187 | + * acumula true|false - acumula os valores de cada elemento do grafico | |
| 188 | + * | |
| 189 | + * relativa true|false - utiliza valores relativos nos eixos | |
| 190 | + * | |
| 191 | + * dadospuros true|false - realiza ou nao processos de adequacao dos dados | |
| 192 | + */ | |
| 193 | + configura : function(parametros) { | |
| 194 | + var idjanela; | |
| 195 | + if (!parametros.idjanela) { | |
| 196 | + idjanela = "graficoi" + parseInt(Math.random() * 1000000, 10); | |
| 197 | + } else { | |
| 198 | + idjanela = parametros.idjanela; | |
| 199 | + } | |
| 200 | + i3GEOF.graficointerativo1.janelas.push(idjanela); | |
| 201 | + if (parametros) { | |
| 202 | + i3GEOF.graficointerativo1.propJanelas[idjanela] = parametros; | |
| 203 | + } else { | |
| 204 | + i3GEOF.graficointerativo1.propJanelas[idjanela] = {}; | |
| 205 | + } | |
| 206 | + if (!parametros.tema) { | |
| 207 | + i3GEOF.graficointerativo1.propJanelas[idjanela].tema = ""; | |
| 208 | + } | |
| 209 | + if (!parametros.atualiza) { | |
| 210 | + i3GEOF.graficointerativo1.propJanelas[idjanela].atualiza = true; | |
| 211 | + } | |
| 212 | + // guarda para esse grafico alguns valores default obtidos dos | |
| 213 | + // parametros gerais da ferramenta | |
| 214 | + if (!parametros.acumula) { | |
| 215 | + i3GEOF.graficointerativo1.propJanelas[idjanela].acumula = parametros.acumula; | |
| 216 | + } | |
| 217 | + if (!parametros.relativa) { | |
| 218 | + i3GEOF.graficointerativo1.propJanelas[idjanela].relativa = parametros.relativa; | |
| 219 | + } | |
| 220 | + if (!parametros.dadospuros) { | |
| 221 | + i3GEOF.graficointerativo1.propJanelas[idjanela].dadospuros = parametros.dadospuros; | |
| 222 | + } | |
| 223 | + return idjanela; | |
| 224 | + }, | |
| 225 | + /** | |
| 226 | + * Aplica ao grafico os parametros de configuracao definidos para cada interface que controla o grafico Os parametros de | |
| 227 | + * configuracao sao obtidos na inicializacao, passados como parametros Essa funcao deve ser executada apos os elementos html terem | |
| 228 | + * sido renderizados | |
| 229 | + */ | |
| 230 | + aplicaConfig : function(idjanela) { | |
| 231 | + var config, i, atualizaConfigGr; | |
| 232 | + config = i3GEOF.graficointerativo1.propJanelas[idjanela]; | |
| 233 | + nomesIds = i3GEO.util.listaChaves(config); | |
| 234 | + atualizaConfigGr = function() { | |
| 235 | + var i,o,n,j; | |
| 236 | + n = nomesIds.length; | |
| 237 | + for (j=0;j<n;j++) { | |
| 238 | + i = nomesIds[j]; | |
| 239 | + o = $i(idjanela + i); | |
| 240 | + if (o && config[i]) { | |
| 241 | + if (o.type.toLowerCase() === "radio" || o.type.toLowerCase() === "checkbox") { | |
| 242 | + o.checked = config[i]; | |
| 243 | + } else { | |
| 244 | + o.value = config[i]; | |
| 245 | + } | |
| 246 | + } | |
| 247 | + } | |
| 248 | + }; | |
| 249 | + // preenche os campos existentes | |
| 250 | + atualizaConfigGr(); | |
| 251 | + // ativa o tipo de grafico | |
| 252 | + if (config.tema) { | |
| 253 | + i3GEOF.graficointerativo1.ativaTipo("", idjanela); | |
| 254 | + i3GEOF.graficointerativo1.comboTemas(idjanela); | |
| 255 | + // cria as entradas de parametros para o eixo y | |
| 256 | + if(config.numeroColunasY && config.numeroColunasY > 0){ | |
| 257 | + for(i=0;i<config.numeroColunasY;i++){ | |
| 258 | + i3GEOF.graficointerativo1.comboItensSel(idjanela); | |
| 259 | + } | |
| 260 | + } | |
| 261 | + // atualiza novamente os campos criados | |
| 262 | + atualizaConfigGr(); | |
| 263 | + if (i3GEOF.graficointerativo1.propJanelas[idjanela].dados != "") { | |
| 264 | + i3GEOF.graficointerativo1.obterDados(idjanela); | |
| 265 | + } | |
| 266 | + } | |
| 267 | + }, | |
| 268 | + /** | |
| 269 | + * Obtem os parametros de cada janela e converte em base64 Cada janela e inserida como um item em um objeto A compactacao e | |
| 270 | + * utilizada para salvar as configuracoes no mapfile atual | |
| 271 | + */ | |
| 272 | + compactaConfig : function() { | |
| 273 | + var c,g, par, janelas, i,n; | |
| 274 | + par = []; | |
| 275 | + janelas = i3GEOF.graficointerativo1.janelas; | |
| 276 | + n = janelas.length; | |
| 277 | + for (i = 0; i < n; i++) { | |
| 278 | + c = i3GEOF.graficointerativo1.retornaConfig(janelas[i]); | |
| 279 | + par.push(c); | |
| 280 | + } | |
| 281 | + g = YAHOO.lang.JSON.stringify(par); | |
| 282 | + return i3GEO.util.base64encode(g); | |
| 283 | + }, | |
| 284 | + restauraGraficos: function(par){ | |
| 285 | + var n,i; | |
| 286 | + par = i3GEO.util.base64decode(par); | |
| 287 | + par = YAHOO.lang.JSON.parse(par); | |
| 288 | + n = par.length; | |
| 289 | + for(i=0;i<n;i++){ | |
| 290 | + i3GEOF.graficointerativo1.iniciaJanelaFlutuante(par[i]); | |
| 291 | + } | |
| 292 | + }, | |
| 293 | + /** | |
| 294 | + * Retorna um objeto contendo os valores de todos os parametros utilizados no grafico de tal forma que um grafico possa ser | |
| 295 | + * renderizado novamente | |
| 296 | + * | |
| 297 | + * A funcao i3GEO.php.salvaMapaBanco utiliza retornaConfig e cria um objeto que ira armazenar os parametros de cada janela | |
| 298 | + */ | |
| 299 | + retornaConfig : function(idjanela) { | |
| 300 | + // as chaves do objeto correspondem ao ID de cada elemento | |
| 301 | + var c, par, objs, obj = "", contador = 0; | |
| 302 | + par = i3GEOF.graficointerativo1.propJanelas[idjanela]; | |
| 303 | + c = $i(idjanela); | |
| 304 | + // pega todos os elementos do tipo checkbox | |
| 305 | + objs = c.getElementsByTagName("checkbox"); | |
| 306 | + for (obj in objs) { | |
| 307 | + if (objs[obj].id) { | |
| 308 | + par[objs[obj].id] = objs[obj].checked; | |
| 309 | + } | |
| 310 | + } | |
| 311 | + // pega todos os elementos do tipo input | |
| 312 | + objs = c.getElementsByTagName("input"); | |
| 313 | + for (obj in objs) { | |
| 314 | + // nao inclui agora os dados e cores | |
| 315 | + if (objs[obj].id && objs[obj].id.search(idjanela + "i3GEOgraficointerativo1Dados") < 0) { | |
| 316 | + par[objs[obj].id] = objs[obj].value; | |
| 317 | + } | |
| 318 | + } | |
| 319 | + // pega todos os elementos do tipo select | |
| 320 | + objs = c.getElementsByTagName("select"); | |
| 321 | + for (obj in objs) { | |
| 322 | + if (objs[obj].id) { | |
| 323 | + par[objs[obj].id] = objs[obj].value; | |
| 324 | + } | |
| 325 | + } | |
| 326 | + // se a janela esta marcada para ser atualizada ao navegar, os dados nao devem ser incluidos | |
| 327 | + if (i3GEOF.graficointerativo1.propJanelas[idjanela].atualiza === false) { | |
| 328 | + // inclui a tabela com os dados | |
| 329 | + c = $i(idjanela + "i3GEOgraficointerativo1Dados"); | |
| 330 | + objs = c.getElementsByTagName("input"); | |
| 331 | + for (obj in objs) { | |
| 332 | + if (objs[obj].id) { | |
| 333 | + par[objs[obj].id] = objs[obj].value; | |
| 334 | + } | |
| 335 | + } | |
| 336 | + } else { | |
| 337 | + par.dados = ""; | |
| 338 | + } | |
| 339 | + // conta o numero de combos do eixo y | |
| 340 | + c = $i(idjanela + "i3GEOgraficointerativo1ComboYlinha"); | |
| 341 | + objs = c.getElementsByTagName("select"); | |
| 342 | + for (obj in objs) { | |
| 343 | + if (objs[obj].value && objs[obj].value != "") { | |
| 344 | + contador++; | |
| 345 | + } | |
| 346 | + } | |
| 347 | + par["numeroColunasY"] = contador; | |
| 348 | + return par; | |
| 163 | 349 | }, |
| 164 | 350 | /** |
| 165 | 351 | * Function: inicia |
| 166 | - * | |
| 352 | + * | |
| 167 | 353 | * Inicia a ferramenta. É chamado por criaJanelaFlutuante |
| 168 | - * | |
| 354 | + * | |
| 169 | 355 | * Parametros: |
| 170 | - * | |
| 356 | + * | |
| 171 | 357 | * iddiv {String} - id do div que receberá o conteudo HTML da ferramenta |
| 172 | - * | |
| 358 | + * | |
| 173 | 359 | * dados {JSON} - dados para o gráfico (opcional) exemplo |
| 174 | 360 | * ["n;x","'Argentina';33796870","'Paraguay';4773464","'Brazil';151525400","'Chile';13772710"] |
| 175 | 361 | */ |
| 176 | 362 | inicia : function(iddiv, idjanela) { |
| 177 | - // try{ | |
| 178 | 363 | $i(iddiv).innerHTML += i3GEOF.graficointerativo1.html(idjanela); |
| 179 | 364 | $i(idjanela + "i3GEOgraficointerativo1Acumula").checked = i3GEOF.graficointerativo1.propJanelas[idjanela].acumula; |
| 180 | 365 | $i(idjanela + "i3GEOgraficointerativo1Relativa").checked = i3GEOF.graficointerativo1.propJanelas[idjanela].relativa; |
| ... | ... | @@ -218,7 +403,7 @@ i3GEOF.graficointerativo1 = |
| 218 | 403 | }; |
| 219 | 404 | $i(idjanela + "i3GEOgraficointerativo1guia5").onclick = |
| 220 | 405 | function() { |
| 221 | - if (i3GEOF.graficointerativo1.tipo === "") { | |
| 406 | + if (i3GEOF.graficointerativo1.propJanelas[idjanela].tipo === "") { | |
| 222 | 407 | alert($trad(4, i3GEOF.graficointerativo1.dicionario)); |
| 223 | 408 | return; |
| 224 | 409 | } |
| ... | ... | @@ -228,11 +413,11 @@ i3GEOF.graficointerativo1 = |
| 228 | 413 | i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOgraficointerativo1guia5", idjanela + "i3GEOgraficointerativo1guia"); |
| 229 | 414 | $i(idjanela + "i3GEOgraficointerativo1Grafico").style.display = "none"; |
| 230 | 415 | $i(idjanela + "i3GEOgraficointerativo1guia5obj").innerHTML = |
| 231 | - "<textarea rows='20' cols='52' >" + (i3GEOF.graficointerativo1.tabela2csv()).join("\n") + "</textarea>"; | |
| 416 | + "<textarea rows='20' cols='52' >" + (i3GEOF.graficointerativo1.tabela2csv(idjanela)).join("\n") + "</textarea>"; | |
| 232 | 417 | }; |
| 233 | 418 | $i(idjanela + "i3GEOgraficointerativo1guia6").onclick = |
| 234 | 419 | function() { |
| 235 | - if (i3GEOF.graficointerativo1.tipo === "") { | |
| 420 | + if (i3GEOF.graficointerativo1.propJanelas[idjanela].tipo === "") { | |
| 236 | 421 | alert($trad(4, i3GEOF.graficointerativo1.dicionario)); |
| 237 | 422 | return; |
| 238 | 423 | } |
| ... | ... | @@ -261,21 +446,27 @@ i3GEOF.graficointerativo1 = |
| 261 | 446 | } |
| 262 | 447 | } |
| 263 | 448 | }); |
| 264 | - if (i3GEOF.graficointerativo1.propJanelas[idjanela].dados | |
| 265 | - && i3GEOF.graficointerativo1.propJanelas[idjanela].dados != "undefined") { | |
| 449 | + if (i3GEOF.graficointerativo1.propJanelas[idjanela].dados != "") { | |
| 266 | 450 | i3GEOF.graficointerativo1.montaTabelaDados(idjanela, i3GEOF.graficointerativo1.propJanelas[idjanela].dados); |
| 267 | 451 | $i(idjanela + "i3GEOgraficointerativo1guia4").onclick.call(); |
| 268 | 452 | } else { |
| 269 | 453 | i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOgraficointerativo1guia1", idjanela + "i3GEOgraficointerativo1guia"); |
| 270 | 454 | } |
| 455 | + // | |
| 456 | + // Apos todos os elementos HTML da ferramenta terem sido renderizados | |
| 457 | + // aplicam-se os parametros armazenados nas propriedades da janela atual | |
| 458 | + // Isso e necessario pois os parametros podem ter sido enviados na inicializacao da ferramenta, | |
| 459 | + // por exemplo, quando um mapa e salvo, os parametros sao armazenados e depois recuperados | |
| 460 | + // | |
| 461 | + i3GEOF.graficointerativo1.aplicaConfig(idjanela); | |
| 271 | 462 | }, |
| 272 | 463 | /** |
| 273 | 464 | * Function: html |
| 274 | - * | |
| 465 | + * | |
| 275 | 466 | * Gera o código html para apresentação das opções da ferramenta |
| 276 | - * | |
| 467 | + * | |
| 277 | 468 | * Retorno: |
| 278 | - * | |
| 469 | + * | |
| 279 | 470 | * String com o código html |
| 280 | 471 | */ |
| 281 | 472 | html : function(idjanela) { |
| ... | ... | @@ -284,128 +475,138 @@ i3GEOF.graficointerativo1 = |
| 284 | 475 | }, |
| 285 | 476 | /** |
| 286 | 477 | * Function: iniciaJanelaFlutuante |
| 287 | - * | |
| 478 | + * | |
| 288 | 479 | * Cria a janela flutuante para controle da ferramenta. |
| 289 | - * | |
| 290 | - * Parametro | |
| 291 | - * | |
| 292 | - * dados {JSON} - dados para o gráfico | |
| 480 | + * | |
| 481 | + * Parametro: | |
| 482 | + * | |
| 483 | + * parametros {obj} - parametros para o gráfico. Contem parametros utilizados para configurar o grafico e tambem pode conter | |
| 484 | + * os dados. Para compatibilidade, se nao contiver o item com chave chamada dados, sera considerado como sendo um objeto com apenas | |
| 485 | + * os dados estatisticos | |
| 486 | + * | |
| 293 | 487 | */ |
| 294 | - iniciaJanelaFlutuante : function(dados) { | |
| 488 | + iniciaJanelaFlutuante : function(parametros) { | |
| 295 | 489 | var minimiza, cabecalho, janela, divid, temp, titulo, idjanela; |
| 296 | - // id utilizado para diferenciar cada janela e seus respectivos | |
| 297 | - // componentes | |
| 298 | - idjanela = "graficoi" + parseInt(Math.random() * 1000000, 10); | |
| 299 | - i3GEOF.graficointerativo1.janelas.push(idjanela); | |
| 300 | - i3GEOF.graficointerativo1.propJanelas[idjanela] = {}; | |
| 301 | - i3GEOF.graficointerativo1.propJanelas[idjanela].tema = i3GEO.temaAtivo; | |
| 302 | - i3GEOF.graficointerativo1.propJanelas[idjanela].atualiza = true; | |
| 303 | - i3GEOF.graficointerativo1.propJanelas[idjanela].dados = dados; | |
| 304 | - | |
| 305 | - // guarda para esse grafico alguns valores default obtidos dos | |
| 306 | - // parametros gerais da ferramenta | |
| 307 | - i3GEOF.graficointerativo1.propJanelas[idjanela].acumula = i3GEOF.graficointerativo1.acumula; | |
| 308 | - i3GEOF.graficointerativo1.propJanelas[idjanela].relativa = i3GEOF.graficointerativo1.relativa; | |
| 309 | - i3GEOF.graficointerativo1.propJanelas[idjanela].dadospuros = i3GEOF.graficointerativo1.dadospuros; | |
| 310 | - | |
| 311 | - if (dados) { | |
| 312 | - i3GEOF.graficointerativo1.propJanelas[idjanela].dados = dados; | |
| 490 | + // | |
| 491 | + // verifica se parametros contem dados, caso contrario compatibiliza o objeto | |
| 492 | + // com a versao 6.0 do i3Geo | |
| 493 | + // | |
| 494 | + if (!parametros) { | |
| 495 | + parametros = { | |
| 496 | + "dados": "" | |
| 497 | + }; | |
| 498 | + } else if (!parametros.dados) { | |
| 499 | + parametros = { | |
| 500 | + "dados" : parametros | |
| 501 | + }; | |
| 313 | 502 | } |
| 503 | + // | |
| 504 | + // configura o grafico baseado no objeto parametros | |
| 505 | + // se em parametros existir um idjanela, o mesmo e retornado, caso contrario, e criado | |
| 506 | + // | |
| 507 | + idjanela = i3GEOF.graficointerativo1.configura(parametros); | |
| 508 | + // | |
| 509 | + // se existir um elemento HTML com o mesmo ID da janela, a renderizacao ocorrera | |
| 510 | + // nesse elemento, caso contrario, sera criada uma janela flutuante | |
| 511 | + // | |
| 512 | + if (!$i(idjanela)) { | |
| 513 | + // cria a janela flutuante | |
| 514 | + cabecalho = function() { | |
| 515 | + i3GEOF.graficointerativo1.ativaFoco(idjanela); | |
| 516 | + }; | |
| 517 | + minimiza = function() { | |
| 518 | + i3GEO.janela.minimiza(idjanela); | |
| 519 | + }; | |
| 520 | + mudaTamanhoGrafico = function() { | |
| 521 | + var t = $i(idjanela + "i3GEOgraficointerativo1Grafico"); | |
| 522 | + if (t.style.display === "block") { | |
| 523 | + i3GEOF.graficointerativo1.tabela2dados(idjanela); | |
| 524 | + } | |
| 525 | + }; | |
| 526 | + duplica = function() { | |
| 527 | + i3GEOF.graficointerativo1.iniciaJanelaFlutuante(); | |
| 528 | + }; | |
| 529 | + titulo = | |
| 530 | + " " + $trad("t37b") + " <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic | |
| 531 | + + "/ajuda_usuario.php?idcategoria=3&idajuda=84' > </a>"; | |
| 532 | + janela = | |
| 533 | + i3GEO.janela.cria( | |
| 534 | + "480px", | |
| 535 | + "450px", | |
| 536 | + "", | |
| 537 | + "", | |
| 538 | + "", | |
| 539 | + titulo, | |
| 540 | + idjanela, | |
| 541 | + false, | |
| 542 | + "hd", | |
| 543 | + cabecalho, | |
| 544 | + minimiza, | |
| 545 | + mudaTamanhoGrafico, | |
| 546 | + true, | |
| 547 | + i3GEO.configura.locaplic + "/imagens/oxygen/16x16/view-statistics.png", | |
| 548 | + duplica); | |
| 549 | + divid = janela[2].id; | |
| 550 | + $i(idjanela + "_corpo").style.backgroundColor = "white"; | |
| 551 | + $i(idjanela + "_corpo").style.overflow = "auto"; | |
| 552 | + // indica se a janela sera atualizada na navegacao | |
| 553 | + temp = 'i3GEOF.graficointerativo1.propJanelas["' + idjanela + '"].atualiza = this.checked'; | |
| 554 | + janela[0] | |
| 555 | + .setFooter("<div style=background-color:#F2F2F2; ><input class='inputsb' checked style='cursor:pointer;position:relative;top:2px;' onclick='" | |
| 556 | + + temp + "' type=checkbox /> " + $trad(53, i3GEOF.graficointerativo1.dicionario) + " (" + idjanela + ")</div>"); | |
| 314 | 557 | |
| 315 | - // cria a janela flutuante | |
| 316 | - cabecalho = function() { | |
| 317 | - i3GEOF.graficointerativo1.ativaFoco(idjanela); | |
| 318 | - }; | |
| 319 | - minimiza = function() { | |
| 320 | - i3GEO.janela.minimiza(idjanela); | |
| 321 | - }; | |
| 322 | - mudaTamanhoGrafico = function() { | |
| 323 | - var t = $i(idjanela + "i3GEOgraficointerativo1Grafico"); | |
| 324 | - if (t.style.display === "block") { | |
| 325 | - i3GEOF.graficointerativo1.tabela2dados(idjanela); | |
| 326 | - } | |
| 327 | - }; | |
| 328 | - duplica = function() { | |
| 329 | - i3GEOF.graficointerativo1.iniciaJanelaFlutuante(); | |
| 330 | - }; | |
| 331 | - titulo = | |
| 332 | - " " + $trad("t37b") + " <a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic | |
| 333 | - + "/ajuda_usuario.php?idcategoria=3&idajuda=84' > </a>"; | |
| 334 | - janela = | |
| 335 | - i3GEO.janela.cria( | |
| 336 | - "480px", | |
| 337 | - "450px", | |
| 338 | - "", | |
| 339 | - "", | |
| 340 | - "", | |
| 341 | - titulo, | |
| 342 | - idjanela, | |
| 343 | - false, | |
| 344 | - "hd", | |
| 345 | - cabecalho, | |
| 346 | - minimiza, | |
| 347 | - mudaTamanhoGrafico, | |
| 348 | - true, | |
| 349 | - i3GEO.configura.locaplic + "/imagens/oxygen/16x16/view-statistics.png", | |
| 350 | - duplica); | |
| 558 | + temp = function() { | |
| 559 | + i3GEOF.graficointerativo1.janelas.remove(idjanela); | |
| 560 | + i3GEOF.graficointerativo1.propJanelas[idjanela] = null; | |
| 561 | + if (i3GEOF.graficointerativo1.janelas.length === 0 && i3GEO.Interface) { | |
| 562 | + if (i3GEO.Interface.ATUAL === "openlayers") { | |
| 563 | + i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo1.atualizaListaDeRegistros()"); | |
| 564 | + } else if (i3GEO.Interface.ATUAL === "googlemaps") { | |
| 565 | + google.maps.event.removeListener(graficointerativo1Dragend); | |
| 566 | + google.maps.event.removeListener(graficointerativo1Zoomend); | |
| 567 | + } else if (i3GEO.Interface.ATUAL === "googleearth") { | |
| 568 | + google.earth.removeEventListener(graficointerativo1Dragend); | |
| 569 | + } | |
| 570 | + i3GEOF.graficointerativo1.propJanelas = {}; | |
| 571 | + i3GEOF.graficointerativo1.janelas = []; | |
| 572 | + } | |
| 573 | + }; | |
| 574 | + YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
| 575 | + janela[0].bringToTop(); | |
| 351 | 576 | |
| 352 | - divid = janela[2].id; | |
| 577 | + } else { | |
| 578 | + // o grafico sera renderizado em $i(idjanela) | |
| 579 | + divid = idjanela; | |
| 580 | + } | |
| 353 | 581 | i3GEOF.graficointerativo1.aguarde = $i(idjanela + "_imagemCabecalho").style; |
| 354 | - $i(idjanela + "_corpo").style.backgroundColor = "white"; | |
| 355 | - $i(idjanela + "_corpo").style.overflow = "auto"; | |
| 356 | - | |
| 357 | 582 | i3GEOF.graficointerativo1.propJanelas[idjanela].aguarde = $i(idjanela + "_imagemCabecalho").style; |
| 358 | 583 | i3GEOF.graficointerativo1.propJanelas[idjanela].atualiza = true; |
| 359 | - // indica se a janela sera atualizada na navegacao | |
| 360 | - temp = 'i3GEOF.graficointerativo1.propJanelas["' + idjanela + '"].atualiza = this.checked'; | |
| 361 | - janela[0] | |
| 362 | - .setFooter("<div style=background-color:#F2F2F2; ><input class='inputsb' checked style='cursor:pointer;position:relative;top:2px;' onclick='" | |
| 363 | - + temp + "' type=checkbox /> " + $trad(53, i3GEOF.graficointerativo1.dicionario) + " (" + idjanela + ")</div>"); | |
| 364 | 584 | |
| 365 | 585 | i3GEOF.graficointerativo1.inicia(divid, idjanela); |
| 366 | 586 | |
| 367 | - if (!i3GEO.Interface) { | |
| 368 | - return; | |
| 369 | - } | |
| 370 | - i3GEO.janela.tempoMsg($trad(37, i3GEOF.graficointerativo1.dicionario)); | |
| 371 | - if (i3GEO.Interface.ATUAL === "openlayers") { | |
| 372 | - i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.graficointerativo1.atualizaListaDeRegistros()"); | |
| 373 | - } | |
| 374 | - if (i3GEO.Interface.ATUAL === "googlemaps") { | |
| 375 | - graficointerativo1Dragend = GEvent.addListener(i3GeoMap, "dragend", function() { | |
| 376 | - i3GEOF.graficointerativo1.atualizaListaDeRegistros(); | |
| 377 | - }); | |
| 378 | - graficointerativo1Zoomend = GEvent.addListener(i3GeoMap, "zoomend", function() { | |
| 379 | - i3GEOF.graficointerativo1.atualizaListaDeRegistros(); | |
| 380 | - }); | |
| 381 | - } | |
| 382 | - if (i3GEO.Interface.ATUAL === "googleearth") { | |
| 383 | - graficointerativo1Dragend = google.earth.addEventListener(i3GeoMap.getView(), "viewchangeend", function() { | |
| 384 | - i3GEOF.graficointerativo1.atualizaListaDeRegistros(); | |
| 385 | - }); | |
| 386 | - } | |
| 387 | - temp = function() { | |
| 388 | - i3GEOF.graficointerativo1.janelas.remove(idjanela); | |
| 389 | - i3GEOF.graficointerativo1.propJanelas[idjanela] = null; | |
| 390 | - if (i3GEOF.graficointerativo1.janelas.length === 0) { | |
| 391 | - if (i3GEO.Interface.ATUAL === "openlayers") { | |
| 392 | - i3GEO.eventos.NAVEGAMAPA.remove("i3GEOF.graficointerativo1.atualizaListaDeRegistros()"); | |
| 393 | - } | |
| 394 | - if (i3GEO.Interface.ATUAL === "googlemaps") { | |
| 395 | - google.maps.event.removeListener(graficointerativo1Dragend); | |
| 396 | - google.maps.event.removeListener(graficointerativo1Zoomend); | |
| 397 | - } | |
| 398 | - if (i3GEO.Interface.ATUAL === "googleearth") { | |
| 399 | - google.earth.removeEventListener(graficointerativo1Dragend); | |
| 400 | - } | |
| 587 | + // eventos que ocorrem no mapa e afetam os graficos | |
| 588 | + if (i3GEO.Interface) { | |
| 589 | + i3GEO.janela.tempoMsg($trad(37, i3GEOF.graficointerativo1.dicionario)); | |
| 590 | + if (i3GEO.Interface.ATUAL === "openlayers" | |
| 591 | + && i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEOF.graficointerativo1.atualizaListaDeRegistros()") < 0) { | |
| 592 | + i3GEO.eventos.NAVEGAMAPA.push("i3GEOF.graficointerativo1.atualizaListaDeRegistros()"); | |
| 593 | + } else if (i3GEO.Interface.ATUAL === "googlemaps" && graficointerativo1Dragend == undefined) { | |
| 594 | + graficointerativo1Dragend = GEvent.addListener(i3GeoMap, "dragend", function() { | |
| 595 | + i3GEOF.graficointerativo1.atualizaListaDeRegistros(); | |
| 596 | + }); | |
| 597 | + graficointerativo1Zoomend = GEvent.addListener(i3GeoMap, "zoomend", function() { | |
| 598 | + i3GEOF.graficointerativo1.atualizaListaDeRegistros(); | |
| 599 | + }); | |
| 600 | + } else if (i3GEO.Interface.ATUAL === "googleearth" && graficointerativo1Dragend == undefined) { | |
| 601 | + graficointerativo1Dragend = google.earth.addEventListener(i3GeoMap.getView(), "viewchangeend", function() { | |
| 602 | + i3GEOF.graficointerativo1.atualizaListaDeRegistros(); | |
| 603 | + }); | |
| 401 | 604 | } |
| 402 | - }; | |
| 403 | - YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
| 404 | - janela[0].bringToTop(); | |
| 605 | + } | |
| 405 | 606 | }, |
| 406 | 607 | /** |
| 407 | 608 | * Function: ativaFoco |
| 408 | - * | |
| 609 | + * | |
| 409 | 610 | * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado |
| 410 | 611 | */ |
| 411 | 612 | ativaFoco : function(idjanela) { |
| ... | ... | @@ -436,7 +637,7 @@ i3GEOF.graficointerativo1 = |
| 436 | 637 | }, |
| 437 | 638 | /** |
| 438 | 639 | * Function: comboTemas |
| 439 | - * | |
| 640 | + * | |
| 440 | 641 | * Monta o combo para escolha do tema que será utilizado no gráfico |
| 441 | 642 | */ |
| 442 | 643 | comboTemas : function(idjanela) { |
| ... | ... | @@ -452,19 +653,20 @@ i3GEOF.graficointerativo1 = |
| 452 | 653 | i3GEOF.graficointerativo1.comboItensSel(idjanela); |
| 453 | 654 | }; |
| 454 | 655 | } |
| 455 | - if (i3GEO.temaAtivo !== "") { | |
| 456 | - $i(idjanela + "i3GEOgraficointerativo1ComboTemasId").value = i3GEO.temaAtivo; | |
| 656 | + var j = i3GEOF.graficointerativo1.propJanelas[idjanela]; | |
| 657 | + if (j.tema && j.tema !== "") { | |
| 658 | + $i(idjanela + "i3GEOgraficointerativo1ComboTemasId").value = j.tema; | |
| 457 | 659 | $i(idjanela + "i3GEOgraficointerativo1ComboTemasId").onchange.call(); |
| 458 | 660 | } |
| 459 | 661 | }, idjanela + "i3GEOgraficointerativo1ComboTemas", "", false, "ligados", "font-size:12px;width:350px"); |
| 460 | 662 | }, |
| 461 | 663 | /** |
| 462 | 664 | * Function: ativaTipo |
| 463 | - * | |
| 665 | + * | |
| 464 | 666 | * Define a variável com o tipo de gráfico e mostra a guia2 |
| 465 | 667 | */ |
| 466 | 668 | ativaTipo : function(obj, idjanela) { |
| 467 | - if (obj) { | |
| 669 | + if (obj && obj != "") { | |
| 468 | 670 | i3GEOF.graficointerativo1.propJanelas[idjanela].tipo = obj.value; |
| 469 | 671 | } |
| 470 | 672 | if (i3GEOF.graficointerativo1.propJanelas[idjanela].tipo == "ponto_1") { |
| ... | ... | @@ -492,9 +694,15 @@ i3GEOF.graficointerativo1 = |
| 492 | 694 | } |
| 493 | 695 | $i(idjanela + "i3GEOgraficointerativo1guia4").onclick.call(); |
| 494 | 696 | }, |
| 697 | + alteraFatorPixelMenos : function(tipo, idjanela) { | |
| 698 | + i3GEOF.graficointerativo1.alteraFatorPixel("menos", idjanela); | |
| 699 | + }, | |
| 700 | + alteraFatorPixelMais : function(tipo, idjanela) { | |
| 701 | + i3GEOF.graficointerativo1.alteraFatorPixel("mais", idjanela); | |
| 702 | + }, | |
| 495 | 703 | /** |
| 496 | 704 | * Function: configuraDados |
| 497 | - * | |
| 705 | + * | |
| 498 | 706 | * Configura o formulário para obtenção dos dados para cada tipo de gráfico |
| 499 | 707 | */ |
| 500 | 708 | configuraDados : function(idjanela) { |
| ... | ... | @@ -517,11 +725,11 @@ i3GEOF.graficointerativo1 = |
| 517 | 725 | }, |
| 518 | 726 | /** |
| 519 | 727 | * Function: comboItensSel |
| 520 | - * | |
| 728 | + * | |
| 521 | 729 | * Cria um combo para selecionar os itens do tema escolhido |
| 522 | - * | |
| 730 | + * | |
| 523 | 731 | * Veja: |
| 524 | - * | |
| 732 | + * | |
| 525 | 733 | * <i3GEO.util.comboItens> |
| 526 | 734 | */ |
| 527 | 735 | comboItensSel : function(idjanela) { |
| ... | ... | @@ -584,11 +792,11 @@ i3GEOF.graficointerativo1 = |
| 584 | 792 | }, |
| 585 | 793 | /** |
| 586 | 794 | * Function: obterDados |
| 587 | - * | |
| 795 | + * | |
| 588 | 796 | * Obtém os dados que serão utilizados no gráfico |
| 589 | - * | |
| 797 | + * | |
| 590 | 798 | * Veja: |
| 591 | - * | |
| 799 | + * | |
| 592 | 800 | * <GRAFICOSELECAO> |
| 593 | 801 | */ |
| 594 | 802 | obterDados : function(idjanela) { |
| ... | ... | @@ -601,10 +809,9 @@ i3GEOF.graficointerativo1 = |
| 601 | 809 | var tema, excluir, cp, tipo, ordenax, monta, p, x, y, i, n, temp; |
| 602 | 810 | |
| 603 | 811 | tema = $i(idjanela + "i3GEOgraficointerativo1ComboTemasId"); |
| 604 | - if(!tema){ | |
| 812 | + if (!tema) { | |
| 605 | 813 | return; |
| 606 | - } | |
| 607 | - else{ | |
| 814 | + } else { | |
| 608 | 815 | tema = tema.value; |
| 609 | 816 | } |
| 610 | 817 | excluir = $i(idjanela + "i3GEOgraficointerativo1excluir").value; |
| ... | ... | @@ -720,11 +927,11 @@ i3GEOF.graficointerativo1 = |
| 720 | 927 | }, |
| 721 | 928 | /** |
| 722 | 929 | * Function: montaTabelaDados |
| 723 | - * | |
| 930 | + * | |
| 724 | 931 | * Monta a tabela com os dados que serão utilizados no gráfico |
| 725 | - * | |
| 932 | + * | |
| 726 | 933 | * Parametro: |
| 727 | - * | |
| 934 | + * | |
| 728 | 935 | * retorno {JSON} - dados no formato JSON |
| 729 | 936 | */ |
| 730 | 937 | montaTabelaDados : function(idjanela, retorno) { |
| ... | ... | @@ -783,7 +990,7 @@ i3GEOF.graficointerativo1 = |
| 783 | 990 | }, |
| 784 | 991 | /** |
| 785 | 992 | * Function: tabela2csv |
| 786 | - * | |
| 993 | + * | |
| 787 | 994 | * Obtém os dados da tabela em CSV |
| 788 | 995 | */ |
| 789 | 996 | tabela2csv : function(idjanela) { |
| ... | ... | @@ -802,7 +1009,7 @@ i3GEOF.graficointerativo1 = |
| 802 | 1009 | }, |
| 803 | 1010 | /** |
| 804 | 1011 | * Function: tabela2dados |
| 805 | - * | |
| 1012 | + * | |
| 806 | 1013 | * Obtém os dados da tabela para compor o gráfico |
| 807 | 1014 | */ |
| 808 | 1015 | tabela2dados : function(idjanela) { |
| ... | ... | @@ -925,7 +1132,7 @@ i3GEOF.graficointerativo1 = |
| 925 | 1132 | }, |
| 926 | 1133 | /** |
| 927 | 1134 | * Function: excluilinha |
| 928 | - * | |
| 1135 | + * | |
| 929 | 1136 | * Exclui uma linha da tabela de dados |
| 930 | 1137 | */ |
| 931 | 1138 | excluilinha : function(celula) { |
| ... | ... | @@ -937,7 +1144,7 @@ i3GEOF.graficointerativo1 = |
| 937 | 1144 | }, |
| 938 | 1145 | /** |
| 939 | 1146 | * Function: corj |
| 940 | - * | |
| 1147 | + * | |
| 941 | 1148 | * Abre a janela para o usuário selecionar uma cor interativamente |
| 942 | 1149 | */ |
| 943 | 1150 | corj : function(obj) { |
| ... | ... | @@ -945,7 +1152,7 @@ i3GEOF.graficointerativo1 = |
| 945 | 1152 | }, |
| 946 | 1153 | /** |
| 947 | 1154 | * Function: ordenaColuna |
| 948 | - * | |
| 1155 | + * | |
| 949 | 1156 | * Ordena uma coluna da tabela |
| 950 | 1157 | */ |
| 951 | 1158 | ordenaColuna : function(coluna, cid) { | ... | ... |
ferramentas/graficointerativo1/template_mst.html
| 1 | 1 | <div id='{{{idjanela}}}i3GEOgraficointerativo1guiasYUI' class='yui-navset' style='top: 0px; cursor: pointer; left: 0px;'> |
| 2 | 2 | <ul class='yui-nav' style='border-width: 0pt 0pt 0px; border-color: rgb(240, 240, 240); border-bottom-color: white;'> |
| 3 | - <li><a><em><div id='{{{idjanela}}}i3GEOgraficointerativo1guia3' style='text-align: center; left: 0px;'> | |
| 4 | - <img class='ticPropriedades2' style='height: 14px' title='{{{prop}}}' src='{{{locaplic}}}/imagens/visual/default/branco.gif'> | |
| 5 | - </div></em></a></li> | |
| 6 | - <li><a><em><div id='{{{idjanela}}}i3GEOgraficointerativo1guia1' style='text-align: center; left: 0px;'>{{{tipo}}}</div></em></a></li> | |
| 7 | - <li><a><em><div id='{{{idjanela}}}i3GEOgraficointerativo1guia2' style='text-align: center; left: 0px;'>{{{dados}}}</div></em></a></li> | |
| 8 | - <li><a><em><div id='{{{idjanela}}}i3GEOgraficointerativo1guia4' style='text-align: center; left: 0px;'>{{{grafico}}}</div></em></a></li> | |
| 9 | - <li><a><em><div id='{{{idjanela}}}i3GEOgraficointerativo1guia5' style='text-align: center; left: 0px;'>CSV</div></em></a></li> | |
| 10 | - <li><a><em><div id='{{{idjanela}}}i3GEOgraficointerativo1guia6' style='text-align: center; left: 0px;'>PNG</div></em></a></li> | |
| 3 | + <li><div id='{{{idjanela}}}i3GEOgraficointerativo1guia3' style='text-align: center; left: 0px;'> | |
| 4 | + <a><em><img class='ticPropriedades2' style='height: 14px' title='{{{prop}}}' | |
| 5 | + src='{{{locaplic}}}/imagens/visual/default/branco.gif'></em> </a> | |
| 6 | + </div></li> | |
| 7 | + <li><div id='{{{idjanela}}}i3GEOgraficointerativo1guia1' style='text-align: center; left: 0px;'> | |
| 8 | + <a><em>{{{tipo}}}</em></a> | |
| 9 | + </div></li> | |
| 10 | + <li><div id='{{{idjanela}}}i3GEOgraficointerativo1guia2' style='text-align: center; left: 0px;'> | |
| 11 | + <a><em>{{{dados}}}</em></a> | |
| 12 | + </div></li> | |
| 13 | + <li><div id='{{{idjanela}}}i3GEOgraficointerativo1guia4' style='text-align: center; left: 0px;'> | |
| 14 | + <a><em>{{{grafico}}}</em></a> | |
| 15 | + </div></li> | |
| 16 | + <li><div id='{{{idjanela}}}i3GEOgraficointerativo1guia5' style='text-align: center; left: 0px;'> | |
| 17 | + <a><em>CSV</em></a> | |
| 18 | + </div></li> | |
| 19 | + <li><div id='{{{idjanela}}}i3GEOgraficointerativo1guia6' style='text-align: center; left: 0px;'> | |
| 20 | + <a><em>PNG</em></a> | |
| 21 | + </div></li> | |
| 11 | 22 | </ul> |
| 12 | 23 | </div> |
| 13 | 24 | <br> |
| ... | ... | @@ -16,7 +27,8 @@ |
| 16 | 27 | <table class=lista6> |
| 17 | 28 | <tr> |
| 18 | 29 | <td><img style='cursor: text;' src='{{{locaplic}}}/imagens/oxygen/22x22/Actions-office-chart-pie-icon.png' /></td> |
| 19 | - <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='pizza_1' name='tipoGrafico' style='border: 0px solid white; cursor: pointer'></td> | |
| 30 | + <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='pizza_1' name='tipoGrafico' | |
| 31 | + style='border: 0px solid white; cursor: pointer'></td> | |
| 20 | 32 | <td>{{{pizza2d}}}</td> |
| 21 | 33 | </tr> |
| 22 | 34 | <tr> |
| ... | ... | @@ -24,7 +36,8 @@ |
| 24 | 36 | </tr> |
| 25 | 37 | <tr> |
| 26 | 38 | <td><img style='cursor: text;' src='{{{locaplic}}}/imagens/oxygen/22x22/Actions-office-chart-area-stacked-icon.png' /></td> |
| 27 | - <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='area_1' name='tipoGrafico' style='border: 0px solid white; cursor: pointer'></td> | |
| 39 | + <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='area_1' name='tipoGrafico' | |
| 40 | + style='border: 0px solid white; cursor: pointer'></td> | |
| 28 | 41 | <td>{{{areasimp}}}</td> |
| 29 | 42 | </tr> |
| 30 | 43 | <tr> |
| ... | ... | @@ -32,7 +45,8 @@ |
| 32 | 45 | </tr> |
| 33 | 46 | <tr> |
| 34 | 47 | <td><img style='cursor: text;' src='{{{locaplic}}}/imagens/oxygen/22x22/Actions-office-chart-scatter-icon.png' /></td> |
| 35 | - <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='ponto_1' name='tipoGrafico' style='border: 0px solid white; cursor: pointer'></td> | |
| 48 | + <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='ponto_1' name='tipoGrafico' | |
| 49 | + style='border: 0px solid white; cursor: pointer'></td> | |
| 36 | 50 | <td>{{{distpt}}}</td> |
| 37 | 51 | </tr> |
| 38 | 52 | <tr> |
| ... | ... | @@ -40,7 +54,8 @@ |
| 40 | 54 | </tr> |
| 41 | 55 | <tr> |
| 42 | 56 | <td><img style='cursor: text;' src='{{{locaplic}}}/imagens/oxygen/22x22/Actions-office-chart-line-stacked-icon.png' /></td> |
| 43 | - <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='linha_1' name='tipoGrafico' style='border: 0px solid white; cursor: pointer'></td> | |
| 57 | + <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='linha_1' name='tipoGrafico' | |
| 58 | + style='border: 0px solid white; cursor: pointer'></td> | |
| 44 | 59 | <td>{{{linhassimp}}}</td> |
| 45 | 60 | </tr> |
| 46 | 61 | <tr> |
| ... | ... | @@ -48,7 +63,8 @@ |
| 48 | 63 | </tr> |
| 49 | 64 | <tr> |
| 50 | 65 | <td><img style='cursor: text;' src='{{{locaplic}}}/imagens/oxygen/22x22/Actions-office-chart-bar-icon-t.png' /></td> |
| 51 | - <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='arvore_1' name='tipoGrafico' style='border: 0px solid white; cursor: pointer'></td> | |
| 66 | + <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='arvore_1' name='tipoGrafico' | |
| 67 | + style='border: 0px solid white; cursor: pointer'></td> | |
| 52 | 68 | <td>{{{arvore}}}</td> |
| 53 | 69 | </tr> |
| 54 | 70 | <tr> |
| ... | ... | @@ -56,7 +72,8 @@ |
| 56 | 72 | </tr> |
| 57 | 73 | <tr> |
| 58 | 74 | <td><img style='cursor: text;' src='{{{locaplic}}}/imagens/oxygen/22x22/Actions-office-chart-bar-icon.png' /></td> |
| 59 | - <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='bar_1' name='tipoGrafico' style='border: 0px solid white; cursor: pointer'></td> | |
| 75 | + <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='bar_1' name='tipoGrafico' | |
| 76 | + style='border: 0px solid white; cursor: pointer'></td> | |
| 60 | 77 | <td>{{{barrasv}}}</td> |
| 61 | 78 | </tr> |
| 62 | 79 | <tr> |
| ... | ... | @@ -64,7 +81,8 @@ |
| 64 | 81 | </tr> |
| 65 | 82 | <tr> |
| 66 | 83 | <td><img style='cursor: text;' src='{{{locaplic}}}/imagens/oxygen/22x22/Actions-office-chart-bar-icon-h.png' /></td> |
| 67 | - <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='bar_2' name='tipoGrafico' style='border: 0px solid white; cursor: pointer'></td> | |
| 84 | + <td><input type=radio onclick='i3GEOF.graficointerativo1.ativaTipo(this,{{{idjanelaA}}})' value='bar_2' name='tipoGrafico' | |
| 85 | + style='border: 0px solid white; cursor: pointer'></td> | |
| 68 | 86 | <td>{{{barrash}}}</td> |
| 69 | 87 | </tr> |
| 70 | 88 | </table> |
| ... | ... | @@ -93,46 +111,39 @@ |
| 93 | 111 | {{{geracor}}} |
| 94 | 112 | </p> |
| 95 | 113 | <p class=paragrafo> |
| 96 | - <input id='{{{idjanela}}}i3GEOgraficointerativo1botao1' type='buttom' value='{{{obterdados}}}' /> | |
| 114 | + <input id='{{{idjanela}}}i3GEOgraficointerativo1botao1' type='button' value='{{{obterdados}}}' /> | |
| 97 | 115 | </p> |
| 98 | 116 | <div id='{{{idjanela}}}i3GEOgraficointerativo1Dados'></div> |
| 99 | 117 | <div class=paragrafo id='{{{idjanela}}}i3GEOgraficointerativo1AjudaPizza'>{{{seescolher}}}</div> |
| 100 | 118 | </div> |
| 101 | 119 | <div class=guiaobj id='{{{idjanela}}}i3GEOgraficointerativo1guia3obj' style='left: 1px; display: none; top: -5px'> |
| 102 | 120 | <p class=paragrafo> |
| 103 | - <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1xInclinado' checked /> | |
| 104 | - {{{inclinax}}} | |
| 121 | + <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1xInclinado' checked /> {{{inclinax}}} | |
| 105 | 122 | </p> |
| 106 | 123 | <p class=paragrafo> |
| 107 | - <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1AdLinhas' checked /> | |
| 108 | - {{{adlinbarras}}} | |
| 124 | + <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1AdLinhas' checked /> {{{adlinbarras}}} | |
| 109 | 125 | </p> |
| 110 | 126 | <p class=paragrafo> |
| 111 | - <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1Acumula' /> | |
| 112 | - {{{utilizvalacum}}} | |
| 127 | + <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1Acumula' /> {{{utilizvalacum}}} | |
| 113 | 128 | </p> |
| 114 | 129 | <p class=paragrafo> |
| 115 | - <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1Relativa' /> | |
| 116 | - {{{utilizvalrelat}}} (%) | |
| 130 | + <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1Relativa' /> {{{utilizvalrelat}}} (%) | |
| 117 | 131 | </p> |
| 118 | 132 | <p class=paragrafo> |
| 119 | - <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1OrdenaX' checked /> | |
| 120 | - {{{ordenax}}} | |
| 133 | + <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1OrdenaX' checked /> {{{ordenax}}} | |
| 121 | 134 | </p> |
| 122 | 135 | <p class=paragrafo> |
| 123 | - <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1DadosPuros' /> | |
| 124 | - {{{naoprocessa}}} | |
| 136 | + <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOgraficointerativo1DadosPuros' /> {{{naoprocessa}}} | |
| 125 | 137 | </p> |
| 126 | 138 | <p class=paragrafo> |
| 127 | - <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOFgraficointerativo1ativaStacked' /> | |
| 128 | - {{{stacked}}} | |
| 139 | + <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOFgraficointerativo1ativaStacked' /> {{{stacked}}} | |
| 129 | 140 | </p> |
| 130 | 141 | <p class=paragrafo> |
| 131 | - <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOFgraficointerativo1ativaRowsInColumns' /> | |
| 132 | - {{{linhasnascols}}} | |
| 142 | + <input style='cursor: pointer' type=checkbox id='{{{idjanela}}}i3GEOFgraficointerativo1ativaRowsInColumns' /> {{{linhasnascols}}} | |
| 133 | 143 | </p> |
| 134 | 144 | <p class=paragrafo> |
| 135 | - <select onchange='i3GEOF.graficointerativo1.obterDados()' id='{{{idjanela}}}i3GEOgraficointerativo1TipoAgregacao'><option value='soma'>{{{soma}}}</option> | |
| 145 | + <select onchange='i3GEOF.graficointerativo1.obterDados()' id='{{{idjanela}}}i3GEOgraficointerativo1TipoAgregacao'><option | |
| 146 | + value='soma'>{{{soma}}}</option> | |
| 136 | 147 | <option value='media'>{{{media}}}</option> |
| 137 | 148 | </select>{{{tipoagregay}}} |
| 138 | 149 | </p> |
| ... | ... | @@ -142,9 +153,10 @@ |
| 142 | 153 | </p> |
| 143 | 154 | </div> |
| 144 | 155 | <div class=guiaobj id='{{{idjanela}}}i3GEOgraficointerativo1guia4obj' style='left: 1px; display: none; top: -10px'> |
| 145 | - <a style='position: absolute; left: 50px;' href='#' onclick='i3GEOF.graficointerativo1.novaJanela()'> {{{janelasep}}} </a> | |
| 146 | - <img onclick='i3GEOF.graficointerativo1.alteraFatorPixel(\'menos\',{{{idjanelaA}}})' style='position: absolute;' src='{{{locaplic}}}/imagens/player_volta.png' /> | |
| 147 | - <img onclick='i3GEOF.graficointerativo1.alteraFatorPixel(\'mais\',{{{idjanelaA}}})' style='position: absolute; left: 20px;' src='{{{locaplic}}}/imagens/player_avanca.png' /> | |
| 156 | + <a style='position: absolute; left: 50px;' href='#' onclick='i3GEOF.graficointerativo1.novaJanela()'> {{{janelasep}}} </a> <img | |
| 157 | + onclick='i3GEOF.graficointerativo1.alteraFatorPixelMenos({{{idjanelaA}}})' style='position: absolute;' | |
| 158 | + src='{{{locaplic}}}/imagens/player_volta.png' /> <img onclick='i3GEOF.graficointerativo1.alteraFatorPixelMais({{{idjanelaA}}})' | |
| 159 | + style='position: absolute; left: 20px;' src='{{{locaplic}}}/imagens/player_avanca.png' /> | |
| 148 | 160 | <div id='{{{idjanela}}}i3GEOgraficointerativo1guia4objCanvas' style='top: 15px;'></div> |
| 149 | 161 | </div> |
| 150 | 162 | <div class=guiaobj id='{{{idjanela}}}i3GEOgraficointerativo1guia5obj' style='font-size: 10px; left: 10px; display: none; top: -0px'></div> | ... | ... |
ferramentas/salvamapa/dicionario.js
| ... | ... | @@ -79,7 +79,7 @@ i3GEOF.salvaMapa.dicionario = { |
| 79 | 79 | it:"" |
| 80 | 80 | }], |
| 81 | 81 | 14: [{ |
| 82 | - pt:"Faça login e cadastre o mapa atual no banco de dados existente no servidor web. Com isso o mapa será salvo de forma permanente e outros usuários poder�o utilizá-lo. Consulte o admnistrador do site que voc� est� utilizando para saber mais sobre a política de uso do mapa que for salvo", | |
| 82 | + pt:"Faça login e cadastre o mapa atual no banco de dados existente no servidor web. Com isso o mapa será salvo de forma permanente e outros usuários poderão utilizá-lo. Consulte o admnistrador do site que você está utilizando para saber mais sobre a política de uso do mapa que for salvo", | |
| 83 | 83 | en:"", |
| 84 | 84 | es:"", |
| 85 | 85 | it:"" | ... | ... |
ferramentas/salvamapa/index.js
| ... | ... | @@ -146,7 +146,7 @@ i3GEOF.salvaMapa = { |
| 146 | 146 | } |
| 147 | 147 | } |
| 148 | 148 | }; |
| 149 | - i3GEO.php.salvaMapaBanco(temp,titulo,id_mapa,$i("i3GEOFsalvaPref").checked,true); | |
| 149 | + i3GEO.php.salvaMapaBanco(temp,titulo,id_mapa,$i("i3GEOFsalvaPref").checked,true,true); | |
| 150 | 150 | }; |
| 151 | 151 | texto = $trad(7,i3GEOF.salvaMapa.dicionario)+"<br><div id=i3GEOFsalvamapaMapa ></div><br><br><input style='position:relative;top:2px;' checked type=checkbox id=i3GEOFsalvaPref />"+$trad(15,i3GEOF.salvaMapa.dicionario); |
| 152 | 152 | i3GEO.janela.prompt(texto + "<br><br>"+$trad(8,i3GEOF.salvaMapa.dicionario),funcaoOK); | ... | ... |