Commit 472012638bc7924af8138f6fe50fda334209fed1
1 parent
05ee1b82
Exists in
master
and in
7 other branches
Inclusão de opçãopara abrir formulário do plugin parametrossql no mashup openlayers
Showing
20 changed files
with
576 additions
and
598 deletions
Show diff stats
admin/admin.db
No preview for this file type
admin/php/editormapfile.php
| ... | ... | @@ -2323,6 +2323,7 @@ function removeCabecalho($arq,$symbolset=true) |
| 2323 | 2323 | } |
| 2324 | 2324 | $final = array_merge($cabeca,$final); |
| 2325 | 2325 | $handle = fopen($arq, "w+"); |
| 2326 | + $testar = array("LEGENDAWMS","LEGENDAIMG","KEYIMAGE","TILEINDEX","TILEITEM","SYMBOL","LABELITEM","FILTERITEM","GROUP","ENCODING","TIP","CLASSE","ITENSDESC","CLASSESNOME","ITENSLINK","ESCALA","CLASSESSIMBOLO","MENSAGEM","EXTENSAO","CLASSESITEM","ESCONDIDO","CLASSESCOR","DOWNLOAD","CLASSESTAMANHO","ITENS","TEMA","APLICAEXTENSAO","IDENTIFICA","TRANSITIONEFFECT"); | |
| 2326 | 2327 | foreach ($final as $f) |
| 2327 | 2328 | { |
| 2328 | 2329 | // |
| ... | ... | @@ -2331,11 +2332,10 @@ function removeCabecalho($arq,$symbolset=true) |
| 2331 | 2332 | // |
| 2332 | 2333 | $teste = strtoupper($f); |
| 2333 | 2334 | $teste = trim($teste); |
| 2334 | - $teste = str_replace(" ","",$teste); | |
| 2335 | - $teste = str_replace("'","",$teste); | |
| 2336 | - $teste = str_replace('"',"",$teste); | |
| 2335 | + $teste = str_replace(array(" ","'",'"'),"",$teste); | |
| 2336 | + //$teste = str_replace("'","",$teste); | |
| 2337 | + //$teste = str_replace('"',"",$teste); | |
| 2337 | 2338 | $teste = preg_replace('/[\n\r\t ]*/', '', $teste); |
| 2338 | - $testar = array("KEYIMAGE","TILEINDEX","TILEITEM","SYMBOL","LABELITEM","FILTERITEM","GROUP","ENCODING","TIP","CLASSE","ITENSDESC","CLASSESNOME","ITENSLINK","ESCALA","CLASSESSIMBOLO","MENSAGEM","EXTENSAO","CLASSESITEM","ESCONDIDO","CLASSESCOR","DOWNLOAD","CLASSESTAMANHO","ITENS","TEMA","APLICAEXTENSAO","IDENTIFICA","TRANSITIONEFFECT"); | |
| 2339 | 2339 | $passou = true; |
| 2340 | 2340 | foreach ($testar as $t) |
| 2341 | 2341 | { |
| ... | ... | @@ -2343,8 +2343,9 @@ function removeCabecalho($arq,$symbolset=true) |
| 2343 | 2343 | $passou = false; |
| 2344 | 2344 | } |
| 2345 | 2345 | } |
| 2346 | - if($passou) | |
| 2346 | + if($passou == true){ | |
| 2347 | 2347 | fwrite($handle,$f); |
| 2348 | + } | |
| 2348 | 2349 | } |
| 2349 | 2350 | fclose($handle); |
| 2350 | 2351 | chmod($arq, 0666); | ... | ... |
admin/php/editortexto.php
| ... | ... | @@ -89,13 +89,30 @@ body { |
| 89 | 89 | echo "<span style=color:red <b>Não foi possível salvar o arquivo. Verifique as permissões ou se há algum erro no mapfile</b></span><br><br>"; |
| 90 | 90 | } |
| 91 | 91 | else{ |
| 92 | - fwrite($fp,$gravarTexto); | |
| 92 | + //remove itens vazios | |
| 93 | + $novoTexto = array(); | |
| 94 | + $testar = array("TEMPORIZADOR","PALLETESTEP","LTEMPOITEMIMAGEM","METAESTAT_ID_MEDIDA_VARIAVEL","GMOPACITY","GMSTATUS","ICONETEMA","LTEMPOITEMTITULO","DESCRIPTION_TEMPLATE","LTEMPOITEMLINK","TILES","METAESTAT_CODIGO_TIPO_REGIAO","ARQUIVOTEMAORIGINAL","PALLETEFILE","NOMEORIGINAL","OLSTATUS","PERMITEDOWNLOAD","LTEMPOFORMATODATA","FILTROORIGINAL","PERMITECOMENTARIO","LTEMPOITEMICONE","DATAORIGINAL","PLUGINI3GEO","METAESTAT","ITEMBUSCARAPIDA","ARQUIVODOWNLOAD","ARQUIVOKMZ","PERMITEKML","PERMITEOGC","CONVCARACTER","CORTEPIXELS","EDITORSQL","LTEMPOCONVENCODE","LTEMPOITEMFIM","OLOPACITY","LEGENDAWMS","LEGENDAIMG","KEYIMAGE","TILEINDEX","TILEITEM","SYMBOL","LABELITEM","FILTERITEM","GROUP","ENCODING","TIP","CLASSE","ITENSDESC","CLASSESNOME","ITENSLINK","ESCALA","CLASSESSIMBOLO","MENSAGEM","EXTENSAO","CLASSESITEM","ESCONDIDO","CLASSESCOR","DOWNLOAD","CLASSESTAMANHO","ITENS","TEMA","APLICAEXTENSAO","IDENTIFICA","TRANSITIONEFFECT"); | |
| 95 | + foreach(preg_split('~[\r\n]+~', $gravarTexto) as $line){ | |
| 96 | + $teste = strtoupper($line); | |
| 97 | + $teste = trim($teste); | |
| 98 | + $teste = str_replace(array(" ","'",'"'),"",$teste); | |
| 99 | + $teste = preg_replace('/[\n\r\t ]*/', '', $teste); | |
| 100 | + $passou = true; | |
| 101 | + foreach ($testar as $t) | |
| 102 | + { | |
| 103 | + if($teste == $t){ | |
| 104 | + $passou = false; | |
| 105 | + } | |
| 106 | + } | |
| 107 | + if($passou == true){ | |
| 108 | + $novoTexto[] = $line; | |
| 109 | + } | |
| 110 | + } | |
| 111 | + fwrite($fp,implode("\r\n",$novoTexto)); | |
| 93 | 112 | } |
| 94 | 113 | fclose($fp); |
| 95 | 114 | } |
| 96 | 115 | ?> |
| 97 | - | |
| 98 | - | |
| 99 | 116 | <div style=float:left; > |
| 100 | 117 | Estilo: <select onchange="mudaEstilo(this.value)"> |
| 101 | 118 | <option value=elegant >Elegant</option> | ... | ... |
aplicmap/legenda5.htm
| ... | ... | @@ -2,21 +2,28 @@ |
| 2 | 2 | [leg_layer_html opt_flag=1] |
| 3 | 3 | <table class=legendatemas cellspacing=0 style="width: 200px"> |
| 4 | 4 | [if name=legendawms oper=isset ] |
| 5 | - <tr> | |
| 6 | - <td style="text-align: left"><img src='[metadata name=legendawms]' /></td> | |
| 7 | - </tr> | |
| 8 | - [/if] [if name=legendaimg oper=isset ] | |
| 9 | - [if name=legendaimg oper=neq value="" ] | |
| 10 | - <tr> | |
| 11 | - <td style="text-align: left"><img src='[metadata name=legendaimg]' /></td> | |
| 12 | - </tr> | |
| 13 | - [/if] | |
| 14 | - [/if] [/leg_layer_html] [leg_class_html] [if name=CLASSE oper=neq value=NAO] | |
| 15 | - <tr> | |
| 16 | - <td style="width: 15px; text-align: left;"><input id='legendack_[leg_layer_name]_[leg_class_index]' type=checkbox checked title=liga/desliga class=inputsb style='border: 0px solid red; cursor: pointer' value=[leg_class_index] name=[leg_layer_name] onclick='i3GEO.arvoreDeCamadas.inverteStatusClasse(this)' /></td> | |
| 17 | - <td style="text-align: left; width: 15px;"><img src=[leg_icon width=16 height=16 ] /></td> | |
| 18 | - <td style="text-align: left; width: 135px"><span style="font-size: 9px; position: relative; left: 2px;">[leg_class_name]</span></td> | |
| 19 | - </tr> | |
| 20 | - [/if] [/leg_class_html] | |
| 5 | + [if name=legendawms oper=neq value="" ] | |
| 6 | + <tr> | |
| 7 | + <td style="text-align: left"><img src='[metadata name=legendawms]' /></td> | |
| 8 | + </tr> | |
| 9 | + [/if] | |
| 10 | + [/if] | |
| 11 | + [if name=legendaimg oper=isset ] | |
| 12 | + [if name=legendaimg oper=neq value="" ] | |
| 13 | + <tr> | |
| 14 | + <td style="text-align: left"><img src='[metadata name=legendaimg]' /></td> | |
| 15 | + </tr> | |
| 16 | + [/if] | |
| 17 | + [/if] | |
| 18 | + [/leg_layer_html] | |
| 19 | + [leg_class_html] | |
| 20 | + [if name=CLASSE oper=neq value=NAO] | |
| 21 | + <tr> | |
| 22 | + <td style="width: 15px; text-align: left;"><input id='legendack_[leg_layer_name]_[leg_class_index]' type=checkbox checked title=liga/desliga class=inputsb style='border: 0px solid red; cursor: pointer' value=[leg_class_index] name=[leg_layer_name] onclick='i3GEO.arvoreDeCamadas.inverteStatusClasse(this)' /></td> | |
| 23 | + <td style="text-align: left; width: 15px;"><img src=[leg_icon width=16 height=16 ] /></td> | |
| 24 | + <td style="text-align: left; width: 135px"><span style="font-size: 9px; position: relative; left: 2px;">[leg_class_name]</span></td> | |
| 25 | + </tr> | |
| 26 | + [/if] | |
| 27 | + [/leg_class_html] | |
| 21 | 28 | </table> |
| 22 | 29 | --> |
| 23 | 30 | \ No newline at end of file | ... | ... |
aplicmap/legendaOgc.html
| 1 | 1 | <!-- |
| 2 | 2 | [leg_layer_html opt_flag=1] |
| 3 | -<table style="border-spacing: 0; border-collapse: collapse; margin: 0px; padding: 0px;" class="tabelaItemLegenda"> | |
| 3 | +<table style="border-spacing: 0; border-collapse: collapse; margin: 0px; padding: 2px;" class="tabelaItemLegenda"> | |
| 4 | 4 | [/leg_layer_html] [leg_class_html] [if name=CLASSE oper=neq value=NAO] |
| 5 | 5 | |
| 6 | 6 | <tr> |
| 7 | - <td class="tabelaItemLegendaIcone" width=16 style="border-spacing: 0; border-collapse: collapse; margin: 0px; padding: 0px;"><img src="[leg_icon width=16 height=16 ]" /></td> | |
| 7 | + <td class="tabelaItemLegendaIcone" width=16 style="border-spacing: 0; border-collapse: collapse; margin: 0px; padding: 2px;"><img src="[leg_icon width=16 height=16 ]" /></td> | |
| 8 | 8 | <td style="border-spacing: 0; border-collapse: collapse; margin: 0px; padding: 0px; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif;" class="tabelaItemLegendaNome"><span>[leg_class_name]</span></td> |
| 9 | 9 | </tr> |
| 10 | 10 | [/if][/leg_class_html] | ... | ... |
classesjs/classe_editorol.js
| ... | ... | @@ -185,10 +185,11 @@ i3GEO.editorOL = { |
| 185 | 185 | nfundo = fundo.length, |
| 186 | 186 | ncontroles = i3GEO.editorOL.controles.length, |
| 187 | 187 | i, |
| 188 | - n; | |
| 189 | - if(i3GEO.editorOL.tiles === false || i3GEO.editorOL.tiles === "false"){ | |
| 190 | - single = true; | |
| 191 | - } | |
| 188 | + n, | |
| 189 | + temp; | |
| 190 | + //if(i3GEO.editorOL.tiles === false || i3GEO.editorOL.tiles === "false"){ | |
| 191 | + // single = true; | |
| 192 | + //} | |
| 192 | 193 | if(i3GEO.editorOL.ativalayerswitcher === "false"){ |
| 193 | 194 | i3GEO.editorOL.ativalayerswitcher = false; |
| 194 | 195 | } |
| ... | ... | @@ -306,6 +307,17 @@ i3GEO.editorOL = { |
| 306 | 307 | i3GEO.editorOL.mapa.zoomToMaxExtent(); |
| 307 | 308 | } |
| 308 | 309 | i3GEO.editorOL.sobeLayersGraficos(); |
| 310 | + //evita que botoes de opcoes propaguem | |
| 311 | + //o mashup utiliza esse tipo de botal junto ao nome do layer | |
| 312 | + temp = i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher"); | |
| 313 | + if(temp){ | |
| 314 | + temp = temp.dataLayersDiv.getElementsByTagName("label"); | |
| 315 | + n = temp.length; | |
| 316 | + for(i = 0; i < n; i++){ | |
| 317 | + //YAHOO.util.Event.addListener(temp[i], "click", YAHOO.util.Event.stopEvent); | |
| 318 | + temp[i].onclick = ""; | |
| 319 | + } | |
| 320 | + } | |
| 309 | 321 | }, |
| 310 | 322 | criaLayerGrafico: function(){ |
| 311 | 323 | i3GEO.desenho.openlayers.criaLayerGrafico(); |
| ... | ... | @@ -593,14 +605,20 @@ i3GEO.editorOL = { |
| 593 | 605 | mostraLegenda: function(){ |
| 594 | 606 | var layers = i3GEO.editorOL.layersLigados(), |
| 595 | 607 | nlayers = layers.length, |
| 596 | - ins = "",i; | |
| 608 | + ins = "",i, icone = ""; | |
| 597 | 609 | for(i=0;i<nlayers;i++){ |
| 598 | 610 | try{ |
| 599 | 611 | if(layers[i].isBaseLayer === false){ |
| 600 | 612 | var url = layers[i].getFullRequestString({"request":"getlegendgraphic"}); |
| 601 | 613 | if(i3GEO.editorOL.legendahtml === true){ |
| 602 | 614 | url = url.replace("image%2Fpng","text/html"); |
| 603 | - ins += layers[i].name+"<br><div id=legendaL_"+i+" ></div><br>"; | |
| 615 | + //verifica se a camada veio de um plugin de classe_plugini3geo | |
| 616 | + //e insere o icone se for necessario | |
| 617 | + if(layers[i].options.plugini3geo){ | |
| 618 | + icone = i3GEO.pluginI3geo[layers[i].options.plugini3geo].iconeArvoreDeCamadas(layers[i].params.LAYERS); | |
| 619 | + } | |
| 620 | + | |
| 621 | + ins += icone + layers[i].name+"<br><div id=legendaL_"+i+" ></div><br>"; | |
| 604 | 622 | //necessario pq nao e sincrono |
| 605 | 623 | eval ("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};"); |
| 606 | 624 | var config = { |
| ... | ... | @@ -634,8 +652,7 @@ i3GEO.editorOL = { |
| 634 | 652 | YAHOO.legendaeditorOL.container.panel.center(); |
| 635 | 653 | |
| 636 | 654 | YAHOO.util.Event.addListener(YAHOO.legendaeditorOL.container.panel.close, "click", function(){ |
| 637 | - //i3GEOpanelEditor.deactivate(); | |
| 638 | - //i3GEOpanelEditor.activate(); | |
| 655 | + YAHOO.legendaeditorOL.container.panel.destroy(); | |
| 639 | 656 | }); |
| 640 | 657 | } |
| 641 | 658 | else{ | ... | ... |
classesjs/classe_plugini3geo.js
| ... | ... | @@ -53,7 +53,8 @@ i3GEO.pluginI3geo = |
| 53 | 53 | { |
| 54 | 54 | "classe" : "heatmap", // namespace da classe |
| 55 | 55 | "nome" : "Mapa de calor", // tituo do plugin |
| 56 | - "editor" : true // inclui no editor de mapfiles | |
| 56 | + "editor" : true | |
| 57 | + // inclui no editor de mapfiles | |
| 57 | 58 | }, |
| 58 | 59 | { |
| 59 | 60 | "classe" : "markercluster", |
| ... | ... | @@ -85,9 +86,7 @@ i3GEO.pluginI3geo = |
| 85 | 86 | inicia : function(camada) { |
| 86 | 87 | if (i3GEO.janela) { |
| 87 | 88 | i3GEO.janela.AGUARDEMODAL = true; |
| 88 | - i3GEO.janela.abreAguarde( | |
| 89 | - "aguardePlugin", | |
| 90 | - "Plugin..."); | |
| 89 | + i3GEO.janela.abreAguarde("aguardePlugin", "Plugin..."); | |
| 91 | 90 | i3GEO.janela.AGUARDEMODAL = false; |
| 92 | 91 | } |
| 93 | 92 | // chama a funcao conforme o tipo de plugin e a interface atual |
| ... | ... | @@ -106,11 +105,10 @@ i3GEO.pluginI3geo = |
| 106 | 105 | * Constroi um icone que sera adicionado na barra de icones do tema quando for adicionado na arvore de camadas |
| 107 | 106 | * Esse icone e utilizado para reabrir o formulario de parametros |
| 108 | 107 | */ |
| 109 | - iconeArvoreDeCamadas : function(camada){ | |
| 108 | + iconeArvoreDeCamadas : function(camada) { | |
| 110 | 109 | if (camada.plugini3geo && camada.plugini3geo != "") { |
| 111 | 110 | return i3GEO.pluginI3geo[camada.plugini3geo.plugin].iconeArvoreDeCamadas(camada.name); |
| 112 | - } | |
| 113 | - else{ | |
| 111 | + } else { | |
| 114 | 112 | return false; |
| 115 | 113 | } |
| 116 | 114 | }, |
| ... | ... | @@ -118,24 +116,21 @@ i3GEO.pluginI3geo = |
| 118 | 116 | return i3GEO.pluginI3geo[plugin].linkAjuda(); |
| 119 | 117 | }, |
| 120 | 118 | ligaCamada : function(nomecamada) { |
| 121 | - if (i3GEO.pluginI3geo.OBJETOS[nomecamada] | |
| 122 | - && i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada) { | |
| 119 | + if (i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada) { | |
| 123 | 120 | i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada(); |
| 124 | 121 | return true; |
| 125 | 122 | } |
| 126 | 123 | return false; |
| 127 | 124 | }, |
| 128 | 125 | desligaCamada : function(nomecamada) { |
| 129 | - if (i3GEO.pluginI3geo.OBJETOS[nomecamada] | |
| 130 | - && i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada) { | |
| 126 | + if (i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada) { | |
| 131 | 127 | i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada(); |
| 132 | 128 | return true; |
| 133 | 129 | } |
| 134 | 130 | return false; |
| 135 | 131 | }, |
| 136 | 132 | removeCamada : function(nomecamada) { |
| 137 | - if (i3GEO.pluginI3geo.OBJETOS[nomecamada] | |
| 138 | - && i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada) { | |
| 133 | + if (i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada) { | |
| 139 | 134 | i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada(); |
| 140 | 135 | delete (i3GEO.pluginI3geo.OBJETOS[nomecamada]); |
| 141 | 136 | return true; |
| ... | ... | @@ -143,16 +138,14 @@ i3GEO.pluginI3geo = |
| 143 | 138 | return false; |
| 144 | 139 | }, |
| 145 | 140 | atualizaCamada : function(nomecamada) { |
| 146 | - if (i3GEO.pluginI3geo.OBJETOS[nomecamada] | |
| 147 | - && i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada) { | |
| 141 | + if (i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada) { | |
| 148 | 142 | i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada(); |
| 149 | 143 | return true; |
| 150 | 144 | } |
| 151 | 145 | return false; |
| 152 | 146 | }, |
| 153 | 147 | existeObjeto : function(nomecamada) { |
| 154 | - if (i3GEO.pluginI3geo.OBJETOS[nomecamada] | |
| 155 | - && i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada) { | |
| 148 | + if (i3GEO.pluginI3geo.OBJETOS[nomecamada] && i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada) { | |
| 156 | 149 | return true; |
| 157 | 150 | } |
| 158 | 151 | return false; |
| ... | ... | @@ -165,13 +158,31 @@ i3GEO.pluginI3geo = |
| 165 | 158 | * arvore de camadas |
| 166 | 159 | */ |
| 167 | 160 | aplicaPropriedades : function(camada) { |
| 168 | - if (camada.plugini3geo | |
| 169 | - && camada.plugini3geo != "") { | |
| 161 | + if (camada.plugini3geo && camada.plugini3geo != "") { | |
| 170 | 162 | camada = i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].aplicaPropriedades(camada); |
| 171 | 163 | } |
| 172 | 164 | return camada; |
| 173 | 165 | }, |
| 174 | 166 | /** |
| 167 | + * Cria um layer conforme a API em uso no aplicativo mashup | |
| 168 | + * | |
| 169 | + * Parametros | |
| 170 | + * | |
| 171 | + * {string} - nome da interface em uso openlayers|googlemaps | |
| 172 | + * | |
| 173 | + * {objeto} - objeto camada, conforme definido em i3GEO.arvoreDeCamadas.CAMADAS | |
| 174 | + * | |
| 175 | + * {string} - codigo epsg que sera usado no WMS | |
| 176 | + */ | |
| 177 | + layerMashup : function(Interface, camada, epsg) { | |
| 178 | + if (camada.plugini3geo && camada.plugini3geo != "" && i3GEO.pluginI3geo[camada.plugini3geo.plugin][Interface].layerMashup) { | |
| 179 | + return i3GEO.pluginI3geo[camada.plugini3geo.plugin][Interface].layerMashup(camada,epsg); | |
| 180 | + } | |
| 181 | + else{ | |
| 182 | + return false; | |
| 183 | + } | |
| 184 | + }, | |
| 185 | + /** | |
| 175 | 186 | * Section: i3GEO.pluginI3geo.heatmap |
| 176 | 187 | * |
| 177 | 188 | * Mapa de calor |
| ... | ... | @@ -206,12 +217,12 @@ i3GEO.pluginI3geo = |
| 206 | 217 | */ |
| 207 | 218 | heatmap : { |
| 208 | 219 | linkAjuda : function() { |
| 209 | - return i3GEO.configura.locaplic | |
| 210 | - + "/ajuda_usuario.php?idcategoria=3&idajuda=121"; | |
| 220 | + return i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=3&idajuda=121"; | |
| 211 | 221 | }, |
| 212 | 222 | formAdmin : function(config) { |
| 213 | 223 | // {"plugin":"heatmap","parametros":{"coluna":"","radius":15,"max":10}} |
| 214 | - var parametros, ins = "", configDefault = '{"plugin":"heatmap","parametros":{"tipoGradiente": "default","valorPonto":1,"coluna":"","radius":15}}'; | |
| 224 | + var parametros, ins = "", configDefault = | |
| 225 | + '{"plugin":"heatmap","parametros":{"tipoGradiente": "default","valorPonto":1,"coluna":"","radius":15}}'; | |
| 215 | 226 | if (config === "") { |
| 216 | 227 | config = configDefault; |
| 217 | 228 | } |
| ... | ... | @@ -220,37 +231,38 @@ i3GEO.pluginI3geo = |
| 220 | 231 | config = YAHOO.lang.JSON.parse(configDefault); |
| 221 | 232 | } |
| 222 | 233 | parametros = config.parametros; |
| 223 | - ins += "" | |
| 224 | - + "<p>Coluna que contém os dados:" | |
| 225 | - + "<br><input name='coluna' type='text' value='" | |
| 226 | - + parametros.coluna | |
| 227 | - + "' size='30'></p>" | |
| 228 | - + "<p>Ou valor numérico para cada ponto:" | |
| 229 | - + "<br><input name='valorPonto' type='text' value='" | |
| 230 | - + parametros.valorPonto | |
| 231 | - + "' size='30'></p>" | |
| 232 | - + "<p>Raio de cada ponto em pixels:" | |
| 233 | - + "<br><input name='radius' type='text' value='" | |
| 234 | - + parametros.radius | |
| 235 | - + "' size='30'></p>" | |
| 236 | - // + "<p>Valor máximo em cada ponto:" | |
| 237 | - // + "<br><input name='max' type='text' value='" | |
| 238 | - // + parametros.max | |
| 239 | - // + "' size='30'></p>" | |
| 240 | - + "<p>Tipo de gradiente (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):" | |
| 241 | - + "<br><input name='tipoGradiente' type='text' value='" | |
| 242 | - + parametros.tipoGradiente | |
| 243 | - + "' size='30'></p>" | |
| 244 | - + "<p>Para definir os cortes no gradiente de cores utilize valores entre 0 e 1." | |
| 245 | - + " As cores são definidas nas classes do LAYER, sendo que o nome define o valor superior do gradiente e COLOR define a cor." | |
| 246 | - + " Veja o exemplo utilizado no tema _lmapadecalor.map</p>"; | |
| 234 | + ins += | |
| 235 | + "" | |
| 236 | + + "<p>Coluna que contém os dados:" | |
| 237 | + + "<br><input name='coluna' type='text' value='" | |
| 238 | + + parametros.coluna | |
| 239 | + + "' size='30'></p>" | |
| 240 | + + "<p>Ou valor numérico para cada ponto:" | |
| 241 | + + "<br><input name='valorPonto' type='text' value='" | |
| 242 | + + parametros.valorPonto | |
| 243 | + + "' size='30'></p>" | |
| 244 | + + "<p>Raio de cada ponto em pixels:" | |
| 245 | + + "<br><input name='radius' type='text' value='" | |
| 246 | + + parametros.radius | |
| 247 | + + "' size='30'></p>" | |
| 248 | + // + "<p>Valor máximo em cada ponto:" | |
| 249 | + // + "<br><input name='max' type='text' value='" | |
| 250 | + // + parametros.max | |
| 251 | + // + "' size='30'></p>" | |
| 252 | + + "<p>Tipo de gradiente (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):" | |
| 253 | + + "<br><input name='tipoGradiente' type='text' value='" | |
| 254 | + + parametros.tipoGradiente | |
| 255 | + + "' size='30'></p>" | |
| 256 | + + "<p>Para definir os cortes no gradiente de cores utilize valores entre 0 e 1." | |
| 257 | + + " As cores são definidas nas classes do LAYER, sendo que o nome define o valor superior do gradiente e COLOR define a cor." | |
| 258 | + + " Veja o exemplo utilizado no tema _lmapadecalor.map</p>"; | |
| 247 | 259 | return ins; |
| 248 | 260 | }, |
| 249 | 261 | /** |
| 250 | 262 | * Constroi um icone que sera adicionado na barra de icones do tema quando for adicionado na arvore de camadas |
| 251 | 263 | * Esse icone e utilizado para reabrir o formulario de parametros |
| 252 | 264 | */ |
| 253 | - iconeArvoreDeCamadas : function(nomecamada){ | |
| 265 | + iconeArvoreDeCamadas : function(nomecamada) { | |
| 254 | 266 | return false; |
| 255 | 267 | }, |
| 256 | 268 | googlemaps : { |
| ... | ... | @@ -271,26 +283,25 @@ i3GEO.pluginI3geo = |
| 271 | 283 | return camada; |
| 272 | 284 | }, |
| 273 | 285 | inicia : function(camada) { |
| 274 | - var nomeScript = "heatmap_script", p = i3GEO.configura.locaplic | |
| 275 | - + "/ferramentas/heatmap/googlemaps_js.php", carregaJs = "nao", criaLayer; | |
| 286 | + var nomeScript = "heatmap_script", p = i3GEO.configura.locaplic + "/ferramentas/heatmap/googlemaps_js.php", carregaJs = | |
| 287 | + "nao", criaLayer; | |
| 276 | 288 | criaLayer = function() { |
| 277 | 289 | var heatmap, pontos; |
| 278 | 290 | |
| 279 | - heatmap = new HeatmapOverlay( | |
| 280 | - i3GeoMap, camada.name, { | |
| 281 | - "radius" : camada.plugini3geo.parametros.radius, | |
| 282 | - "visible" : true, | |
| 283 | - "opacity" : camada.transparency, | |
| 284 | - "gradient" : heatmap_config.gradient, | |
| 285 | - "legend" : { | |
| 286 | - "title" : camada.tema, | |
| 287 | - "position" : "bl", | |
| 288 | - "offset" : [ | |
| 289 | - 5, | |
| 290 | - 50 | |
| 291 | - ] | |
| 292 | - } | |
| 293 | - }); | |
| 291 | + heatmap = new HeatmapOverlay(i3GeoMap, camada.name, { | |
| 292 | + "radius" : camada.plugini3geo.parametros.radius, | |
| 293 | + "visible" : true, | |
| 294 | + "opacity" : camada.transparency, | |
| 295 | + "gradient" : heatmap_config.gradient, | |
| 296 | + "legend" : { | |
| 297 | + "title" : camada.tema, | |
| 298 | + "position" : "bl", | |
| 299 | + "offset" : [ | |
| 300 | + 5, | |
| 301 | + 50 | |
| 302 | + ] | |
| 303 | + } | |
| 304 | + }); | |
| 294 | 305 | // i3GeoMap.overlayMapTypes.insertAt(0, heatmap); |
| 295 | 306 | pontos = { |
| 296 | 307 | max : camada.plugini3geo.parametros.max, |
| ... | ... | @@ -320,21 +331,11 @@ i3GEO.pluginI3geo = |
| 320 | 331 | } else { |
| 321 | 332 | nomeScript = ""; |
| 322 | 333 | } |
| 323 | - p += "?carregajs=" | |
| 324 | - + carregaJs | |
| 325 | - + "&layer=" | |
| 326 | - + camada.name | |
| 327 | - + "&coluna=" | |
| 328 | - + camada.plugini3geo.parametros.coluna | |
| 329 | - + "&tipoGradiente=" | |
| 330 | - + camada.plugini3geo.parametros.tipoGradiente | |
| 331 | - + "&g_sid=" | |
| 332 | - + i3GEO.configura.sid | |
| 333 | - + "&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config"; | |
| 334 | - i3GEO.util.scriptTag( | |
| 335 | - p, | |
| 336 | - criaLayer, | |
| 337 | - nomeScript); | |
| 334 | + p += | |
| 335 | + "?carregajs=" + carregaJs + "&layer=" + camada.name + "&coluna=" + camada.plugini3geo.parametros.coluna | |
| 336 | + + "&tipoGradiente=" + camada.plugini3geo.parametros.tipoGradiente + "&g_sid=" + i3GEO.configura.sid | |
| 337 | + + "&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config"; | |
| 338 | + i3GEO.util.scriptTag(p, criaLayer, nomeScript); | |
| 338 | 339 | } |
| 339 | 340 | }, |
| 340 | 341 | // |
| ... | ... | @@ -362,8 +363,8 @@ i3GEO.pluginI3geo = |
| 362 | 363 | return camada; |
| 363 | 364 | }, |
| 364 | 365 | inicia : function(camada, objMapa) { |
| 365 | - var nomeScript = "heatmap_script", p = i3GEO.configura.locaplic | |
| 366 | - + "/ferramentas/heatmap/openlayers_js.php", carregaJs = "nao", criaLayer; | |
| 366 | + var nomeScript = "heatmap_script", p = i3GEO.configura.locaplic + "/ferramentas/heatmap/openlayers_js.php", carregaJs = | |
| 367 | + "nao", criaLayer; | |
| 367 | 368 | criaLayer = function() { |
| 368 | 369 | var temp, heatmap, transformedTestData = { |
| 369 | 370 | max : 1, |
| ... | ... | @@ -383,37 +384,32 @@ i3GEO.pluginI3geo = |
| 383 | 384 | while (datalen--) { |
| 384 | 385 | temp = heatmap_dados[datalen].count; |
| 385 | 386 | nudata.push({ |
| 386 | - lonlat : new OpenLayers.LonLat( | |
| 387 | - data[datalen].lng, heatmap_dados[datalen].lat), | |
| 387 | + lonlat : new OpenLayers.LonLat(data[datalen].lng, heatmap_dados[datalen].lat), | |
| 388 | 388 | count : temp |
| 389 | 389 | }); |
| 390 | - max = Math.max( | |
| 391 | - max, | |
| 392 | - temp); | |
| 390 | + max = Math.max(max, temp); | |
| 393 | 391 | } |
| 394 | 392 | transformedTestData.max = max; |
| 395 | 393 | transformedTestData.data = nudata; |
| 396 | 394 | // create our heatmap layer |
| 397 | - heatmap = new OpenLayers.Layer.Heatmap( | |
| 398 | - camada.name, objMapa, objMapa.baseLayer, { | |
| 399 | - "visible" : true, | |
| 400 | - "opacity" : camada.transparency, | |
| 401 | - "radius" : camada.plugini3geo.parametros.radius, | |
| 402 | - "gradient" : heatmap_config.gradient, | |
| 403 | - "legend" : { | |
| 404 | - "title" : camada.tema, | |
| 405 | - "position" : "bl", | |
| 406 | - "offset" : [ | |
| 407 | - 5, | |
| 408 | - 50 | |
| 409 | - ] | |
| 410 | - } | |
| 411 | - }, { | |
| 412 | - isBaseLayer : false, | |
| 413 | - projection : new OpenLayers.Projection( | |
| 414 | - "EPSG:4326"), | |
| 415 | - displayInLayerSwitcher : true | |
| 416 | - }); | |
| 395 | + heatmap = new OpenLayers.Layer.Heatmap(camada.name, objMapa, objMapa.baseLayer, { | |
| 396 | + "visible" : true, | |
| 397 | + "opacity" : camada.transparency, | |
| 398 | + "radius" : camada.plugini3geo.parametros.radius, | |
| 399 | + "gradient" : heatmap_config.gradient, | |
| 400 | + "legend" : { | |
| 401 | + "title" : camada.tema, | |
| 402 | + "position" : "bl", | |
| 403 | + "offset" : [ | |
| 404 | + 5, | |
| 405 | + 50 | |
| 406 | + ] | |
| 407 | + } | |
| 408 | + }, { | |
| 409 | + isBaseLayer : false, | |
| 410 | + projection : new OpenLayers.Projection("EPSG:4326"), | |
| 411 | + displayInLayerSwitcher : true | |
| 412 | + }); | |
| 417 | 413 | heatmap.ligaCamada = function() { |
| 418 | 414 | this.toggle(); |
| 419 | 415 | this.updateLayer(); |
| ... | ... | @@ -444,25 +440,14 @@ i3GEO.pluginI3geo = |
| 444 | 440 | } else { |
| 445 | 441 | nomeScript = ""; |
| 446 | 442 | } |
| 447 | - if (!i3GEO.configura | |
| 448 | - || !i3GEO.configura.sid) { | |
| 443 | + if (!i3GEO.configura || !i3GEO.configura.sid) { | |
| 449 | 444 | i3GEO.configura.sid = ""; |
| 450 | 445 | } |
| 451 | - p += "?carregajs=" | |
| 452 | - + carregaJs | |
| 453 | - + "&layer=" | |
| 454 | - + camada.name | |
| 455 | - + "&coluna=" | |
| 456 | - + camada.plugini3geo.parametros.coluna | |
| 457 | - + "&tipoGradiente=" | |
| 458 | - + camada.plugini3geo.parametros.tipoGradiente | |
| 459 | - + "&g_sid=" | |
| 460 | - + i3GEO.configura.sid | |
| 461 | - + "&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config"; | |
| 462 | - i3GEO.util.scriptTag( | |
| 463 | - p, | |
| 464 | - criaLayer, | |
| 465 | - nomeScript); | |
| 446 | + p += | |
| 447 | + "?carregajs=" + carregaJs + "&layer=" + camada.name + "&coluna=" + camada.plugini3geo.parametros.coluna | |
| 448 | + + "&tipoGradiente=" + camada.plugini3geo.parametros.tipoGradiente + "&g_sid=" + i3GEO.configura.sid | |
| 449 | + + "&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config"; | |
| 450 | + i3GEO.util.scriptTag(p, criaLayer, nomeScript); | |
| 466 | 451 | } |
| 467 | 452 | }, |
| 468 | 453 | googleearth : { |
| ... | ... | @@ -503,11 +488,11 @@ i3GEO.pluginI3geo = |
| 503 | 488 | */ |
| 504 | 489 | markercluster : { |
| 505 | 490 | linkAjuda : function() { |
| 506 | - return i3GEO.configura.locaplic | |
| 507 | - + "/ajuda_usuario.php?idcategoria=3&idajuda=121"; | |
| 491 | + return i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=3&idajuda=121"; | |
| 508 | 492 | }, |
| 509 | 493 | formAdmin : function(config) { |
| 510 | - var parametros, ins = "", configDefault = '{"plugin":"markercluster","parametros":{"tipoEstilos": "default","gridSize":50}}'; | |
| 494 | + var parametros, ins = "", configDefault = | |
| 495 | + '{"plugin":"markercluster","parametros":{"tipoEstilos": "default","gridSize":50}}'; | |
| 511 | 496 | if (config === "") { |
| 512 | 497 | config = configDefault; |
| 513 | 498 | } |
| ... | ... | @@ -516,17 +501,16 @@ i3GEO.pluginI3geo = |
| 516 | 501 | config = YAHOO.lang.JSON.parse(configDefault); |
| 517 | 502 | } |
| 518 | 503 | parametros = config.parametros; |
| 519 | - ins += "" | |
| 520 | - + "<p>Distância máxima entre ponto em pixels:" | |
| 521 | - + "<br><input name='gridSize' type='text' value='" | |
| 522 | - + parametros.gridSize | |
| 523 | - + "' size='30'></p>" | |
| 524 | - + "<p>Tipo de estilos (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):" | |
| 525 | - + "<br><input name='tipoEstilos' type='text' value='" | |
| 526 | - + parametros.tipoEstilos | |
| 527 | - + "' size='30'></p>" | |
| 528 | - + "<p>Os símbolos utilizados podem ser customizados alterando-se as classes do Mapfile</p>" | |
| 529 | - + "<p>Veja o exemplo utilizado no tema _lmapadecluster.map</p>"; | |
| 504 | + ins += | |
| 505 | + "" | |
| 506 | + + "<p>Distância máxima entre ponto em pixels:" | |
| 507 | + + "<br><input name='gridSize' type='text' value='" | |
| 508 | + + parametros.gridSize | |
| 509 | + + "' size='30'></p>" | |
| 510 | + + "<p>Tipo de estilos (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):" | |
| 511 | + + "<br><input name='tipoEstilos' type='text' value='" + parametros.tipoEstilos + "' size='30'></p>" | |
| 512 | + + "<p>Os símbolos utilizados podem ser customizados alterando-se as classes do Mapfile</p>" | |
| 513 | + + "<p>Veja o exemplo utilizado no tema _lmapadecluster.map</p>"; | |
| 530 | 514 | |
| 531 | 515 | return ins; |
| 532 | 516 | }, |
| ... | ... | @@ -534,7 +518,7 @@ i3GEO.pluginI3geo = |
| 534 | 518 | * Constroi um icone que sera adicionado na barra de icones do tema quando for adicionado na arvore de camadas |
| 535 | 519 | * Esse icone e utilizado para reabrir o formulario de parametros |
| 536 | 520 | */ |
| 537 | - iconeArvoreDeCamadas : function(nomecamada){ | |
| 521 | + iconeArvoreDeCamadas : function(nomecamada) { | |
| 538 | 522 | return false; |
| 539 | 523 | }, |
| 540 | 524 | googlemaps : { |
| ... | ... | @@ -555,36 +539,30 @@ i3GEO.pluginI3geo = |
| 555 | 539 | return camada; |
| 556 | 540 | }, |
| 557 | 541 | inicia : function(camada) { |
| 558 | - var nomeScript = "markercluster_script", p = i3GEO.configura.locaplic | |
| 559 | - + "/ferramentas/markercluster/googlemaps_js.php", carregaJs = "nao", criaLayer; | |
| 542 | + var nomeScript = "markercluster_script", p = i3GEO.configura.locaplic + "/ferramentas/markercluster/googlemaps_js.php", carregaJs = | |
| 543 | + "nao", criaLayer; | |
| 560 | 544 | criaLayer = function() { |
| 561 | 545 | var markercluster, marcas, latLng, marker, n, i; |
| 562 | 546 | n = markercluster_dados.length; |
| 563 | 547 | marcas = []; |
| 564 | 548 | for (i = 0; i < n; i++) { |
| 565 | - latLng = new google.maps.LatLng( | |
| 566 | - markercluster_dados[i].lat, markercluster_dados[i].lng); | |
| 567 | - marker = new google.maps.Marker( | |
| 568 | - { | |
| 569 | - 'position' : latLng, | |
| 570 | - icon : { | |
| 571 | - url : markercluster_config.ponto.url, | |
| 572 | - scaledSize : new google.maps.Size( | |
| 573 | - markercluster_config.ponto.width, markercluster_config.ponto.height) | |
| 574 | - } | |
| 575 | - }); | |
| 549 | + latLng = new google.maps.LatLng(markercluster_dados[i].lat, markercluster_dados[i].lng); | |
| 550 | + marker = new google.maps.Marker({ | |
| 551 | + 'position' : latLng, | |
| 552 | + icon : { | |
| 553 | + url : markercluster_config.ponto.url, | |
| 554 | + scaledSize : new google.maps.Size(markercluster_config.ponto.width, markercluster_config.ponto.height) | |
| 555 | + } | |
| 556 | + }); | |
| 576 | 557 | marcas.push(marker); |
| 577 | 558 | } |
| 578 | - markercluster = new MarkerClusterer( | |
| 579 | - i3GeoMap, marcas, { | |
| 580 | - "gridSize" : parseInt( | |
| 581 | - camada.plugini3geo.parametros.gridSize, | |
| 582 | - 10), | |
| 583 | - "visible" : true, | |
| 584 | - "opacity" : camada.transparency, | |
| 585 | - "name" : camada.name, | |
| 586 | - "styles" : markercluster_config.estilos | |
| 587 | - }); | |
| 559 | + markercluster = new MarkerClusterer(i3GeoMap, marcas, { | |
| 560 | + "gridSize" : parseInt(camada.plugini3geo.parametros.gridSize, 10), | |
| 561 | + "visible" : true, | |
| 562 | + "opacity" : camada.transparency, | |
| 563 | + "name" : camada.name, | |
| 564 | + "styles" : markercluster_config.estilos | |
| 565 | + }); | |
| 588 | 566 | i3GEO.janela.fechaAguarde("aguardePlugin"); |
| 589 | 567 | i3GEO.eventos.cliquePerm.ativo = false; |
| 590 | 568 | |
| ... | ... | @@ -617,19 +595,11 @@ i3GEO.pluginI3geo = |
| 617 | 595 | } else { |
| 618 | 596 | nomeScript = ""; |
| 619 | 597 | } |
| 620 | - p += "?carregajs=" | |
| 621 | - + carregaJs | |
| 622 | - + "&layer=" | |
| 623 | - + camada.name | |
| 624 | - + "&g_sid=" | |
| 625 | - + i3GEO.configura.sid | |
| 626 | - + "&tipoEstilos=" | |
| 627 | - + camada.plugini3geo.parametros.tipoEstilos | |
| 628 | - + "&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config"; | |
| 629 | - i3GEO.util.scriptTag( | |
| 630 | - p, | |
| 631 | - criaLayer, | |
| 632 | - nomeScript); | |
| 598 | + p += | |
| 599 | + "?carregajs=" + carregaJs + "&layer=" + camada.name + "&g_sid=" + i3GEO.configura.sid + "&tipoEstilos=" | |
| 600 | + + camada.plugini3geo.parametros.tipoEstilos | |
| 601 | + + "&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config"; | |
| 602 | + i3GEO.util.scriptTag(p, criaLayer, nomeScript); | |
| 633 | 603 | } |
| 634 | 604 | }, |
| 635 | 605 | openlayers : { |
| ... | ... | @@ -650,70 +620,61 @@ i3GEO.pluginI3geo = |
| 650 | 620 | return camada; |
| 651 | 621 | }, |
| 652 | 622 | inicia : function(camada, objMapa) { |
| 653 | - var nomeScript = "markercluster_script", p = i3GEO.configura.locaplic | |
| 654 | - + "/ferramentas/markercluster/openlayers_js.php", carregaJs = "nao", criaLayer; | |
| 655 | - criaLayer = function() { | |
| 656 | - var layerListeners, logMax, logMin, classes, min, max, markercluster, marcas, lonlat, n, i, style, nestilos, intervalo, regra, regras = []; | |
| 623 | + var nomeScript = "markercluster_script", p = i3GEO.configura.locaplic + "/ferramentas/markercluster/openlayers_js.php", carregaJs = | |
| 624 | + "nao", criaLayer; | |
| 625 | + criaLayer = | |
| 626 | + function() { | |
| 627 | + var layerListeners, logMax, logMin, classes, min, max, markercluster, marcas, lonlat, n, i, style, nestilos, intervalo, regra, regras = | |
| 628 | + []; | |
| 657 | 629 | |
| 658 | - nestilos = markercluster_config.estilos.length; | |
| 659 | - n = markercluster_dados.length; | |
| 630 | + nestilos = markercluster_config.estilos.length; | |
| 631 | + n = markercluster_dados.length; | |
| 660 | 632 | |
| 661 | - classes = Array(); | |
| 662 | - logMax = Math.log(n) | |
| 663 | - / Math.LN10; // max decimal logarithm (or base | |
| 664 | - // 10) | |
| 665 | - logMin = Math.log(1) | |
| 666 | - / Math.LN10; | |
| 667 | - intervalo = (logMax - logMin) | |
| 668 | - / nestilos; | |
| 669 | - // we compute log bounds | |
| 670 | - for (i = 0; i < nestilos; i++) { | |
| 671 | - if (i == 0) { | |
| 672 | - classes[i] = logMin; | |
| 673 | - } else { | |
| 674 | - classes[i] = classes[i - 1] | |
| 675 | - + intervalo; | |
| 633 | + classes = Array(); | |
| 634 | + logMax = Math.log(n) / Math.LN10; // max decimal logarithm (or base | |
| 635 | + // 10) | |
| 636 | + logMin = Math.log(1) / Math.LN10; | |
| 637 | + intervalo = (logMax - logMin) / nestilos; | |
| 638 | + // we compute log bounds | |
| 639 | + for (i = 0; i < nestilos; i++) { | |
| 640 | + if (i == 0) { | |
| 641 | + classes[i] = logMin; | |
| 642 | + } else { | |
| 643 | + classes[i] = classes[i - 1] + intervalo; | |
| 644 | + } | |
| 676 | 645 | } |
| 677 | - } | |
| 678 | - // we compute antilog | |
| 679 | - classes = classes.map(function(x) { | |
| 680 | - return Math.pow( | |
| 681 | - 10, | |
| 682 | - x); | |
| 683 | - }); | |
| 684 | - // and we finally add max value | |
| 685 | - classes.push(n); | |
| 646 | + // we compute antilog | |
| 647 | + classes = classes.map(function(x) { | |
| 648 | + return Math.pow(10, x); | |
| 649 | + }); | |
| 650 | + // and we finally add max value | |
| 651 | + classes.push(n); | |
| 686 | 652 | |
| 687 | - // ponto sozinho | |
| 688 | - regra = new OpenLayers.Rule( | |
| 689 | - { | |
| 690 | - filter : new OpenLayers.Filter.Comparison( | |
| 691 | - { | |
| 692 | - type : OpenLayers.Filter.Comparison.LESS_THAN, | |
| 693 | - property : "count", | |
| 694 | - value : 2 | |
| 695 | - }), | |
| 653 | + // ponto sozinho | |
| 654 | + regra = new OpenLayers.Rule({ | |
| 655 | + filter : new OpenLayers.Filter.Comparison({ | |
| 656 | + type : OpenLayers.Filter.Comparison.LESS_THAN, | |
| 657 | + property : "count", | |
| 658 | + value : 2 | |
| 659 | + }), | |
| 696 | 660 | symbolizer : { |
| 697 | 661 | externalGraphic : markercluster_config.ponto.url, |
| 698 | 662 | graphicWidth : markercluster_config.ponto.width, |
| 699 | 663 | graphicHeight : markercluster_config.ponto.height, |
| 700 | - graphicYOffset : (markercluster_config.ponto.height / 2) | |
| 701 | - * -1 | |
| 664 | + graphicYOffset : (markercluster_config.ponto.height / 2) * -1 | |
| 702 | 665 | } |
| 703 | 666 | }); |
| 704 | - regras.push(regra); | |
| 705 | - min = 2; | |
| 706 | - for (i = 0; i < nestilos; i++) { | |
| 707 | - max = classes[i + 1]; | |
| 708 | - regra = new OpenLayers.Rule( | |
| 709 | - { | |
| 710 | - filter : new OpenLayers.Filter.Comparison( | |
| 711 | - { | |
| 712 | - type : OpenLayers.Filter.Comparison.BETWEEN, | |
| 713 | - property : "count", | |
| 714 | - lowerBoundary : min, | |
| 715 | - upperBoundary : max | |
| 716 | - }), | |
| 667 | + regras.push(regra); | |
| 668 | + min = 2; | |
| 669 | + for (i = 0; i < nestilos; i++) { | |
| 670 | + max = classes[i + 1]; | |
| 671 | + regra = new OpenLayers.Rule({ | |
| 672 | + filter : new OpenLayers.Filter.Comparison({ | |
| 673 | + type : OpenLayers.Filter.Comparison.BETWEEN, | |
| 674 | + property : "count", | |
| 675 | + lowerBoundary : min, | |
| 676 | + upperBoundary : max | |
| 677 | + }), | |
| 717 | 678 | symbolizer : { |
| 718 | 679 | externalGraphic : markercluster_config.estilos[i].url, |
| 719 | 680 | graphicWidth : markercluster_config.estilos[i].width, |
| ... | ... | @@ -725,92 +686,75 @@ i3GEO.pluginI3geo = |
| 725 | 686 | fontSize : "12px" |
| 726 | 687 | } |
| 727 | 688 | }); |
| 728 | - regras.push(regra); | |
| 729 | - min = max; | |
| 730 | - } | |
| 689 | + regras.push(regra); | |
| 690 | + min = max; | |
| 691 | + } | |
| 731 | 692 | |
| 732 | - // Create a Style that uses the three previous rules | |
| 733 | - style = new OpenLayers.Style( | |
| 734 | - null, { | |
| 693 | + // Create a Style that uses the three previous rules | |
| 694 | + style = new OpenLayers.Style(null, { | |
| 735 | 695 | rules : regras |
| 736 | 696 | }); |
| 737 | - // para uso com o mashup | |
| 738 | - if (!objMapa) { | |
| 739 | - objMapa = i3geoOL; | |
| 740 | - } | |
| 697 | + // para uso com o mashup | |
| 698 | + if (!objMapa) { | |
| 699 | + objMapa = i3geoOL; | |
| 700 | + } | |
| 741 | 701 | |
| 742 | - layerListeners = { | |
| 743 | - featureclick : function(e) { | |
| 744 | - if (e.feature.cluster.length > 1) { | |
| 745 | - objMapa.setCenter( | |
| 746 | - [ | |
| 702 | + layerListeners = { | |
| 703 | + featureclick : function(e) { | |
| 704 | + if (e.feature.cluster.length > 1) { | |
| 705 | + objMapa.setCenter([ | |
| 747 | 706 | e.feature.geometry.x, |
| 748 | 707 | e.feature.geometry.y |
| 749 | - ], | |
| 750 | - objMapa.getZoom() + 1, | |
| 751 | - false, | |
| 752 | - false); | |
| 753 | - // objMapa.zoomIn(); | |
| 708 | + ], objMapa.getZoom() + 1, false, false); | |
| 709 | + // objMapa.zoomIn(); | |
| 710 | + } | |
| 711 | + return false; | |
| 754 | 712 | } |
| 755 | - return false; | |
| 756 | - } | |
| 757 | - }; | |
| 713 | + }; | |
| 758 | 714 | |
| 759 | - markercluster = new OpenLayers.Layer.Vector( | |
| 760 | - camada.name, { | |
| 715 | + markercluster = new OpenLayers.Layer.Vector(camada.name, { | |
| 761 | 716 | renderers : [ |
| 762 | 717 | 'Canvas', |
| 763 | 718 | 'SVG' |
| 764 | 719 | ], |
| 765 | 720 | strategies : [ |
| 766 | - new OpenLayers.Strategy.AnimatedCluster( | |
| 767 | - { | |
| 768 | - distance : parseInt( | |
| 769 | - camada.plugini3geo.parametros.gridSize, | |
| 770 | - 10) | |
| 771 | - }) | |
| 721 | + new OpenLayers.Strategy.AnimatedCluster({ | |
| 722 | + distance : parseInt(camada.plugini3geo.parametros.gridSize, 10) | |
| 723 | + }) | |
| 772 | 724 | ], |
| 773 | - styleMap : new OpenLayers.StyleMap( | |
| 774 | - style), | |
| 725 | + styleMap : new OpenLayers.StyleMap(style), | |
| 775 | 726 | eventListeners : layerListeners |
| 776 | 727 | }); |
| 777 | - objMapa.addLayer(markercluster); | |
| 728 | + objMapa.addLayer(markercluster); | |
| 778 | 729 | |
| 779 | - marcas = []; | |
| 780 | - for (i = 0; i < n; i++) { | |
| 781 | - lonlat = new OpenLayers.LonLat( | |
| 782 | - markercluster_dados[i].lng, markercluster_dados[i].lat); | |
| 783 | - if (i3GEO.Interface.openlayers.googleLike === true) { | |
| 784 | - lonlat.transform( | |
| 785 | - new OpenLayers.Projection( | |
| 786 | - "EPSG:4326"), | |
| 787 | - new OpenLayers.Projection( | |
| 788 | - "EPSG:900913")); | |
| 730 | + marcas = []; | |
| 731 | + for (i = 0; i < n; i++) { | |
| 732 | + lonlat = new OpenLayers.LonLat(markercluster_dados[i].lng, markercluster_dados[i].lat); | |
| 733 | + if (i3GEO.Interface.openlayers.googleLike === true) { | |
| 734 | + lonlat.transform(new OpenLayers.Projection("EPSG:4326"), new OpenLayers.Projection("EPSG:900913")); | |
| 735 | + } | |
| 736 | + marcas.push(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(lonlat.lon, lonlat.lat))); | |
| 789 | 737 | } |
| 790 | - marcas.push(new OpenLayers.Feature.Vector( | |
| 791 | - new OpenLayers.Geometry.Point( | |
| 792 | - lonlat.lon, lonlat.lat))); | |
| 793 | - } | |
| 794 | - markercluster.addFeatures(marcas); | |
| 795 | - | |
| 796 | - i3GEO.janela.fechaAguarde("aguardePlugin"); | |
| 797 | - i3GEO.eventos.cliquePerm.ativo = false; | |
| 738 | + markercluster.addFeatures(marcas); | |
| 798 | 739 | |
| 799 | - markercluster.ligaCamada = function() { | |
| 800 | - i3GEO.eventos.cliquePerm.ativo = false; | |
| 801 | - }; | |
| 802 | - markercluster.desLigaCamada = function() { | |
| 803 | - i3GEO.eventos.cliquePerm.ativo = true; | |
| 804 | - }; | |
| 805 | - markercluster.removeCamada = function() { | |
| 806 | - i3GEO.eventos.cliquePerm.ativo = true; | |
| 807 | - }; | |
| 808 | - markercluster.atualizaCamada = function() { | |
| 740 | + i3GEO.janela.fechaAguarde("aguardePlugin"); | |
| 809 | 741 | i3GEO.eventos.cliquePerm.ativo = false; |
| 742 | + | |
| 743 | + markercluster.ligaCamada = function() { | |
| 744 | + i3GEO.eventos.cliquePerm.ativo = false; | |
| 745 | + }; | |
| 746 | + markercluster.desLigaCamada = function() { | |
| 747 | + i3GEO.eventos.cliquePerm.ativo = true; | |
| 748 | + }; | |
| 749 | + markercluster.removeCamada = function() { | |
| 750 | + i3GEO.eventos.cliquePerm.ativo = true; | |
| 751 | + }; | |
| 752 | + markercluster.atualizaCamada = function() { | |
| 753 | + i3GEO.eventos.cliquePerm.ativo = false; | |
| 754 | + }; | |
| 755 | + i3GEO.pluginI3geo.OBJETOS[camada.name] = markercluster; | |
| 756 | + markercluster_dados = null; | |
| 810 | 757 | }; |
| 811 | - i3GEO.pluginI3geo.OBJETOS[camada.name] = markercluster; | |
| 812 | - markercluster_dados = null; | |
| 813 | - }; | |
| 814 | 758 | // se o script nao existir carrega o codigo e os dados |
| 815 | 759 | // caso contrario, carrega apenas os dados no script |
| 816 | 760 | if (!$i(nomeScript)) { |
| ... | ... | @@ -818,19 +762,11 @@ i3GEO.pluginI3geo = |
| 818 | 762 | } else { |
| 819 | 763 | nomeScript = ""; |
| 820 | 764 | } |
| 821 | - p += "?carregajs=" | |
| 822 | - + carregaJs | |
| 823 | - + "&layer=" | |
| 824 | - + camada.name | |
| 825 | - + "&g_sid=" | |
| 826 | - + i3GEO.configura.sid | |
| 827 | - + "&tipoEstilos=" | |
| 828 | - + camada.plugini3geo.parametros.tipoEstilos | |
| 829 | - + "&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config"; | |
| 830 | - i3GEO.util.scriptTag( | |
| 831 | - p, | |
| 832 | - criaLayer, | |
| 833 | - nomeScript); | |
| 765 | + p += | |
| 766 | + "?carregajs=" + carregaJs + "&layer=" + camada.name + "&g_sid=" + i3GEO.configura.sid + "&tipoEstilos=" | |
| 767 | + + camada.plugini3geo.parametros.tipoEstilos | |
| 768 | + + "&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config"; | |
| 769 | + i3GEO.util.scriptTag(p, criaLayer, nomeScript); | |
| 834 | 770 | } |
| 835 | 771 | } |
| 836 | 772 | }, |
| ... | ... | @@ -858,8 +794,7 @@ i3GEO.pluginI3geo = |
| 858 | 794 | */ |
| 859 | 795 | layerkml : { |
| 860 | 796 | linkAjuda : function() { |
| 861 | - return i3GEO.configura.locaplic | |
| 862 | - + "/ajuda_usuario.php?idcategoria=3&idajuda=121"; | |
| 797 | + return i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=3&idajuda=121"; | |
| 863 | 798 | // http://localhost/i3geo/aplicmap/dados/sundials.kml |
| 864 | 799 | // http://dev.openlayers.org/examples/kml/sundials.kml |
| 865 | 800 | }, |
| ... | ... | @@ -873,17 +808,16 @@ i3GEO.pluginI3geo = |
| 873 | 808 | config = YAHOO.lang.JSON.parse(configDefault); |
| 874 | 809 | } |
| 875 | 810 | parametros = config.parametros; |
| 876 | - ins += "<p>Url do arquivo Kml:<br><input name='url' type='text' value='" | |
| 877 | - + parametros.url | |
| 878 | - + "'/></p>" | |
| 879 | - + "<p>Veja o exemplo utilizado no tema _lmapakml.map</p>"; | |
| 811 | + ins += | |
| 812 | + "<p>Url do arquivo Kml:<br><input name='url' type='text' value='" + parametros.url + "'/></p>" | |
| 813 | + + "<p>Veja o exemplo utilizado no tema _lmapakml.map</p>"; | |
| 880 | 814 | return ins; |
| 881 | 815 | }, |
| 882 | 816 | /** |
| 883 | 817 | * Constroi um icone que sera adicionado na barra de icones do tema quando for adicionado na arvore de camadas |
| 884 | 818 | * Esse icone e utilizado para reabrir o formulario de parametros |
| 885 | 819 | */ |
| 886 | - iconeArvoreDeCamadas : function(nomecamada){ | |
| 820 | + iconeArvoreDeCamadas : function(nomecamada) { | |
| 887 | 821 | return false; |
| 888 | 822 | }, |
| 889 | 823 | googlemaps : { |
| ... | ... | @@ -904,12 +838,11 @@ i3GEO.pluginI3geo = |
| 904 | 838 | return camada; |
| 905 | 839 | }, |
| 906 | 840 | inicia : function(camada) { |
| 907 | - var layerkml = new google.maps.KmlLayer( | |
| 908 | - camada.plugini3geo.parametros.url, { | |
| 909 | - map : i3GeoMap, | |
| 910 | - preserveViewport : true, | |
| 911 | - name : camada.name | |
| 912 | - }); | |
| 841 | + var layerkml = new google.maps.KmlLayer(camada.plugini3geo.parametros.url, { | |
| 842 | + map : i3GeoMap, | |
| 843 | + preserveViewport : true, | |
| 844 | + name : camada.name | |
| 845 | + }); | |
| 913 | 846 | i3GEO.janela.fechaAguarde("aguardePlugin"); |
| 914 | 847 | layerkml.ligaCamada = function() { |
| 915 | 848 | i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap); |
| ... | ... | @@ -948,67 +881,65 @@ i3GEO.pluginI3geo = |
| 948 | 881 | }, |
| 949 | 882 | inicia : function(camada, objMapa) { |
| 950 | 883 | var layerkml; |
| 951 | - url = i3GEO.configura.locaplic | |
| 952 | - + "/classesphp/proxy.php?url=" | |
| 953 | - + camada.plugini3geo.parametros.url; | |
| 954 | - layerkml = new OpenLayers.Layer.Vector( | |
| 955 | - camada.name, { | |
| 956 | - displayOutsideMaxExtent : true, | |
| 957 | - displayInLayerSwitcher : false, | |
| 958 | - visibility : true, | |
| 959 | - strategies : [ | |
| 960 | - new OpenLayers.Strategy.Fixed() | |
| 961 | - ], | |
| 962 | - protocol : new OpenLayers.Protocol.HTTP( | |
| 963 | - { | |
| 964 | - url : url, | |
| 965 | - format : new OpenLayers.Format.KML( | |
| 966 | - { | |
| 967 | - extractStyles : true, | |
| 968 | - extractAttributes : true, | |
| 969 | - maxDepth : 5 | |
| 970 | - }) | |
| 971 | - }) | |
| 972 | - }); | |
| 884 | + url = i3GEO.configura.locaplic + "/classesphp/proxy.php?url=" + camada.plugini3geo.parametros.url; | |
| 885 | + layerkml = new OpenLayers.Layer.Vector(camada.name, { | |
| 886 | + displayOutsideMaxExtent : true, | |
| 887 | + displayInLayerSwitcher : false, | |
| 888 | + visibility : true, | |
| 889 | + strategies : [ | |
| 890 | + new OpenLayers.Strategy.Fixed() | |
| 891 | + ], | |
| 892 | + protocol : new OpenLayers.Protocol.HTTP({ | |
| 893 | + url : url, | |
| 894 | + format : new OpenLayers.Format.KML({ | |
| 895 | + extractStyles : true, | |
| 896 | + extractAttributes : true, | |
| 897 | + maxDepth : 5 | |
| 898 | + }) | |
| 899 | + }) | |
| 900 | + }); | |
| 973 | 901 | i3geoOL.addLayer(layerkml); |
| 974 | 902 | |
| 975 | 903 | if (!objMapa) { |
| 976 | 904 | objMapa = i3geoOL; |
| 977 | 905 | } |
| 978 | - layerkml.div.onclick = function(e) { | |
| 979 | - var targ = "", id, temp, features, n, i, j = "", html = ""; | |
| 980 | - if (!e) { | |
| 981 | - e = window.event; | |
| 982 | - } | |
| 983 | - if (e.target) { | |
| 984 | - targ = e.target; | |
| 985 | - } else if (e.srcElement) { | |
| 986 | - targ = e.srcElement; | |
| 987 | - } | |
| 988 | - if (targ.id) { | |
| 989 | - temp = targ.id.split("_Point"); | |
| 990 | - if (temp[0] === "OpenLayers_Geometry") { | |
| 991 | - id = targ.id; | |
| 992 | - temp = i3geoOL.getLayer(this.id); | |
| 993 | - features = temp.features; | |
| 994 | - n = features.length; | |
| 995 | - for (i = 0; i < n; i++) { | |
| 996 | - if (features[i].geometry.id === id) { | |
| 997 | - for (j in features[i].attributes) { | |
| 998 | - html += j | |
| 999 | - + ": " | |
| 1000 | - + features[i].attributes[j]; | |
| 1001 | - } | |
| 1002 | - g = features[i].geometry; | |
| 1003 | - i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud( | |
| 1004 | - "kml", new OpenLayers.LonLat( | |
| 1005 | - g.x, g.y), null, html, null, true)); | |
| 906 | + layerkml.div.onclick = | |
| 907 | + function(e) { | |
| 908 | + var targ = "", id, temp, features, n, i, j = "", html = ""; | |
| 909 | + if (!e) { | |
| 910 | + e = window.event; | |
| 911 | + } | |
| 912 | + if (e.target) { | |
| 913 | + targ = e.target; | |
| 914 | + } else if (e.srcElement) { | |
| 915 | + targ = e.srcElement; | |
| 916 | + } | |
| 917 | + if (targ.id) { | |
| 918 | + temp = targ.id.split("_Point"); | |
| 919 | + if (temp[0] === "OpenLayers_Geometry") { | |
| 920 | + id = targ.id; | |
| 921 | + temp = i3geoOL.getLayer(this.id); | |
| 922 | + features = temp.features; | |
| 923 | + n = features.length; | |
| 924 | + for (i = 0; i < n; i++) { | |
| 925 | + if (features[i].geometry.id === id) { | |
| 926 | + for (j in features[i].attributes) { | |
| 927 | + html += j + ": " + features[i].attributes[j]; | |
| 928 | + } | |
| 929 | + g = features[i].geometry; | |
| 930 | + i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud( | |
| 931 | + "kml", | |
| 932 | + new OpenLayers.LonLat(g.x, g.y), | |
| 933 | + null, | |
| 934 | + html, | |
| 935 | + null, | |
| 936 | + true)); | |
| 1006 | 937 | |
| 938 | + } | |
| 1007 | 939 | } |
| 1008 | 940 | } |
| 1009 | 941 | } |
| 1010 | - } | |
| 1011 | - }; | |
| 942 | + }; | |
| 1012 | 943 | |
| 1013 | 944 | i3GEO.janela.fechaAguarde("aguardePlugin"); |
| 1014 | 945 | i3GEO.eventos.cliquePerm.ativo = false; |
| ... | ... | @@ -1058,8 +989,7 @@ i3GEO.pluginI3geo = |
| 1058 | 989 | */ |
| 1059 | 990 | parametrossql : { |
| 1060 | 991 | linkAjuda : function() { |
| 1061 | - return i3GEO.configura.locaplic | |
| 1062 | - + "/ajuda_usuario.php?idcategoria=3&idajuda=127"; | |
| 992 | + return i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=3&idajuda=127"; | |
| 1063 | 993 | }, |
| 1064 | 994 | formAdmin : function(config) { |
| 1065 | 995 | var n, i, parametros, ins = "", configDefault = |
| ... | ... | @@ -1073,35 +1003,26 @@ i3GEO.pluginI3geo = |
| 1073 | 1003 | } |
| 1074 | 1004 | parametros = config.parametros; |
| 1075 | 1005 | n = 4; |
| 1076 | - if(config.ativo == undefined){ | |
| 1006 | + if (config.ativo == undefined) { | |
| 1077 | 1007 | config.ativo = "sim"; |
| 1078 | 1008 | } |
| 1079 | 1009 | ins += "<p class='paragrafo'>Abre o formulário quando a camada é adicionada ao mapa: (true ou false)</p>"; |
| 1080 | 1010 | ins += "<select style='width:200px' id='parametrosSqlAtivo' ><option value='' ></option>"; |
| 1081 | - if(config.ativo === "nao"){ | |
| 1011 | + if (config.ativo === "nao") { | |
| 1082 | 1012 | ins += "<option value=sim >sim</option><option value=nao selected >nao</option></select>"; |
| 1083 | - } else{ | |
| 1013 | + } else { | |
| 1084 | 1014 | ins += "<option value=sim selected >sim</option><option value=nao >nao</option></select>"; |
| 1085 | 1015 | } |
| 1086 | 1016 | |
| 1087 | - ins += "<table><tr><td>Título</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>"; | |
| 1017 | + ins += | |
| 1018 | + "<table><tr><td>Título</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>"; | |
| 1088 | 1019 | for (i = 0; i < n; i++) { |
| 1089 | - ins += "<tr><td><input name='titulo' type=text size=20 value='" | |
| 1090 | - + parametros[i].titulo | |
| 1091 | - + "' /></td>" | |
| 1092 | - + "<td><input name='chave' type=text size=20 value='" | |
| 1093 | - + parametros[i].chave | |
| 1094 | - + "' /></td>" | |
| 1095 | - + "<td><input name='tipo' type=text size=20 value='" | |
| 1096 | - + parametros[i].tipo | |
| 1097 | - + "' /></td> " | |
| 1098 | - + "<td><input name='valores' type=text size=20 value='" | |
| 1099 | - + parametros[i].valores | |
| 1100 | - + "' /></td> " | |
| 1101 | - + "<td><input name='prog' type=text size=20 value='" | |
| 1102 | - + parametros[i].prog | |
| 1103 | - + "' /></td> " | |
| 1104 | - + "<td></tr>"; | |
| 1020 | + ins += | |
| 1021 | + "<tr><td><input name='titulo' type=text size=20 value='" + parametros[i].titulo + "' /></td>" | |
| 1022 | + + "<td><input name='chave' type=text size=20 value='" + parametros[i].chave + "' /></td>" | |
| 1023 | + + "<td><input name='tipo' type=text size=20 value='" + parametros[i].tipo + "' /></td> " | |
| 1024 | + + "<td><input name='valores' type=text size=20 value='" + parametros[i].valores + "' /></td> " | |
| 1025 | + + "<td><input name='prog' type=text size=20 value='" + parametros[i].prog + "' /></td> " + "<td></tr>"; | |
| 1105 | 1026 | } |
| 1106 | 1027 | ins += |
| 1107 | 1028 | "</table>" |
| ... | ... | @@ -1119,56 +1040,63 @@ i3GEO.pluginI3geo = |
| 1119 | 1040 | // administracao |
| 1120 | 1041 | // ver i3geo/admin/editormapfile.js funcao salvarDadosEditorPlugin |
| 1121 | 1042 | parametrosFormAdmin : function(onde) { |
| 1122 | - var campo = 0,nlinhas = 4, ncampos = 5, campos = onde.getElementsByTagName("input"), par = [], temp = [], i, j; | |
| 1043 | + var campo = 0, nlinhas = 4, ncampos = 5, campos = onde.getElementsByTagName("input"), par = [], temp = [], i, j; | |
| 1123 | 1044 | for (j = 0; j < nlinhas; j++) { |
| 1124 | 1045 | temp = []; |
| 1125 | 1046 | for (i = 0; i < ncampos; i++) { |
| 1126 | - if(campos[campo] && campos[campo].name != ""){ | |
| 1127 | - temp.push('"'+campos[campo].name | |
| 1128 | - + '" : "' | |
| 1129 | - + campos[campo].value | |
| 1130 | - + '"'); | |
| 1047 | + if (campos[campo] && campos[campo].name != "") { | |
| 1048 | + temp.push('"' + campos[campo].name + '" : "' + campos[campo].value + '"'); | |
| 1131 | 1049 | } |
| 1132 | 1050 | campo++; |
| 1133 | 1051 | } |
| 1134 | - par.push("{" | |
| 1135 | - + temp.join(",") | |
| 1136 | - + "}"); | |
| 1052 | + par.push("{" + temp.join(",") + "}"); | |
| 1137 | 1053 | } |
| 1138 | - return '{"plugin":"parametrossql","ativo":"' + $i("parametrosSqlAtivo").value + '","parametros":[' | |
| 1139 | - + par.join(",") | |
| 1140 | - + ']}'; | |
| 1054 | + return '{"plugin":"parametrossql","ativo":"' + $i("parametrosSqlAtivo").value + '","parametros":[' + par.join(",") + ']}'; | |
| 1141 | 1055 | }, |
| 1142 | 1056 | /** |
| 1143 | 1057 | * Constroi um icone que sera adicionado na barra de icones do tema quando for adicionado na arvore de camadas |
| 1144 | 1058 | * Esse icone e utilizado para reabrir o formulario de parametros |
| 1145 | 1059 | */ |
| 1146 | - iconeArvoreDeCamadas : function(nomecamada){ | |
| 1147 | - var icone = "<img " | |
| 1148 | - + "class='pluginParametrossql'" | |
| 1149 | - + " onclick='i3GEO.util.animaClique(this);" | |
| 1150 | - + "i3GEO.pluginI3geo.parametrossql.buscaParForm(\"" + nomecamada + "\")" | |
| 1151 | - + "' title='Variaveis'" | |
| 1152 | - + "' src='" | |
| 1153 | - + i3GEO.configura.locaplic + "/imagens/branco.gif" | |
| 1154 | - + "'/>"; | |
| 1060 | + iconeArvoreDeCamadas : function(nomecamada) { | |
| 1061 | + var icone = | |
| 1062 | + "<img class='pluginParametrossql' " | |
| 1063 | + + "onclick='i3GEO.util.animaClique(this);" | |
| 1064 | + + "i3GEO.pluginI3geo.parametrossql.buscaParForm(\"" + nomecamada + "\");return false;'" | |
| 1065 | + + "title='Variaveis' " | |
| 1066 | + + "src='" | |
| 1067 | + + i3GEO.configura.locaplic | |
| 1068 | + + "/imagens/branco.gif' />"; | |
| 1155 | 1069 | return icone; |
| 1156 | 1070 | }, |
| 1157 | - buscaParForm : function (nomecamada){ | |
| 1158 | - var p, cp, temp; | |
| 1159 | - temp = function(retorno){ | |
| 1071 | + buscaParForm : function(nomecamada) { | |
| 1072 | + var p, cp, temp,s; | |
| 1073 | + temp = function(retorno) { | |
| 1074 | + var camada; | |
| 1160 | 1075 | retorno.data.ativo = "sim"; |
| 1161 | 1076 | //pega o objeto camada |
| 1162 | - var camada = i3GEO.arvoreDeCamadas.pegaTema(nomecamada); | |
| 1163 | - camada.plugini3geo = retorno.data; | |
| 1077 | + if(i3GEO.arvoreDeCamadas){ | |
| 1078 | + camada = i3GEO.arvoreDeCamadas.pegaTema(nomecamada); | |
| 1079 | + camada.plugini3geo = retorno.data; | |
| 1080 | + } | |
| 1081 | + else{ | |
| 1082 | + camada = { | |
| 1083 | + plugini3geo : retorno.data, | |
| 1084 | + name : nomecamada | |
| 1085 | + }; | |
| 1086 | + } | |
| 1164 | 1087 | i3GEO.pluginI3geo.parametrossql.inicia(camada); |
| 1165 | 1088 | }; |
| 1089 | + s = i3GEO.configura.sid; | |
| 1090 | + if(s === undefined){ | |
| 1091 | + s = ""; | |
| 1092 | + } | |
| 1166 | 1093 | //aqui e necessario buscar os parametros do plugin para poder abrir o formulario |
| 1167 | - p = i3GEO.configura.locaplic+"/ferramentas/parametrossql/exec.php?g_sid="+i3GEO.configura.sid | |
| 1168 | - + "&funcao=PARAMETROSPLUGIN&name="+ nomecamada; | |
| 1094 | + p = | |
| 1095 | + i3GEO.configura.locaplic + "/ferramentas/parametrossql/exec.php?g_sid=" + s | |
| 1096 | + + "&funcao=PARAMETROSPLUGIN&tema=" + nomecamada; | |
| 1169 | 1097 | cp = new cpaint(); |
| 1170 | 1098 | cp.set_response_type("JSON"); |
| 1171 | - cp.call(p,"foo",temp); | |
| 1099 | + cp.call(p, "foo", temp); | |
| 1172 | 1100 | }, |
| 1173 | 1101 | inicia : function(camada) { |
| 1174 | 1102 | i3GEO.janela.fechaAguarde("aguardePlugin"); |
| ... | ... | @@ -1195,6 +1123,16 @@ i3GEO.pluginI3geo = |
| 1195 | 1123 | }, |
| 1196 | 1124 | aplicaPropriedades : function(camada) { |
| 1197 | 1125 | return camada; |
| 1126 | + }, | |
| 1127 | + layerMashup : function(camada,epsg) { | |
| 1128 | + var p; | |
| 1129 | + p = new OpenLayers.Layer.WMS( | |
| 1130 | + camada.tema, | |
| 1131 | + "http://localhost/i3geo/ogc.php?tema="+camada.name+"&", | |
| 1132 | + {layers:camada.name,SRS:'EPSG:'+epsg,FORMAT:'image/png'}, | |
| 1133 | + {singleTile:false,isBaseLayer:false,visibility:true,plugini3geo:"parametrossql"} | |
| 1134 | + ); | |
| 1135 | + return p; | |
| 1198 | 1136 | } |
| 1199 | 1137 | } |
| 1200 | 1138 | } | ... | ... |
classesjs/compactados/classe_editorol_compacto.js
| 1 | -if(!i3GEO||typeof(i3GEO)==='undefined'){var i3GEO={};i3GEO.Interface={};navn=false;navm=false;$i=function(id){return document.getElementById(id)};app=navigator.appName.substring(0,1);if(app==='N'){navn=true}else{navm=true}OpenLayers.ImgPath="../pacotes/openlayers/img/";OpenLayers.Lang.setCode("pt-BR")}i3GEO.editorOL={simbologia:{opacidade:0.8,texto:"",fillColor:"250,180,15",strokeWidth:2,strokeColor:"250,150,0",pointRadius:4,graphicName:"square",fontSize:"12px",fontColor:"0,0,0",externalGraphic:"",graphicHeight:25,graphicWidth:25},backup:new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}),nomeFuncaoSalvar:"i3GEO.editorOL.salvaGeo()",e_oce:new OpenLayers.Layer.ArcGIS93Rest("ESRI Ocean Basemap","http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_ims:new OpenLayers.Layer.ArcGIS93Rest("ESRI Imagery World 2D","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_wsm:new OpenLayers.Layer.ArcGIS93Rest("ESRI World Street Map","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),ol_mma:new OpenLayers.Layer.WMS("Base cartográfica","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",{layers:'baseraster',SRS:'EPSG:4618',FORMAT:'image/png'},{singleTile:false}),ol_wms:new OpenLayers.Layer.WMS("OpenLayers WMS","http://labs.metacarta.com/wms/vmap0",{layers:'basic'}),top_wms:new OpenLayers.Layer.WMS("Toponímia MMA","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&",{layers:"base",FORMAT:'image/png'}),est_wms:new OpenLayers.Layer.WMS("Estados do Brasil","http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&",{layers:"estadosl",FORMAT:'image/png'}),osm:new OpenLayers.Layer.OSM("OSM","http://tile.openstreetmap.org/${z}/${x}/${y}.png",{isBaseLayer:true,visibility:false}),fundo:"e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce",kml:[],layersIniciais:[],botoes:{'pan':true,'zoombox':true,'zoomtot':true,'zoomin':true,'zoomout':true,'legenda':true,'distancia':true,'area':true,'identifica':true,'linha':true,'ponto':true,'poligono':true,'texto':true,'edita':true,'listag':true,'corta':true,'apaga':true,'procura':true,'selecao':true,'selecaotudo':true,'salva':true,'ajuda':true,'propriedades':true,'fecha':false,'tools':true,'undo':false,'frente':false,'legenda':true,'rodadomouse':true},pontos:[],marca:"../pacotes/openlayers/img/marker-gold.png",controles:[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoomBar(),new OpenLayers.Control.LayerSwitcher({'ascending':false}),new OpenLayers.Control.ScaleLine(),new OpenLayers.Control.MousePosition({'separator':' '}),new OpenLayers.Control.OverviewMap(),new OpenLayers.Control.KeyboardDefaults()],tiles:true,incluilayergrafico:true,ativalayerswitcher:false,ativarodadomouse:true,legendahtml:false,numzoom:12,minresolution:0.703125,maxext:"",mapext:new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081),mapa:"",inicia:function(){var alayers=[],fundo=(i3GEO.editorOL.fundo).split(","),nfundo=fundo.length,ncontroles=i3GEO.editorOL.controles.length,i,n;if(i3GEO.editorOL.tiles===false||i3GEO.editorOL.tiles==="false"){single=true}if(i3GEO.editorOL.ativalayerswitcher==="false"){i3GEO.editorOL.ativalayerswitcher=false}if(i3GEO.editorOL.ativalayerswitcher==="true"){i3GEO.editorOL.ativalayerswitcher=true}if(i3GEO.editorOL.ativarodadomouse==="false"){i3GEO.editorOL.ativarodadomouse=false}if(i3GEO.editorOL.ativarodadomouse==="true"){i3GEO.editorOL.ativarodadomouse=true}if(i3GEO.editorOL.legendahtml==="false"){i3GEO.editorOL.legendahtml=false}if(i3GEO.editorOL.legendahtml==="true"){i3GEO.editorOL.legendahtml=true}if(i3GEO.editorOL.incluilayergrafico==="false"){i3GEO.editorOL.incluilayergrafico=false}if(i3GEO.editorOL.incluilayergrafico==="true"){i3GEO.editorOL.incluilayergrafico=true}if(i3GEO.editorOL.incluilayergrafico===true){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}}else{i3GEO.desenho.layergrafico="";i3GEO.editorOL.botoes.linha=false;i3GEO.editorOL.botoes.ponto=false;i3GEO.editorOL.botoes.poligono=false;i3GEO.editorOL.botoes.texto=false;i3GEO.editorOL.botoes.edita=false;i3GEO.editorOL.botoes.listag=false;i3GEO.editorOL.botoes.corta=false;i3GEO.editorOL.botoes.apaga=false;i3GEO.editorOL.botoes.selecao=false;i3GEO.editorOL.botoes.selecaotudo=false;i3GEO.editorOL.botoes.salva=false;i3GEO.editorOL.botoes.propriedades=false;i3GEO.editorOL.botoes.fecha=false;i3GEO.editorOL.botoes.tools=false;i3GEO.editorOL.botoes.undo=false;i3GEO.editorOL.botoes.frente=false}if(i3GEO.editorOL.mapa===""){alert("O objeto i3GEO.editorOL.mapa nao existe. Precisa ser criado com new OpenLayers.Map()");return}for(i=0;i<ncontroles;i++){i3GEO.editorOL.mapa.addControl(i3GEO.editorOL.controles[i])}if(i3GEO.editorOL.fundo!=""){for(i=nfundo-1;i>=0;i--){if(fundo[i]!=""){try{i3GEO.editorOL[fundo[i]].transitionEffect='resize';i3GEO.editorOL[fundo[i]].setVisibility(false);i3GEO.editorOL[fundo[i]].singleTile=false;alayers.push(i3GEO.editorOL[fundo[i]])}catch(e){if(alayers[0]){alayers[0].setVisibility(true)}}}}}i3GEO.editorOL.mapa.addLayers(alayers);if(i3GEO.editorOL.layersIniciais!==""){n=i3GEO.editorOL.layersIniciais.length;for(i=0;i<n;i++){i3GEO.editorOL.mapa.addLayer(i3GEO.editorOL.layersIniciais[i])}}if(!i3GEO.desenho.layergrafico&&i3GEO.editorOL.incluilayergrafico===true){i3GEO.editorOL.mapa.addLayers([i3GEO.desenho.layergrafico])}i3GEO.editorOL.adicionaKml();i3GEO.editorOL.adicionaMarcas();i3GEO.editorOL.coordenadas();i3GEO.editorOL.criaJanelaBusca();i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes);if(i3GEO.editorOL.ativalayerswitcher===true){i3GEO.editorOL.ativaLayerSwitcher()}if(i3GEO.editorOL.ativarodadomouse===false){i3GEO.editorOL.desativaRodaDoMouse()}if(i3GEO.editorOL.numzoom!==""){i3GEO.editorOL.mapa.setOptions({numZoomLevels:i3GEO.editorOL.numzoom})}if(i3GEO.editorOL.maxext!==""){i3GEO.editorOL.mapa.setOptions({maxExtent:i3GEO.editorOL.maxext})}if(i3GEO.editorOL.mapext!=""){var m=i3GEO.util.extGeo2OSM(i3GEO.editorOL.mapext);i3GEO.editorOL.mapa.zoomToExtent(m)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}i3GEO.editorOL.sobeLayersGraficos()},criaLayerGrafico:function(){i3GEO.desenho.openlayers.criaLayerGrafico()},layersLigados:function(){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,ins=[],i;for(i=0;i<nlayers;i++){if(layers[i].visibility===true){ins.push(layers[i])}}return ins},layersClonados:function(paramsLayers){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,i;for(i=0;i<nlayers;i++){if(layers[i].params&&layers[i].params.CLONETMS===paramsLayers){return(layers[i])}}return false},layertms2wms:function(tms){var layer,url;url=tms.url.replace("&cache=sim","&DESLIGACACHE=sim");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");layer=new OpenLayers.Layer.WMS(tms.layername+"_clone",url,{layers:tms.name,transparent:true},{gutter:0,isBaseLayer:false,displayInLayerSwitcher:false,opacity:1,visibility:true,singleTile:true});return layer},removeClone:function(){var nome=i3GEO.editorOL.layerAtivo().layername+"_clone",busca=i3GEO.editorOL.mapa.getLayersByName(nome);if(busca.length>0){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.mapa.getLayersByName(camada.name)[0],false)}},coordenadas:function(){var idcoord=i3GEO.editorOL.mapa.getControlsBy("separator"," ");if(idcoord[0]){i3GEO.editorOL.mapa.events.register("mousemove",i3GEO.editorOL.mapa,function(e){var p,lonlat,d;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(p);lonlat=i3GEO.util.projOSM2Geo(lonlat);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{$i(idcoord[0].id).innerHTML="Long: "+d[0]+"<br>Lat: "+d[1]}catch(e){}})}},criaJanelaBusca:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,ins,combo="<select id=i3GEOOLlistaTemasBusca ><option value=''>----</option>";for(i=0;i<nlayers;i++){combo+="<option value='"+i+"' >"+layers[i].name+"</option>"}combo+="</select>";ins="<div class=paragrafo >Tema:<br>"+combo;ins+="<br>Item:<br><span id=i3GEOOLcomboitens ></span>";ins+="<br>Procurar por:<br><input type=text size=20 id=i3GEOOLpalavraBusca >";ins+="<br><br><input type=button value='Procurar' id='i3GEOOLbotaoBusca' ></div>";ins+="<br>Resultado:<br><span id=i3GEOOLcomboresultado ></span>";try{YAHOO.namespace("procura.container");YAHOO.procura.container.panel=new YAHOO.widget.Panel("panelprocura",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.procura.container.panel.setHeader("Encontre no mapa");YAHOO.procura.container.panel.setBody(ins);YAHOO.procura.container.panel.setFooter("");YAHOO.procura.container.panel.render(document.body);YAHOO.procura.container.panel.center();document.getElementById("i3GEOOLbotaoBusca").onclick=function(){var layer=i3GEO.editorOL.layerAtivo(),item=document.getElementById("i3GEOOLbuscaItem").value,palavra=document.getElementById("i3GEOOLpalavraBusca").value;if(item===""||palavra===""){alert("Escolha o item e o texto de busca");return}i3GEO.editorOL.busca(layer,item,palavra,"i3GEOOLcomboresultado")};document.getElementById("i3GEOOLlistaTemasBusca").onchange=function(){i3GEO.editorOL.ativaTema(this.value);document.getElementById("i3GEOOLcomboitens").innerHTML="...";i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(),"i3GEOOLcomboitens","i3GEOOLbuscaItem")}}catch(e){}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",temp,combo="<select id=i3GEOOLlistaTemasAtivos style=width:235px; >";for(i=0;i<nlayers;i++){nometema="";if(i3GEO.arvoreDeCamadas&&i3GEO.arvoreDeCamadas.CAMADAS){temp=i3GEO.arvoreDeCamadas.pegaTema(layers[i].name,"","name");if(temp!=""){nometema=temp.tema+" - "}}combo+="<option value='"+i+"' >"+nometema+layers[i].name+"</option>"}combo+="</select>";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo);document.getElementById("i3GEOOLlistaTemasAtivos").onchange=function(){if(botaoIdentifica){botaoIdentifica.layers=[i3GEO.editorOL.layersLigados()[this.value]]}}},criaJanelaAtivaTema:function(){var temp;if(!document.getElementById("paneltemaativo")){YAHOO.namespace("temaativo.container");YAHOO.temaativo.container.panel=new YAHOO.widget.Panel("paneltemaativo",{zIndex:20000,iframe:true,width:"250px",visible:false,draggable:true,close:true});YAHOO.temaativo.container.panel.setBody("");if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.temaativo.container.panel.setHeader("Tema ativo<div id='paneltemaativo_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.temaativo.container.panel.setHeader("Tema ativo")}YAHOO.temaativo.container.panel.setFooter("");YAHOO.temaativo.container.panel.render(document.body);YAHOO.temaativo.container.panel.show();YAHOO.temaativo.container.panel.center();i3GEO.editorOL.atualizaJanelaAtivaTema();YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close,"click",function(){i3GEOpanelEditor.deactivate();i3GEOpanelEditor.activate();if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}}temp=$i("paneltemaativo_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("paneltemaativo")}}}else{YAHOO.temaativo.container.panel.show();i3GEO.editorOL.atualizaJanelaAtivaTema()}},ativaTema:function(id){document.getElementById("i3GEOOLlistaTemasAtivos").value=id},layerAtivo:function(){var id=document.getElementById("i3GEOOLlistaTemasAtivos");if(id){id=id.value}else{id=i3GEO.temaAtivo}if(id==""){return[]}else{return i3GEO.editorOL.layersLigados()[id]}},listaItens:function(layer,idonde,idobj){if(!layer){return}if(!layer.params){return}var u=layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0";u+="&typename="+layer.params.LAYERS;document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.WFSDescribeFeatureType({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),prop=gml.featureTypes[0].properties,nprop=prop.length,i,combo="<select id="+idobj+" ><option value=''>----</option>";for(i=0;i<nprop;i++){combo+="<option value="+prop[i].name+" >"+prop[i].name+"</option>"}combo+="</select>";document.getElementById(idonde).innerHTML=combo},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},busca:function(layer,item,palavra,onde){document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";var u=layer.url+"&request=getfeature&service=wfs&version=1.0.0";u=u.replace("Z=${z}&X=${x}&Y=${y}","");u+="&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS;u+="&filter=<Filter><PropertyIsLike wildcard=* singleChar=. escape=! ><PropertyName>"+item+"</PropertyName><Literal>*"+palavra+"*</Literal></PropertyIsLike></Filter>";document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";document.getElementById(onde).innerHTML="...";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),ngml=gml.length,i,ins="<select onchange='i3GEO.editorOL.zoomPara(this.value)'>";ins+="<option value=''>---</option>";for(i=0;i<ngml;i++){eval("var valor = gml[i].data."+item);var bounds=gml[i].geometry.getBounds();bounds=bounds.toBBOX();ins+="<option value='"+bounds+"'>"+valor+"</option>"}ins+="</select>";document.getElementById(onde).innerHTML=ins},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},zoomPara:function(bbox){var b=new OpenLayers.Bounds.fromString(bbox);i3GEO.editorOL.mapa.zoomToExtent(b)},mostraLegenda:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,ins="",i;for(i=0;i<nlayers;i++){try{if(layers[i].isBaseLayer===false){var url=layers[i].getFullRequestString({"request":"getlegendgraphic"});if(i3GEO.editorOL.legendahtml===true){url=url.replace("image%2Fpng","text/html");ins+=layers[i].name+"<br><div id=legendaL_"+i+" ></div><br>";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");var config={method:"GET",url:url,callback:f};OpenLayers.Request.issue(config)}else{url=url.replace("LAYERS","LAYER");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");ins+=layers[i].name+"<br><img src='"+url+"&SERVICE=wms' /><br>"}}}catch(e){}}if(!document.getElementById("panellegendaeditorOL")){YAHOO.namespace("legendaeditorOL.container");YAHOO.legendaeditorOL.container.panel=new YAHOO.widget.Panel("panellegendaeditorOL",{zIndex:20000,iframe:true,width:"auto",visible:false,draggable:true,close:true});YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.setHeader("Legenda");YAHOO.legendaeditorOL.container.panel.setFooter("");YAHOO.legendaeditorOL.container.panel.render(document.body);YAHOO.legendaeditorOL.container.panel.show();YAHOO.legendaeditorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.legendaeditorOL.container.panel.close,"click",function(){})}else{YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.show()}},captura:function(lonlat){var d=0.1,layers=[i3GEO.editorOL.layerAtivo()],xy=lonlat.split(","),u=layers[0].url+"&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS;u=u.replace("&cache=sim","&DESLIGACACHE=sim");u=u.replace("&Z=${z}&X=${x}&Y=${y}","");u=u.replace("Z=${z}&X=${x}&Y=${y}","");xy[0]=xy[0]*1;xy[1]=xy[1]*1;var poligono=(xy[0]-d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]+d);u+="&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:posList>"+poligono+"</gml:posList></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></Filter>";document.body.style.cursor="wait";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="wait"}OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}var i,n,f,fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText);n=gml.length;for(i=0;i<n;i++){f=gml[i];f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,registros:f["attributes"]}}i3GEO.desenho.layergrafico.addFeatures(gml)},failure:function(){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}alert("Erro")}})},salvaGeometrias:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="";if(n>0){if($i("panelsalvageometrias")){if(YAHOO.i3GEO){YAHOO.salvaGeometrias.container.panel=YAHOO.i3GEO.janela.manager.find("panelsalvageometrias")}YAHOO.salvaGeometrias.container.panel.show();YAHOO.salvaGeometrias.container.panel.bringToTop()}else{try{YAHOO.namespace("salvaGeometrias.container");YAHOO.salvaGeometrias.container.panel=new YAHOO.widget.Panel("panelsalvageometrias",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.salvaGeometrias.container.panel.setHeader("Geometrias");YAHOO.salvaGeometrias.container.panel.setBody("");YAHOO.salvaGeometrias.container.panel.setFooter("");YAHOO.salvaGeometrias.container.panel.render(document.body);YAHOO.salvaGeometrias.container.panel.center();if(YAHOO.i3GEO&&YAHOO.i3GEO.janela){YAHOO.i3GEO.janela.manager.register(YAHOO.salvaGeometrias.container.panel)}YAHOO.salvaGeometrias.container.panel.show()}catch(e){}}ins+="<p class=paragrafo >Foram encontrada(s) "+n+" geometria(s) selecionada(s) </p>";ins+="<p class=paragrafo ><a href='#' onclick='i3GEO.editorOL.listaGeometriasSel()' >Listar</a> ";if(i3GEO.arvoreDeCamadas){ins+="<a href='#' onclick='"+i3GEO.editorOL.nomeFuncaoSalvar+"' >Salvar dados</a> "}ins+="<a href='#' onclick='i3GEO.editorOL.incorporar()' >Incorporar ao mapa</a></p>";ins+="<p class=paragrafo>"+$trad("ajudaEditorOlSalva")+"</p>";YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{alert("Selecione pelo menos um elemento")}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="",i,a,w,g;for(i=0;i<n;i++){g=geos[i];ins+="<b>Geometria: "+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.geometry)+"<br><br>";ins+="<b>Atributos: "+i+"</b><br>";a=g.attributes;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}if(g.attributes.registros){ins+="<b>Registros: "+i+"</b><br>";a=g.attributes.registros;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}}ins+="<br>"}w=window.open();w.document.write(ins);w.document.close()},testeSalvar:function(){alert("Funcao nao disponivel. Defina o nome da funcao em i3GEO.editorOL.nomeFuncaoSalvar ")},salvaGeo:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,funcaoOK=function(){if(geos[0].geometry){var registros="",valorunico="",nometema=$i("editorOLcomboTemaEditavel").value,key="",tema,redesenha,p,g=i3GEO.editorOL.google2wgs(geos[0].geometry);if(nometema==""){return}tema=i3GEO.arvoreDeCamadas.pegaTema(nometema,"","name");if(geos[0].attributes.registros){registros=geos[0].attributes.registros;for(key in registros){if(registros[key]&&key==tema.colunaidunico){valorunico=registros[key]}}}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);i3GEO.Interface.atualizaTema("",nometema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto","Adicionando...");i3GEO.janela.AGUARDEMODAL=false;if(valorunico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+g)}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+g)}}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto="Salvar no tema:<br><div id=editorOLondeComboTemaEditavel ></div><br><br>";if(n!=1){i3GEO.janela.tempoMsg("Selecione apenas uma figura")}else{i3GEO.janela.confirma(texto,300,"Salva","Cancela",funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel")}},criaBotoes:function(botoes){var sketchSymbolizers={"Point":{pointRadius:4,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},"Line":{strokeWidth:3,strokeOpacity:1,strokeColor:"#666666",strokeDashstyle:"dash"},"Polygon":{strokeWidth:2,strokeOpacity:1,strokeColor:"#666666",fillColor:"white",fillOpacity:0.3}},style=new OpenLayers.Style(),styleMap=new OpenLayers.StyleMap({"default":style,"vertex":{strokeOpacity:1,strokeWidth:1,fillColor:"white",fillOpacity:0.45,pointRadius:3}},{extendDefault:false}),adiciona=false,button,controles=[];style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);i3GEOpanelEditor=new OpenLayers.Control.Panel({displayClass:"olControlEditingToolbar1 noprint",saveState:false,activateControl:function(c){this.deactivate();this.activate();try{i3GEO.editorOL.ModifyFeature.deactivate();if(i3GEO&&i3GEO.barraDeBotoes){i3GEO.barraDeBotoes.ativaPadrao()}}catch(e){}if(!c.trigger){c.activate()}else{c.trigger.call()}}});if(botoes.procura===true){button=new OpenLayers.Control.Button({displayClass:"editorOLprocura",trigger:function(){YAHOO.procura.container.panel.show()},title:"procura",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.pan===true){controles.push(new OpenLayers.Control.Navigation({title:"deslocar",displayClass:"editorOLpan",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoombox===true){controles.push(new OpenLayers.Control.ZoomBox({title:"zoombox",displayClass:"editorOLzoombox",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoomtot===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomtot",trigger:function(){if(i3GEO.editorOL.mapext&&i3GEO.editorOL.mapext!=""){i3GEO.editorOL.mapa.zoomToExtent(i3GEO.editorOL.mapext)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}},title:"ajusta extensao",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomin===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomin",trigger:function(){i3GEO.editorOL.mapa.zoomIn()},title:"aproxima",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomout===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomout",trigger:function(){i3GEO.editorOL.mapa.zoomOut()},title:"afasta",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.legenda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlegenda",trigger:function(){i3GEO.editorOL.mostraLegenda()},title:"legenda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.distancia===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Path,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLdistancia",title:"distancia",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units,measure=event.measure;alert("Distancia: "+measure.toFixed(3)+" "+units)}});controles.push(button);adiciona=true}if(botoes.area===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLarea",title:"area",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units;var measure=event.measure;alert("Área: "+measure.toFixed(3)+" "+units+" quadrados")}});controles.push(button);adiciona=true}if(botoes.identifica===true){botaoIdentifica=new OpenLayers.Control.WMSGetFeatureInfo({maxFeatures:1,infoFormat:'text/plain',layers:[i3GEO.editorOL.layerAtivo()],queryVisible:true,title:"identifica",type:OpenLayers.Control.TYPE_TOOL,displayClass:"editorOLidentifica",eventListeners:{getfeatureinfo:function(event){var lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),lonlattexto="<hr>",formata;if(botoes.linha===true||botoes.ponto===true||botoes.poligono===true||botoes.edita===true){lonlattexto+="<pre><span style=font-size:12px;color:blue;cursor:pointer onclick='i3GEO.editorOL.captura(\""+lonlat.lon+","+lonlat.lat+"\")'>edita geometria</span></pre><br>"}formata=function(texto){var temp,temp1,n,i,f=[],textoN=texto.split(":");try{if(textoN.length>1){temp=textoN[2].replace(/\n\r/g,"");temp=temp.replace(/'/g,"");temp=temp.replace(/\n/g,"|");temp=temp.replace(/_/g," ");temp=temp.replace(/=/g,":");temp=temp.split("|");n=temp.length;for(i=0;i<n;i++){temp1=temp[i].replace(/^\s+/,"");temp1=temp1.replace(/\s+$/,"");if(temp1!="")f.push(temp1)}texto=f.join("<br><br>")}}catch(e){}return texto};i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("chicken",i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),null,"<div style=text-align:left >"+lonlattexto+"<pre>"+formata(event.text)+"</pre></div>",null,true));i3GEO.editorOL.removeClone()},beforegetfeatureinfo:function(event){var ativo=[i3GEO.editorOL.layerAtivo()];if(ativo[0].serviceVersion==="&tms="||ativo[0].CLASS_NAME=="OpenLayers.Layer.TMS"||ativo[0].CLASS_NAME=="OpenLayers.Layer.OSM"){ativo=[i3GEO.editorOL.layertms2wms(ativo[0])]}ativo[0].projection=new OpenLayers.Projection("EPSG:4326");event.object.layers=ativo;botaoIdentifica.layers=ativo;botaoIdentifica.url=ativo[0].url},activate:function(){i3GEO.editorOL.criaJanelaAtivaTema()}}});controles.push(botaoIdentifica);adiciona=true}if(botoes.linha===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Path,{displayClass:"editorOLlinha",title:"digitalizar linha",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.ponto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLponto",title:"digitalizar ponto",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f,style_mark;if(i3GEO.editorOL.simbologia.externalGraphic!=""){style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=i3GEO.editorOL.simbologia.externalGraphic;style_mark.graphicWidth=i3GEO.editorOL.simbologia.graphicWidth;style_mark.graphicHeight=i3GEO.editorOL.simbologia.graphicHeight;style_mark.fillOpacity=i3GEO.editorOL.simbologia.opacidade;f=new OpenLayers.Feature.Vector(feature,null,style_mark)}else{f=new OpenLayers.Feature.Vector(feature)}f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,externalGraphic:i3GEO.editorOL.simbologia.externalGraphic,graphicHeight:i3GEO.editorOL.simbologia.graphicHeight,graphicWidth:i3GEO.editorOL.simbologia.graphicWidth};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.poligono===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLpoligono",title:"digitalizar poligono",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.texto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLtexto",title:"incluir texto",type:OpenLayers.Control.TYPE_TOOL,persist:true,callbacks:{done:function(feature){var texto=window.prompt("Texto",""),label=new OpenLayers.Feature.Vector(feature);label["attributes"]={opacidade:0.1,fillColor:"white",strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,texto:texto,pointRadius:2,graphicName:"square",strokeColor:"black",fontColor:i3GEO.editorOL.simbologia.fontColor,fontSize:i3GEO.editorOL.simbologia.fontSize,fontFamily:"Arial",fontWeight:"bold",labelAlign:"rt"};if(texto&&texto!==""){i3GEO.desenho.layergrafico.addFeatures([label])}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEO.editorOL.CortaFeature=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLcorta",title:"corta figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length!=1){alert("Selecione primeiro um elemento para ser cortado");i3GEO.editorOL.CortaFeature.deactivate()}else{i3GEO.editorOL.CortaFeature.activate()}},callbacks:{done:function(feature){var temp,sel=i3GEO.desenho.layergrafico.selectedFeatures[0].geometry,corta=feature;temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,sel+"|"+corta,"difference")}}});controles.push(i3GEO.editorOL.CortaFeature);adiciona=true}if(botoes.edita===true){i3GEO.editorOL.ModifyFeature=new OpenLayers.Control.ModifyFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLedita",title:"modifica figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,mode:OpenLayers.Control.ModifyFeature.RESHAPE,standalone:false,createVertices:true,styleMap:"default",vertexRenderIntent:"vertex"});controles.push(i3GEO.editorOL.ModifyFeature);adiciona=true}if(botoes.edita===true&&botoes.listag===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlistag",trigger:function(){i3GEO.editorOL.listaGeometrias()},title:"lista geometrias",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.frente===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfrente",trigger:function(){i3GEO.editorOL.trazParaFrente();if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},title:"traz para frente",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.tools===true&&i3GEO.php){button=new OpenLayers.Control.Button({displayClass:"editorOLtools",trigger:function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}},title:"ferramentas",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.selecao===true){i3GEO.editorOL.selbutton=new OpenLayers.Control.SelectFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLselecao",title:"seleciona elemento",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,multiple:false,hover:false,toggleKey:"ctrlKey",multipleKey:"shiftKey",box:false});controles.push(i3GEO.editorOL.selbutton);adiciona=true}if(botoes.selecaotudo===true){button=new OpenLayers.Control.Button({displayClass:"editorOLselecaoTudo",trigger:function(){var fs=i3GEO.desenho.layergrafico.features,n=fs.length,i;for(i=0;i<n;i++){i3GEO.editorOL.selbutton.select(fs[i])}},title:"seleciona tudo",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.apaga===true){button=new OpenLayers.Control.Button({displayClass:"editorOLapaga",trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length>0){var x=window.confirm("Exclui os elementos selecionados?");if(x){i3GEO.editorOL.guardaBackup();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.janela.tempoMsg("Para excluir registros do banco de dados utilize a ferramenta de identificacao")}}else{alert("Selecione pelo menos um elemento")}},title:"apaga selecionados",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.propriedades===true){button=new OpenLayers.Control.Button({displayClass:"editorOLpropriedades",trigger:function(){i3GEO.editorOL.propriedades()},title:"propriedades",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.salva===true){button=new OpenLayers.Control.Button({displayClass:"editorOLsalva",trigger:function(){i3GEO.editorOL.salvaGeometrias()},title:"salva",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.ajuda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLajuda",trigger:function(){try{window.open(i3GEO.configura.locaplic+"/mashups/openlayers_ajuda.php")}catch(e){window.open("openlayers_ajuda.php")}},title:"ajuda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.fecha===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfecha",trigger:function(){var temp=window.confirm($trad("x94"));if(i3GEO.eventos){i3GEO.eventos.cliquePerm.ativa()}i3GEOpanelEditor.destroy();try{YAHOO.temaativo.container.panel.destroy()}catch(e){}try{YAHOO.procura.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.listaGeometrias.panel.destroy()}catch(e){}try{YAHOO.editorOL.ferramentas.panel.destroy()}catch(e){}try{YAHOO.legendaeditorOL.container.panel.destroy()}catch(e){}try{YAHOO.salvaGeometrias.container.panel.destroy()}catch(e){}if(temp===true){try{if(i3GEO.desenho.layergrafico){i3GEO.editorOL.mapa.removeLayer(i3GEO.desenho.layergrafico);delete(i3GEO.desenho.layergrafico)}if(i3GEO.editorOL.backup){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.backup);delete(i3GEO.editorOL.backup)}}catch(e){}}},title:"fecha editor",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}i3GEOOLsnap=new OpenLayers.Control.Snapping({layer:i3GEO.desenho.layergrafico});i3GEOOLsplit=new OpenLayers.Control.Split({layer:i3GEO.desenho.layergrafico,source:i3GEO.desenho.layergrafico,tolerance:0.0001,eventListeners:{beforesplit:function(event){i3GEO.editorOL.guardaBackup()},aftersplit:function(event){i3GEO.editorOL.flashFeatures(event.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}}});if(adiciona===true){i3GEOpanelEditor.addControls(controles);i3GEO.editorOL.mapa.addControl(i3GEOpanelEditor)}},mudaSimbolo:function(estilo,id){var valor=$i(id).value,geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,i;i3GEO.editorOL.simbologia[estilo]=valor;for(i=0;i<n;i++){geos[i].attributes[estilo]=valor;geos[i].style[estilo]=valor}},adicionaMarcas:function(){if(i3GEO.editorOL.pontos.length===0){return}var f,SHADOW_Z_INDEX=10,MARKER_Z_INDEX=11,layer=new OpenLayers.Layer.Vector("pontos",{styleMap:new OpenLayers.StyleMap({externalGraphic:i3GEO.editorOL.marca,backgroundGraphic:"../pacotes/openlayers/img/marker_shadow.png",backgroundXOffset:0,backgroundYOffset:-7,graphicZIndex:MARKER_Z_INDEX,backgroundGraphicZIndex:SHADOW_Z_INDEX,pointRadius:10}),isBaseLayer:false,rendererOptions:{yOrdering:true},displayInLayerSwitcher:true,visibility:true}),index,x=[],y=[],features=[];for(index=0;index<i3GEO.editorOL.pontos.length;index=index+2){x.push(i3GEO.editorOL.pontos[index]);y.push(i3GEO.editorOL.pontos[index+1])}for(index=0;index<x.length;index++){f=new OpenLayers.Geometry.Point(x[index],y[index]);f=i3GEO.util.projGeo2OSM(f);f=new OpenLayers.Feature.Vector(f);features.push(f)}layer.addFeatures(features);i3GEO.editorOL.mapa.addLayer(layer)},adicionaKml:function(){var temp,n,i,id,url;n=i3GEO.editorOL.kml.length;for(i=0;i<n;i++){id="kml"+i;url=i3GEO.editorOL.kml[i];eval(id+" = new OpenLayers.Layer.Vector('"+id+"', {displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true, strategies: [new OpenLayers.Strategy.Fixed()],protocol: new OpenLayers.Protocol.HTTP({url: '"+url+"',format: new OpenLayers.Format.KML({extractStyles: true,extractAttributes: true,maxDepth: 5})})})");eval("i3GEO.editorOL.mapa.addLayer("+id+");");eval("temp = "+id+".div;");temp.onclick=function(e){var targ="",id,temp,features,n,i,g,html="";if(!e){e=window.event}if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ.id){temp=targ.id.split("_");if(temp[0]==="OpenLayers.Geometry.Point"){id=targ.id;temp=i3GEO.editorOL.mapa.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(var j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}}}},propriedades:function(){if(!document.getElementById("panelpropriedadesEditor")){YAHOO.namespace("editorOL.container");YAHOO.editorOL.container.panel=new YAHOO.widget.Panel("panelpropriedadesEditor",{zIndex:20000,iframe:true,width:"350px",height:"250px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo ><b>Estilos (utilize a cor no formato r,g,b):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td>Cor do contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'strokeColor\',\'i3GEOEditorOLcorContorno\')" type="text" style="cursor:text" id="i3GEOEditorOLcorContorno" size="12" value="'+i3GEO.editorOL.simbologia.strokeColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(\'\',\'i3GEOEditorOLcorContorno\');" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor do preenchimento</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'fillColor\',\'i3GEOEditorOLcorPre\')" type="text" style="cursor:text" id="i3GEOEditorOLcorPre" size="12" value="'+i3GEO.editorOL.simbologia.fillColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(\'\',\'i3GEOEditorOLcorPre\');" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'fontColor\',\'i3GEOEditorOLcorFonte\')" type="text" style="cursor:text" id="i3GEOEditorOLcorFonte" size="12" value="'+i3GEO.editorOL.simbologia.fontColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(\'\',\'i3GEOEditorOLcorFonte\');" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Tamanho da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'fontSize\',\'i3GEOEditorOLfontsize\')" type="text" style="cursor:text" id="i3GEOEditorOLfontsize" size="3" value="'+i3GEO.editorOL.simbologia.fontSize+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Opacidade (de 0 a 1)</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'opacidade\',\'i3GEOEditorOLopacidade\')" type="text" style="cursor:text" id="i3GEOEditorOLopacidade" size="3" value="'+i3GEO.editorOL.simbologia.opacidade+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura da linha/contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'strokeWidth\',\'i3GEOEditorOLlarguraLinha\')" type="text" style="cursor:text" id="i3GEOEditorOLlarguraLinha" size="2" value="'+i3GEO.editorOL.simbologia.strokeWidth+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Url de uma figura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'externalGraphic\',\'i3GEOEditorOLexternalGraphic\')" type="text" style="cursor:text" id="i3GEOEditorOLexternalGraphic" size="22" value="'+i3GEO.editorOL.simbologia.externalGraphic+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura e altura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'graphicWidth\',\'i3GEOEditorOLgraphicWidth\')" type="text" style="cursor:text" id="i3GEOEditorOLgraphicWidth" size="4" value="'+i3GEO.editorOL.simbologia.graphicWidth+'" /> <input onchange="i3GEO.editorOL.mudaSimbolo(\'graphicHeight\',\'i3GEOEditorOLgraphicHeight\')" type="text" style="cursor:text" id="i3GEOEditorOLgraphicHeight" size="4" value="'+i3GEO.editorOL.simbologia.graphicHeight+'" /></td><td></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Ajusta nó em edição para o(a):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td></td><td>nó</td><td></td><td>vértice</td><td></td><td>borda</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_node" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_nodeTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_vertex" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_vertexTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_edge" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_edgeTolerance" type="text" size="3" value=15 /></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Divide intersecção ao digitalizar</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.split()" type="checkbox" id="edge_split_toggle" /></td><td>borda</td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Operação ativada pelo botão de modificação da figura</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input checked style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESHAPE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera figura</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESIZE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera tamanho</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.ROTATE;" type="radio" name=i3geoOLtipoEdita /></td><td>rotaciona</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.DRAG;" type="radio" name=i3geoOLtipoEdita /></td><td>desloca</td>'+' </tr>'+'</table>';YAHOO.editorOL.container.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.container.panel.setHeader("Propriedades<div id='panelpropriedadesEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.container.panel.setHeader("Propriedades")}YAHOO.editorOL.container.panel.setFooter("");YAHOO.editorOL.container.panel.render(document.body);YAHOO.editorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close,"click",function(){});temp=$i("panelpropriedadesEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelpropriedadesEditor")}}}YAHOO.editorOL.container.panel.show();temp=$i("panelpropriedadesEditor").getElementsByTagName("div");if(temp&&temp[2]){temp[2].style.overflow="auto"}},listaGeometrias:function(){if(!document.getElementById("panellistagEditor")){YAHOO.namespace("editorOL.listaGeometrias");YAHOO.editorOL.listaGeometrias.panel=new YAHOO.widget.Panel("panellistagEditor",{zIndex:20000,iframe:true,width:"320px",visible:false,draggable:true,close:true});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias <div id='panellistagEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias")}YAHOO.editorOL.listaGeometrias.panel.setFooter("");YAHOO.editorOL.listaGeometrias.panel.render(document.body);YAHOO.editorOL.listaGeometrias.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.listaGeometrias.panel.close,"click",function(){YAHOO.editorOL.listaGeometrias.panel.destroy()});temp=$i("panellistagEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panellistagEditor")}}}else{YAHOO.editorOL.listaGeometrias.panel.render(document.body)}var g,temp,geos=i3GEO.desenho.layergrafico.features,n=geos.length,ins="<table class=lista4 >";ins+="<tr><td><i>Geometrias</i></td><td><i>Opções</i></td><td></td><td></td></tr>";while(n>0){n-=1;g=geos[n].geometry;ins+="<tr><td>"+g.CLASS_NAME+"</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.selFeature("+n+")'>seleciona</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.unselFeature("+n+")'>limpa</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.flashFeaturesI("+n+")'>brilha</td></tr>"}ins+="</table>";if(geos.length===0){ins="Nenhum elemento gráfico encontrado. Utilize as opções de criação de geometrias."}YAHOO.editorOL.listaGeometrias.panel.show();if(i3GEO.configura){temp=$i("panellistagEditor").getElementsByTagName("div")[2]}else{temp=$i("panellistagEditor").getElementsByTagName("div")[1]}temp.style.overflow="auto";temp.style.height="100px";temp.innerHTML=ins},ferramentas:function(){if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo >Operações sobre as figuras selecionadas:</p>'+'<select onchange="i3GEO.editorOL.processageo(this.value);this.value = \'\'" >'+' <option value="">---</option>'+' <option value=union >União</option>';if(i3GEO.php){ins+=' <option value=intersection >Intersecção</option>'+' <option value=convexhull >Convex hull</option>'+' <option value=boundary >Bordas</option>'+' <option value=difference >Diferença</option>'+' <option value=symdifference >Diferença simétrica</option>'}ins+='</select>'+'<br><br><a class=paragrafo href=# onclick="i3GEO.desenho.layergrafico.destroyFeatures()" >Apaga tudo</a>';YAHOO.editorOL.ferramentas.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas <div id='panelferramentasEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas")}YAHOO.editorOL.ferramentas.panel.setFooter("");YAHOO.editorOL.ferramentas.panel.render(document.body);YAHOO.editorOL.ferramentas.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.ferramentas.panel.close,"click",function(){});temp=$i("panelferramentasEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelferramentasEditor")}}}else{YAHOO.editorOL.ferramentas.panel.render(document.body)}YAHOO.editorOL.ferramentas.panel.show()},snap:function(){var target=i3GEOOLsnap.targets[0],tipos=["node","vertex","edge"],ntipos=tipos.length,i,temp,ativa=false;i3GEOOLsnap.deactivate();for(i=0;i<ntipos;i++){temp=$i("target_"+tipos[i]);target[tipos[i]]=temp.checked;if(temp.checked===true){ativa=true}temp=$i("target_"+tipos[i]+"Tolerance");target[tipos[i]+"Tolerance"]=temp.value}if(ativa===true){i3GEOOLsnap.activate()}},split:function(){i3GEOOLsplit.deactivate();var temp=$i("edge_split_toggle");if(temp.checked===true){i3GEOOLsplit.activate()}},processageo:function(operacao){if(operacao===""){return}var geosel=i3GEO.desenho.layergrafico.selectedFeatures,polis,linhas,pontos,temp;if(geosel.length>0){polis=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Point");temp=function(retorno){if(i3GEO.janela){i3GEO.janela.fechaAguarde("i3GEO.editorPoli");i3GEO.janela.fechaAguarde("i3GEO.editorLinhas");i3GEO.janela.fechaAguarde("i3GEO.editorPontos")}if(retorno!=""&&retorno.data&&retorno.data!=""&&operacao!="converteSHP"){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}if(operacao==="converteSHP"){i3GEO.atualiza();i3GEO.janela.minimiza("paneltemaativo")}};if(operacao==="incorporar"){if(polis.length>0){temp=i3GEO.editorOL.merge(polis)}if(linhas.length>0){temp=i3GEO.editorOL.merge(linhas)}if(pontos.length>0){temp=i3GEO.editorOL.merge(pontos)}if(i3GEO.mapa){i3GEO.mapa.dialogo.wkt2layer(temp)}return}if(operacao==="union"&&!i3GEO.php){if(polis.length>0){temp=i3GEO.editorOL.uniaojts(polis);i3GEO.editorOL.substituiFeaturesSel(temp)}if(linhas.length>0){temp=i3GEO.editorOL.uniaojts(linhas);i3GEO.editorOL.substituiFeaturesSel(temp)}if(pontos.length>0){temp=i3GEO.editorOL.uniaojts(pontos);i3GEO.editorOL.substituiFeaturesSel(temp)}}else{if(polis.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos");i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),operacao)}if(linhas.length>0){i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas");i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),operacao)}if(pontos.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos");i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao)}}return}else{alert("Selecione pelo menos dois elementos")}},merge:function(geoms){var n=geoms.length,w=new Wkt.Wkt(),g,m,i;w.read(geoms[0].toString());if(n>1){for(i=1;i<n;i++){g=geoms[i].toString();m=new Wkt.Wkt();m.read(g);w.merge(m)}}return w.write()},uniaojts:function(geoms){var n=geoms.length,rwkt=new jsts.io.WKTReader(),wwkt=new jsts.io.WKTWriter(),fwkt=new OpenLayers.Format.WKT(),g,i,uniao;if(n>1){uniao=(fwkt.read(geoms[0]).geometry).toString();uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=(fwkt.read(geoms[i]).geometry).toString();uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.read(uniao)]}else{return false}},retornaGeometriasTipo:function(features,tipo){var n=features.length,lista=[],i,temp;for(i=0;i<n;i++){temp=features[i].geometry;if(temp.CLASS_NAME==tipo){lista.push(temp)}}return lista},guardaBackup:function(){return},unselTodos:function(){var n,i;n=i3GEO.desenho.layergrafico.features.length;for(i=0;i<n;i++){i3GEO.desenho.layergrafico.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[i])}},unselTodosBackup:function(){var n,i;n=i3GEO.editorOL.backup.features.length;for(i=0;i<n;i++){i3GEO.editorOL.backup.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.editorOL.backup.features[i])}},restauraBackup:function(){if(i3GEO.editorOL.backup.features.length>0){i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features)}if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},substituiFeaturesSel:function(wkt){i3GEO.editorOL.guardaBackup();try{var f,fwkt=new OpenLayers.Format.WKT();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);f=fwkt.read(wkt);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}catch(e){i3GEO.editorOL.restauraBackup()}},adicionaFeatureWkt:function(wkt,atributos){var f,fwkt=new OpenLayers.Format.WKT();if(atributos.externalGraphic&&atributos.externalGraphic!=""){var style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=atributos.externalGraphic;style_mark.graphicWidth=atributos.graphicWidth;style_mark.graphicHeight=atributos.graphicHeight;style_mark.fillOpacity=atributos.opacidade;f=fwkt.read(wkt);f["attributes"]=atributos;f["style"]=style_mark}else{f=fwkt.read(wkt);f["attributes"]=atributos}i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},flashFeaturesI:function(index){i3GEO.editorOL.flashFeatures([i3GEO.desenho.layergrafico.features[index]],0)},flashFeatures:function(features,index){if(!index){index=0}var current=features[index];if(current&¤t.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(features[index],"select")}var prev=features[index-1];if(prev&&prev.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(prev,"default")}++index;if(index<=features.length){window.setTimeout(function(){i3GEO.editorOL.flashFeatures(features,index)},75)}},selFeature:function(index){i3GEO.editorOL.selbutton.select(i3GEO.desenho.layergrafico.features[index])},unselFeature:function(index){i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[index])},carregajts:function(funcao){if(i3GEO.configura){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}else{i3GEO.util.scriptTag("../pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}},trazParaFrente:function(){var features=i3GEO.desenho.layergrafico.selectedFeatures;if(features.length>0){i3GEO.editorOL.backup=new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false});i3GEO.editorOL.backup.addFeatures(features);i3GEO.editorOL.unselTodosBackup();i3GEO.desenho.layergrafico.removeFeatures(features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}else{alert("Selecione pelo menos um elemento")}},pegaControle:function(classe){var n=i3GEO.editorOL.controles.length,i;for(i=0;i<n;i++){if(i3GEO.editorOL.controles[i].CLASS_NAME===classe){return i3GEO.editorOL.controles[i]}}return false},ativaLayerSwitcher:function(){var ls=i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher");if(ls){ls.maximizeDiv.click()}},desativaRodaDoMouse:function(){var controls=i3GEO.editorOL.mapa.getControlsByClass('OpenLayers.Control.Navigation');for(var i=0;i<controls.length;++i){controls[i].disableZoomWheel()}},google2wgs:function(obj){if(i3GEO.Interface.openlayers.googleLike===true){var projWGS84=new OpenLayers.Projection("EPSG:4326"),proj900913=new OpenLayers.Projection("EPSG:900913");return obj.transform(proj900913,projWGS84)}else{return obj}},sobeLayersGraficos:function(){var nlayers=i3GEO.editorOL.mapa.getNumLayers(),layers=i3GEO.editorOL.mapa.layers,i;for(i=0;i<nlayers;i++){if(layers[i].CLASS_NAME=="OpenLayers.Layer.Vector"&&layers[i].name!="Nenhum"){i3GEO.editorOL.mapa.raiseLayer(i3GEO.editorOL.mapa.layers[i],nlayers)}}}}; | |
| 2 | 1 | \ No newline at end of file |
| 2 | +if(!i3GEO||typeof(i3GEO)==='undefined'){var i3GEO={};i3GEO.Interface={};navn=false;navm=false;$i=function(id){return document.getElementById(id)};app=navigator.appName.substring(0,1);if(app==='N'){navn=true}else{navm=true}OpenLayers.ImgPath="../pacotes/openlayers/img/";OpenLayers.Lang.setCode("pt-BR")}i3GEO.editorOL={simbologia:{opacidade:0.8,texto:"",fillColor:"250,180,15",strokeWidth:2,strokeColor:"250,150,0",pointRadius:4,graphicName:"square",fontSize:"12px",fontColor:"0,0,0",externalGraphic:"",graphicHeight:25,graphicWidth:25},backup:new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}),nomeFuncaoSalvar:"i3GEO.editorOL.salvaGeo()",e_oce:new OpenLayers.Layer.ArcGIS93Rest("ESRI Ocean Basemap","http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_ims:new OpenLayers.Layer.ArcGIS93Rest("ESRI Imagery World 2D","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_wsm:new OpenLayers.Layer.ArcGIS93Rest("ESRI World Street Map","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),ol_mma:new OpenLayers.Layer.WMS("Base cartográfica","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",{layers:'baseraster',SRS:'EPSG:4618',FORMAT:'image/png'},{singleTile:false}),ol_wms:new OpenLayers.Layer.WMS("OpenLayers WMS","http://labs.metacarta.com/wms/vmap0",{layers:'basic'}),top_wms:new OpenLayers.Layer.WMS("Toponímia MMA","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&",{layers:"base",FORMAT:'image/png'}),est_wms:new OpenLayers.Layer.WMS("Estados do Brasil","http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&",{layers:"estadosl",FORMAT:'image/png'}),osm:new OpenLayers.Layer.OSM("OSM","http://tile.openstreetmap.org/${z}/${x}/${y}.png",{isBaseLayer:true,visibility:false}),fundo:"e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce",kml:[],layersIniciais:[],botoes:{'pan':true,'zoombox':true,'zoomtot':true,'zoomin':true,'zoomout':true,'legenda':true,'distancia':true,'area':true,'identifica':true,'linha':true,'ponto':true,'poligono':true,'texto':true,'edita':true,'listag':true,'corta':true,'apaga':true,'procura':true,'selecao':true,'selecaotudo':true,'salva':true,'ajuda':true,'propriedades':true,'fecha':false,'tools':true,'undo':false,'frente':false,'legenda':true,'rodadomouse':true},pontos:[],marca:"../pacotes/openlayers/img/marker-gold.png",controles:[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoomBar(),new OpenLayers.Control.LayerSwitcher({'ascending':false}),new OpenLayers.Control.ScaleLine(),new OpenLayers.Control.MousePosition({'separator':' '}),new OpenLayers.Control.OverviewMap(),new OpenLayers.Control.KeyboardDefaults()],tiles:true,incluilayergrafico:true,ativalayerswitcher:false,ativarodadomouse:true,legendahtml:false,numzoom:12,minresolution:0.703125,maxext:"",mapext:new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081),mapa:"",inicia:function(){var alayers=[],fundo=(i3GEO.editorOL.fundo).split(","),nfundo=fundo.length,ncontroles=i3GEO.editorOL.controles.length,i,n,temp;if(i3GEO.editorOL.ativalayerswitcher==="false"){i3GEO.editorOL.ativalayerswitcher=false}if(i3GEO.editorOL.ativalayerswitcher==="true"){i3GEO.editorOL.ativalayerswitcher=true}if(i3GEO.editorOL.ativarodadomouse==="false"){i3GEO.editorOL.ativarodadomouse=false}if(i3GEO.editorOL.ativarodadomouse==="true"){i3GEO.editorOL.ativarodadomouse=true}if(i3GEO.editorOL.legendahtml==="false"){i3GEO.editorOL.legendahtml=false}if(i3GEO.editorOL.legendahtml==="true"){i3GEO.editorOL.legendahtml=true}if(i3GEO.editorOL.incluilayergrafico==="false"){i3GEO.editorOL.incluilayergrafico=false}if(i3GEO.editorOL.incluilayergrafico==="true"){i3GEO.editorOL.incluilayergrafico=true}if(i3GEO.editorOL.incluilayergrafico===true){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}}else{i3GEO.desenho.layergrafico="";i3GEO.editorOL.botoes.linha=false;i3GEO.editorOL.botoes.ponto=false;i3GEO.editorOL.botoes.poligono=false;i3GEO.editorOL.botoes.texto=false;i3GEO.editorOL.botoes.edita=false;i3GEO.editorOL.botoes.listag=false;i3GEO.editorOL.botoes.corta=false;i3GEO.editorOL.botoes.apaga=false;i3GEO.editorOL.botoes.selecao=false;i3GEO.editorOL.botoes.selecaotudo=false;i3GEO.editorOL.botoes.salva=false;i3GEO.editorOL.botoes.propriedades=false;i3GEO.editorOL.botoes.fecha=false;i3GEO.editorOL.botoes.tools=false;i3GEO.editorOL.botoes.undo=false;i3GEO.editorOL.botoes.frente=false}if(i3GEO.editorOL.mapa===""){alert("O objeto i3GEO.editorOL.mapa nao existe. Precisa ser criado com new OpenLayers.Map()");return}for(i=0;i<ncontroles;i++){i3GEO.editorOL.mapa.addControl(i3GEO.editorOL.controles[i])}if(i3GEO.editorOL.fundo!=""){for(i=nfundo-1;i>=0;i--){if(fundo[i]!=""){try{i3GEO.editorOL[fundo[i]].transitionEffect='resize';i3GEO.editorOL[fundo[i]].setVisibility(false);i3GEO.editorOL[fundo[i]].singleTile=false;alayers.push(i3GEO.editorOL[fundo[i]])}catch(e){if(alayers[0]){alayers[0].setVisibility(true)}}}}}i3GEO.editorOL.mapa.addLayers(alayers);if(i3GEO.editorOL.layersIniciais!==""){n=i3GEO.editorOL.layersIniciais.length;for(i=0;i<n;i++){i3GEO.editorOL.mapa.addLayer(i3GEO.editorOL.layersIniciais[i])}}if(!i3GEO.desenho.layergrafico&&i3GEO.editorOL.incluilayergrafico===true){i3GEO.editorOL.mapa.addLayers([i3GEO.desenho.layergrafico])}i3GEO.editorOL.adicionaKml();i3GEO.editorOL.adicionaMarcas();i3GEO.editorOL.coordenadas();i3GEO.editorOL.criaJanelaBusca();i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes);if(i3GEO.editorOL.ativalayerswitcher===true){i3GEO.editorOL.ativaLayerSwitcher()}if(i3GEO.editorOL.ativarodadomouse===false){i3GEO.editorOL.desativaRodaDoMouse()}if(i3GEO.editorOL.numzoom!==""){i3GEO.editorOL.mapa.setOptions({numZoomLevels:i3GEO.editorOL.numzoom})}if(i3GEO.editorOL.maxext!==""){i3GEO.editorOL.mapa.setOptions({maxExtent:i3GEO.editorOL.maxext})}if(i3GEO.editorOL.mapext!=""){var m=i3GEO.util.extGeo2OSM(i3GEO.editorOL.mapext);i3GEO.editorOL.mapa.zoomToExtent(m)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}i3GEO.editorOL.sobeLayersGraficos();temp=i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher");if(temp){temp=temp.dataLayersDiv.getElementsByTagName("label");n=temp.length;for(i=0;i<n;i++){temp[i].onclick=""}}},criaLayerGrafico:function(){i3GEO.desenho.openlayers.criaLayerGrafico()},layersLigados:function(){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,ins=[],i;for(i=0;i<nlayers;i++){if(layers[i].visibility===true){ins.push(layers[i])}}return ins},layersClonados:function(paramsLayers){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,i;for(i=0;i<nlayers;i++){if(layers[i].params&&layers[i].params.CLONETMS===paramsLayers){return(layers[i])}}return false},layertms2wms:function(tms){var layer,url;url=tms.url.replace("&cache=sim","&DESLIGACACHE=sim");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");layer=new OpenLayers.Layer.WMS(tms.layername+"_clone",url,{layers:tms.name,transparent:true},{gutter:0,isBaseLayer:false,displayInLayerSwitcher:false,opacity:1,visibility:true,singleTile:true});return layer},removeClone:function(){var nome=i3GEO.editorOL.layerAtivo().layername+"_clone",busca=i3GEO.editorOL.mapa.getLayersByName(nome);if(busca.length>0){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.mapa.getLayersByName(camada.name)[0],false)}},coordenadas:function(){var idcoord=i3GEO.editorOL.mapa.getControlsBy("separator"," ");if(idcoord[0]){i3GEO.editorOL.mapa.events.register("mousemove",i3GEO.editorOL.mapa,function(e){var p,lonlat,d;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(p);lonlat=i3GEO.util.projOSM2Geo(lonlat);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{$i(idcoord[0].id).innerHTML="Long: "+d[0]+"<br>Lat: "+d[1]}catch(e){}})}},criaJanelaBusca:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,ins,combo="<select id=i3GEOOLlistaTemasBusca ><option value=''>----</option>";for(i=0;i<nlayers;i++){combo+="<option value='"+i+"' >"+layers[i].name+"</option>"}combo+="</select>";ins="<div class=paragrafo >Tema:<br>"+combo;ins+="<br>Item:<br><span id=i3GEOOLcomboitens ></span>";ins+="<br>Procurar por:<br><input type=text size=20 id=i3GEOOLpalavraBusca >";ins+="<br><br><input type=button value='Procurar' id='i3GEOOLbotaoBusca' ></div>";ins+="<br>Resultado:<br><span id=i3GEOOLcomboresultado ></span>";try{YAHOO.namespace("procura.container");YAHOO.procura.container.panel=new YAHOO.widget.Panel("panelprocura",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.procura.container.panel.setHeader("Encontre no mapa");YAHOO.procura.container.panel.setBody(ins);YAHOO.procura.container.panel.setFooter("");YAHOO.procura.container.panel.render(document.body);YAHOO.procura.container.panel.center();document.getElementById("i3GEOOLbotaoBusca").onclick=function(){var layer=i3GEO.editorOL.layerAtivo(),item=document.getElementById("i3GEOOLbuscaItem").value,palavra=document.getElementById("i3GEOOLpalavraBusca").value;if(item===""||palavra===""){alert("Escolha o item e o texto de busca");return}i3GEO.editorOL.busca(layer,item,palavra,"i3GEOOLcomboresultado")};document.getElementById("i3GEOOLlistaTemasBusca").onchange=function(){i3GEO.editorOL.ativaTema(this.value);document.getElementById("i3GEOOLcomboitens").innerHTML="...";i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(),"i3GEOOLcomboitens","i3GEOOLbuscaItem")}}catch(e){}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",temp,combo="<select id=i3GEOOLlistaTemasAtivos style=width:235px; >";for(i=0;i<nlayers;i++){nometema="";if(i3GEO.arvoreDeCamadas&&i3GEO.arvoreDeCamadas.CAMADAS){temp=i3GEO.arvoreDeCamadas.pegaTema(layers[i].name,"","name");if(temp!=""){nometema=temp.tema+" - "}}combo+="<option value='"+i+"' >"+nometema+layers[i].name+"</option>"}combo+="</select>";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo);document.getElementById("i3GEOOLlistaTemasAtivos").onchange=function(){if(botaoIdentifica){botaoIdentifica.layers=[i3GEO.editorOL.layersLigados()[this.value]]}}},criaJanelaAtivaTema:function(){var temp;if(!document.getElementById("paneltemaativo")){YAHOO.namespace("temaativo.container");YAHOO.temaativo.container.panel=new YAHOO.widget.Panel("paneltemaativo",{zIndex:20000,iframe:true,width:"250px",visible:false,draggable:true,close:true});YAHOO.temaativo.container.panel.setBody("");if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.temaativo.container.panel.setHeader("Tema ativo<div id='paneltemaativo_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.temaativo.container.panel.setHeader("Tema ativo")}YAHOO.temaativo.container.panel.setFooter("");YAHOO.temaativo.container.panel.render(document.body);YAHOO.temaativo.container.panel.show();YAHOO.temaativo.container.panel.center();i3GEO.editorOL.atualizaJanelaAtivaTema();YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close,"click",function(){i3GEOpanelEditor.deactivate();i3GEOpanelEditor.activate();if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}}temp=$i("paneltemaativo_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("paneltemaativo")}}}else{YAHOO.temaativo.container.panel.show();i3GEO.editorOL.atualizaJanelaAtivaTema()}},ativaTema:function(id){document.getElementById("i3GEOOLlistaTemasAtivos").value=id},layerAtivo:function(){var id=document.getElementById("i3GEOOLlistaTemasAtivos");if(id){id=id.value}else{id=i3GEO.temaAtivo}if(id==""){return[]}else{return i3GEO.editorOL.layersLigados()[id]}},listaItens:function(layer,idonde,idobj){if(!layer){return}if(!layer.params){return}var u=layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0";u+="&typename="+layer.params.LAYERS;document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.WFSDescribeFeatureType({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),prop=gml.featureTypes[0].properties,nprop=prop.length,i,combo="<select id="+idobj+" ><option value=''>----</option>";for(i=0;i<nprop;i++){combo+="<option value="+prop[i].name+" >"+prop[i].name+"</option>"}combo+="</select>";document.getElementById(idonde).innerHTML=combo},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},busca:function(layer,item,palavra,onde){document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";var u=layer.url+"&request=getfeature&service=wfs&version=1.0.0";u=u.replace("Z=${z}&X=${x}&Y=${y}","");u+="&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS;u+="&filter=<Filter><PropertyIsLike wildcard=* singleChar=. escape=! ><PropertyName>"+item+"</PropertyName><Literal>*"+palavra+"*</Literal></PropertyIsLike></Filter>";document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";document.getElementById(onde).innerHTML="...";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),ngml=gml.length,i,ins="<select onchange='i3GEO.editorOL.zoomPara(this.value)'>";ins+="<option value=''>---</option>";for(i=0;i<ngml;i++){eval("var valor = gml[i].data."+item);var bounds=gml[i].geometry.getBounds();bounds=bounds.toBBOX();ins+="<option value='"+bounds+"'>"+valor+"</option>"}ins+="</select>";document.getElementById(onde).innerHTML=ins},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},zoomPara:function(bbox){var b=new OpenLayers.Bounds.fromString(bbox);i3GEO.editorOL.mapa.zoomToExtent(b)},mostraLegenda:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,ins="",i,icone="";for(i=0;i<nlayers;i++){try{if(layers[i].isBaseLayer===false){var url=layers[i].getFullRequestString({"request":"getlegendgraphic"});if(i3GEO.editorOL.legendahtml===true){url=url.replace("image%2Fpng","text/html");if(layers[i].options.plugini3geo){icone=i3GEO.pluginI3geo[layers[i].options.plugini3geo].iconeArvoreDeCamadas(layers[i].params.LAYERS)}ins+=icone+layers[i].name+"<br><div id=legendaL_"+i+" ></div><br>";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");var config={method:"GET",url:url,callback:f};OpenLayers.Request.issue(config)}else{url=url.replace("LAYERS","LAYER");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");ins+=layers[i].name+"<br><img src='"+url+"&SERVICE=wms' /><br>"}}}catch(e){}}if(!document.getElementById("panellegendaeditorOL")){YAHOO.namespace("legendaeditorOL.container");YAHOO.legendaeditorOL.container.panel=new YAHOO.widget.Panel("panellegendaeditorOL",{zIndex:20000,iframe:true,width:"auto",visible:false,draggable:true,close:true});YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.setHeader("Legenda");YAHOO.legendaeditorOL.container.panel.setFooter("");YAHOO.legendaeditorOL.container.panel.render(document.body);YAHOO.legendaeditorOL.container.panel.show();YAHOO.legendaeditorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.legendaeditorOL.container.panel.close,"click",function(){YAHOO.legendaeditorOL.container.panel.destroy()})}else{YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.show()}},captura:function(lonlat){var d=0.1,layers=[i3GEO.editorOL.layerAtivo()],xy=lonlat.split(","),u=layers[0].url+"&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS;u=u.replace("&cache=sim","&DESLIGACACHE=sim");u=u.replace("&Z=${z}&X=${x}&Y=${y}","");u=u.replace("Z=${z}&X=${x}&Y=${y}","");xy[0]=xy[0]*1;xy[1]=xy[1]*1;var poligono=(xy[0]-d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]+d);u+="&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:posList>"+poligono+"</gml:posList></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></Filter>";document.body.style.cursor="wait";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="wait"}OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}var i,n,f,fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText);n=gml.length;for(i=0;i<n;i++){f=gml[i];f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,registros:f["attributes"]}}i3GEO.desenho.layergrafico.addFeatures(gml)},failure:function(){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}alert("Erro")}})},salvaGeometrias:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="";if(n>0){if($i("panelsalvageometrias")){if(YAHOO.i3GEO){YAHOO.salvaGeometrias.container.panel=YAHOO.i3GEO.janela.manager.find("panelsalvageometrias")}YAHOO.salvaGeometrias.container.panel.show();YAHOO.salvaGeometrias.container.panel.bringToTop()}else{try{YAHOO.namespace("salvaGeometrias.container");YAHOO.salvaGeometrias.container.panel=new YAHOO.widget.Panel("panelsalvageometrias",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.salvaGeometrias.container.panel.setHeader("Geometrias");YAHOO.salvaGeometrias.container.panel.setBody("");YAHOO.salvaGeometrias.container.panel.setFooter("");YAHOO.salvaGeometrias.container.panel.render(document.body);YAHOO.salvaGeometrias.container.panel.center();if(YAHOO.i3GEO&&YAHOO.i3GEO.janela){YAHOO.i3GEO.janela.manager.register(YAHOO.salvaGeometrias.container.panel)}YAHOO.salvaGeometrias.container.panel.show()}catch(e){}}ins+="<p class=paragrafo >Foram encontrada(s) "+n+" geometria(s) selecionada(s) </p>";ins+="<p class=paragrafo ><a href='#' onclick='i3GEO.editorOL.listaGeometriasSel()' >Listar</a> ";if(i3GEO.arvoreDeCamadas){ins+="<a href='#' onclick='"+i3GEO.editorOL.nomeFuncaoSalvar+"' >Salvar dados</a> "}ins+="<a href='#' onclick='i3GEO.editorOL.incorporar()' >Incorporar ao mapa</a></p>";ins+="<p class=paragrafo>"+$trad("ajudaEditorOlSalva")+"</p>";YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{alert("Selecione pelo menos um elemento")}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="",i,a,w,g;for(i=0;i<n;i++){g=geos[i];ins+="<b>Geometria: "+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.geometry)+"<br><br>";ins+="<b>Atributos: "+i+"</b><br>";a=g.attributes;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}if(g.attributes.registros){ins+="<b>Registros: "+i+"</b><br>";a=g.attributes.registros;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}}ins+="<br>"}w=window.open();w.document.write(ins);w.document.close()},testeSalvar:function(){alert("Funcao nao disponivel. Defina o nome da funcao em i3GEO.editorOL.nomeFuncaoSalvar ")},salvaGeo:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,funcaoOK=function(){if(geos[0].geometry){var registros="",valorunico="",nometema=$i("editorOLcomboTemaEditavel").value,key="",tema,redesenha,p,g=i3GEO.editorOL.google2wgs(geos[0].geometry);if(nometema==""){return}tema=i3GEO.arvoreDeCamadas.pegaTema(nometema,"","name");if(geos[0].attributes.registros){registros=geos[0].attributes.registros;for(key in registros){if(registros[key]&&key==tema.colunaidunico){valorunico=registros[key]}}}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);i3GEO.Interface.atualizaTema("",nometema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto","Adicionando...");i3GEO.janela.AGUARDEMODAL=false;if(valorunico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+g)}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+g)}}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto="Salvar no tema:<br><div id=editorOLondeComboTemaEditavel ></div><br><br>";if(n!=1){i3GEO.janela.tempoMsg("Selecione apenas uma figura")}else{i3GEO.janela.confirma(texto,300,"Salva","Cancela",funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel")}},criaBotoes:function(botoes){var sketchSymbolizers={"Point":{pointRadius:4,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},"Line":{strokeWidth:3,strokeOpacity:1,strokeColor:"#666666",strokeDashstyle:"dash"},"Polygon":{strokeWidth:2,strokeOpacity:1,strokeColor:"#666666",fillColor:"white",fillOpacity:0.3}},style=new OpenLayers.Style(),styleMap=new OpenLayers.StyleMap({"default":style,"vertex":{strokeOpacity:1,strokeWidth:1,fillColor:"white",fillOpacity:0.45,pointRadius:3}},{extendDefault:false}),adiciona=false,button,controles=[];style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);i3GEOpanelEditor=new OpenLayers.Control.Panel({displayClass:"olControlEditingToolbar1 noprint",saveState:false,activateControl:function(c){this.deactivate();this.activate();try{i3GEO.editorOL.ModifyFeature.deactivate();if(i3GEO&&i3GEO.barraDeBotoes){i3GEO.barraDeBotoes.ativaPadrao()}}catch(e){}if(!c.trigger){c.activate()}else{c.trigger.call()}}});if(botoes.procura===true){button=new OpenLayers.Control.Button({displayClass:"editorOLprocura",trigger:function(){YAHOO.procura.container.panel.show()},title:"procura",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.pan===true){controles.push(new OpenLayers.Control.Navigation({title:"deslocar",displayClass:"editorOLpan",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoombox===true){controles.push(new OpenLayers.Control.ZoomBox({title:"zoombox",displayClass:"editorOLzoombox",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoomtot===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomtot",trigger:function(){if(i3GEO.editorOL.mapext&&i3GEO.editorOL.mapext!=""){i3GEO.editorOL.mapa.zoomToExtent(i3GEO.editorOL.mapext)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}},title:"ajusta extensao",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomin===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomin",trigger:function(){i3GEO.editorOL.mapa.zoomIn()},title:"aproxima",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomout===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomout",trigger:function(){i3GEO.editorOL.mapa.zoomOut()},title:"afasta",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.legenda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlegenda",trigger:function(){i3GEO.editorOL.mostraLegenda()},title:"legenda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.distancia===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Path,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLdistancia",title:"distancia",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units,measure=event.measure;alert("Distancia: "+measure.toFixed(3)+" "+units)}});controles.push(button);adiciona=true}if(botoes.area===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLarea",title:"area",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units;var measure=event.measure;alert("Área: "+measure.toFixed(3)+" "+units+" quadrados")}});controles.push(button);adiciona=true}if(botoes.identifica===true){botaoIdentifica=new OpenLayers.Control.WMSGetFeatureInfo({maxFeatures:1,infoFormat:'text/plain',layers:[i3GEO.editorOL.layerAtivo()],queryVisible:true,title:"identifica",type:OpenLayers.Control.TYPE_TOOL,displayClass:"editorOLidentifica",eventListeners:{getfeatureinfo:function(event){var lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),lonlattexto="<hr>",formata;if(botoes.linha===true||botoes.ponto===true||botoes.poligono===true||botoes.edita===true){lonlattexto+="<pre><span style=font-size:12px;color:blue;cursor:pointer onclick='i3GEO.editorOL.captura(\""+lonlat.lon+","+lonlat.lat+"\")'>edita geometria</span></pre><br>"}formata=function(texto){var temp,temp1,n,i,f=[],textoN=texto.split(":");try{if(textoN.length>1){temp=textoN[2].replace(/\n\r/g,"");temp=temp.replace(/'/g,"");temp=temp.replace(/\n/g,"|");temp=temp.replace(/_/g," ");temp=temp.replace(/=/g,":");temp=temp.split("|");n=temp.length;for(i=0;i<n;i++){temp1=temp[i].replace(/^\s+/,"");temp1=temp1.replace(/\s+$/,"");if(temp1!="")f.push(temp1)}texto=f.join("<br><br>")}}catch(e){}return texto};i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("chicken",i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),null,"<div style=text-align:left >"+lonlattexto+"<pre>"+formata(event.text)+"</pre></div>",null,true));i3GEO.editorOL.removeClone()},beforegetfeatureinfo:function(event){var ativo=[i3GEO.editorOL.layerAtivo()];if(ativo[0].serviceVersion==="&tms="||ativo[0].CLASS_NAME=="OpenLayers.Layer.TMS"||ativo[0].CLASS_NAME=="OpenLayers.Layer.OSM"){ativo=[i3GEO.editorOL.layertms2wms(ativo[0])]}ativo[0].projection=new OpenLayers.Projection("EPSG:4326");event.object.layers=ativo;botaoIdentifica.layers=ativo;botaoIdentifica.url=ativo[0].url},activate:function(){i3GEO.editorOL.criaJanelaAtivaTema()}}});controles.push(botaoIdentifica);adiciona=true}if(botoes.linha===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Path,{displayClass:"editorOLlinha",title:"digitalizar linha",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.ponto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLponto",title:"digitalizar ponto",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f,style_mark;if(i3GEO.editorOL.simbologia.externalGraphic!=""){style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=i3GEO.editorOL.simbologia.externalGraphic;style_mark.graphicWidth=i3GEO.editorOL.simbologia.graphicWidth;style_mark.graphicHeight=i3GEO.editorOL.simbologia.graphicHeight;style_mark.fillOpacity=i3GEO.editorOL.simbologia.opacidade;f=new OpenLayers.Feature.Vector(feature,null,style_mark)}else{f=new OpenLayers.Feature.Vector(feature)}f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,externalGraphic:i3GEO.editorOL.simbologia.externalGraphic,graphicHeight:i3GEO.editorOL.simbologia.graphicHeight,graphicWidth:i3GEO.editorOL.simbologia.graphicWidth};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.poligono===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLpoligono",title:"digitalizar poligono",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.texto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLtexto",title:"incluir texto",type:OpenLayers.Control.TYPE_TOOL,persist:true,callbacks:{done:function(feature){var texto=window.prompt("Texto",""),label=new OpenLayers.Feature.Vector(feature);label["attributes"]={opacidade:0.1,fillColor:"white",strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,texto:texto,pointRadius:2,graphicName:"square",strokeColor:"black",fontColor:i3GEO.editorOL.simbologia.fontColor,fontSize:i3GEO.editorOL.simbologia.fontSize,fontFamily:"Arial",fontWeight:"bold",labelAlign:"rt"};if(texto&&texto!==""){i3GEO.desenho.layergrafico.addFeatures([label])}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEO.editorOL.CortaFeature=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLcorta",title:"corta figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length!=1){alert("Selecione primeiro um elemento para ser cortado");i3GEO.editorOL.CortaFeature.deactivate()}else{i3GEO.editorOL.CortaFeature.activate()}},callbacks:{done:function(feature){var temp,sel=i3GEO.desenho.layergrafico.selectedFeatures[0].geometry,corta=feature;temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,sel+"|"+corta,"difference")}}});controles.push(i3GEO.editorOL.CortaFeature);adiciona=true}if(botoes.edita===true){i3GEO.editorOL.ModifyFeature=new OpenLayers.Control.ModifyFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLedita",title:"modifica figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,mode:OpenLayers.Control.ModifyFeature.RESHAPE,standalone:false,createVertices:true,styleMap:"default",vertexRenderIntent:"vertex"});controles.push(i3GEO.editorOL.ModifyFeature);adiciona=true}if(botoes.edita===true&&botoes.listag===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlistag",trigger:function(){i3GEO.editorOL.listaGeometrias()},title:"lista geometrias",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.frente===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfrente",trigger:function(){i3GEO.editorOL.trazParaFrente();if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},title:"traz para frente",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.tools===true&&i3GEO.php){button=new OpenLayers.Control.Button({displayClass:"editorOLtools",trigger:function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}},title:"ferramentas",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.selecao===true){i3GEO.editorOL.selbutton=new OpenLayers.Control.SelectFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLselecao",title:"seleciona elemento",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,multiple:false,hover:false,toggleKey:"ctrlKey",multipleKey:"shiftKey",box:false});controles.push(i3GEO.editorOL.selbutton);adiciona=true}if(botoes.selecaotudo===true){button=new OpenLayers.Control.Button({displayClass:"editorOLselecaoTudo",trigger:function(){var fs=i3GEO.desenho.layergrafico.features,n=fs.length,i;for(i=0;i<n;i++){i3GEO.editorOL.selbutton.select(fs[i])}},title:"seleciona tudo",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.apaga===true){button=new OpenLayers.Control.Button({displayClass:"editorOLapaga",trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length>0){var x=window.confirm("Exclui os elementos selecionados?");if(x){i3GEO.editorOL.guardaBackup();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.janela.tempoMsg("Para excluir registros do banco de dados utilize a ferramenta de identificacao")}}else{alert("Selecione pelo menos um elemento")}},title:"apaga selecionados",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.propriedades===true){button=new OpenLayers.Control.Button({displayClass:"editorOLpropriedades",trigger:function(){i3GEO.editorOL.propriedades()},title:"propriedades",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.salva===true){button=new OpenLayers.Control.Button({displayClass:"editorOLsalva",trigger:function(){i3GEO.editorOL.salvaGeometrias()},title:"salva",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.ajuda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLajuda",trigger:function(){try{window.open(i3GEO.configura.locaplic+"/mashups/openlayers_ajuda.php")}catch(e){window.open("openlayers_ajuda.php")}},title:"ajuda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.fecha===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfecha",trigger:function(){var temp=window.confirm($trad("x94"));if(i3GEO.eventos){i3GEO.eventos.cliquePerm.ativa()}i3GEOpanelEditor.destroy();try{YAHOO.temaativo.container.panel.destroy()}catch(e){}try{YAHOO.procura.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.listaGeometrias.panel.destroy()}catch(e){}try{YAHOO.editorOL.ferramentas.panel.destroy()}catch(e){}try{YAHOO.legendaeditorOL.container.panel.destroy()}catch(e){}try{YAHOO.salvaGeometrias.container.panel.destroy()}catch(e){}if(temp===true){try{if(i3GEO.desenho.layergrafico){i3GEO.editorOL.mapa.removeLayer(i3GEO.desenho.layergrafico);delete(i3GEO.desenho.layergrafico)}if(i3GEO.editorOL.backup){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.backup);delete(i3GEO.editorOL.backup)}}catch(e){}}},title:"fecha editor",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}i3GEOOLsnap=new OpenLayers.Control.Snapping({layer:i3GEO.desenho.layergrafico});i3GEOOLsplit=new OpenLayers.Control.Split({layer:i3GEO.desenho.layergrafico,source:i3GEO.desenho.layergrafico,tolerance:0.0001,eventListeners:{beforesplit:function(event){i3GEO.editorOL.guardaBackup()},aftersplit:function(event){i3GEO.editorOL.flashFeatures(event.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}}});if(adiciona===true){i3GEOpanelEditor.addControls(controles);i3GEO.editorOL.mapa.addControl(i3GEOpanelEditor)}},mudaSimbolo:function(estilo,id){var valor=$i(id).value,geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,i;i3GEO.editorOL.simbologia[estilo]=valor;for(i=0;i<n;i++){geos[i].attributes[estilo]=valor;geos[i].style[estilo]=valor}},adicionaMarcas:function(){if(i3GEO.editorOL.pontos.length===0){return}var f,SHADOW_Z_INDEX=10,MARKER_Z_INDEX=11,layer=new OpenLayers.Layer.Vector("pontos",{styleMap:new OpenLayers.StyleMap({externalGraphic:i3GEO.editorOL.marca,backgroundGraphic:"../pacotes/openlayers/img/marker_shadow.png",backgroundXOffset:0,backgroundYOffset:-7,graphicZIndex:MARKER_Z_INDEX,backgroundGraphicZIndex:SHADOW_Z_INDEX,pointRadius:10}),isBaseLayer:false,rendererOptions:{yOrdering:true},displayInLayerSwitcher:true,visibility:true}),index,x=[],y=[],features=[];for(index=0;index<i3GEO.editorOL.pontos.length;index=index+2){x.push(i3GEO.editorOL.pontos[index]);y.push(i3GEO.editorOL.pontos[index+1])}for(index=0;index<x.length;index++){f=new OpenLayers.Geometry.Point(x[index],y[index]);f=i3GEO.util.projGeo2OSM(f);f=new OpenLayers.Feature.Vector(f);features.push(f)}layer.addFeatures(features);i3GEO.editorOL.mapa.addLayer(layer)},adicionaKml:function(){var temp,n,i,id,url;n=i3GEO.editorOL.kml.length;for(i=0;i<n;i++){id="kml"+i;url=i3GEO.editorOL.kml[i];eval(id+" = new OpenLayers.Layer.Vector('"+id+"', {displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true, strategies: [new OpenLayers.Strategy.Fixed()],protocol: new OpenLayers.Protocol.HTTP({url: '"+url+"',format: new OpenLayers.Format.KML({extractStyles: true,extractAttributes: true,maxDepth: 5})})})");eval("i3GEO.editorOL.mapa.addLayer("+id+");");eval("temp = "+id+".div;");temp.onclick=function(e){var targ="",id,temp,features,n,i,g,html="";if(!e){e=window.event}if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ.id){temp=targ.id.split("_");if(temp[0]==="OpenLayers.Geometry.Point"){id=targ.id;temp=i3GEO.editorOL.mapa.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(var j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}}}},propriedades:function(){if(!document.getElementById("panelpropriedadesEditor")){YAHOO.namespace("editorOL.container");YAHOO.editorOL.container.panel=new YAHOO.widget.Panel("panelpropriedadesEditor",{zIndex:20000,iframe:true,width:"350px",height:"250px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo ><b>Estilos (utilize a cor no formato r,g,b):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td>Cor do contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'strokeColor\',\'i3GEOEditorOLcorContorno\')" type="text" style="cursor:text" id="i3GEOEditorOLcorContorno" size="12" value="'+i3GEO.editorOL.simbologia.strokeColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(\'\',\'i3GEOEditorOLcorContorno\');" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor do preenchimento</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'fillColor\',\'i3GEOEditorOLcorPre\')" type="text" style="cursor:text" id="i3GEOEditorOLcorPre" size="12" value="'+i3GEO.editorOL.simbologia.fillColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(\'\',\'i3GEOEditorOLcorPre\');" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'fontColor\',\'i3GEOEditorOLcorFonte\')" type="text" style="cursor:text" id="i3GEOEditorOLcorFonte" size="12" value="'+i3GEO.editorOL.simbologia.fontColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(\'\',\'i3GEOEditorOLcorFonte\');" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Tamanho da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'fontSize\',\'i3GEOEditorOLfontsize\')" type="text" style="cursor:text" id="i3GEOEditorOLfontsize" size="3" value="'+i3GEO.editorOL.simbologia.fontSize+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Opacidade (de 0 a 1)</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'opacidade\',\'i3GEOEditorOLopacidade\')" type="text" style="cursor:text" id="i3GEOEditorOLopacidade" size="3" value="'+i3GEO.editorOL.simbologia.opacidade+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura da linha/contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'strokeWidth\',\'i3GEOEditorOLlarguraLinha\')" type="text" style="cursor:text" id="i3GEOEditorOLlarguraLinha" size="2" value="'+i3GEO.editorOL.simbologia.strokeWidth+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Url de uma figura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'externalGraphic\',\'i3GEOEditorOLexternalGraphic\')" type="text" style="cursor:text" id="i3GEOEditorOLexternalGraphic" size="22" value="'+i3GEO.editorOL.simbologia.externalGraphic+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura e altura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(\'graphicWidth\',\'i3GEOEditorOLgraphicWidth\')" type="text" style="cursor:text" id="i3GEOEditorOLgraphicWidth" size="4" value="'+i3GEO.editorOL.simbologia.graphicWidth+'" /> <input onchange="i3GEO.editorOL.mudaSimbolo(\'graphicHeight\',\'i3GEOEditorOLgraphicHeight\')" type="text" style="cursor:text" id="i3GEOEditorOLgraphicHeight" size="4" value="'+i3GEO.editorOL.simbologia.graphicHeight+'" /></td><td></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Ajusta nó em edição para o(a):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td></td><td>nó</td><td></td><td>vértice</td><td></td><td>borda</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_node" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_nodeTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_vertex" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_vertexTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_edge" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_edgeTolerance" type="text" size="3" value=15 /></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Divide intersecção ao digitalizar</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.split()" type="checkbox" id="edge_split_toggle" /></td><td>borda</td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Operação ativada pelo botão de modificação da figura</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input checked style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESHAPE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera figura</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESIZE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera tamanho</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.ROTATE;" type="radio" name=i3geoOLtipoEdita /></td><td>rotaciona</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.DRAG;" type="radio" name=i3geoOLtipoEdita /></td><td>desloca</td>'+' </tr>'+'</table>';YAHOO.editorOL.container.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.container.panel.setHeader("Propriedades<div id='panelpropriedadesEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.container.panel.setHeader("Propriedades")}YAHOO.editorOL.container.panel.setFooter("");YAHOO.editorOL.container.panel.render(document.body);YAHOO.editorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close,"click",function(){});temp=$i("panelpropriedadesEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelpropriedadesEditor")}}}YAHOO.editorOL.container.panel.show();temp=$i("panelpropriedadesEditor").getElementsByTagName("div");if(temp&&temp[2]){temp[2].style.overflow="auto"}},listaGeometrias:function(){if(!document.getElementById("panellistagEditor")){YAHOO.namespace("editorOL.listaGeometrias");YAHOO.editorOL.listaGeometrias.panel=new YAHOO.widget.Panel("panellistagEditor",{zIndex:20000,iframe:true,width:"320px",visible:false,draggable:true,close:true});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias <div id='panellistagEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias")}YAHOO.editorOL.listaGeometrias.panel.setFooter("");YAHOO.editorOL.listaGeometrias.panel.render(document.body);YAHOO.editorOL.listaGeometrias.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.listaGeometrias.panel.close,"click",function(){YAHOO.editorOL.listaGeometrias.panel.destroy()});temp=$i("panellistagEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panellistagEditor")}}}else{YAHOO.editorOL.listaGeometrias.panel.render(document.body)}var g,temp,geos=i3GEO.desenho.layergrafico.features,n=geos.length,ins="<table class=lista4 >";ins+="<tr><td><i>Geometrias</i></td><td><i>Opções</i></td><td></td><td></td></tr>";while(n>0){n-=1;g=geos[n].geometry;ins+="<tr><td>"+g.CLASS_NAME+"</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.selFeature("+n+")'>seleciona</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.unselFeature("+n+")'>limpa</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.flashFeaturesI("+n+")'>brilha</td></tr>"}ins+="</table>";if(geos.length===0){ins="Nenhum elemento gráfico encontrado. Utilize as opções de criação de geometrias."}YAHOO.editorOL.listaGeometrias.panel.show();if(i3GEO.configura){temp=$i("panellistagEditor").getElementsByTagName("div")[2]}else{temp=$i("panellistagEditor").getElementsByTagName("div")[1]}temp.style.overflow="auto";temp.style.height="100px";temp.innerHTML=ins},ferramentas:function(){if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo >Operações sobre as figuras selecionadas:</p>'+'<select onchange="i3GEO.editorOL.processageo(this.value);this.value = \'\'" >'+' <option value="">---</option>'+' <option value=union >União</option>';if(i3GEO.php){ins+=' <option value=intersection >Intersecção</option>'+' <option value=convexhull >Convex hull</option>'+' <option value=boundary >Bordas</option>'+' <option value=difference >Diferença</option>'+' <option value=symdifference >Diferença simétrica</option>'}ins+='</select>'+'<br><br><a class=paragrafo href=# onclick="i3GEO.desenho.layergrafico.destroyFeatures()" >Apaga tudo</a>';YAHOO.editorOL.ferramentas.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas <div id='panelferramentasEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas")}YAHOO.editorOL.ferramentas.panel.setFooter("");YAHOO.editorOL.ferramentas.panel.render(document.body);YAHOO.editorOL.ferramentas.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.ferramentas.panel.close,"click",function(){});temp=$i("panelferramentasEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelferramentasEditor")}}}else{YAHOO.editorOL.ferramentas.panel.render(document.body)}YAHOO.editorOL.ferramentas.panel.show()},snap:function(){var target=i3GEOOLsnap.targets[0],tipos=["node","vertex","edge"],ntipos=tipos.length,i,temp,ativa=false;i3GEOOLsnap.deactivate();for(i=0;i<ntipos;i++){temp=$i("target_"+tipos[i]);target[tipos[i]]=temp.checked;if(temp.checked===true){ativa=true}temp=$i("target_"+tipos[i]+"Tolerance");target[tipos[i]+"Tolerance"]=temp.value}if(ativa===true){i3GEOOLsnap.activate()}},split:function(){i3GEOOLsplit.deactivate();var temp=$i("edge_split_toggle");if(temp.checked===true){i3GEOOLsplit.activate()}},processageo:function(operacao){if(operacao===""){return}var geosel=i3GEO.desenho.layergrafico.selectedFeatures,polis,linhas,pontos,temp;if(geosel.length>0){polis=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Point");temp=function(retorno){if(i3GEO.janela){i3GEO.janela.fechaAguarde("i3GEO.editorPoli");i3GEO.janela.fechaAguarde("i3GEO.editorLinhas");i3GEO.janela.fechaAguarde("i3GEO.editorPontos")}if(retorno!=""&&retorno.data&&retorno.data!=""&&operacao!="converteSHP"){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}if(operacao==="converteSHP"){i3GEO.atualiza();i3GEO.janela.minimiza("paneltemaativo")}};if(operacao==="incorporar"){if(polis.length>0){temp=i3GEO.editorOL.merge(polis)}if(linhas.length>0){temp=i3GEO.editorOL.merge(linhas)}if(pontos.length>0){temp=i3GEO.editorOL.merge(pontos)}if(i3GEO.mapa){i3GEO.mapa.dialogo.wkt2layer(temp)}return}if(operacao==="union"&&!i3GEO.php){if(polis.length>0){temp=i3GEO.editorOL.uniaojts(polis);i3GEO.editorOL.substituiFeaturesSel(temp)}if(linhas.length>0){temp=i3GEO.editorOL.uniaojts(linhas);i3GEO.editorOL.substituiFeaturesSel(temp)}if(pontos.length>0){temp=i3GEO.editorOL.uniaojts(pontos);i3GEO.editorOL.substituiFeaturesSel(temp)}}else{if(polis.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos");i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),operacao)}if(linhas.length>0){i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas");i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),operacao)}if(pontos.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos");i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao)}}return}else{alert("Selecione pelo menos dois elementos")}},merge:function(geoms){var n=geoms.length,w=new Wkt.Wkt(),g,m,i;w.read(geoms[0].toString());if(n>1){for(i=1;i<n;i++){g=geoms[i].toString();m=new Wkt.Wkt();m.read(g);w.merge(m)}}return w.write()},uniaojts:function(geoms){var n=geoms.length,rwkt=new jsts.io.WKTReader(),wwkt=new jsts.io.WKTWriter(),fwkt=new OpenLayers.Format.WKT(),g,i,uniao;if(n>1){uniao=(fwkt.read(geoms[0]).geometry).toString();uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=(fwkt.read(geoms[i]).geometry).toString();uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.read(uniao)]}else{return false}},retornaGeometriasTipo:function(features,tipo){var n=features.length,lista=[],i,temp;for(i=0;i<n;i++){temp=features[i].geometry;if(temp.CLASS_NAME==tipo){lista.push(temp)}}return lista},guardaBackup:function(){return},unselTodos:function(){var n,i;n=i3GEO.desenho.layergrafico.features.length;for(i=0;i<n;i++){i3GEO.desenho.layergrafico.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[i])}},unselTodosBackup:function(){var n,i;n=i3GEO.editorOL.backup.features.length;for(i=0;i<n;i++){i3GEO.editorOL.backup.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.editorOL.backup.features[i])}},restauraBackup:function(){if(i3GEO.editorOL.backup.features.length>0){i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features)}if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},substituiFeaturesSel:function(wkt){i3GEO.editorOL.guardaBackup();try{var f,fwkt=new OpenLayers.Format.WKT();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);f=fwkt.read(wkt);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}catch(e){i3GEO.editorOL.restauraBackup()}},adicionaFeatureWkt:function(wkt,atributos){var f,fwkt=new OpenLayers.Format.WKT();if(atributos.externalGraphic&&atributos.externalGraphic!=""){var style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=atributos.externalGraphic;style_mark.graphicWidth=atributos.graphicWidth;style_mark.graphicHeight=atributos.graphicHeight;style_mark.fillOpacity=atributos.opacidade;f=fwkt.read(wkt);f["attributes"]=atributos;f["style"]=style_mark}else{f=fwkt.read(wkt);f["attributes"]=atributos}i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},flashFeaturesI:function(index){i3GEO.editorOL.flashFeatures([i3GEO.desenho.layergrafico.features[index]],0)},flashFeatures:function(features,index){if(!index){index=0}var current=features[index];if(current&¤t.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(features[index],"select")}var prev=features[index-1];if(prev&&prev.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(prev,"default")}++index;if(index<=features.length){window.setTimeout(function(){i3GEO.editorOL.flashFeatures(features,index)},75)}},selFeature:function(index){i3GEO.editorOL.selbutton.select(i3GEO.desenho.layergrafico.features[index])},unselFeature:function(index){i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[index])},carregajts:function(funcao){if(i3GEO.configura){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}else{i3GEO.util.scriptTag("../pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}},trazParaFrente:function(){var features=i3GEO.desenho.layergrafico.selectedFeatures;if(features.length>0){i3GEO.editorOL.backup=new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false});i3GEO.editorOL.backup.addFeatures(features);i3GEO.editorOL.unselTodosBackup();i3GEO.desenho.layergrafico.removeFeatures(features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}else{alert("Selecione pelo menos um elemento")}},pegaControle:function(classe){var n=i3GEO.editorOL.controles.length,i;for(i=0;i<n;i++){if(i3GEO.editorOL.controles[i].CLASS_NAME===classe){return i3GEO.editorOL.controles[i]}}return false},ativaLayerSwitcher:function(){var ls=i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher");if(ls){ls.maximizeDiv.click()}},desativaRodaDoMouse:function(){var controls=i3GEO.editorOL.mapa.getControlsByClass('OpenLayers.Control.Navigation');for(var i=0;i<controls.length;++i){controls[i].disableZoomWheel()}},google2wgs:function(obj){if(i3GEO.Interface.openlayers.googleLike===true){var projWGS84=new OpenLayers.Projection("EPSG:4326"),proj900913=new OpenLayers.Projection("EPSG:900913");return obj.transform(proj900913,projWGS84)}else{return obj}},sobeLayersGraficos:function(){var nlayers=i3GEO.editorOL.mapa.getNumLayers(),layers=i3GEO.editorOL.mapa.layers,i;for(i=0;i<nlayers;i++){if(layers[i].CLASS_NAME=="OpenLayers.Layer.Vector"&&layers[i].name!="Nenhum"){i3GEO.editorOL.mapa.raiseLayer(i3GEO.editorOL.mapa.layers[i],nlayers)}}}}; | |
| 3 | 3 | \ No newline at end of file | ... | ... |
classesjs/compactados/classe_plugini3geo_compacto.js
| 1 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.pluginI3geo={OBJETOS:{},PLUGINS:[{"classe":"heatmap","nome":"Mapa de calor","editor":true},{"classe":"markercluster","nome":"Agrupamento de pontos (cluster)","editor":true},{"classe":"layerkml","nome":"Camada Kml","editor":true},{"classe":"parametrossql","nome":"SQL parametrizado","editor":true}],inicia:function(camada){if(i3GEO.janela){i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardePlugin","Plugin...");i3GEO.janela.AGUARDEMODAL=false}i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].inicia(camada)},formAdmin:function(plugin,configString){return i3GEO.pluginI3geo[plugin].formAdmin(configString)},iconeArvoreDeCamadas:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){return i3GEO.pluginI3geo[camada.plugini3geo.plugin].iconeArvoreDeCamadas(camada.name)}else{return false}},linkAjuda:function(plugin){return i3GEO.pluginI3geo[plugin].linkAjuda()},ligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada();return true}return false},desligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada();return true}return false},removeCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada();delete(i3GEO.pluginI3geo.OBJETOS[nomecamada]);return true}return false},atualizaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada();return true}return false},existeObjeto:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){return true}return false},aplicaPropriedades:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){camada=i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].aplicaPropriedades(camada)}return camada},heatmap:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"heatmap","parametros":{"tipoGradiente": "default","valorPonto":1,"coluna":"","radius":15}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="heatmap"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Coluna que contém os dados:"+"<br><input name='coluna' type='text' value='"+parametros.coluna+"' size='30'></p>"+"<p>Ou valor numérico para cada ponto:"+"<br><input name='valorPonto' type='text' value='"+parametros.valorPonto+"' size='30'></p>"+"<p>Raio de cada ponto em pixels:"+"<br><input name='radius' type='text' value='"+parametros.radius+"' size='30'></p>"+"<p>Tipo de gradiente (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoGradiente' type='text' value='"+parametros.tipoGradiente+"' size='30'></p>"+"<p>Para definir os cortes no gradiente de cores utilize valores entre 0 e 1."+" As cores são definidas nas classes do LAYER, sendo que o nome define o valor superior do gradiente e COLOR define a cor."+" Veja o exemplo utilizado no tema _lmapadecalor.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var heatmap,pontos;heatmap=new HeatmapOverlay(i3GeoMap,camada.name,{"radius":camada.plugini3geo.parametros.radius,"visible":true,"opacity":camada.transparency,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}});pontos={max:camada.plugini3geo.parametros.max,data:heatmap_dados};i3GEO.janela.fechaAguarde("aguardePlugin");heatmap.setDataSet(pontos);heatmap.ligaCamada=function(){this.liga()};heatmap.desLigaCamada=function(){this.desliga()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.draw()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;heatmap_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var temp,heatmap,transformedTestData={max:1,data:[]},data=heatmap_dados,datalen=heatmap_dados.length,nudata=[],max=0;if(!objMapa){objMapa=i3geoOL}while(datalen--){temp=heatmap_dados[datalen].count;nudata.push({lonlat:new OpenLayers.LonLat(data[datalen].lng,heatmap_dados[datalen].lat),count:temp});max=Math.max(max,temp)}transformedTestData.max=max;transformedTestData.data=nudata;heatmap=new OpenLayers.Layer.Heatmap(camada.name,objMapa,objMapa.baseLayer,{"visible":true,"opacity":camada.transparency,"radius":camada.plugini3geo.parametros.radius,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}},{isBaseLayer:false,projection:new OpenLayers.Projection("EPSG:4326"),displayInLayerSwitcher:true});heatmap.ligaCamada=function(){this.toggle();this.updateLayer()};heatmap.desLigaCamada=function(){this.toggle();this.updateLayer()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.updateLayer()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;objMapa.addLayer(heatmap);heatmap.setDataSet(transformedTestData);heatmap_dados=null;if(i3GEO.janela){i3GEO.janela.fechaAguarde("aguardePlugin")}};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}if(!i3GEO.configura||!i3GEO.configura.sid){i3GEO.configura.sid=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},googleearth:{inicia:function(){alert("Plugin nao disponivel")}}},markercluster:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"markercluster","parametros":{"tipoEstilos": "default","gridSize":50}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="markercluster"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Distância máxima entre ponto em pixels:"+"<br><input name='gridSize' type='text' value='"+parametros.gridSize+"' size='30'></p>"+"<p>Tipo de estilos (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoEstilos' type='text' value='"+parametros.tipoEstilos+"' size='30'></p>"+"<p>Os símbolos utilizados podem ser customizados alterando-se as classes do Mapfile</p>"+"<p>Veja o exemplo utilizado no tema _lmapadecluster.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var markercluster,marcas,latLng,marker,n,i;n=markercluster_dados.length;marcas=[];for(i=0;i<n;i++){latLng=new google.maps.LatLng(markercluster_dados[i].lat,markercluster_dados[i].lng);marker=new google.maps.Marker({'position':latLng,icon:{url:markercluster_config.ponto.url,scaledSize:new google.maps.Size(markercluster_config.ponto.width,markercluster_config.ponto.height)}});marcas.push(marker)}markercluster=new MarkerClusterer(i3GeoMap,marcas,{"gridSize":parseInt(camada.plugini3geo.parametros.gridSize,10),"visible":true,"opacity":camada.transparency,"name":camada.name,"styles":markercluster_config.estilos});i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=false;i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].clearMarkers();i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var layerListeners,logMax,logMin,classes,min,max,markercluster,marcas,lonlat,n,i,style,nestilos,intervalo,regra,regras=[];nestilos=markercluster_config.estilos.length;n=markercluster_dados.length;classes=Array();logMax=Math.log(n)/Math.LN10; logMin=Math.log(1)/Math.LN10;intervalo=(logMax-logMin)/nestilos;for(i=0;i<nestilos;i++){if(i==0){classes[i]=logMin}else{classes[i]=classes[i-1]+intervalo}}classes=classes.map(function(x){return Math.pow(10,x)});classes.push(n);regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN,property:"count",value:2}),symbolizer:{externalGraphic:markercluster_config.ponto.url,graphicWidth:markercluster_config.ponto.width,graphicHeight:markercluster_config.ponto.height,graphicYOffset:(markercluster_config.ponto.height/2)*-1}});regras.push(regra);min=2;for(i=0;i<nestilos;i++){max=classes[i+1];regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN,property:"count",lowerBoundary:min,upperBoundary:max}),symbolizer:{externalGraphic:markercluster_config.estilos[i].url,graphicWidth:markercluster_config.estilos[i].width,graphicHeight:markercluster_config.estilos[i].height,label:"${count}",labelOutlineWidth:1,fontColor:"#000000",fontOpacity:1,fontSize:"12px"}});regras.push(regra);min=max}style=new OpenLayers.Style(null,{rules:regras});if(!objMapa){objMapa=i3geoOL}layerListeners={featureclick:function(e){if(e.feature.cluster.length>1){objMapa.setCenter([e.feature.geometry.x,e.feature.geometry.y],objMapa.getZoom()+1,false,false)}return false}};markercluster=new OpenLayers.Layer.Vector(camada.name,{renderers:['Canvas','SVG'],strategies:[new OpenLayers.Strategy.AnimatedCluster({distance:parseInt(camada.plugini3geo.parametros.gridSize,10)})],styleMap:new OpenLayers.StyleMap(style),eventListeners:layerListeners});objMapa.addLayer(markercluster);marcas=[];for(i=0;i<n;i++){lonlat=new OpenLayers.LonLat(markercluster_dados[i].lng,markercluster_dados[i].lat);if(i3GEO.Interface.openlayers.googleLike===true){lonlat.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"))}marcas.push(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(lonlat.lon,lonlat.lat)))}markercluster.addFeatures(marcas);i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}}},layerkml:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"layerkml","parametros":{"url": ""}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="layerkml"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+="<p>Url do arquivo Kml:<br><input name='url' type='text' value='"+parametros.url+"'/></p>"+"<p>Veja o exemplo utilizado no tema _lmapakml.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var layerkml=new google.maps.KmlLayer(camada.plugini3geo.parametros.url,{map:i3GeoMap,preserveViewport:true,name:camada.name});i3GEO.janela.fechaAguarde("aguardePlugin");layerkml.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};layerkml.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null)};layerkml.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true)};layerkml.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var layerkml;url=i3GEO.configura.locaplic+"/classesphp/proxy.php?url="+camada.plugini3geo.parametros.url;layerkml=new OpenLayers.Layer.Vector(camada.name,{displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true,strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP({url:url,format:new OpenLayers.Format.KML({extractStyles:true,extractAttributes:true,maxDepth:5})})});i3geoOL.addLayer(layerkml);if(!objMapa){objMapa=i3geoOL}layerkml.div.onclick=function(e){var targ="",id,temp,features,n,i,j="",html="";if(!e){e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.id){temp=targ.id.split("_Point");if(temp[0]==="OpenLayers_Geometry"){id=targ.id;temp=i3geoOL.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}};i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;layerkml.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};layerkml.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}}},parametrossql:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=127"},formAdmin:function(config){var n,i,parametros,ins="",configDefault='{"plugin":"parametrossql","ativo":"sim","parametros":[{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""}]}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="parametrossql"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;n=4;if(config.ativo==undefined){config.ativo="sim"}ins+="<p class='paragrafo'>Abre o formulário quando a camada é adicionada ao mapa: (true ou false)</p>";ins+="<select style='width:200px' id='parametrosSqlAtivo' ><option value='' ></option>";if(config.ativo==="nao"){ins+="<option value=sim >sim</option><option value=nao selected >nao</option></select>"}else{ins+="<option value=sim selected >sim</option><option value=nao >nao</option></select>"}ins+="<table><tr><td>Título</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>";for(i=0;i<n;i++){ins+="<tr><td><input name='titulo' type=text size=20 value='"+parametros[i].titulo+"' /></td>"+"<td><input name='chave' type=text size=20 value='"+parametros[i].chave+"' /></td>"+"<td><input name='tipo' type=text size=20 value='"+parametros[i].tipo+"' /></td> "+"<td><input name='valores' type=text size=20 value='"+parametros[i].valores+"' /></td> "+"<td><input name='prog' type=text size=20 value='"+parametros[i].prog+"' /></td> "+"<td></tr>"}ins+="</table>"+"<p class='paragrafo'>As chaves são palavras que devem existir no SQL definido em DATA e/ou no filtro (FILTER)."+"<br>O usuário irá fornecer os valores que serão então utilizados para substituir as chaves de forma dinâmica"+"<br>Será mostrado ao usuário um formulário com opções. Cada opção conterá um título e um campo de formulário"+"<br>Cada campo de formulário pode ser dos tipos input (para digitar um valor) ou select (caixa de opções)."+"<br>Em valores deve ser definida a lista ou o valor default que será mostrado. No caso de listas, utilize vírgula para separar os valores."+"<br>Em ativo, é indicado com sim ou nao se o formulário será aberto quando a camada for adicionada ao mapa."+"<br>Como opcional, pode ser definido o endereço de um programa PHP que retorna a lista de nomes e valores que serão utilizados para preencher "+"o campo de escolha. Para mais informações, veja o mapfile i3geo/temas/_llocaliphp.map. O caminho desse arquivo PHP é relativo à pasta i3geo.";return ins},parametrosFormAdmin:function(onde){var campo=0,nlinhas=4,ncampos=5,campos=onde.getElementsByTagName("input"),par=[],temp=[],i,j;for(j=0;j<nlinhas;j++){temp=[];for(i=0;i<ncampos;i++){if(campos[campo]&&campos[campo].name!=""){temp.push('"'+campos[campo].name+'" : "'+campos[campo].value+'"')}campo++}par.push("{"+temp.join(",")+"}")}return'{"plugin":"parametrossql","ativo":"'+$i("parametrosSqlAtivo").value+'","parametros":['+par.join(",")+']}'},iconeArvoreDeCamadas:function(nomecamada){var icone="<img "+"class='pluginParametrossql'"+" onclick='i3GEO.util.animaClique(this);"+"i3GEO.pluginI3geo.parametrossql.buscaParForm(\""+nomecamada+"\")"+"' title='Variaveis'"+"' src='"+i3GEO.configura.locaplic+"/imagens/branco.gif"+"'/>";return icone},buscaParForm:function(nomecamada){var p,cp,temp;temp=function(retorno){retorno.data.ativo="sim";var camada=i3GEO.arvoreDeCamadas.pegaTema(nomecamada);camada.plugini3geo=retorno.data;i3GEO.pluginI3geo.parametrossql.inicia(camada)};p=i3GEO.configura.locaplic+"/ferramentas/parametrossql/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=PARAMETROSPLUGIN&name="+nomecamada;cp=new cpaint();cp.set_response_type("JSON");cp.call(p,"foo",temp)},inicia:function(camada){i3GEO.janela.fechaAguarde("aguardePlugin");var iniciaform=function(){i3GEOF.parametrossql.iniciaJanelaFlutuante(camada)};i3GEO.util.scriptTag((i3GEO.configura.locaplic+"/ferramentas/parametrossql/dependencias.php"),iniciaform,"parametrossql_script")},googlemaps:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada}},openlayers:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada}}}}; | |
| 2 | 1 | \ No newline at end of file |
| 2 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.pluginI3geo={OBJETOS:{},PLUGINS:[{"classe":"heatmap","nome":"Mapa de calor","editor":true},{"classe":"markercluster","nome":"Agrupamento de pontos (cluster)","editor":true},{"classe":"layerkml","nome":"Camada Kml","editor":true},{"classe":"parametrossql","nome":"SQL parametrizado","editor":true}],inicia:function(camada){if(i3GEO.janela){i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardePlugin","Plugin...");i3GEO.janela.AGUARDEMODAL=false}i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].inicia(camada)},formAdmin:function(plugin,configString){return i3GEO.pluginI3geo[plugin].formAdmin(configString)},iconeArvoreDeCamadas:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){return i3GEO.pluginI3geo[camada.plugini3geo.plugin].iconeArvoreDeCamadas(camada.name)}else{return false}},linkAjuda:function(plugin){return i3GEO.pluginI3geo[plugin].linkAjuda()},ligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada();return true}return false},desligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada();return true}return false},removeCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada();delete(i3GEO.pluginI3geo.OBJETOS[nomecamada]);return true}return false},atualizaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada();return true}return false},existeObjeto:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){return true}return false},aplicaPropriedades:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){camada=i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].aplicaPropriedades(camada)}return camada},layerMashup:function(Interface,camada,epsg){if(camada.plugini3geo&&camada.plugini3geo!=""&&i3GEO.pluginI3geo[camada.plugini3geo.plugin][Interface].layerMashup){return i3GEO.pluginI3geo[camada.plugini3geo.plugin][Interface].layerMashup(camada,epsg)}else{return false}},heatmap:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"heatmap","parametros":{"tipoGradiente": "default","valorPonto":1,"coluna":"","radius":15}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="heatmap"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Coluna que contém os dados:"+"<br><input name='coluna' type='text' value='"+parametros.coluna+"' size='30'></p>"+"<p>Ou valor numérico para cada ponto:"+"<br><input name='valorPonto' type='text' value='"+parametros.valorPonto+"' size='30'></p>"+"<p>Raio de cada ponto em pixels:"+"<br><input name='radius' type='text' value='"+parametros.radius+"' size='30'></p>"+"<p>Tipo de gradiente (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoGradiente' type='text' value='"+parametros.tipoGradiente+"' size='30'></p>"+"<p>Para definir os cortes no gradiente de cores utilize valores entre 0 e 1."+" As cores são definidas nas classes do LAYER, sendo que o nome define o valor superior do gradiente e COLOR define a cor."+" Veja o exemplo utilizado no tema _lmapadecalor.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var heatmap,pontos;heatmap=new HeatmapOverlay(i3GeoMap,camada.name,{"radius":camada.plugini3geo.parametros.radius,"visible":true,"opacity":camada.transparency,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}});pontos={max:camada.plugini3geo.parametros.max,data:heatmap_dados};i3GEO.janela.fechaAguarde("aguardePlugin");heatmap.setDataSet(pontos);heatmap.ligaCamada=function(){this.liga()};heatmap.desLigaCamada=function(){this.desliga()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.draw()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;heatmap_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var temp,heatmap,transformedTestData={max:1,data:[]},data=heatmap_dados,datalen=heatmap_dados.length,nudata=[],max=0;if(!objMapa){objMapa=i3geoOL}while(datalen--){temp=heatmap_dados[datalen].count;nudata.push({lonlat:new OpenLayers.LonLat(data[datalen].lng,heatmap_dados[datalen].lat),count:temp});max=Math.max(max,temp)}transformedTestData.max=max;transformedTestData.data=nudata;heatmap=new OpenLayers.Layer.Heatmap(camada.name,objMapa,objMapa.baseLayer,{"visible":true,"opacity":camada.transparency,"radius":camada.plugini3geo.parametros.radius,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}},{isBaseLayer:false,projection:new OpenLayers.Projection("EPSG:4326"),displayInLayerSwitcher:true});heatmap.ligaCamada=function(){this.toggle();this.updateLayer()};heatmap.desLigaCamada=function(){this.toggle();this.updateLayer()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.updateLayer()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;objMapa.addLayer(heatmap);heatmap.setDataSet(transformedTestData);heatmap_dados=null;if(i3GEO.janela){i3GEO.janela.fechaAguarde("aguardePlugin")}};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}if(!i3GEO.configura||!i3GEO.configura.sid){i3GEO.configura.sid=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},googleearth:{inicia:function(){alert("Plugin nao disponivel")}}},markercluster:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"markercluster","parametros":{"tipoEstilos": "default","gridSize":50}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="markercluster"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Distância máxima entre ponto em pixels:"+"<br><input name='gridSize' type='text' value='"+parametros.gridSize+"' size='30'></p>"+"<p>Tipo de estilos (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoEstilos' type='text' value='"+parametros.tipoEstilos+"' size='30'></p>"+"<p>Os símbolos utilizados podem ser customizados alterando-se as classes do Mapfile</p>"+"<p>Veja o exemplo utilizado no tema _lmapadecluster.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var markercluster,marcas,latLng,marker,n,i;n=markercluster_dados.length;marcas=[];for(i=0;i<n;i++){latLng=new google.maps.LatLng(markercluster_dados[i].lat,markercluster_dados[i].lng);marker=new google.maps.Marker({'position':latLng,icon:{url:markercluster_config.ponto.url,scaledSize:new google.maps.Size(markercluster_config.ponto.width,markercluster_config.ponto.height)}});marcas.push(marker)}markercluster=new MarkerClusterer(i3GeoMap,marcas,{"gridSize":parseInt(camada.plugini3geo.parametros.gridSize,10),"visible":true,"opacity":camada.transparency,"name":camada.name,"styles":markercluster_config.estilos});i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=false;i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].clearMarkers();i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var layerListeners,logMax,logMin,classes,min,max,markercluster,marcas,lonlat,n,i,style,nestilos,intervalo,regra,regras=[];nestilos=markercluster_config.estilos.length;n=markercluster_dados.length;classes=Array();logMax=Math.log(n)/Math.LN10; logMin=Math.log(1)/Math.LN10;intervalo=(logMax-logMin)/nestilos;for(i=0;i<nestilos;i++){if(i==0){classes[i]=logMin}else{classes[i]=classes[i-1]+intervalo}}classes=classes.map(function(x){return Math.pow(10,x)});classes.push(n);regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN,property:"count",value:2}),symbolizer:{externalGraphic:markercluster_config.ponto.url,graphicWidth:markercluster_config.ponto.width,graphicHeight:markercluster_config.ponto.height,graphicYOffset:(markercluster_config.ponto.height/2)*-1}});regras.push(regra);min=2;for(i=0;i<nestilos;i++){max=classes[i+1];regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN,property:"count",lowerBoundary:min,upperBoundary:max}),symbolizer:{externalGraphic:markercluster_config.estilos[i].url,graphicWidth:markercluster_config.estilos[i].width,graphicHeight:markercluster_config.estilos[i].height,label:"${count}",labelOutlineWidth:1,fontColor:"#000000",fontOpacity:1,fontSize:"12px"}});regras.push(regra);min=max}style=new OpenLayers.Style(null,{rules:regras});if(!objMapa){objMapa=i3geoOL}layerListeners={featureclick:function(e){if(e.feature.cluster.length>1){objMapa.setCenter([e.feature.geometry.x,e.feature.geometry.y],objMapa.getZoom()+1,false,false)}return false}};markercluster=new OpenLayers.Layer.Vector(camada.name,{renderers:['Canvas','SVG'],strategies:[new OpenLayers.Strategy.AnimatedCluster({distance:parseInt(camada.plugini3geo.parametros.gridSize,10)})],styleMap:new OpenLayers.StyleMap(style),eventListeners:layerListeners});objMapa.addLayer(markercluster);marcas=[];for(i=0;i<n;i++){lonlat=new OpenLayers.LonLat(markercluster_dados[i].lng,markercluster_dados[i].lat);if(i3GEO.Interface.openlayers.googleLike===true){lonlat.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"))}marcas.push(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(lonlat.lon,lonlat.lat)))}markercluster.addFeatures(marcas);i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}}},layerkml:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"layerkml","parametros":{"url": ""}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="layerkml"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+="<p>Url do arquivo Kml:<br><input name='url' type='text' value='"+parametros.url+"'/></p>"+"<p>Veja o exemplo utilizado no tema _lmapakml.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var layerkml=new google.maps.KmlLayer(camada.plugini3geo.parametros.url,{map:i3GeoMap,preserveViewport:true,name:camada.name});i3GEO.janela.fechaAguarde("aguardePlugin");layerkml.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};layerkml.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null)};layerkml.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true)};layerkml.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var layerkml;url=i3GEO.configura.locaplic+"/classesphp/proxy.php?url="+camada.plugini3geo.parametros.url;layerkml=new OpenLayers.Layer.Vector(camada.name,{displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true,strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP({url:url,format:new OpenLayers.Format.KML({extractStyles:true,extractAttributes:true,maxDepth:5})})});i3geoOL.addLayer(layerkml);if(!objMapa){objMapa=i3geoOL}layerkml.div.onclick=function(e){var targ="",id,temp,features,n,i,j="",html="";if(!e){e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.id){temp=targ.id.split("_Point");if(temp[0]==="OpenLayers_Geometry"){id=targ.id;temp=i3geoOL.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}};i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;layerkml.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};layerkml.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}}},parametrossql:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=127"},formAdmin:function(config){var n,i,parametros,ins="",configDefault='{"plugin":"parametrossql","ativo":"sim","parametros":[{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""}]}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="parametrossql"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;n=4;if(config.ativo==undefined){config.ativo="sim"}ins+="<p class='paragrafo'>Abre o formulário quando a camada é adicionada ao mapa: (true ou false)</p>";ins+="<select style='width:200px' id='parametrosSqlAtivo' ><option value='' ></option>";if(config.ativo==="nao"){ins+="<option value=sim >sim</option><option value=nao selected >nao</option></select>"}else{ins+="<option value=sim selected >sim</option><option value=nao >nao</option></select>"}ins+="<table><tr><td>Título</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>";for(i=0;i<n;i++){ins+="<tr><td><input name='titulo' type=text size=20 value='"+parametros[i].titulo+"' /></td>"+"<td><input name='chave' type=text size=20 value='"+parametros[i].chave+"' /></td>"+"<td><input name='tipo' type=text size=20 value='"+parametros[i].tipo+"' /></td> "+"<td><input name='valores' type=text size=20 value='"+parametros[i].valores+"' /></td> "+"<td><input name='prog' type=text size=20 value='"+parametros[i].prog+"' /></td> "+"<td></tr>"}ins+="</table>"+"<p class='paragrafo'>As chaves são palavras que devem existir no SQL definido em DATA e/ou no filtro (FILTER)."+"<br>O usuário irá fornecer os valores que serão então utilizados para substituir as chaves de forma dinâmica"+"<br>Será mostrado ao usuário um formulário com opções. Cada opção conterá um título e um campo de formulário"+"<br>Cada campo de formulário pode ser dos tipos input (para digitar um valor) ou select (caixa de opções)."+"<br>Em valores deve ser definida a lista ou o valor default que será mostrado. No caso de listas, utilize vírgula para separar os valores."+"<br>Em ativo, é indicado com sim ou nao se o formulário será aberto quando a camada for adicionada ao mapa."+"<br>Como opcional, pode ser definido o endereço de um programa PHP que retorna a lista de nomes e valores que serão utilizados para preencher "+"o campo de escolha. Para mais informações, veja o mapfile i3geo/temas/_llocaliphp.map. O caminho desse arquivo PHP é relativo à pasta i3geo.";return ins},parametrosFormAdmin:function(onde){var campo=0,nlinhas=4,ncampos=5,campos=onde.getElementsByTagName("input"),par=[],temp=[],i,j;for(j=0;j<nlinhas;j++){temp=[];for(i=0;i<ncampos;i++){if(campos[campo]&&campos[campo].name!=""){temp.push('"'+campos[campo].name+'" : "'+campos[campo].value+'"')}campo++}par.push("{"+temp.join(",")+"}")}return'{"plugin":"parametrossql","ativo":"'+$i("parametrosSqlAtivo").value+'","parametros":['+par.join(",")+']}'},iconeArvoreDeCamadas:function(nomecamada){var icone="<img class='pluginParametrossql' "+"onclick='i3GEO.util.animaClique(this);"+"i3GEO.pluginI3geo.parametrossql.buscaParForm(\""+nomecamada+"\");return false;'"+"title='Variaveis' "+"src='"+i3GEO.configura.locaplic+"/imagens/branco.gif' />";return icone},buscaParForm:function(nomecamada){var p,cp,temp,s;temp=function(retorno){var camada;retorno.data.ativo="sim";if(i3GEO.arvoreDeCamadas){camada=i3GEO.arvoreDeCamadas.pegaTema(nomecamada);camada.plugini3geo=retorno.data}else{camada={plugini3geo:retorno.data,name:nomecamada}}i3GEO.pluginI3geo.parametrossql.inicia(camada)};s=i3GEO.configura.sid;if(s===undefined){s=""}p=i3GEO.configura.locaplic+"/ferramentas/parametrossql/exec.php?g_sid="+s+"&funcao=PARAMETROSPLUGIN&tema="+nomecamada;cp=new cpaint();cp.set_response_type("JSON");cp.call(p,"foo",temp)},inicia:function(camada){i3GEO.janela.fechaAguarde("aguardePlugin");var iniciaform=function(){i3GEOF.parametrossql.iniciaJanelaFlutuante(camada)};i3GEO.util.scriptTag((i3GEO.configura.locaplic+"/ferramentas/parametrossql/dependencias.php"),iniciaform,"parametrossql_script")},googlemaps:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada}},openlayers:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada},layerMashup:function(camada,epsg){var p;p=new OpenLayers.Layer.WMS(camada.tema,"http://localhost/i3geo/ogc.php?tema="+camada.name+"&",{layers:camada.name,SRS:'EPSG:'+epsg,FORMAT:'image/png'},{singleTile:false,isBaseLayer:false,visibility:true,plugini3geo:"parametrossql"});return p}}}}; | |
| 3 | 3 | \ No newline at end of file | ... | ... |
classesjs/i3geo_tudo_compacto6.js
| ... | ... | @@ -285,7 +285,7 @@ if(typeof(i3GEOF)==='undefined'){var i3GEOF={}}i3GEO.login={divnomelogin:"i3GEON |
| 285 | 285 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.marcador={prompt:function(){i3GEO.janela.prompt($trad("x77"),i3GEO.marcador.armazena,"")},armazena:function(){var cookies=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),ext=i3GEO.parametros.mapexten,nome="Marcador",valor;if($i("i3GEOjanelaprompt")){nome=$i("i3GEOjanelaprompt").value}valor=nome+"|"+ext;if(cookies){cookies+=":"}else{cookies=""}valor=cookies+valor;i3GEO.util.insereCookie("marcadoresDoI3Geo",valor,365);i3GEO.marcador.redesenha()},redesenha:function(){var m=i3GEOoMenuBar.getMenu("i3GeoMenuMarcador");m.clearContent();m.addItems(i3GEO.marcador.itensMenu());m.render()},exporta:function(){var c=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),texto;if(!c){c=""}texto="<p class=paragrafo >"+$trad("x78")+"</p><div class='i3geoForm i3geoFormIconeEdita' ><input type=text value='"+c+"' onclick='javascript:this.select()'/></div>";i3GEO.janela.mensagemSimples(texto,$trad("x79"))},exportaShp:function(){var c=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),temp=function(retorno){i3GEO.temaAtivo=retorno.data;i3GEO.atualiza()};if(c){i3GEO.php.marcadores2shp(temp)}},importa:function(){var temp=function(){var cookies=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),novos="";if($i("i3GEOjanelaprompt")){novos=$i("i3GEOjanelaprompt").value}if(cookies){cookies+=":"}else{cookies=""}novos=cookies+novos;i3GEO.util.insereCookie("marcadoresDoI3Geo",novos,365);i3GEO.marcador.redesenha()};i3GEO.janela.prompt($trad("x83"),temp,"")},remove:function(nomeMarcador){var cookie=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),valores=cookie.split(":"),n=valores.length,i,temp,novos=[];for(i=0;i<n;i++){temp=valores[i].split("|");if(temp[0]&&temp[0]!==nomeMarcador){novos.push(valores[i])}}i3GEO.util.insereCookie("marcadoresDoI3Geo",novos.join(":"),365);i3GEO.marcador.redesenha()},recuperaZoom:function(nomeMarcador){var cookie=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),valores=cookie.split(":"),n=valores.length,i,temp;for(i=0;i<n;i++){temp=valores[i].split("|");if(temp[0]&&temp[0]===nomeMarcador){i3GEO.navega.zoomExt("","","",temp[1]);return}}},adicionaMenuSuspenso:function(obj){obj.menu.push({nome:$trad("x79"),id:"i3GeoMenuMarcador"});obj.submenus.i3GeoMenuMarcador=i3GEO.marcador.itensMenu();return obj},itensMenu:function(){var itens=[],cookie=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),valores,n,i,temp;itens.push({id:"omenudataMarcadorSalva",text:$trad("x82"),url:"javascript:i3GEO.marcador.prompt()"},{id:"omenudataMarcadorExporta",text:$trad("x80"),url:"javascript:i3GEO.marcador.exporta()"},{id:"omenudataMarcadorImporta",text:$trad("x81"),url:"javascript:i3GEO.marcador.importa()"},{id:"omenudataMarcadorExportaShp",text:$trad("x84"),url:"javascript:i3GEO.marcador.exportaShp()"});if(cookie){valores=cookie.split(":");n=valores.length;for(i=0;i<n;i++){temp=valores[i].split("|");if(temp.length===2){itens.push({id:"omenudataMarcador"+i,text:"<img title='"+$trad("x62")+"' src='"+i3GEO.configura.locaplic+"/imagens/branco.gif' class=x onclick='i3GEO.marcador.remove(\""+temp[0]+"\")' /> <span style='color:blue;background-color:white;'>"+temp[0]+"</span>",url:"javascript:i3GEO.marcador.recuperaZoom('"+temp[0]+"')"})}}}return itens}}; |
| 286 | 286 | // |
| 287 | 287 | //compactados/classe_plugini3geo_compacto.js |
| 288 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.pluginI3geo={OBJETOS:{},PLUGINS:[{"classe":"heatmap","nome":"Mapa de calor","editor":true},{"classe":"markercluster","nome":"Agrupamento de pontos (cluster)","editor":true},{"classe":"layerkml","nome":"Camada Kml","editor":true},{"classe":"parametrossql","nome":"SQL parametrizado","editor":true}],inicia:function(camada){if(i3GEO.janela){i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardePlugin","Plugin...");i3GEO.janela.AGUARDEMODAL=false}i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].inicia(camada)},formAdmin:function(plugin,configString){return i3GEO.pluginI3geo[plugin].formAdmin(configString)},iconeArvoreDeCamadas:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){return i3GEO.pluginI3geo[camada.plugini3geo.plugin].iconeArvoreDeCamadas(camada.name)}else{return false}},linkAjuda:function(plugin){return i3GEO.pluginI3geo[plugin].linkAjuda()},ligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada();return true}return false},desligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada();return true}return false},removeCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada();delete(i3GEO.pluginI3geo.OBJETOS[nomecamada]);return true}return false},atualizaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada();return true}return false},existeObjeto:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){return true}return false},aplicaPropriedades:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){camada=i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].aplicaPropriedades(camada)}return camada},heatmap:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"heatmap","parametros":{"tipoGradiente": "default","valorPonto":1,"coluna":"","radius":15}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="heatmap"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Coluna que contém os dados:"+"<br><input name='coluna' type='text' value='"+parametros.coluna+"' size='30'></p>"+"<p>Ou valor numérico para cada ponto:"+"<br><input name='valorPonto' type='text' value='"+parametros.valorPonto+"' size='30'></p>"+"<p>Raio de cada ponto em pixels:"+"<br><input name='radius' type='text' value='"+parametros.radius+"' size='30'></p>"+"<p>Tipo de gradiente (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoGradiente' type='text' value='"+parametros.tipoGradiente+"' size='30'></p>"+"<p>Para definir os cortes no gradiente de cores utilize valores entre 0 e 1."+" As cores são definidas nas classes do LAYER, sendo que o nome define o valor superior do gradiente e COLOR define a cor."+" Veja o exemplo utilizado no tema _lmapadecalor.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var heatmap,pontos;heatmap=new HeatmapOverlay(i3GeoMap,camada.name,{"radius":camada.plugini3geo.parametros.radius,"visible":true,"opacity":camada.transparency,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}});pontos={max:camada.plugini3geo.parametros.max,data:heatmap_dados};i3GEO.janela.fechaAguarde("aguardePlugin");heatmap.setDataSet(pontos);heatmap.ligaCamada=function(){this.liga()};heatmap.desLigaCamada=function(){this.desliga()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.draw()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;heatmap_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var temp,heatmap,transformedTestData={max:1,data:[]},data=heatmap_dados,datalen=heatmap_dados.length,nudata=[],max=0;if(!objMapa){objMapa=i3geoOL}while(datalen--){temp=heatmap_dados[datalen].count;nudata.push({lonlat:new OpenLayers.LonLat(data[datalen].lng,heatmap_dados[datalen].lat),count:temp});max=Math.max(max,temp)}transformedTestData.max=max;transformedTestData.data=nudata;heatmap=new OpenLayers.Layer.Heatmap(camada.name,objMapa,objMapa.baseLayer,{"visible":true,"opacity":camada.transparency,"radius":camada.plugini3geo.parametros.radius,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}},{isBaseLayer:false,projection:new OpenLayers.Projection("EPSG:4326"),displayInLayerSwitcher:true});heatmap.ligaCamada=function(){this.toggle();this.updateLayer()};heatmap.desLigaCamada=function(){this.toggle();this.updateLayer()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.updateLayer()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;objMapa.addLayer(heatmap);heatmap.setDataSet(transformedTestData);heatmap_dados=null;if(i3GEO.janela){i3GEO.janela.fechaAguarde("aguardePlugin")}};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}if(!i3GEO.configura||!i3GEO.configura.sid){i3GEO.configura.sid=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},googleearth:{inicia:function(){alert("Plugin nao disponivel")}}},markercluster:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"markercluster","parametros":{"tipoEstilos": "default","gridSize":50}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="markercluster"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Distância máxima entre ponto em pixels:"+"<br><input name='gridSize' type='text' value='"+parametros.gridSize+"' size='30'></p>"+"<p>Tipo de estilos (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoEstilos' type='text' value='"+parametros.tipoEstilos+"' size='30'></p>"+"<p>Os símbolos utilizados podem ser customizados alterando-se as classes do Mapfile</p>"+"<p>Veja o exemplo utilizado no tema _lmapadecluster.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var markercluster,marcas,latLng,marker,n,i;n=markercluster_dados.length;marcas=[];for(i=0;i<n;i++){latLng=new google.maps.LatLng(markercluster_dados[i].lat,markercluster_dados[i].lng);marker=new google.maps.Marker({'position':latLng,icon:{url:markercluster_config.ponto.url,scaledSize:new google.maps.Size(markercluster_config.ponto.width,markercluster_config.ponto.height)}});marcas.push(marker)}markercluster=new MarkerClusterer(i3GeoMap,marcas,{"gridSize":parseInt(camada.plugini3geo.parametros.gridSize,10),"visible":true,"opacity":camada.transparency,"name":camada.name,"styles":markercluster_config.estilos});i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=false;i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].clearMarkers();i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var layerListeners,logMax,logMin,classes,min,max,markercluster,marcas,lonlat,n,i,style,nestilos,intervalo,regra,regras=[];nestilos=markercluster_config.estilos.length;n=markercluster_dados.length;classes=Array();logMax=Math.log(n)/Math.LN10; logMin=Math.log(1)/Math.LN10;intervalo=(logMax-logMin)/nestilos;for(i=0;i<nestilos;i++){if(i==0){classes[i]=logMin}else{classes[i]=classes[i-1]+intervalo}}classes=classes.map(function(x){return Math.pow(10,x)});classes.push(n);regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN,property:"count",value:2}),symbolizer:{externalGraphic:markercluster_config.ponto.url,graphicWidth:markercluster_config.ponto.width,graphicHeight:markercluster_config.ponto.height,graphicYOffset:(markercluster_config.ponto.height/2)*-1}});regras.push(regra);min=2;for(i=0;i<nestilos;i++){max=classes[i+1];regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN,property:"count",lowerBoundary:min,upperBoundary:max}),symbolizer:{externalGraphic:markercluster_config.estilos[i].url,graphicWidth:markercluster_config.estilos[i].width,graphicHeight:markercluster_config.estilos[i].height,label:"${count}",labelOutlineWidth:1,fontColor:"#000000",fontOpacity:1,fontSize:"12px"}});regras.push(regra);min=max}style=new OpenLayers.Style(null,{rules:regras});if(!objMapa){objMapa=i3geoOL}layerListeners={featureclick:function(e){if(e.feature.cluster.length>1){objMapa.setCenter([e.feature.geometry.x,e.feature.geometry.y],objMapa.getZoom()+1,false,false)}return false}};markercluster=new OpenLayers.Layer.Vector(camada.name,{renderers:['Canvas','SVG'],strategies:[new OpenLayers.Strategy.AnimatedCluster({distance:parseInt(camada.plugini3geo.parametros.gridSize,10)})],styleMap:new OpenLayers.StyleMap(style),eventListeners:layerListeners});objMapa.addLayer(markercluster);marcas=[];for(i=0;i<n;i++){lonlat=new OpenLayers.LonLat(markercluster_dados[i].lng,markercluster_dados[i].lat);if(i3GEO.Interface.openlayers.googleLike===true){lonlat.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"))}marcas.push(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(lonlat.lon,lonlat.lat)))}markercluster.addFeatures(marcas);i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}}},layerkml:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"layerkml","parametros":{"url": ""}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="layerkml"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+="<p>Url do arquivo Kml:<br><input name='url' type='text' value='"+parametros.url+"'/></p>"+"<p>Veja o exemplo utilizado no tema _lmapakml.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var layerkml=new google.maps.KmlLayer(camada.plugini3geo.parametros.url,{map:i3GeoMap,preserveViewport:true,name:camada.name});i3GEO.janela.fechaAguarde("aguardePlugin");layerkml.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};layerkml.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null)};layerkml.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true)};layerkml.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var layerkml;url=i3GEO.configura.locaplic+"/classesphp/proxy.php?url="+camada.plugini3geo.parametros.url;layerkml=new OpenLayers.Layer.Vector(camada.name,{displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true,strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP({url:url,format:new OpenLayers.Format.KML({extractStyles:true,extractAttributes:true,maxDepth:5})})});i3geoOL.addLayer(layerkml);if(!objMapa){objMapa=i3geoOL}layerkml.div.onclick=function(e){var targ="",id,temp,features,n,i,j="",html="";if(!e){e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.id){temp=targ.id.split("_Point");if(temp[0]==="OpenLayers_Geometry"){id=targ.id;temp=i3geoOL.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}};i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;layerkml.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};layerkml.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}}},parametrossql:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=127"},formAdmin:function(config){var n,i,parametros,ins="",configDefault='{"plugin":"parametrossql","ativo":"sim","parametros":[{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""}]}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="parametrossql"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;n=4;if(config.ativo==undefined){config.ativo="sim"}ins+="<p class='paragrafo'>Abre o formulário quando a camada é adicionada ao mapa: (true ou false)</p>";ins+="<select style='width:200px' id='parametrosSqlAtivo' ><option value='' ></option>";if(config.ativo==="nao"){ins+="<option value=sim >sim</option><option value=nao selected >nao</option></select>"}else{ins+="<option value=sim selected >sim</option><option value=nao >nao</option></select>"}ins+="<table><tr><td>Título</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>";for(i=0;i<n;i++){ins+="<tr><td><input name='titulo' type=text size=20 value='"+parametros[i].titulo+"' /></td>"+"<td><input name='chave' type=text size=20 value='"+parametros[i].chave+"' /></td>"+"<td><input name='tipo' type=text size=20 value='"+parametros[i].tipo+"' /></td> "+"<td><input name='valores' type=text size=20 value='"+parametros[i].valores+"' /></td> "+"<td><input name='prog' type=text size=20 value='"+parametros[i].prog+"' /></td> "+"<td></tr>"}ins+="</table>"+"<p class='paragrafo'>As chaves são palavras que devem existir no SQL definido em DATA e/ou no filtro (FILTER)."+"<br>O usuário irá fornecer os valores que serão então utilizados para substituir as chaves de forma dinâmica"+"<br>Será mostrado ao usuário um formulário com opções. Cada opção conterá um título e um campo de formulário"+"<br>Cada campo de formulário pode ser dos tipos input (para digitar um valor) ou select (caixa de opções)."+"<br>Em valores deve ser definida a lista ou o valor default que será mostrado. No caso de listas, utilize vírgula para separar os valores."+"<br>Em ativo, é indicado com sim ou nao se o formulário será aberto quando a camada for adicionada ao mapa."+"<br>Como opcional, pode ser definido o endereço de um programa PHP que retorna a lista de nomes e valores que serão utilizados para preencher "+"o campo de escolha. Para mais informações, veja o mapfile i3geo/temas/_llocaliphp.map. O caminho desse arquivo PHP é relativo à pasta i3geo.";return ins},parametrosFormAdmin:function(onde){var campo=0,nlinhas=4,ncampos=5,campos=onde.getElementsByTagName("input"),par=[],temp=[],i,j;for(j=0;j<nlinhas;j++){temp=[];for(i=0;i<ncampos;i++){if(campos[campo]&&campos[campo].name!=""){temp.push('"'+campos[campo].name+'" : "'+campos[campo].value+'"')}campo++}par.push("{"+temp.join(",")+"}")}return'{"plugin":"parametrossql","ativo":"'+$i("parametrosSqlAtivo").value+'","parametros":['+par.join(",")+']}'},iconeArvoreDeCamadas:function(nomecamada){var icone="<img "+"class='pluginParametrossql'"+" onclick='i3GEO.util.animaClique(this);"+"i3GEO.pluginI3geo.parametrossql.buscaParForm(\""+nomecamada+"\")"+"' title='Variaveis'"+"' src='"+i3GEO.configura.locaplic+"/imagens/branco.gif"+"'/>";return icone},buscaParForm:function(nomecamada){var p,cp,temp;temp=function(retorno){retorno.data.ativo="sim";var camada=i3GEO.arvoreDeCamadas.pegaTema(nomecamada);camada.plugini3geo=retorno.data;i3GEO.pluginI3geo.parametrossql.inicia(camada)};p=i3GEO.configura.locaplic+"/ferramentas/parametrossql/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=PARAMETROSPLUGIN&name="+nomecamada;cp=new cpaint();cp.set_response_type("JSON");cp.call(p,"foo",temp)},inicia:function(camada){i3GEO.janela.fechaAguarde("aguardePlugin");var iniciaform=function(){i3GEOF.parametrossql.iniciaJanelaFlutuante(camada)};i3GEO.util.scriptTag((i3GEO.configura.locaplic+"/ferramentas/parametrossql/dependencias.php"),iniciaform,"parametrossql_script")},googlemaps:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada}},openlayers:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada}}}}; | |
| 288 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.pluginI3geo={OBJETOS:{},PLUGINS:[{"classe":"heatmap","nome":"Mapa de calor","editor":true},{"classe":"markercluster","nome":"Agrupamento de pontos (cluster)","editor":true},{"classe":"layerkml","nome":"Camada Kml","editor":true},{"classe":"parametrossql","nome":"SQL parametrizado","editor":true}],inicia:function(camada){if(i3GEO.janela){i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardePlugin","Plugin...");i3GEO.janela.AGUARDEMODAL=false}i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].inicia(camada)},formAdmin:function(plugin,configString){return i3GEO.pluginI3geo[plugin].formAdmin(configString)},iconeArvoreDeCamadas:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){return i3GEO.pluginI3geo[camada.plugini3geo.plugin].iconeArvoreDeCamadas(camada.name)}else{return false}},linkAjuda:function(plugin){return i3GEO.pluginI3geo[plugin].linkAjuda()},ligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada();return true}return false},desligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada();return true}return false},removeCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada();delete(i3GEO.pluginI3geo.OBJETOS[nomecamada]);return true}return false},atualizaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada();return true}return false},existeObjeto:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){return true}return false},aplicaPropriedades:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){camada=i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].aplicaPropriedades(camada)}return camada},layerMashup:function(Interface,camada,epsg){if(camada.plugini3geo&&camada.plugini3geo!=""&&i3GEO.pluginI3geo[camada.plugini3geo.plugin][Interface].layerMashup){return i3GEO.pluginI3geo[camada.plugini3geo.plugin][Interface].layerMashup(camada,epsg)}else{return false}},heatmap:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"heatmap","parametros":{"tipoGradiente": "default","valorPonto":1,"coluna":"","radius":15}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="heatmap"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Coluna que contém os dados:"+"<br><input name='coluna' type='text' value='"+parametros.coluna+"' size='30'></p>"+"<p>Ou valor numérico para cada ponto:"+"<br><input name='valorPonto' type='text' value='"+parametros.valorPonto+"' size='30'></p>"+"<p>Raio de cada ponto em pixels:"+"<br><input name='radius' type='text' value='"+parametros.radius+"' size='30'></p>"+"<p>Tipo de gradiente (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoGradiente' type='text' value='"+parametros.tipoGradiente+"' size='30'></p>"+"<p>Para definir os cortes no gradiente de cores utilize valores entre 0 e 1."+" As cores são definidas nas classes do LAYER, sendo que o nome define o valor superior do gradiente e COLOR define a cor."+" Veja o exemplo utilizado no tema _lmapadecalor.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var heatmap,pontos;heatmap=new HeatmapOverlay(i3GeoMap,camada.name,{"radius":camada.plugini3geo.parametros.radius,"visible":true,"opacity":camada.transparency,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}});pontos={max:camada.plugini3geo.parametros.max,data:heatmap_dados};i3GEO.janela.fechaAguarde("aguardePlugin");heatmap.setDataSet(pontos);heatmap.ligaCamada=function(){this.liga()};heatmap.desLigaCamada=function(){this.desliga()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.draw()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;heatmap_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var temp,heatmap,transformedTestData={max:1,data:[]},data=heatmap_dados,datalen=heatmap_dados.length,nudata=[],max=0;if(!objMapa){objMapa=i3geoOL}while(datalen--){temp=heatmap_dados[datalen].count;nudata.push({lonlat:new OpenLayers.LonLat(data[datalen].lng,heatmap_dados[datalen].lat),count:temp});max=Math.max(max,temp)}transformedTestData.max=max;transformedTestData.data=nudata;heatmap=new OpenLayers.Layer.Heatmap(camada.name,objMapa,objMapa.baseLayer,{"visible":true,"opacity":camada.transparency,"radius":camada.plugini3geo.parametros.radius,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}},{isBaseLayer:false,projection:new OpenLayers.Projection("EPSG:4326"),displayInLayerSwitcher:true});heatmap.ligaCamada=function(){this.toggle();this.updateLayer()};heatmap.desLigaCamada=function(){this.toggle();this.updateLayer()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.updateLayer()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;objMapa.addLayer(heatmap);heatmap.setDataSet(transformedTestData);heatmap_dados=null;if(i3GEO.janela){i3GEO.janela.fechaAguarde("aguardePlugin")}};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}if(!i3GEO.configura||!i3GEO.configura.sid){i3GEO.configura.sid=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},googleearth:{inicia:function(){alert("Plugin nao disponivel")}}},markercluster:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"markercluster","parametros":{"tipoEstilos": "default","gridSize":50}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="markercluster"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Distância máxima entre ponto em pixels:"+"<br><input name='gridSize' type='text' value='"+parametros.gridSize+"' size='30'></p>"+"<p>Tipo de estilos (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoEstilos' type='text' value='"+parametros.tipoEstilos+"' size='30'></p>"+"<p>Os símbolos utilizados podem ser customizados alterando-se as classes do Mapfile</p>"+"<p>Veja o exemplo utilizado no tema _lmapadecluster.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var markercluster,marcas,latLng,marker,n,i;n=markercluster_dados.length;marcas=[];for(i=0;i<n;i++){latLng=new google.maps.LatLng(markercluster_dados[i].lat,markercluster_dados[i].lng);marker=new google.maps.Marker({'position':latLng,icon:{url:markercluster_config.ponto.url,scaledSize:new google.maps.Size(markercluster_config.ponto.width,markercluster_config.ponto.height)}});marcas.push(marker)}markercluster=new MarkerClusterer(i3GeoMap,marcas,{"gridSize":parseInt(camada.plugini3geo.parametros.gridSize,10),"visible":true,"opacity":camada.transparency,"name":camada.name,"styles":markercluster_config.estilos});i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=false;i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].clearMarkers();i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var layerListeners,logMax,logMin,classes,min,max,markercluster,marcas,lonlat,n,i,style,nestilos,intervalo,regra,regras=[];nestilos=markercluster_config.estilos.length;n=markercluster_dados.length;classes=Array();logMax=Math.log(n)/Math.LN10; logMin=Math.log(1)/Math.LN10;intervalo=(logMax-logMin)/nestilos;for(i=0;i<nestilos;i++){if(i==0){classes[i]=logMin}else{classes[i]=classes[i-1]+intervalo}}classes=classes.map(function(x){return Math.pow(10,x)});classes.push(n);regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN,property:"count",value:2}),symbolizer:{externalGraphic:markercluster_config.ponto.url,graphicWidth:markercluster_config.ponto.width,graphicHeight:markercluster_config.ponto.height,graphicYOffset:(markercluster_config.ponto.height/2)*-1}});regras.push(regra);min=2;for(i=0;i<nestilos;i++){max=classes[i+1];regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN,property:"count",lowerBoundary:min,upperBoundary:max}),symbolizer:{externalGraphic:markercluster_config.estilos[i].url,graphicWidth:markercluster_config.estilos[i].width,graphicHeight:markercluster_config.estilos[i].height,label:"${count}",labelOutlineWidth:1,fontColor:"#000000",fontOpacity:1,fontSize:"12px"}});regras.push(regra);min=max}style=new OpenLayers.Style(null,{rules:regras});if(!objMapa){objMapa=i3geoOL}layerListeners={featureclick:function(e){if(e.feature.cluster.length>1){objMapa.setCenter([e.feature.geometry.x,e.feature.geometry.y],objMapa.getZoom()+1,false,false)}return false}};markercluster=new OpenLayers.Layer.Vector(camada.name,{renderers:['Canvas','SVG'],strategies:[new OpenLayers.Strategy.AnimatedCluster({distance:parseInt(camada.plugini3geo.parametros.gridSize,10)})],styleMap:new OpenLayers.StyleMap(style),eventListeners:layerListeners});objMapa.addLayer(markercluster);marcas=[];for(i=0;i<n;i++){lonlat=new OpenLayers.LonLat(markercluster_dados[i].lng,markercluster_dados[i].lat);if(i3GEO.Interface.openlayers.googleLike===true){lonlat.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"))}marcas.push(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(lonlat.lon,lonlat.lat)))}markercluster.addFeatures(marcas);i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}}},layerkml:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"layerkml","parametros":{"url": ""}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="layerkml"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+="<p>Url do arquivo Kml:<br><input name='url' type='text' value='"+parametros.url+"'/></p>"+"<p>Veja o exemplo utilizado no tema _lmapakml.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var layerkml=new google.maps.KmlLayer(camada.plugini3geo.parametros.url,{map:i3GeoMap,preserveViewport:true,name:camada.name});i3GEO.janela.fechaAguarde("aguardePlugin");layerkml.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};layerkml.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null)};layerkml.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true)};layerkml.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var layerkml;url=i3GEO.configura.locaplic+"/classesphp/proxy.php?url="+camada.plugini3geo.parametros.url;layerkml=new OpenLayers.Layer.Vector(camada.name,{displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true,strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP({url:url,format:new OpenLayers.Format.KML({extractStyles:true,extractAttributes:true,maxDepth:5})})});i3geoOL.addLayer(layerkml);if(!objMapa){objMapa=i3geoOL}layerkml.div.onclick=function(e){var targ="",id,temp,features,n,i,j="",html="";if(!e){e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.id){temp=targ.id.split("_Point");if(temp[0]==="OpenLayers_Geometry"){id=targ.id;temp=i3geoOL.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}};i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;layerkml.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};layerkml.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}}},parametrossql:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=127"},formAdmin:function(config){var n,i,parametros,ins="",configDefault='{"plugin":"parametrossql","ativo":"sim","parametros":[{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""}]}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="parametrossql"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;n=4;if(config.ativo==undefined){config.ativo="sim"}ins+="<p class='paragrafo'>Abre o formulário quando a camada é adicionada ao mapa: (true ou false)</p>";ins+="<select style='width:200px' id='parametrosSqlAtivo' ><option value='' ></option>";if(config.ativo==="nao"){ins+="<option value=sim >sim</option><option value=nao selected >nao</option></select>"}else{ins+="<option value=sim selected >sim</option><option value=nao >nao</option></select>"}ins+="<table><tr><td>Título</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>";for(i=0;i<n;i++){ins+="<tr><td><input name='titulo' type=text size=20 value='"+parametros[i].titulo+"' /></td>"+"<td><input name='chave' type=text size=20 value='"+parametros[i].chave+"' /></td>"+"<td><input name='tipo' type=text size=20 value='"+parametros[i].tipo+"' /></td> "+"<td><input name='valores' type=text size=20 value='"+parametros[i].valores+"' /></td> "+"<td><input name='prog' type=text size=20 value='"+parametros[i].prog+"' /></td> "+"<td></tr>"}ins+="</table>"+"<p class='paragrafo'>As chaves são palavras que devem existir no SQL definido em DATA e/ou no filtro (FILTER)."+"<br>O usuário irá fornecer os valores que serão então utilizados para substituir as chaves de forma dinâmica"+"<br>Será mostrado ao usuário um formulário com opções. Cada opção conterá um título e um campo de formulário"+"<br>Cada campo de formulário pode ser dos tipos input (para digitar um valor) ou select (caixa de opções)."+"<br>Em valores deve ser definida a lista ou o valor default que será mostrado. No caso de listas, utilize vírgula para separar os valores."+"<br>Em ativo, é indicado com sim ou nao se o formulário será aberto quando a camada for adicionada ao mapa."+"<br>Como opcional, pode ser definido o endereço de um programa PHP que retorna a lista de nomes e valores que serão utilizados para preencher "+"o campo de escolha. Para mais informações, veja o mapfile i3geo/temas/_llocaliphp.map. O caminho desse arquivo PHP é relativo à pasta i3geo.";return ins},parametrosFormAdmin:function(onde){var campo=0,nlinhas=4,ncampos=5,campos=onde.getElementsByTagName("input"),par=[],temp=[],i,j;for(j=0;j<nlinhas;j++){temp=[];for(i=0;i<ncampos;i++){if(campos[campo]&&campos[campo].name!=""){temp.push('"'+campos[campo].name+'" : "'+campos[campo].value+'"')}campo++}par.push("{"+temp.join(",")+"}")}return'{"plugin":"parametrossql","ativo":"'+$i("parametrosSqlAtivo").value+'","parametros":['+par.join(",")+']}'},iconeArvoreDeCamadas:function(nomecamada){var icone="<img class='pluginParametrossql' "+"onclick='i3GEO.util.animaClique(this);"+"i3GEO.pluginI3geo.parametrossql.buscaParForm(\""+nomecamada+"\");return false;'"+"title='Variaveis' "+"src='"+i3GEO.configura.locaplic+"/imagens/branco.gif' />";return icone},buscaParForm:function(nomecamada){var p,cp,temp,s;temp=function(retorno){var camada;retorno.data.ativo="sim";if(i3GEO.arvoreDeCamadas){camada=i3GEO.arvoreDeCamadas.pegaTema(nomecamada);camada.plugini3geo=retorno.data}else{camada={plugini3geo:retorno.data,name:nomecamada}}i3GEO.pluginI3geo.parametrossql.inicia(camada)};s=i3GEO.configura.sid;if(s===undefined){s=""}p=i3GEO.configura.locaplic+"/ferramentas/parametrossql/exec.php?g_sid="+s+"&funcao=PARAMETROSPLUGIN&tema="+nomecamada;cp=new cpaint();cp.set_response_type("JSON");cp.call(p,"foo",temp)},inicia:function(camada){i3GEO.janela.fechaAguarde("aguardePlugin");var iniciaform=function(){i3GEOF.parametrossql.iniciaJanelaFlutuante(camada)};i3GEO.util.scriptTag((i3GEO.configura.locaplic+"/ferramentas/parametrossql/dependencias.php"),iniciaform,"parametrossql_script")},googlemaps:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada}},openlayers:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada},layerMashup:function(camada,epsg){var p;p=new OpenLayers.Layer.WMS(camada.tema,"http://localhost/i3geo/ogc.php?tema="+camada.name+"&",{layers:camada.name,SRS:'EPSG:'+epsg,FORMAT:'image/png'},{singleTile:false,isBaseLayer:false,visibility:true,plugini3geo:"parametrossql"});return p}}}}; | |
| 289 | 289 | // |
| 290 | 290 | //compactados/euDock.2.0.js |
| 291 | 291 | if(!euEnv)var euEnv=new Array();euEnv.Kost=new Array();euEnv.Kost.num=0;euEnv.Kost.next=function(){return this.num++};euEnv.euDockArray=new Array();euEnv.refreshTime=35;euEnv.exeThread=true;euEnv.exeThreadWhiteLoop=0;euEnv.x=0;euEnv.y=0;euEnv.mouseMoved=false;var euUP=1;var euDOWN=2;var euLEFT=3;var euRIGHT=4;var euICON=5;var euMOUSE=6;var euSCREEN=7;var euOBJECT=8;var euABSOLUTE=9;var euRELATIVE=10;var euHORIZONTAL=11;var euVERTICAL=12;var euCENTER=13;var euTRANSPARENT=14;var euFIXED=15;var euOPAQUE=16;function euIdObjTop(euObj){var ret=euObj.offsetTop;while((euObj=euObj.offsetParent)!=null)ret+=euObj.offsetTop;return ret};function euIdObjLeft(euObj){var ret=euObj.offsetLeft;while((euObj=euObj.offsetParent)!=null)ret+=euObj.offsetLeft;return ret};function isEuInside(euObj,x,y){var euTop=euIdObjTop(euObj);var euLeft=euIdObjLeft(euObj);return((euTop<=y&&(euTop+euObj.offsetHeight)>=y)&&(euLeft<=x&&(euLeft+euObj.offsetWidth)>=x))};function euDimensioni(){if(typeof(window.innerWidth)=='number'){euEnv.euFrameWidth=window.innerWidth-16;euEnv.euFrameHeight=window.innerHeight}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){euEnv.euFrameWidth=document.documentElement.clientWidth-16;euEnv.euFrameHeight=document.documentElement.clientHeight}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){euEnv.euFrameWidth=document.body.clientWidth;euEnv.euFrameHeight=document.body.clientHeight}};function offsEut(){euEnv.euScrOfY=0;euEnv.euScrOfX=0;if(typeof(window.pageYoffsEut)=='number'){euEnv.euScrOfY=window.pageYoffsEut;euEnv.euScrOfX=window.pageXoffsEut}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){euEnv.euScrOfY=document.body.scrollTop;euEnv.euScrOfX=document.body.scrollLeft}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){euEnv.euScrOfY=document.documentElement.scrollTop;euEnv.euScrOfX=document.documentElement.scrollLeft}};function euKostFunc30(x){return 0.3};function euKostFunc100(x){return 1};function euLinear(x){return x};function euLinear30(x){var r=1*(x+(1-x)*0.3);return r};function euLinear20(x){return x+(1-x)*0.2};function euExp30(x){return euLinear30(x*x*x)};function euLinear50(x){return x+(1-x)*0.5};function euHarmonic(x){return euLinear30((1-Math.cos(Math.PI*x))/2)};function euSemiHarmonic(x){return euLinear30(Math.cos(Math.PI*(1-x)/2))};function euDock(onde){this.id='euDock_'+euEnv.Kost.next();var novoel=document.createElement("div");novoel.style.position="absolute";novoel.innerHTML="<div id='"+this.id+"_bar' style='z-index:1;position:absolute;border:0px solid black;'></div>"+"<div id='"+this.id+"' style='z-index:1;position:absolute;border:0px solid black; cursor: pointer;'></div>";if(onde){novoel.style.zIndex=100000;onde.appendChild(novoel)}else{document.body.appendChild(novoel)}this.div=document.getElementById(this.id);this.divBar=document.getElementById(this.id+"_bar");this.iconsArray=new Array();this.isInside=false;euEnv.euDockArray[this.id]=this;this.bar=null;this.mouseX=0;this.mouseY=0;this.centerPosX=0;this.centerPosY=0;this.offset=0;this.iconOffset=0;this.venusHillSize=3;this.venusHillTrans=euLinear;this.position=euUP;this.align=euSCREEN;this.objectAlign=euDOWN;this.idObjectHook;this.animaition=euICON;this.animFading=euABSOLUTE;this.setIconsOffset=function(offset){this.iconOffset=offset};this.setAnimation=function(anim,size){this.animaition=anim;this.venusHillSize=size};this.setPointAlign=function(x,y,pos){this.offset=0;this.align=euABSOLUTE;this.position=pos;this.setCenterPos(x,y)};this.setObjectAlign=function(idObj,align,offset,pos){this.offset=offset;this.align=euOBJECT;this.objectAlign=align;this.position=pos;this.idObjectHook=document.getElementById(idObj);this.setObjectCoord()};this.setObjectCoord=function(){var tempx,tempy;if(this.objectAlign==euDOWN){if(onde){tempx=(this.idObjectHook.offsetWidth/2);tempy=0}else{tempx=euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2);tempy=euIdObjTop(this.idObjectHook)+this.idObjectHook.offsetHeight+this.offset;if(navm&&!document.doctype||(navm&&document.doctype&&document.doctype.systemId=="")){tempx=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))[0]+(euIdObjLeft(this.idObjectHook)/2)}if(navm&&i3GEO.util.versaoNavegador()==="IE8"&&tempx<this.idObjectHook.offsetWidth){tempx=i3GEO.parametros.w/2;if(i3GEO.guias.TIPO==="guia"||i3GEO.guias.TIPO==="sanfona"&&$i("contemFerramentas")){tempx+=parseInt($i("contemFerramentas").style.width,10)}}}this.setCenterPos(tempx,tempy)}else if(this.objectAlign==euUP)this.setCenterPos(euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2),euIdObjTop(this.idObjectHook)-this.offset);else if(this.objectAlign==euLEFT)this.setCenterPos(euIdObjLeft(this.idObjectHook)-this.offset,euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2));else if(this.objectAlign==euRIGHT)this.setCenterPos(euIdObjLeft(this.idObjectHook)+this.idObjectHook.offsetWidth+this.offset,euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2));else if(this.objectAlign==euCENTER){if(this.position==euUP||this.position==euDOWN||this.position==euHORIZONTAL)this.setCenterPos(euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2),euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2)-this.offset);else this.setCenterPos(euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2)+this.offset,euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2))}};this.setScreenAlign=function(align,offset){this.offset=offset;this.align=euSCREEN;if(align==euUP)this.position=euDOWN;else if(align==euDOWN)this.position=euUP;else if(align==euLEFT)this.position=euRIGHT;else if(align==euRIGHT)this.position=euLEFT;this.setScreenCoord()};this.setScreenCoord=function(){euDimensioni();offsEut();if(this.position==euDOWN)this.setCenterPos(euEnv.euScrOfX+euEnv.euFrameWidth/2,euEnv.euScrOfY+this.offset);else if(this.position==euUP)this.setCenterPos(euEnv.euScrOfX+euEnv.euFrameWidth/2,euEnv.euScrOfY+euEnv.euFrameHeight-this.offset);else if(this.position==euRIGHT)this.setCenterPos(euEnv.euScrOfX+this.offset,euEnv.euScrOfY+euEnv.euFrameHeight/2);else if(this.position==euLEFT)this.setCenterPos(euEnv.euScrOfX+euEnv.euFrameWidth-this.offset,euEnv.euScrOfY+euEnv.euFrameHeight/2)};this.refreshDiv=function(){if(this.position==euDOWN){this.setPos(this.centerPosX-this.getWidth()/2,this.centerPosY+this.iconOffset)}else if(this.position==euUP){this.setPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.getHeight()-this.iconOffset)}else if(this.position==euRIGHT){this.setPos(this.centerPosX+this.iconOffset,this.centerPosY-this.getHeight()/2)}else if(this.position==euLEFT){this.setPos(this.centerPosX-this.getWidth()-this.iconOffset,this.centerPosY-this.getHeight()/2)}else if(this.position==euHORIZONTAL){this.setPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.getHeight()/2+this.iconOffset)}else if(this.position==euVERTICAL){this.setPos(this.centerPosX-this.getWidth()/2+this.iconOffset,this.centerPosY-this.getHeight()/2)}if(this.bar){if(this.position==euDOWN){this.setBarPos(this.centerPosX-this.getWidth()/2,this.centerPosY)}else if(this.position==euUP){this.setBarPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.bar.getSize())}else if(this.position==euRIGHT){this.setBarPos(this.centerPosX,this.centerPosY-this.getHeight()/2)}else if(this.position==euLEFT){this.setBarPos(this.centerPosX-this.bar.getSize(),this.centerPosY-this.getHeight()/2)}else if(this.position==euHORIZONTAL){this.setBarPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.bar.getSize()/2)}else if(this.position==euVERTICAL){this.setBarPos(this.centerPosX-this.bar.getSize()/2,this.centerPosY-this.getHeight()/2)}}};this.riposition=function(){if(this.align==euSCREEN)this.setScreenCoord();else if(this.align==euOBJECT)this.setObjectCoord()};this.setCenterPos=function(x,y){this.centerPosX=x;this.centerPosY=y;this.refreshDiv()};this.setPos=function(x,y){this.setPosX(x);this.setPosY(y)};this.setBarPos=function(x,y){this.setBarPosX(x);this.setBarPosY(y)};this.setDim=function(w,h){this.setWidth(w);this.setHeight(h)};this.setBarPosX=function(x){document.getElementById(this.id+"_bar").style.left=x+'px'};this.setBarPosY=function(y){document.getElementById(this.id+"_bar").style.top=y+'px'};this.getPosX=function(){return document.getElementById(this.id).style.left.replace(/[^0-9]/g,"")};this.setPosX=function(x){document.getElementById(this.id).style.left=x+'px'};this.getPosY=function(){return document.getElementById(this.id).style.top.replace(/[^0-9]/g,"")};this.setPosY=function(y){document.getElementById(this.id).style.top=y+'px'};this.getWidth=function(){return document.getElementById(this.id).style.width.replace(/[^0-9]/g,"")};this.setWidth=function(w){document.getElementById(this.id).style.width=Math.round(w)+'px'};this.getHeight=function(){return document.getElementById(this.id).style.height.replace(/[^0-9]/g,"")};this.setHeight=function(h){document.getElementById(this.id).style.height=Math.round(h)+'px'};this.getVenusWidth=function(){return this.venusHillSize*this.getWidth()};this.getVenusHeight=function(){return this.venusHillSize*this.getHeight()};this.getMouseRelativeX=function(){return this.mouseX-euIdObjLeft(this.div)};this.getMouseRelativeY=function(){return this.mouseY-euIdObjTop(this.div)};this.updateDims=function(){var bakWidth=0;var bakHeight=0;for(var i in this.iconsArray)if(this.iconsArray[i].id){if(this.position==euUP||this.position==euDOWN||this.position==euHORIZONTAL){bakWidth+=this.iconsArray[i].getWidth();bakHeight=(this.iconsArray[i].getHeight()>bakHeight)?this.iconsArray[i].getHeight():bakHeight;bakHeight=Math.round(bakHeight)}else{bakHeight+=this.iconsArray[i].getHeight();bakWidth=(this.iconsArray[i].getWidth()>bakWidth)?this.iconsArray[i].getWidth():bakWidth;bakWidth=Math.round(bakWidth)}}if(this.bar){if(this.position==euUP||this.position==euDOWN||this.position==euHORIZONTAL)this.bar.setProperties(bakWidth,this.position);else this.bar.setProperties(bakHeight,this.position);this.bar.refresh()}var posx=0;var posy=0;var updPosX=0;var updPosY=0;for(var i in this.iconsArray)if(this.iconsArray[i].id){if(this.position==euDOWN){updPosX=posx;updPosY=posy;posx+=this.iconsArray[i].getWidth()}else if(this.position==euUP){updPosX=posx;updPosY=bakHeight-this.iconsArray[i].getHeight();posx+=this.iconsArray[i].getWidth()}else if(this.position==euRIGHT){updPosX=posx;updPosY=posy;posy+=this.iconsArray[i].getHeight()}else if(this.position==euLEFT){updPosX=bakWidth-this.iconsArray[i].getWidth();updPosY=posy;posy+=this.iconsArray[i].getHeight()}else if(this.position==euHORIZONTAL){updPosX=posx;updPosY=(bakHeight-this.iconsArray[i].getHeight())/2;posx+=this.iconsArray[i].getWidth()}else if(this.position==euVERTICAL){updPosX=(bakWidth-this.iconsArray[i].getWidth())/2;updPosY=posy;posy+=this.iconsArray[i].getHeight()}this.iconsArray[i].setPos(updPosX,updPosY);this.iconsArray[i].refresh()}this.setDim(bakWidth,bakHeight);this.refreshDiv()};this.kernel=function(){};this.kernelMouseOver=function(){};this.kernelMouseOut=function(){};this.mouseOut=function(){};this.mouseOver=function(){};this.mouseMove=function(x,y){};this.iconParams=new Array();this.setAllFrameStep=function(step){this.iconParams.frameStep=step;for(var i in this.iconsArray)if(this.iconsArray[i].id)this.iconsArray[i].frameStep=step};this.setAllZoomFunc=function(func){};this.setAllZoomFuncW=function(func){};this.setAllZoomFuncH=function(func){};this.setBar=function(args){var id='euDock_bar_'+euEnv.Kost.next();euEnv.euDockArray[id]=new euDockBar(id,this);euEnv.euDockArray[id].setElements(args);this.bar=euEnv.euDockArray[id];return euEnv.euDockArray[id]};this.addIcon=function(args,params){var i,id=params.id;var id='euDock_icon_'+euEnv.Kost.next();euEnv.euDockArray[id]=new euDockIcon(id,this);euEnv.euDockArray[id].addElement(args);this.iconsArray.push(euEnv.euDockArray[id]);for(i in this.iconParams)euEnv.euDockArray[id][i]=this.iconParams[i];for(i in params)euEnv.euDockArray[id][i]=params[i];return euEnv.euDockArray[id]};this.delIcon=function(elem){euEnv.euDockArray.splice(elem);euEnv.euDockArray[elem.id]=0;for(var i in this.iconsArray)if(this.iconsArray[i]==elem)this.iconsArray.splice(i,1);elem.destroy();elem=null;this.updateDims()}};function euDockIcon(id,dock){this.id=id;this.parentDock=dock;this.elementsArray;this.zoomFuncW=euLinear30;this.zoomFuncH=euLinear30;this.posX=0;this.posY=0;this.width=0;this.height=0;this.frame=0;this.frameStep=0.5;this.fadingFrame=0;this.fadingStep=1;this.fadingType=euTRANSPARENT;this.loaded=false;this.runningFrame=false;this.runningFading=false;this.updateDims=function(){if(!this.loaded)return;for(var i=0;i<this.elementsArray.length;i++)this.elementsArray[i].setProperties(this.posX,this.posY,this.getWidth(),this.getHeight())};this.updateFading=function(){};this.refresh=function(){this.updateDims()};this.isAbsoluteInside=function(x,y){x-=this.getAbsolutePosX();y-=this.getAbsolutePosY();return x>0&&y>0&&x<this.getWidth()&&y<this.getHeight()};this.isInside=function(x,y){return this.isInsideX(x)&&this.isInsideY(y)};this.isInsideX=function(x){return(this.loaded&&(this.posX<=x)&&((this.posX+this.getWidth())>=x))};this.isInsideY=function(y){return(this.loaded&&(this.posY<=y)&&((this.posY+this.getHeight())>=y))};this.retrieveLoadingDims=function(elem,num){if(elem.onLoadPrev)elem.onLoadPrev();if(num==0&&!this.loaded)this.setDim(elem.getWidth(),elem.getHeight());elem.loaded=true;var ret=true;for(var i in this.elementsArray)if(this.elementsArray[i].id)ret&=this.elementsArray[i].loaded;this.loaded=ret;if(this.loaded){this.parentDock.updateDims();for(var i in this.elementsArray)if(this.elementsArray[i].id)this.elementsArray[i].show()}if(elem.onLoadNext)elem.onLoadNext()};this.setPos=function(x,y){this.posX=x;this.posY=y};this.setDim=function(w,h){if(this.width==0)this.width=w;if(this.height==0)this.height=h};this.getAbsolutePosX=function(){return euIdObjLeft(this.parentDock.div)+this.posX};this.getAbsolutePosY=function(){return euIdObjTop(this.parentDock.div)+this.posY};this.setPosX=function(x){this.posX=x};this.setPosY=function(y){this.posY=y};this.getWidth=function(){if(!this.loaded)return 0;var calc=this.width*this.zoomFuncW(this.frame);return 38};this.getHeight=function(){if(!this.loaded)return 0;return 38};this.isRunning=function(){return this.runningFrame||this.runningFading};this.setFrameTo=function(frameTo){if(this.frame==frameTo)this.runningFrame=false;else{this.runningFrame=true;this.frame+=(frameTo-this.frame)*this.frameStep;if(Math.abs(this.frame-frameTo)<0.01)this.frame=frameTo;if(this.frame<0)this.frame=0;if(this.frame>1)this.frame=1}return this.runningFrame};this.addElement=function(args){if(typeof(args)!="undefined"&&args!=null){this.elementsArray=new Array();this.fadingStep=0.5/args.length;for(var i=0;i<args.length;i++)for(var ii in args[i]){var id="euDock_"+ii+"_"+euEnv.Kost.next();euEnv.euDockArray[id]=new window[ii](id,args[i][ii],this.parentDock.div,"euEnv.euDockArray."+this.id+".retrieveLoadingDims(euEnv.euDockArray."+id+","+i+");");this.elementsArray.push(euEnv.euDockArray[id]);euEnv.euDockArray[id].loaded=false}}};this.destroy=function(){for(var i in this.elementsArray)if(this.elementsArray[i].id){euEnv.euDockArray[this.elementsArray[i].id]=0;euEnv.euDockArray.splice(this.elementsArray[i],1);this.elementsArray[i].destroy()}this.elementsArray.splice(0,this.elementsArray.length)};this.mouseClick=function(x,y){if(this.isAbsoluteInside(x,y)){this.mouseInsideClick(x,y,this.id,this.getAbsolutePosX(),this.getAbsolutePosY())}}};function euDockBar(id,dock){this.id=id;this.parentDock=dock;this.elementsArray=new Array();this.len=0;this.align=euUP;this.loaded=false;this.getSize=function(){if(!this.loaded)return 0;if(this.align==euUP||this.align==euDOWN||this.align==euHORIZONTAL)return this.elementsArray.left.getHeight();else return this.elementsArray.top.getWidth()};this.refresh=function(){if(!this.loaded)return;if(this.align==euUP||this.align==euDOWN||this.align==euHORIZONTAL){this.elementsArray.left.setPos(-this.elementsArray.left.getWidth(),0);this.elementsArray.horizontal.setProperties(0,0,Math.round(this.len),this.getSize());this.elementsArray.right.setPos(Math.round(this.len),0);this.elementsArray.left.show();this.elementsArray.horizontal.show();this.elementsArray.right.show();if(this.elementsArray.top)this.elementsArray.top.hide();if(this.elementsArray.bottom)this.elementsArray.bottom.hide();if(this.elementsArray.vertical){this.elementsArray.vertical.setProperties(0,0,0,0);this.elementsArray.vertical.hide()}}else{this.elementsArray.top.setPos(0,-this.elementsArray.top.getHeight());this.elementsArray.vertical.setProperties(0,0,this.getSize(),Math.round(this.len));this.elementsArray.bottom.setPos(0,Math.round(this.len));this.elementsArray.top.show();this.elementsArray.vertical.show();this.elementsArray.bottom.show();if(this.elementsArray.left)this.elementsArray.left.hide();if(this.elementsArray.right)this.elementsArray.right.hide();if(this.elementsArray.horizontal){this.elementsArray.horizontal.setProperties(0,0,0,0);this.elementsArray.horizontal.hide()}}};this.setProperties=function(len,align){this.len=len+1;this.align=align;this.refresh()};this.retrieveLoadingDims=function(elem){if(elem.onLoadPrev)elem.onLoadPrev();elem.loaded=true;var ret=true;for(var i in this.elementsArray)if(this.elementsArray[i].id)ret&=this.elementsArray[i].loaded;this.loaded=ret;if(this.loaded){this.parentDock.updateDims();for(var i in this.elementsArray)if(this.elementsArray[i].id)this.elementsArray[i].show()}if(elem.onLoadNext)elem.onLoadNext()};this.setElements=function(args){if(typeof(args)!="undefined"&&args!=null){for(var i in args)for(var ii in args[i]){var id="euDock_"+ii+"_"+euEnv.Kost.next();euEnv.euDockArray[id]=new window[ii](id,args[i][ii],this.parentDock.divBar,"euEnv.euDockArray."+this.id+".retrieveLoadingDims(euEnv.euDockArray."+id+");");this.elementsArray[i]=euEnv.euDockArray[id];euEnv.euDockArray[id].loaded=false}}}};function euThread(){};function euKernel(){};function on_MouseMove(e){return true};function on_MouseDown(e){return true};function on_MouseUp(e){return true};function on_MouseClick(e){if(!e)var e=window.event;for(var i in euEnv.euDockArray)if(euEnv.euDockArray[i].mouseClick)euEnv.exeThread|=euEnv.euDockArray[i].mouseClick(euEnv.euScrOfX+e.clientX,euEnv.euScrOfY+e.clientY);return true}; | ... | ... |
classesjs/i3geo_tudo_compacto6.js.php
| ... | ... | @@ -285,7 +285,7 @@ if(typeof(i3GEOF)==='undefined'){var i3GEOF={}}i3GEO.login={divnomelogin:"i3GEON |
| 285 | 285 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.marcador={prompt:function(){i3GEO.janela.prompt($trad("x77"),i3GEO.marcador.armazena,"")},armazena:function(){var cookies=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),ext=i3GEO.parametros.mapexten,nome="Marcador",valor;if($i("i3GEOjanelaprompt")){nome=$i("i3GEOjanelaprompt").value}valor=nome+"|"+ext;if(cookies){cookies+=":"}else{cookies=""}valor=cookies+valor;i3GEO.util.insereCookie("marcadoresDoI3Geo",valor,365);i3GEO.marcador.redesenha()},redesenha:function(){var m=i3GEOoMenuBar.getMenu("i3GeoMenuMarcador");m.clearContent();m.addItems(i3GEO.marcador.itensMenu());m.render()},exporta:function(){var c=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),texto;if(!c){c=""}texto="<p class=paragrafo >"+$trad("x78")+"</p><div class='i3geoForm i3geoFormIconeEdita' ><input type=text value='"+c+"' onclick='javascript:this.select()'/></div>";i3GEO.janela.mensagemSimples(texto,$trad("x79"))},exportaShp:function(){var c=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),temp=function(retorno){i3GEO.temaAtivo=retorno.data;i3GEO.atualiza()};if(c){i3GEO.php.marcadores2shp(temp)}},importa:function(){var temp=function(){var cookies=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),novos="";if($i("i3GEOjanelaprompt")){novos=$i("i3GEOjanelaprompt").value}if(cookies){cookies+=":"}else{cookies=""}novos=cookies+novos;i3GEO.util.insereCookie("marcadoresDoI3Geo",novos,365);i3GEO.marcador.redesenha()};i3GEO.janela.prompt($trad("x83"),temp,"")},remove:function(nomeMarcador){var cookie=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),valores=cookie.split(":"),n=valores.length,i,temp,novos=[];for(i=0;i<n;i++){temp=valores[i].split("|");if(temp[0]&&temp[0]!==nomeMarcador){novos.push(valores[i])}}i3GEO.util.insereCookie("marcadoresDoI3Geo",novos.join(":"),365);i3GEO.marcador.redesenha()},recuperaZoom:function(nomeMarcador){var cookie=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),valores=cookie.split(":"),n=valores.length,i,temp;for(i=0;i<n;i++){temp=valores[i].split("|");if(temp[0]&&temp[0]===nomeMarcador){i3GEO.navega.zoomExt("","","",temp[1]);return}}},adicionaMenuSuspenso:function(obj){obj.menu.push({nome:$trad("x79"),id:"i3GeoMenuMarcador"});obj.submenus.i3GeoMenuMarcador=i3GEO.marcador.itensMenu();return obj},itensMenu:function(){var itens=[],cookie=i3GEO.util.pegaCookie("marcadoresDoI3Geo"),valores,n,i,temp;itens.push({id:"omenudataMarcadorSalva",text:$trad("x82"),url:"javascript:i3GEO.marcador.prompt()"},{id:"omenudataMarcadorExporta",text:$trad("x80"),url:"javascript:i3GEO.marcador.exporta()"},{id:"omenudataMarcadorImporta",text:$trad("x81"),url:"javascript:i3GEO.marcador.importa()"},{id:"omenudataMarcadorExportaShp",text:$trad("x84"),url:"javascript:i3GEO.marcador.exportaShp()"});if(cookie){valores=cookie.split(":");n=valores.length;for(i=0;i<n;i++){temp=valores[i].split("|");if(temp.length===2){itens.push({id:"omenudataMarcador"+i,text:"<img title='"+$trad("x62")+"' src='"+i3GEO.configura.locaplic+"/imagens/branco.gif' class=x onclick='i3GEO.marcador.remove(\""+temp[0]+"\")' /> <span style='color:blue;background-color:white;'>"+temp[0]+"</span>",url:"javascript:i3GEO.marcador.recuperaZoom('"+temp[0]+"')"})}}}return itens}}; |
| 286 | 286 | // |
| 287 | 287 | //compactados/classe_plugini3geo_compacto.js |
| 288 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.pluginI3geo={OBJETOS:{},PLUGINS:[{"classe":"heatmap","nome":"Mapa de calor","editor":true},{"classe":"markercluster","nome":"Agrupamento de pontos (cluster)","editor":true},{"classe":"layerkml","nome":"Camada Kml","editor":true},{"classe":"parametrossql","nome":"SQL parametrizado","editor":true}],inicia:function(camada){if(i3GEO.janela){i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardePlugin","Plugin...");i3GEO.janela.AGUARDEMODAL=false}i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].inicia(camada)},formAdmin:function(plugin,configString){return i3GEO.pluginI3geo[plugin].formAdmin(configString)},iconeArvoreDeCamadas:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){return i3GEO.pluginI3geo[camada.plugini3geo.plugin].iconeArvoreDeCamadas(camada.name)}else{return false}},linkAjuda:function(plugin){return i3GEO.pluginI3geo[plugin].linkAjuda()},ligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada();return true}return false},desligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada();return true}return false},removeCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada();delete(i3GEO.pluginI3geo.OBJETOS[nomecamada]);return true}return false},atualizaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada();return true}return false},existeObjeto:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){return true}return false},aplicaPropriedades:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){camada=i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].aplicaPropriedades(camada)}return camada},heatmap:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"heatmap","parametros":{"tipoGradiente": "default","valorPonto":1,"coluna":"","radius":15}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="heatmap"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Coluna que contém os dados:"+"<br><input name='coluna' type='text' value='"+parametros.coluna+"' size='30'></p>"+"<p>Ou valor numérico para cada ponto:"+"<br><input name='valorPonto' type='text' value='"+parametros.valorPonto+"' size='30'></p>"+"<p>Raio de cada ponto em pixels:"+"<br><input name='radius' type='text' value='"+parametros.radius+"' size='30'></p>"+"<p>Tipo de gradiente (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoGradiente' type='text' value='"+parametros.tipoGradiente+"' size='30'></p>"+"<p>Para definir os cortes no gradiente de cores utilize valores entre 0 e 1."+" As cores são definidas nas classes do LAYER, sendo que o nome define o valor superior do gradiente e COLOR define a cor."+" Veja o exemplo utilizado no tema _lmapadecalor.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var heatmap,pontos;heatmap=new HeatmapOverlay(i3GeoMap,camada.name,{"radius":camada.plugini3geo.parametros.radius,"visible":true,"opacity":camada.transparency,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}});pontos={max:camada.plugini3geo.parametros.max,data:heatmap_dados};i3GEO.janela.fechaAguarde("aguardePlugin");heatmap.setDataSet(pontos);heatmap.ligaCamada=function(){this.liga()};heatmap.desLigaCamada=function(){this.desliga()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.draw()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;heatmap_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var temp,heatmap,transformedTestData={max:1,data:[]},data=heatmap_dados,datalen=heatmap_dados.length,nudata=[],max=0;if(!objMapa){objMapa=i3geoOL}while(datalen--){temp=heatmap_dados[datalen].count;nudata.push({lonlat:new OpenLayers.LonLat(data[datalen].lng,heatmap_dados[datalen].lat),count:temp});max=Math.max(max,temp)}transformedTestData.max=max;transformedTestData.data=nudata;heatmap=new OpenLayers.Layer.Heatmap(camada.name,objMapa,objMapa.baseLayer,{"visible":true,"opacity":camada.transparency,"radius":camada.plugini3geo.parametros.radius,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}},{isBaseLayer:false,projection:new OpenLayers.Projection("EPSG:4326"),displayInLayerSwitcher:true});heatmap.ligaCamada=function(){this.toggle();this.updateLayer()};heatmap.desLigaCamada=function(){this.toggle();this.updateLayer()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.updateLayer()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;objMapa.addLayer(heatmap);heatmap.setDataSet(transformedTestData);heatmap_dados=null;if(i3GEO.janela){i3GEO.janela.fechaAguarde("aguardePlugin")}};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}if(!i3GEO.configura||!i3GEO.configura.sid){i3GEO.configura.sid=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},googleearth:{inicia:function(){alert("Plugin nao disponivel")}}},markercluster:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"markercluster","parametros":{"tipoEstilos": "default","gridSize":50}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="markercluster"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Distância máxima entre ponto em pixels:"+"<br><input name='gridSize' type='text' value='"+parametros.gridSize+"' size='30'></p>"+"<p>Tipo de estilos (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoEstilos' type='text' value='"+parametros.tipoEstilos+"' size='30'></p>"+"<p>Os símbolos utilizados podem ser customizados alterando-se as classes do Mapfile</p>"+"<p>Veja o exemplo utilizado no tema _lmapadecluster.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var markercluster,marcas,latLng,marker,n,i;n=markercluster_dados.length;marcas=[];for(i=0;i<n;i++){latLng=new google.maps.LatLng(markercluster_dados[i].lat,markercluster_dados[i].lng);marker=new google.maps.Marker({'position':latLng,icon:{url:markercluster_config.ponto.url,scaledSize:new google.maps.Size(markercluster_config.ponto.width,markercluster_config.ponto.height)}});marcas.push(marker)}markercluster=new MarkerClusterer(i3GeoMap,marcas,{"gridSize":parseInt(camada.plugini3geo.parametros.gridSize,10),"visible":true,"opacity":camada.transparency,"name":camada.name,"styles":markercluster_config.estilos});i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=false;i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].clearMarkers();i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var layerListeners,logMax,logMin,classes,min,max,markercluster,marcas,lonlat,n,i,style,nestilos,intervalo,regra,regras=[];nestilos=markercluster_config.estilos.length;n=markercluster_dados.length;classes=Array();logMax=Math.log(n)/Math.LN10; logMin=Math.log(1)/Math.LN10;intervalo=(logMax-logMin)/nestilos;for(i=0;i<nestilos;i++){if(i==0){classes[i]=logMin}else{classes[i]=classes[i-1]+intervalo}}classes=classes.map(function(x){return Math.pow(10,x)});classes.push(n);regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN,property:"count",value:2}),symbolizer:{externalGraphic:markercluster_config.ponto.url,graphicWidth:markercluster_config.ponto.width,graphicHeight:markercluster_config.ponto.height,graphicYOffset:(markercluster_config.ponto.height/2)*-1}});regras.push(regra);min=2;for(i=0;i<nestilos;i++){max=classes[i+1];regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN,property:"count",lowerBoundary:min,upperBoundary:max}),symbolizer:{externalGraphic:markercluster_config.estilos[i].url,graphicWidth:markercluster_config.estilos[i].width,graphicHeight:markercluster_config.estilos[i].height,label:"${count}",labelOutlineWidth:1,fontColor:"#000000",fontOpacity:1,fontSize:"12px"}});regras.push(regra);min=max}style=new OpenLayers.Style(null,{rules:regras});if(!objMapa){objMapa=i3geoOL}layerListeners={featureclick:function(e){if(e.feature.cluster.length>1){objMapa.setCenter([e.feature.geometry.x,e.feature.geometry.y],objMapa.getZoom()+1,false,false)}return false}};markercluster=new OpenLayers.Layer.Vector(camada.name,{renderers:['Canvas','SVG'],strategies:[new OpenLayers.Strategy.AnimatedCluster({distance:parseInt(camada.plugini3geo.parametros.gridSize,10)})],styleMap:new OpenLayers.StyleMap(style),eventListeners:layerListeners});objMapa.addLayer(markercluster);marcas=[];for(i=0;i<n;i++){lonlat=new OpenLayers.LonLat(markercluster_dados[i].lng,markercluster_dados[i].lat);if(i3GEO.Interface.openlayers.googleLike===true){lonlat.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"))}marcas.push(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(lonlat.lon,lonlat.lat)))}markercluster.addFeatures(marcas);i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}}},layerkml:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"layerkml","parametros":{"url": ""}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="layerkml"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+="<p>Url do arquivo Kml:<br><input name='url' type='text' value='"+parametros.url+"'/></p>"+"<p>Veja o exemplo utilizado no tema _lmapakml.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var layerkml=new google.maps.KmlLayer(camada.plugini3geo.parametros.url,{map:i3GeoMap,preserveViewport:true,name:camada.name});i3GEO.janela.fechaAguarde("aguardePlugin");layerkml.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};layerkml.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null)};layerkml.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true)};layerkml.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var layerkml;url=i3GEO.configura.locaplic+"/classesphp/proxy.php?url="+camada.plugini3geo.parametros.url;layerkml=new OpenLayers.Layer.Vector(camada.name,{displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true,strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP({url:url,format:new OpenLayers.Format.KML({extractStyles:true,extractAttributes:true,maxDepth:5})})});i3geoOL.addLayer(layerkml);if(!objMapa){objMapa=i3geoOL}layerkml.div.onclick=function(e){var targ="",id,temp,features,n,i,j="",html="";if(!e){e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.id){temp=targ.id.split("_Point");if(temp[0]==="OpenLayers_Geometry"){id=targ.id;temp=i3geoOL.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}};i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;layerkml.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};layerkml.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}}},parametrossql:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=127"},formAdmin:function(config){var n,i,parametros,ins="",configDefault='{"plugin":"parametrossql","ativo":"sim","parametros":[{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""}]}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="parametrossql"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;n=4;if(config.ativo==undefined){config.ativo="sim"}ins+="<p class='paragrafo'>Abre o formulário quando a camada é adicionada ao mapa: (true ou false)</p>";ins+="<select style='width:200px' id='parametrosSqlAtivo' ><option value='' ></option>";if(config.ativo==="nao"){ins+="<option value=sim >sim</option><option value=nao selected >nao</option></select>"}else{ins+="<option value=sim selected >sim</option><option value=nao >nao</option></select>"}ins+="<table><tr><td>Título</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>";for(i=0;i<n;i++){ins+="<tr><td><input name='titulo' type=text size=20 value='"+parametros[i].titulo+"' /></td>"+"<td><input name='chave' type=text size=20 value='"+parametros[i].chave+"' /></td>"+"<td><input name='tipo' type=text size=20 value='"+parametros[i].tipo+"' /></td> "+"<td><input name='valores' type=text size=20 value='"+parametros[i].valores+"' /></td> "+"<td><input name='prog' type=text size=20 value='"+parametros[i].prog+"' /></td> "+"<td></tr>"}ins+="</table>"+"<p class='paragrafo'>As chaves são palavras que devem existir no SQL definido em DATA e/ou no filtro (FILTER)."+"<br>O usuário irá fornecer os valores que serão então utilizados para substituir as chaves de forma dinâmica"+"<br>Será mostrado ao usuário um formulário com opções. Cada opção conterá um título e um campo de formulário"+"<br>Cada campo de formulário pode ser dos tipos input (para digitar um valor) ou select (caixa de opções)."+"<br>Em valores deve ser definida a lista ou o valor default que será mostrado. No caso de listas, utilize vírgula para separar os valores."+"<br>Em ativo, é indicado com sim ou nao se o formulário será aberto quando a camada for adicionada ao mapa."+"<br>Como opcional, pode ser definido o endereço de um programa PHP que retorna a lista de nomes e valores que serão utilizados para preencher "+"o campo de escolha. Para mais informações, veja o mapfile i3geo/temas/_llocaliphp.map. O caminho desse arquivo PHP é relativo à pasta i3geo.";return ins},parametrosFormAdmin:function(onde){var campo=0,nlinhas=4,ncampos=5,campos=onde.getElementsByTagName("input"),par=[],temp=[],i,j;for(j=0;j<nlinhas;j++){temp=[];for(i=0;i<ncampos;i++){if(campos[campo]&&campos[campo].name!=""){temp.push('"'+campos[campo].name+'" : "'+campos[campo].value+'"')}campo++}par.push("{"+temp.join(",")+"}")}return'{"plugin":"parametrossql","ativo":"'+$i("parametrosSqlAtivo").value+'","parametros":['+par.join(",")+']}'},iconeArvoreDeCamadas:function(nomecamada){var icone="<img "+"class='pluginParametrossql'"+" onclick='i3GEO.util.animaClique(this);"+"i3GEO.pluginI3geo.parametrossql.buscaParForm(\""+nomecamada+"\")"+"' title='Variaveis'"+"' src='"+i3GEO.configura.locaplic+"/imagens/branco.gif"+"'/>";return icone},buscaParForm:function(nomecamada){var p,cp,temp;temp=function(retorno){retorno.data.ativo="sim";var camada=i3GEO.arvoreDeCamadas.pegaTema(nomecamada);camada.plugini3geo=retorno.data;i3GEO.pluginI3geo.parametrossql.inicia(camada)};p=i3GEO.configura.locaplic+"/ferramentas/parametrossql/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=PARAMETROSPLUGIN&name="+nomecamada;cp=new cpaint();cp.set_response_type("JSON");cp.call(p,"foo",temp)},inicia:function(camada){i3GEO.janela.fechaAguarde("aguardePlugin");var iniciaform=function(){i3GEOF.parametrossql.iniciaJanelaFlutuante(camada)};i3GEO.util.scriptTag((i3GEO.configura.locaplic+"/ferramentas/parametrossql/dependencias.php"),iniciaform,"parametrossql_script")},googlemaps:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada}},openlayers:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada}}}}; | |
| 288 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.pluginI3geo={OBJETOS:{},PLUGINS:[{"classe":"heatmap","nome":"Mapa de calor","editor":true},{"classe":"markercluster","nome":"Agrupamento de pontos (cluster)","editor":true},{"classe":"layerkml","nome":"Camada Kml","editor":true},{"classe":"parametrossql","nome":"SQL parametrizado","editor":true}],inicia:function(camada){if(i3GEO.janela){i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardePlugin","Plugin...");i3GEO.janela.AGUARDEMODAL=false}i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].inicia(camada)},formAdmin:function(plugin,configString){return i3GEO.pluginI3geo[plugin].formAdmin(configString)},iconeArvoreDeCamadas:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){return i3GEO.pluginI3geo[camada.plugini3geo.plugin].iconeArvoreDeCamadas(camada.name)}else{return false}},linkAjuda:function(plugin){return i3GEO.pluginI3geo[plugin].linkAjuda()},ligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].ligaCamada();return true}return false},desligaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].desLigaCamada();return true}return false},removeCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].removeCamada();delete(i3GEO.pluginI3geo.OBJETOS[nomecamada]);return true}return false},atualizaCamada:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada();return true}return false},existeObjeto:function(nomecamada){if(i3GEO.pluginI3geo.OBJETOS[nomecamada]&&i3GEO.pluginI3geo.OBJETOS[nomecamada].atualizaCamada){return true}return false},aplicaPropriedades:function(camada){if(camada.plugini3geo&&camada.plugini3geo!=""){camada=i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL].aplicaPropriedades(camada)}return camada},layerMashup:function(Interface,camada,epsg){if(camada.plugini3geo&&camada.plugini3geo!=""&&i3GEO.pluginI3geo[camada.plugini3geo.plugin][Interface].layerMashup){return i3GEO.pluginI3geo[camada.plugini3geo.plugin][Interface].layerMashup(camada,epsg)}else{return false}},heatmap:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"heatmap","parametros":{"tipoGradiente": "default","valorPonto":1,"coluna":"","radius":15}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="heatmap"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Coluna que contém os dados:"+"<br><input name='coluna' type='text' value='"+parametros.coluna+"' size='30'></p>"+"<p>Ou valor numérico para cada ponto:"+"<br><input name='valorPonto' type='text' value='"+parametros.valorPonto+"' size='30'></p>"+"<p>Raio de cada ponto em pixels:"+"<br><input name='radius' type='text' value='"+parametros.radius+"' size='30'></p>"+"<p>Tipo de gradiente (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoGradiente' type='text' value='"+parametros.tipoGradiente+"' size='30'></p>"+"<p>Para definir os cortes no gradiente de cores utilize valores entre 0 e 1."+" As cores são definidas nas classes do LAYER, sendo que o nome define o valor superior do gradiente e COLOR define a cor."+" Veja o exemplo utilizado no tema _lmapadecalor.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var heatmap,pontos;heatmap=new HeatmapOverlay(i3GeoMap,camada.name,{"radius":camada.plugini3geo.parametros.radius,"visible":true,"opacity":camada.transparency,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}});pontos={max:camada.plugini3geo.parametros.max,data:heatmap_dados};i3GEO.janela.fechaAguarde("aguardePlugin");heatmap.setDataSet(pontos);heatmap.ligaCamada=function(){this.liga()};heatmap.desLigaCamada=function(){this.desliga()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.draw()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;heatmap_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="heatmap_script",p=i3GEO.configura.locaplic+"/ferramentas/heatmap/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var temp,heatmap,transformedTestData={max:1,data:[]},data=heatmap_dados,datalen=heatmap_dados.length,nudata=[],max=0;if(!objMapa){objMapa=i3geoOL}while(datalen--){temp=heatmap_dados[datalen].count;nudata.push({lonlat:new OpenLayers.LonLat(data[datalen].lng,heatmap_dados[datalen].lat),count:temp});max=Math.max(max,temp)}transformedTestData.max=max;transformedTestData.data=nudata;heatmap=new OpenLayers.Layer.Heatmap(camada.name,objMapa,objMapa.baseLayer,{"visible":true,"opacity":camada.transparency,"radius":camada.plugini3geo.parametros.radius,"gradient":heatmap_config.gradient,"legend":{"title":camada.tema,"position":"bl","offset":[5,50]}},{isBaseLayer:false,projection:new OpenLayers.Projection("EPSG:4326"),displayInLayerSwitcher:true});heatmap.ligaCamada=function(){this.toggle();this.updateLayer()};heatmap.desLigaCamada=function(){this.toggle();this.updateLayer()};heatmap.removeCamada=function(){this.destroy()};heatmap.atualizaCamada=function(){this.updateLayer()};i3GEO.pluginI3geo.OBJETOS[camada.name]=heatmap;objMapa.addLayer(heatmap);heatmap.setDataSet(transformedTestData);heatmap_dados=null;if(i3GEO.janela){i3GEO.janela.fechaAguarde("aguardePlugin")}};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}if(!i3GEO.configura||!i3GEO.configura.sid){i3GEO.configura.sid=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&coluna="+camada.plugini3geo.parametros.coluna+"&tipoGradiente="+camada.plugini3geo.parametros.tipoGradiente+"&g_sid="+i3GEO.configura.sid+"&nomevariavel=heatmap_dados&nomevariavelConfig=heatmap_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},googleearth:{inicia:function(){alert("Plugin nao disponivel")}}},markercluster:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"markercluster","parametros":{"tipoEstilos": "default","gridSize":50}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="markercluster"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+=""+"<p>Distância máxima entre ponto em pixels:"+"<br><input name='gridSize' type='text' value='"+parametros.gridSize+"' size='30'></p>"+"<p>Tipo de estilos (deixe vazio para utilizar as classes definidas no Layer ou escreva 'default' para usar o normal):"+"<br><input name='tipoEstilos' type='text' value='"+parametros.tipoEstilos+"' size='30'></p>"+"<p>Os símbolos utilizados podem ser customizados alterando-se as classes do Mapfile</p>"+"<p>Veja o exemplo utilizado no tema _lmapadecluster.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/googlemaps_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var markercluster,marcas,latLng,marker,n,i;n=markercluster_dados.length;marcas=[];for(i=0;i<n;i++){latLng=new google.maps.LatLng(markercluster_dados[i].lat,markercluster_dados[i].lng);marker=new google.maps.Marker({'position':latLng,icon:{url:markercluster_config.ponto.url,scaledSize:new google.maps.Size(markercluster_config.ponto.width,markercluster_config.ponto.height)}});marcas.push(marker)}markercluster=new MarkerClusterer(i3GeoMap,marcas,{"gridSize":parseInt(camada.plugini3geo.parametros.gridSize,10),"visible":true,"opacity":camada.transparency,"name":camada.name,"styles":markercluster_config.estilos});i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=false;i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].clearMarkers();i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].ready_=true;i3GEO.pluginI3geo.OBJETOS[camada.name].redraw();i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var nomeScript="markercluster_script",p=i3GEO.configura.locaplic+"/ferramentas/markercluster/openlayers_js.php",carregaJs="nao",criaLayer;criaLayer=function(){var layerListeners,logMax,logMin,classes,min,max,markercluster,marcas,lonlat,n,i,style,nestilos,intervalo,regra,regras=[];nestilos=markercluster_config.estilos.length;n=markercluster_dados.length;classes=Array();logMax=Math.log(n)/Math.LN10; logMin=Math.log(1)/Math.LN10;intervalo=(logMax-logMin)/nestilos;for(i=0;i<nestilos;i++){if(i==0){classes[i]=logMin}else{classes[i]=classes[i-1]+intervalo}}classes=classes.map(function(x){return Math.pow(10,x)});classes.push(n);regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.LESS_THAN,property:"count",value:2}),symbolizer:{externalGraphic:markercluster_config.ponto.url,graphicWidth:markercluster_config.ponto.width,graphicHeight:markercluster_config.ponto.height,graphicYOffset:(markercluster_config.ponto.height/2)*-1}});regras.push(regra);min=2;for(i=0;i<nestilos;i++){max=classes[i+1];regra=new OpenLayers.Rule({filter:new OpenLayers.Filter.Comparison({type:OpenLayers.Filter.Comparison.BETWEEN,property:"count",lowerBoundary:min,upperBoundary:max}),symbolizer:{externalGraphic:markercluster_config.estilos[i].url,graphicWidth:markercluster_config.estilos[i].width,graphicHeight:markercluster_config.estilos[i].height,label:"${count}",labelOutlineWidth:1,fontColor:"#000000",fontOpacity:1,fontSize:"12px"}});regras.push(regra);min=max}style=new OpenLayers.Style(null,{rules:regras});if(!objMapa){objMapa=i3geoOL}layerListeners={featureclick:function(e){if(e.feature.cluster.length>1){objMapa.setCenter([e.feature.geometry.x,e.feature.geometry.y],objMapa.getZoom()+1,false,false)}return false}};markercluster=new OpenLayers.Layer.Vector(camada.name,{renderers:['Canvas','SVG'],strategies:[new OpenLayers.Strategy.AnimatedCluster({distance:parseInt(camada.plugini3geo.parametros.gridSize,10)})],styleMap:new OpenLayers.StyleMap(style),eventListeners:layerListeners});objMapa.addLayer(markercluster);marcas=[];for(i=0;i<n;i++){lonlat=new OpenLayers.LonLat(markercluster_dados[i].lng,markercluster_dados[i].lat);if(i3GEO.Interface.openlayers.googleLike===true){lonlat.transform(new OpenLayers.Projection("EPSG:4326"),new OpenLayers.Projection("EPSG:900913"))}marcas.push(new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(lonlat.lon,lonlat.lat)))}markercluster.addFeatures(marcas);i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;markercluster.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};markercluster.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};markercluster.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=markercluster;markercluster_dados=null};if(!$i(nomeScript)){carregaJs="sim"}else{nomeScript=""}p+="?carregajs="+carregaJs+"&layer="+camada.name+"&g_sid="+i3GEO.configura.sid+"&tipoEstilos="+camada.plugini3geo.parametros.tipoEstilos+"&nomevariavel=markercluster_dados&nomevariavelConfig=markercluster_config";i3GEO.util.scriptTag(p,criaLayer,nomeScript)}}},layerkml:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=121"},formAdmin:function(config){var parametros,ins="",configDefault='{"plugin":"layerkml","parametros":{"url": ""}}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="layerkml"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;ins+="<p>Url do arquivo Kml:<br><input name='url' type='text' value='"+parametros.url+"'/></p>"+"<p>Veja o exemplo utilizado no tema _lmapakml.map</p>";return ins},iconeArvoreDeCamadas:function(nomecamada){return false},googlemaps:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada){var layerkml=new google.maps.KmlLayer(camada.plugini3geo.parametros.url,{map:i3GeoMap,preserveViewport:true,name:camada.name});i3GEO.janela.fechaAguarde("aguardePlugin");layerkml.ligaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};layerkml.desLigaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null)};layerkml.removeCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true)};layerkml.atualizaCamada=function(){i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(null);i3GEO.pluginI3geo.OBJETOS[camada.name].resetViewport(true);i3GEO.pluginI3geo.OBJETOS[camada.name].setMap(i3GeoMap)};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}},openlayers:{aplicaPropriedades:function(camada){camada.sel="nao";camada.download="nao";camada.AGUARDALEGENDA=false;camada.temporizador="";camada.copia=false;camada.procurar=false;camada.toponimia=false;camada.etiquetas=false;camada.tabela=false;camada.grafico=false;camada.destacar=false;camada.wms=false;camada.classe="NAO";return camada},inicia:function(camada,objMapa){var layerkml;url=i3GEO.configura.locaplic+"/classesphp/proxy.php?url="+camada.plugini3geo.parametros.url;layerkml=new OpenLayers.Layer.Vector(camada.name,{displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true,strategies:[new OpenLayers.Strategy.Fixed()],protocol:new OpenLayers.Protocol.HTTP({url:url,format:new OpenLayers.Format.KML({extractStyles:true,extractAttributes:true,maxDepth:5})})});i3geoOL.addLayer(layerkml);if(!objMapa){objMapa=i3geoOL}layerkml.div.onclick=function(e){var targ="",id,temp,features,n,i,j="",html="";if(!e){e=window.event}if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.id){temp=targ.id.split("_Point");if(temp[0]==="OpenLayers_Geometry"){id=targ.id;temp=i3geoOL.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3geoOL.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}};i3GEO.janela.fechaAguarde("aguardePlugin");i3GEO.eventos.cliquePerm.ativo=false;layerkml.ligaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};layerkml.desLigaCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.removeCamada=function(){i3GEO.eventos.cliquePerm.ativo=true};layerkml.atualizaCamada=function(){i3GEO.eventos.cliquePerm.ativo=false};i3GEO.pluginI3geo.OBJETOS[camada.name]=layerkml}}},parametrossql:{linkAjuda:function(){return i3GEO.configura.locaplic+"/ajuda_usuario.php?idcategoria=3&idajuda=127"},formAdmin:function(config){var n,i,parametros,ins="",configDefault='{"plugin":"parametrossql","ativo":"sim","parametros":[{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""},{"titulo":"","tipo":"input","valores":[],"chave":"","prog":""}]}';if(config===""){config=configDefault}config=YAHOO.lang.JSON.parse(config);if(config.plugin!="parametrossql"){config=YAHOO.lang.JSON.parse(configDefault)}parametros=config.parametros;n=4;if(config.ativo==undefined){config.ativo="sim"}ins+="<p class='paragrafo'>Abre o formulário quando a camada é adicionada ao mapa: (true ou false)</p>";ins+="<select style='width:200px' id='parametrosSqlAtivo' ><option value='' ></option>";if(config.ativo==="nao"){ins+="<option value=sim >sim</option><option value=nao selected >nao</option></select>"}else{ins+="<option value=sim selected >sim</option><option value=nao >nao</option></select>"}ins+="<table><tr><td>Título</td><td>Chave</td><td>Tipo (input ou select)</td><td>Valores</td><td>PHP que retorna os valores (opcional)</td></tr>";for(i=0;i<n;i++){ins+="<tr><td><input name='titulo' type=text size=20 value='"+parametros[i].titulo+"' /></td>"+"<td><input name='chave' type=text size=20 value='"+parametros[i].chave+"' /></td>"+"<td><input name='tipo' type=text size=20 value='"+parametros[i].tipo+"' /></td> "+"<td><input name='valores' type=text size=20 value='"+parametros[i].valores+"' /></td> "+"<td><input name='prog' type=text size=20 value='"+parametros[i].prog+"' /></td> "+"<td></tr>"}ins+="</table>"+"<p class='paragrafo'>As chaves são palavras que devem existir no SQL definido em DATA e/ou no filtro (FILTER)."+"<br>O usuário irá fornecer os valores que serão então utilizados para substituir as chaves de forma dinâmica"+"<br>Será mostrado ao usuário um formulário com opções. Cada opção conterá um título e um campo de formulário"+"<br>Cada campo de formulário pode ser dos tipos input (para digitar um valor) ou select (caixa de opções)."+"<br>Em valores deve ser definida a lista ou o valor default que será mostrado. No caso de listas, utilize vírgula para separar os valores."+"<br>Em ativo, é indicado com sim ou nao se o formulário será aberto quando a camada for adicionada ao mapa."+"<br>Como opcional, pode ser definido o endereço de um programa PHP que retorna a lista de nomes e valores que serão utilizados para preencher "+"o campo de escolha. Para mais informações, veja o mapfile i3geo/temas/_llocaliphp.map. O caminho desse arquivo PHP é relativo à pasta i3geo.";return ins},parametrosFormAdmin:function(onde){var campo=0,nlinhas=4,ncampos=5,campos=onde.getElementsByTagName("input"),par=[],temp=[],i,j;for(j=0;j<nlinhas;j++){temp=[];for(i=0;i<ncampos;i++){if(campos[campo]&&campos[campo].name!=""){temp.push('"'+campos[campo].name+'" : "'+campos[campo].value+'"')}campo++}par.push("{"+temp.join(",")+"}")}return'{"plugin":"parametrossql","ativo":"'+$i("parametrosSqlAtivo").value+'","parametros":['+par.join(",")+']}'},iconeArvoreDeCamadas:function(nomecamada){var icone="<img class='pluginParametrossql' "+"onclick='i3GEO.util.animaClique(this);"+"i3GEO.pluginI3geo.parametrossql.buscaParForm(\""+nomecamada+"\");return false;'"+"title='Variaveis' "+"src='"+i3GEO.configura.locaplic+"/imagens/branco.gif' />";return icone},buscaParForm:function(nomecamada){var p,cp,temp,s;temp=function(retorno){var camada;retorno.data.ativo="sim";if(i3GEO.arvoreDeCamadas){camada=i3GEO.arvoreDeCamadas.pegaTema(nomecamada);camada.plugini3geo=retorno.data}else{camada={plugini3geo:retorno.data,name:nomecamada}}i3GEO.pluginI3geo.parametrossql.inicia(camada)};s=i3GEO.configura.sid;if(s===undefined){s=""}p=i3GEO.configura.locaplic+"/ferramentas/parametrossql/exec.php?g_sid="+s+"&funcao=PARAMETROSPLUGIN&tema="+nomecamada;cp=new cpaint();cp.set_response_type("JSON");cp.call(p,"foo",temp)},inicia:function(camada){i3GEO.janela.fechaAguarde("aguardePlugin");var iniciaform=function(){i3GEOF.parametrossql.iniciaJanelaFlutuante(camada)};i3GEO.util.scriptTag((i3GEO.configura.locaplic+"/ferramentas/parametrossql/dependencias.php"),iniciaform,"parametrossql_script")},googlemaps:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada}},openlayers:{inicia:function(camada){i3GEO.pluginI3geo.parametrossql.inicia(camada)},aplicaPropriedades:function(camada){return camada},layerMashup:function(camada,epsg){var p;p=new OpenLayers.Layer.WMS(camada.tema,"http://localhost/i3geo/ogc.php?tema="+camada.name+"&",{layers:camada.name,SRS:'EPSG:'+epsg,FORMAT:'image/png'},{singleTile:false,isBaseLayer:false,visibility:true,plugini3geo:"parametrossql"});return p}}}}; | |
| 289 | 289 | // |
| 290 | 290 | //compactados/euDock.2.0.js |
| 291 | 291 | if(!euEnv)var euEnv=new Array();euEnv.Kost=new Array();euEnv.Kost.num=0;euEnv.Kost.next=function(){return this.num++};euEnv.euDockArray=new Array();euEnv.refreshTime=35;euEnv.exeThread=true;euEnv.exeThreadWhiteLoop=0;euEnv.x=0;euEnv.y=0;euEnv.mouseMoved=false;var euUP=1;var euDOWN=2;var euLEFT=3;var euRIGHT=4;var euICON=5;var euMOUSE=6;var euSCREEN=7;var euOBJECT=8;var euABSOLUTE=9;var euRELATIVE=10;var euHORIZONTAL=11;var euVERTICAL=12;var euCENTER=13;var euTRANSPARENT=14;var euFIXED=15;var euOPAQUE=16;function euIdObjTop(euObj){var ret=euObj.offsetTop;while((euObj=euObj.offsetParent)!=null)ret+=euObj.offsetTop;return ret};function euIdObjLeft(euObj){var ret=euObj.offsetLeft;while((euObj=euObj.offsetParent)!=null)ret+=euObj.offsetLeft;return ret};function isEuInside(euObj,x,y){var euTop=euIdObjTop(euObj);var euLeft=euIdObjLeft(euObj);return((euTop<=y&&(euTop+euObj.offsetHeight)>=y)&&(euLeft<=x&&(euLeft+euObj.offsetWidth)>=x))};function euDimensioni(){if(typeof(window.innerWidth)=='number'){euEnv.euFrameWidth=window.innerWidth-16;euEnv.euFrameHeight=window.innerHeight}else if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){euEnv.euFrameWidth=document.documentElement.clientWidth-16;euEnv.euFrameHeight=document.documentElement.clientHeight}else if(document.body&&(document.body.clientWidth||document.body.clientHeight)){euEnv.euFrameWidth=document.body.clientWidth;euEnv.euFrameHeight=document.body.clientHeight}};function offsEut(){euEnv.euScrOfY=0;euEnv.euScrOfX=0;if(typeof(window.pageYoffsEut)=='number'){euEnv.euScrOfY=window.pageYoffsEut;euEnv.euScrOfX=window.pageXoffsEut}else if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){euEnv.euScrOfY=document.body.scrollTop;euEnv.euScrOfX=document.body.scrollLeft}else if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){euEnv.euScrOfY=document.documentElement.scrollTop;euEnv.euScrOfX=document.documentElement.scrollLeft}};function euKostFunc30(x){return 0.3};function euKostFunc100(x){return 1};function euLinear(x){return x};function euLinear30(x){var r=1*(x+(1-x)*0.3);return r};function euLinear20(x){return x+(1-x)*0.2};function euExp30(x){return euLinear30(x*x*x)};function euLinear50(x){return x+(1-x)*0.5};function euHarmonic(x){return euLinear30((1-Math.cos(Math.PI*x))/2)};function euSemiHarmonic(x){return euLinear30(Math.cos(Math.PI*(1-x)/2))};function euDock(onde){this.id='euDock_'+euEnv.Kost.next();var novoel=document.createElement("div");novoel.style.position="absolute";novoel.innerHTML="<div id='"+this.id+"_bar' style='z-index:1;position:absolute;border:0px solid black;'></div>"+"<div id='"+this.id+"' style='z-index:1;position:absolute;border:0px solid black; cursor: pointer;'></div>";if(onde){novoel.style.zIndex=100000;onde.appendChild(novoel)}else{document.body.appendChild(novoel)}this.div=document.getElementById(this.id);this.divBar=document.getElementById(this.id+"_bar");this.iconsArray=new Array();this.isInside=false;euEnv.euDockArray[this.id]=this;this.bar=null;this.mouseX=0;this.mouseY=0;this.centerPosX=0;this.centerPosY=0;this.offset=0;this.iconOffset=0;this.venusHillSize=3;this.venusHillTrans=euLinear;this.position=euUP;this.align=euSCREEN;this.objectAlign=euDOWN;this.idObjectHook;this.animaition=euICON;this.animFading=euABSOLUTE;this.setIconsOffset=function(offset){this.iconOffset=offset};this.setAnimation=function(anim,size){this.animaition=anim;this.venusHillSize=size};this.setPointAlign=function(x,y,pos){this.offset=0;this.align=euABSOLUTE;this.position=pos;this.setCenterPos(x,y)};this.setObjectAlign=function(idObj,align,offset,pos){this.offset=offset;this.align=euOBJECT;this.objectAlign=align;this.position=pos;this.idObjectHook=document.getElementById(idObj);this.setObjectCoord()};this.setObjectCoord=function(){var tempx,tempy;if(this.objectAlign==euDOWN){if(onde){tempx=(this.idObjectHook.offsetWidth/2);tempy=0}else{tempx=euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2);tempy=euIdObjTop(this.idObjectHook)+this.idObjectHook.offsetHeight+this.offset;if(navm&&!document.doctype||(navm&&document.doctype&&document.doctype.systemId=="")){tempx=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))[0]+(euIdObjLeft(this.idObjectHook)/2)}if(navm&&i3GEO.util.versaoNavegador()==="IE8"&&tempx<this.idObjectHook.offsetWidth){tempx=i3GEO.parametros.w/2;if(i3GEO.guias.TIPO==="guia"||i3GEO.guias.TIPO==="sanfona"&&$i("contemFerramentas")){tempx+=parseInt($i("contemFerramentas").style.width,10)}}}this.setCenterPos(tempx,tempy)}else if(this.objectAlign==euUP)this.setCenterPos(euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2),euIdObjTop(this.idObjectHook)-this.offset);else if(this.objectAlign==euLEFT)this.setCenterPos(euIdObjLeft(this.idObjectHook)-this.offset,euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2));else if(this.objectAlign==euRIGHT)this.setCenterPos(euIdObjLeft(this.idObjectHook)+this.idObjectHook.offsetWidth+this.offset,euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2));else if(this.objectAlign==euCENTER){if(this.position==euUP||this.position==euDOWN||this.position==euHORIZONTAL)this.setCenterPos(euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2),euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2)-this.offset);else this.setCenterPos(euIdObjLeft(this.idObjectHook)+(this.idObjectHook.offsetWidth/2)+this.offset,euIdObjTop(this.idObjectHook)+(this.idObjectHook.offsetHeight/2))}};this.setScreenAlign=function(align,offset){this.offset=offset;this.align=euSCREEN;if(align==euUP)this.position=euDOWN;else if(align==euDOWN)this.position=euUP;else if(align==euLEFT)this.position=euRIGHT;else if(align==euRIGHT)this.position=euLEFT;this.setScreenCoord()};this.setScreenCoord=function(){euDimensioni();offsEut();if(this.position==euDOWN)this.setCenterPos(euEnv.euScrOfX+euEnv.euFrameWidth/2,euEnv.euScrOfY+this.offset);else if(this.position==euUP)this.setCenterPos(euEnv.euScrOfX+euEnv.euFrameWidth/2,euEnv.euScrOfY+euEnv.euFrameHeight-this.offset);else if(this.position==euRIGHT)this.setCenterPos(euEnv.euScrOfX+this.offset,euEnv.euScrOfY+euEnv.euFrameHeight/2);else if(this.position==euLEFT)this.setCenterPos(euEnv.euScrOfX+euEnv.euFrameWidth-this.offset,euEnv.euScrOfY+euEnv.euFrameHeight/2)};this.refreshDiv=function(){if(this.position==euDOWN){this.setPos(this.centerPosX-this.getWidth()/2,this.centerPosY+this.iconOffset)}else if(this.position==euUP){this.setPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.getHeight()-this.iconOffset)}else if(this.position==euRIGHT){this.setPos(this.centerPosX+this.iconOffset,this.centerPosY-this.getHeight()/2)}else if(this.position==euLEFT){this.setPos(this.centerPosX-this.getWidth()-this.iconOffset,this.centerPosY-this.getHeight()/2)}else if(this.position==euHORIZONTAL){this.setPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.getHeight()/2+this.iconOffset)}else if(this.position==euVERTICAL){this.setPos(this.centerPosX-this.getWidth()/2+this.iconOffset,this.centerPosY-this.getHeight()/2)}if(this.bar){if(this.position==euDOWN){this.setBarPos(this.centerPosX-this.getWidth()/2,this.centerPosY)}else if(this.position==euUP){this.setBarPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.bar.getSize())}else if(this.position==euRIGHT){this.setBarPos(this.centerPosX,this.centerPosY-this.getHeight()/2)}else if(this.position==euLEFT){this.setBarPos(this.centerPosX-this.bar.getSize(),this.centerPosY-this.getHeight()/2)}else if(this.position==euHORIZONTAL){this.setBarPos(this.centerPosX-this.getWidth()/2,this.centerPosY-this.bar.getSize()/2)}else if(this.position==euVERTICAL){this.setBarPos(this.centerPosX-this.bar.getSize()/2,this.centerPosY-this.getHeight()/2)}}};this.riposition=function(){if(this.align==euSCREEN)this.setScreenCoord();else if(this.align==euOBJECT)this.setObjectCoord()};this.setCenterPos=function(x,y){this.centerPosX=x;this.centerPosY=y;this.refreshDiv()};this.setPos=function(x,y){this.setPosX(x);this.setPosY(y)};this.setBarPos=function(x,y){this.setBarPosX(x);this.setBarPosY(y)};this.setDim=function(w,h){this.setWidth(w);this.setHeight(h)};this.setBarPosX=function(x){document.getElementById(this.id+"_bar").style.left=x+'px'};this.setBarPosY=function(y){document.getElementById(this.id+"_bar").style.top=y+'px'};this.getPosX=function(){return document.getElementById(this.id).style.left.replace(/[^0-9]/g,"")};this.setPosX=function(x){document.getElementById(this.id).style.left=x+'px'};this.getPosY=function(){return document.getElementById(this.id).style.top.replace(/[^0-9]/g,"")};this.setPosY=function(y){document.getElementById(this.id).style.top=y+'px'};this.getWidth=function(){return document.getElementById(this.id).style.width.replace(/[^0-9]/g,"")};this.setWidth=function(w){document.getElementById(this.id).style.width=Math.round(w)+'px'};this.getHeight=function(){return document.getElementById(this.id).style.height.replace(/[^0-9]/g,"")};this.setHeight=function(h){document.getElementById(this.id).style.height=Math.round(h)+'px'};this.getVenusWidth=function(){return this.venusHillSize*this.getWidth()};this.getVenusHeight=function(){return this.venusHillSize*this.getHeight()};this.getMouseRelativeX=function(){return this.mouseX-euIdObjLeft(this.div)};this.getMouseRelativeY=function(){return this.mouseY-euIdObjTop(this.div)};this.updateDims=function(){var bakWidth=0;var bakHeight=0;for(var i in this.iconsArray)if(this.iconsArray[i].id){if(this.position==euUP||this.position==euDOWN||this.position==euHORIZONTAL){bakWidth+=this.iconsArray[i].getWidth();bakHeight=(this.iconsArray[i].getHeight()>bakHeight)?this.iconsArray[i].getHeight():bakHeight;bakHeight=Math.round(bakHeight)}else{bakHeight+=this.iconsArray[i].getHeight();bakWidth=(this.iconsArray[i].getWidth()>bakWidth)?this.iconsArray[i].getWidth():bakWidth;bakWidth=Math.round(bakWidth)}}if(this.bar){if(this.position==euUP||this.position==euDOWN||this.position==euHORIZONTAL)this.bar.setProperties(bakWidth,this.position);else this.bar.setProperties(bakHeight,this.position);this.bar.refresh()}var posx=0;var posy=0;var updPosX=0;var updPosY=0;for(var i in this.iconsArray)if(this.iconsArray[i].id){if(this.position==euDOWN){updPosX=posx;updPosY=posy;posx+=this.iconsArray[i].getWidth()}else if(this.position==euUP){updPosX=posx;updPosY=bakHeight-this.iconsArray[i].getHeight();posx+=this.iconsArray[i].getWidth()}else if(this.position==euRIGHT){updPosX=posx;updPosY=posy;posy+=this.iconsArray[i].getHeight()}else if(this.position==euLEFT){updPosX=bakWidth-this.iconsArray[i].getWidth();updPosY=posy;posy+=this.iconsArray[i].getHeight()}else if(this.position==euHORIZONTAL){updPosX=posx;updPosY=(bakHeight-this.iconsArray[i].getHeight())/2;posx+=this.iconsArray[i].getWidth()}else if(this.position==euVERTICAL){updPosX=(bakWidth-this.iconsArray[i].getWidth())/2;updPosY=posy;posy+=this.iconsArray[i].getHeight()}this.iconsArray[i].setPos(updPosX,updPosY);this.iconsArray[i].refresh()}this.setDim(bakWidth,bakHeight);this.refreshDiv()};this.kernel=function(){};this.kernelMouseOver=function(){};this.kernelMouseOut=function(){};this.mouseOut=function(){};this.mouseOver=function(){};this.mouseMove=function(x,y){};this.iconParams=new Array();this.setAllFrameStep=function(step){this.iconParams.frameStep=step;for(var i in this.iconsArray)if(this.iconsArray[i].id)this.iconsArray[i].frameStep=step};this.setAllZoomFunc=function(func){};this.setAllZoomFuncW=function(func){};this.setAllZoomFuncH=function(func){};this.setBar=function(args){var id='euDock_bar_'+euEnv.Kost.next();euEnv.euDockArray[id]=new euDockBar(id,this);euEnv.euDockArray[id].setElements(args);this.bar=euEnv.euDockArray[id];return euEnv.euDockArray[id]};this.addIcon=function(args,params){var i,id=params.id;var id='euDock_icon_'+euEnv.Kost.next();euEnv.euDockArray[id]=new euDockIcon(id,this);euEnv.euDockArray[id].addElement(args);this.iconsArray.push(euEnv.euDockArray[id]);for(i in this.iconParams)euEnv.euDockArray[id][i]=this.iconParams[i];for(i in params)euEnv.euDockArray[id][i]=params[i];return euEnv.euDockArray[id]};this.delIcon=function(elem){euEnv.euDockArray.splice(elem);euEnv.euDockArray[elem.id]=0;for(var i in this.iconsArray)if(this.iconsArray[i]==elem)this.iconsArray.splice(i,1);elem.destroy();elem=null;this.updateDims()}};function euDockIcon(id,dock){this.id=id;this.parentDock=dock;this.elementsArray;this.zoomFuncW=euLinear30;this.zoomFuncH=euLinear30;this.posX=0;this.posY=0;this.width=0;this.height=0;this.frame=0;this.frameStep=0.5;this.fadingFrame=0;this.fadingStep=1;this.fadingType=euTRANSPARENT;this.loaded=false;this.runningFrame=false;this.runningFading=false;this.updateDims=function(){if(!this.loaded)return;for(var i=0;i<this.elementsArray.length;i++)this.elementsArray[i].setProperties(this.posX,this.posY,this.getWidth(),this.getHeight())};this.updateFading=function(){};this.refresh=function(){this.updateDims()};this.isAbsoluteInside=function(x,y){x-=this.getAbsolutePosX();y-=this.getAbsolutePosY();return x>0&&y>0&&x<this.getWidth()&&y<this.getHeight()};this.isInside=function(x,y){return this.isInsideX(x)&&this.isInsideY(y)};this.isInsideX=function(x){return(this.loaded&&(this.posX<=x)&&((this.posX+this.getWidth())>=x))};this.isInsideY=function(y){return(this.loaded&&(this.posY<=y)&&((this.posY+this.getHeight())>=y))};this.retrieveLoadingDims=function(elem,num){if(elem.onLoadPrev)elem.onLoadPrev();if(num==0&&!this.loaded)this.setDim(elem.getWidth(),elem.getHeight());elem.loaded=true;var ret=true;for(var i in this.elementsArray)if(this.elementsArray[i].id)ret&=this.elementsArray[i].loaded;this.loaded=ret;if(this.loaded){this.parentDock.updateDims();for(var i in this.elementsArray)if(this.elementsArray[i].id)this.elementsArray[i].show()}if(elem.onLoadNext)elem.onLoadNext()};this.setPos=function(x,y){this.posX=x;this.posY=y};this.setDim=function(w,h){if(this.width==0)this.width=w;if(this.height==0)this.height=h};this.getAbsolutePosX=function(){return euIdObjLeft(this.parentDock.div)+this.posX};this.getAbsolutePosY=function(){return euIdObjTop(this.parentDock.div)+this.posY};this.setPosX=function(x){this.posX=x};this.setPosY=function(y){this.posY=y};this.getWidth=function(){if(!this.loaded)return 0;var calc=this.width*this.zoomFuncW(this.frame);return 38};this.getHeight=function(){if(!this.loaded)return 0;return 38};this.isRunning=function(){return this.runningFrame||this.runningFading};this.setFrameTo=function(frameTo){if(this.frame==frameTo)this.runningFrame=false;else{this.runningFrame=true;this.frame+=(frameTo-this.frame)*this.frameStep;if(Math.abs(this.frame-frameTo)<0.01)this.frame=frameTo;if(this.frame<0)this.frame=0;if(this.frame>1)this.frame=1}return this.runningFrame};this.addElement=function(args){if(typeof(args)!="undefined"&&args!=null){this.elementsArray=new Array();this.fadingStep=0.5/args.length;for(var i=0;i<args.length;i++)for(var ii in args[i]){var id="euDock_"+ii+"_"+euEnv.Kost.next();euEnv.euDockArray[id]=new window[ii](id,args[i][ii],this.parentDock.div,"euEnv.euDockArray."+this.id+".retrieveLoadingDims(euEnv.euDockArray."+id+","+i+");");this.elementsArray.push(euEnv.euDockArray[id]);euEnv.euDockArray[id].loaded=false}}};this.destroy=function(){for(var i in this.elementsArray)if(this.elementsArray[i].id){euEnv.euDockArray[this.elementsArray[i].id]=0;euEnv.euDockArray.splice(this.elementsArray[i],1);this.elementsArray[i].destroy()}this.elementsArray.splice(0,this.elementsArray.length)};this.mouseClick=function(x,y){if(this.isAbsoluteInside(x,y)){this.mouseInsideClick(x,y,this.id,this.getAbsolutePosX(),this.getAbsolutePosY())}}};function euDockBar(id,dock){this.id=id;this.parentDock=dock;this.elementsArray=new Array();this.len=0;this.align=euUP;this.loaded=false;this.getSize=function(){if(!this.loaded)return 0;if(this.align==euUP||this.align==euDOWN||this.align==euHORIZONTAL)return this.elementsArray.left.getHeight();else return this.elementsArray.top.getWidth()};this.refresh=function(){if(!this.loaded)return;if(this.align==euUP||this.align==euDOWN||this.align==euHORIZONTAL){this.elementsArray.left.setPos(-this.elementsArray.left.getWidth(),0);this.elementsArray.horizontal.setProperties(0,0,Math.round(this.len),this.getSize());this.elementsArray.right.setPos(Math.round(this.len),0);this.elementsArray.left.show();this.elementsArray.horizontal.show();this.elementsArray.right.show();if(this.elementsArray.top)this.elementsArray.top.hide();if(this.elementsArray.bottom)this.elementsArray.bottom.hide();if(this.elementsArray.vertical){this.elementsArray.vertical.setProperties(0,0,0,0);this.elementsArray.vertical.hide()}}else{this.elementsArray.top.setPos(0,-this.elementsArray.top.getHeight());this.elementsArray.vertical.setProperties(0,0,this.getSize(),Math.round(this.len));this.elementsArray.bottom.setPos(0,Math.round(this.len));this.elementsArray.top.show();this.elementsArray.vertical.show();this.elementsArray.bottom.show();if(this.elementsArray.left)this.elementsArray.left.hide();if(this.elementsArray.right)this.elementsArray.right.hide();if(this.elementsArray.horizontal){this.elementsArray.horizontal.setProperties(0,0,0,0);this.elementsArray.horizontal.hide()}}};this.setProperties=function(len,align){this.len=len+1;this.align=align;this.refresh()};this.retrieveLoadingDims=function(elem){if(elem.onLoadPrev)elem.onLoadPrev();elem.loaded=true;var ret=true;for(var i in this.elementsArray)if(this.elementsArray[i].id)ret&=this.elementsArray[i].loaded;this.loaded=ret;if(this.loaded){this.parentDock.updateDims();for(var i in this.elementsArray)if(this.elementsArray[i].id)this.elementsArray[i].show()}if(elem.onLoadNext)elem.onLoadNext()};this.setElements=function(args){if(typeof(args)!="undefined"&&args!=null){for(var i in args)for(var ii in args[i]){var id="euDock_"+ii+"_"+euEnv.Kost.next();euEnv.euDockArray[id]=new window[ii](id,args[i][ii],this.parentDock.divBar,"euEnv.euDockArray."+this.id+".retrieveLoadingDims(euEnv.euDockArray."+id+");");this.elementsArray[i]=euEnv.euDockArray[id];euEnv.euDockArray[id].loaded=false}}}};function euThread(){};function euKernel(){};function on_MouseMove(e){return true};function on_MouseDown(e){return true};function on_MouseUp(e){return true};function on_MouseClick(e){if(!e)var e=window.event;for(var i in euEnv.euDockArray)if(euEnv.euDockArray[i].mouseClick)euEnv.exeThread|=euEnv.euDockArray[i].mouseClick(euEnv.euScrOfX+e.clientX,euEnv.euScrOfY+e.clientY);return true}; | ... | ... |
classesphp/classe_legenda.php
| ... | ... | @@ -240,6 +240,14 @@ string com a legenda HTML |
| 240 | 240 | if($classe->status == MS_OFF){ |
| 241 | 241 | $desligarLayer[] = $c; |
| 242 | 242 | } |
| 243 | + //remove o offset em simbolos do tipo imagem | |
| 244 | + if($classe->numstyles > 0){ | |
| 245 | + $estilo = $classe->getstyle(0); | |
| 246 | + if($estilo->symbolname != "" && file_exists($estilo->symbolname)){ | |
| 247 | + $estilo->set("offsetx",0); | |
| 248 | + $estilo->set("offsety",0); | |
| 249 | + } | |
| 250 | + } | |
| 243 | 251 | } |
| 244 | 252 | $la->set("minscaledenom",0); |
| 245 | 253 | $la->set("maxscaledenom",0); | ... | ... |
ferramentas/parametrossql/exec.php
| ... | ... | @@ -14,19 +14,20 @@ switch (strtoupper($funcao)) |
| 14 | 14 | case "PARAMETROSPLUGIN": |
| 15 | 15 | //no mashup o nome do tema e sempre o nome do mapfile |
| 16 | 16 | if (file_exists($locaplic."/temas/".$tema.".map")){ |
| 17 | - $map1 = @ms_newMapObj($locaplic."/temas/".$tema.".map"); | |
| 17 | + $map1 = @ms_newMapObj($locaplic."/temas/".$tema.".map"); | |
| 18 | + $layer1 = $map1->getlayerbyname($tema); | |
| 18 | 19 | } |
| 19 | 20 | else{ |
| 20 | 21 | //nesse caso, o mapfile vem da secao php |
| 21 | 22 | $map = ms_newMapObj($map_file); |
| 22 | - $layer = $map->getlayerbyname($name); | |
| 23 | + $layer = $map->getlayerbyname($tema); | |
| 23 | 24 | //os parametros do plugin sao obtidos do mapfile original |
| 24 | 25 | if (file_exists($locaplic."/temas/".$layer->getmetadata("nomeoriginal").".map")){ |
| 25 | 26 | $map1 = @ms_newMapObj($locaplic."/temas/".$layer->getmetadata("nomeoriginal").".map"); |
| 27 | + $layer1 = $map1->getlayerbyname($layer->getmetadata("nomeoriginal")); | |
| 26 | 28 | } |
| 27 | 29 | } |
| 28 | 30 | if($map1){ |
| 29 | - $layer1 = $map1->getlayerbyname($layer->getmetadata("nomeoriginal")); | |
| 30 | 31 | if($layer1 != ""){ |
| 31 | 32 | $c = $layer1->getmetadata("PLUGINI3GEO"); |
| 32 | 33 | if($c == ""){ |
| ... | ... | @@ -75,9 +76,9 @@ switch (strtoupper($funcao)) |
| 75 | 76 | $chaves = implode(",",$chaves); |
| 76 | 77 | $filtro = $layer1->getFilterString(); |
| 77 | 78 | if(!empty($valores)){ |
| 78 | - $chaves = str_ireplace(array("and", "or", "select","from","where","update","delete","insert","--"),"",$chaves); | |
| 79 | + $chaves = str_ireplace(array(" and ", " or ", "select","from","where","update","delete","insert","--"),"",$chaves); | |
| 79 | 80 | $chaves = explode(",",$chaves); |
| 80 | - $valores = str_ireplace(array("and", "or", "select","from","where","update","delete","insert","--"),"",$valores); | |
| 81 | + $valores = str_ireplace(array(" and ", " or ", "select","from","where","update","delete","insert","--"),"",$valores); | |
| 81 | 82 | $valores = explode(",",strip_tags($valores)); |
| 82 | 83 | $n = count($chaves); |
| 83 | 84 | for($i = 0; $i < $n; $i++){ | ... | ... |
ferramentas/parametrossql/index.js
| ... | ... | @@ -129,9 +129,6 @@ i3GEOF.parametrossql = { |
| 129 | 129 | //funcao que sera executada ao ser clicado no cabeçalho da janela |
| 130 | 130 | cabecalho = function(){ |
| 131 | 131 | }; |
| 132 | - minimiza = function(){ | |
| 133 | - i3GEO.janela.minimiza("i3GEOF.parametrossql"); | |
| 134 | - }; | |
| 135 | 132 | //cria a janela flutuante |
| 136 | 133 | titulo = "<a class=ajuda_usuario style='margin-left:40px;' target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=5&idajuda=35' > </a>"; |
| 137 | 134 | janela = i3GEO.janela.cria( |
| ... | ... | @@ -145,7 +142,7 @@ i3GEOF.parametrossql = { |
| 145 | 142 | false, |
| 146 | 143 | "hd", |
| 147 | 144 | cabecalho, |
| 148 | - minimiza, | |
| 145 | + "", | |
| 149 | 146 | "", |
| 150 | 147 | true |
| 151 | 148 | ); | ... | ... |
mashups/openlayers.php
| ... | ... | @@ -470,6 +470,27 @@ if(count($temasPluginI3Geo) > 0){ |
| 470 | 470 | opacity: .8; |
| 471 | 471 | filter: alpha(opacity = 80); |
| 472 | 472 | } |
| 473 | + | |
| 474 | +.pluginParametrossql { | |
| 475 | + background-image: url("../imagens/gisicons/settings.png"); | |
| 476 | + background-size: 14px auto; | |
| 477 | + cursor: pointer; | |
| 478 | + position: relative; | |
| 479 | + top: 3px; | |
| 480 | + width: 14px; | |
| 481 | +} | |
| 482 | + | |
| 483 | +.ajuda_usuario { | |
| 484 | + background-image: url(../imagens/external.png); | |
| 485 | + background-position: 0px 0px; | |
| 486 | + background-repeat: no-repeat; | |
| 487 | + margin-left: 0; | |
| 488 | + text-decoration: none; | |
| 489 | + cursor: help; | |
| 490 | + position: relative; | |
| 491 | + top: 2px; | |
| 492 | + font-size: 13px; | |
| 493 | +} | |
| 473 | 494 | </style> |
| 474 | 495 | </head> |
| 475 | 496 | <body class=" yui-skin-sam"> |
| ... | ... | @@ -544,7 +565,7 @@ i3GEO.editorOL.ativarodadomouse = "<?php |
| 544 | 565 | i3GEO.editorOL.legendahtml = "<?php |
| 545 | 566 | if(isset($legendahtml)){echo $legendahtml;} |
| 546 | 567 | else |
| 547 | - {echo "false";} | |
| 568 | + {echo "true";} | |
| 548 | 569 | ?>"; |
| 549 | 570 | |
| 550 | 571 | <?php |
| ... | ... | @@ -593,25 +614,31 @@ i3GEO.editorOL.mapa = new OpenLayers.Map( |
| 593 | 614 | minResolution: i3GEO.editorOL.minresolution |
| 594 | 615 | } |
| 595 | 616 | ); |
| 596 | -i3GEO.editorOL.inicia(); | |
| 597 | 617 | if(!i3GEO.configura){ |
| 598 | 618 | i3GEO.configura = {"locaplic": "../"}; |
| 599 | 619 | } |
| 600 | 620 | <?php |
| 601 | 621 | //camadas plugin |
| 602 | - | |
| 603 | 622 | foreach ($temasPluginI3Geo as $t){ |
| 604 | 623 | //cria um objeto javascript para iniciar o plugin |
| 605 | 624 | $camada = '{"tema": "'.$t["tema"].'","name":"'.$t["name"].'","plugini3geo":'.$t["plugin"].'}'; |
| 606 | 625 | echo "var camada = $camada;\n"; |
| 607 | 626 | //echo "i3GEO.pluginI3geo[camada.plugini3geo.plugin].openlayers.inicia(camada,i3GEO.editorOL.mapa);\n"; |
| 608 | - echo "adicionaPluginI3geo(camada);\n"; | |
| 627 | + $visivel = "false"; | |
| 628 | + if(in_array($t["name"],$visiveis)){ | |
| 629 | + $visivel = "true"; | |
| 630 | + } | |
| 631 | + echo "adicionaPluginI3geo(camada,$visivel);\n"; | |
| 609 | 632 | } |
| 610 | 633 | ?> |
| 611 | -function adicionaPluginI3geo(camada){ | |
| 634 | +i3GEO.editorOL.inicia(); | |
| 635 | + | |
| 636 | +function adicionaPluginI3geo(camada,visivel){ | |
| 612 | 637 | //TODO nao funciona |
| 613 | - if(camada.plugini3geo.plugin != "parametrossql"){ | |
| 614 | - i3GEO.pluginI3geo[camada.plugini3geo.plugin].openlayers.inicia(camada,i3GEO.editorOL.mapa); | |
| 638 | + var l = i3GEO.pluginI3geo.layerMashup("openlayers",camada,"4326"); | |
| 639 | + l.setVisibility(visivel); | |
| 640 | + if(l != true){ | |
| 641 | + i3GEO.editorOL.layersIniciais.push(l); | |
| 615 | 642 | } |
| 616 | 643 | } |
| 617 | 644 | </script> | ... | ... |
mashups/openlayers_compacto.js
| ... | ... | @@ -1643,7 +1643,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.desenho={layergrafico:null,es |
| 1643 | 1643 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}YAHOO.namespace("i3GEO.janela");YAHOO.i3GEO.janela.manager=new YAHOO.widget.OverlayManager();YAHOO.namespace("janelaDoca.xp");YAHOO.janelaDoca.xp.manager=new YAHOO.widget.OverlayManager();YAHOO.i3GEO.janela.managerAguarde=new YAHOO.widget.OverlayManager();i3GEO.janela={ESTILOBD:"display:block;padding:5px 1px 5px 1px;",ESTILOAGUARDE:"normal",AGUARDEMODAL:false,ANTESCRIA:["i3GEO.janela.prepara()"],ANTESFECHA:[],TRANSICAOSUAVE:true,OPACIDADE:65,OPACIDADEAGUARDE:50,TIPS:[],ULTIMOZINDEX:5,prepara:function(){var iu=i3GEO.util;iu.escondeBox()},cria:function(wlargura,waltura,wsrc,nx,ny,texto,id,modal,classe,funcaoCabecalho,funcaoMinimiza,funcaoAposRedim,dimensionavel,icone,funcaoDuplica,transicao){if(!transicao){transicao="sim"}if(!dimensionavel){dimensionavel=true}if(!icone){icone=""}var i,wlargurA,ins,novoel,wdocaiframe,temp,fix,underlay,ifr,janela;if($i(id)){janela=YAHOO.i3GEO.janela.manager.find(id);janela.show();janela.bringToTop();return}if(navm&&!chro){this.TRANSICAOSUAVE=false}if(this.ANTESCRIA){for(i=0;i<this.ANTESCRIA.length;i++){eval(this.ANTESCRIA[i])}}if(!classe||classe==""){classe="hd"}if(!id||id===""){id="wdoca"}if(!modal||modal===""){modal=false}ifr=false;if(i3GEO.Interface&&i3GEO.Interface!=undefined&&i3GEO.Interface.ATUAL==="googleearth"){i3GEO.janela.TRANSICAOSUAVE=false;ifr=true}fix="contained";if(nx===""||nx==="center"){fix=true}if(modal===true){underlay="none"}else{underlay="shadow"}temp=navm?0:2;wlargurA=parseInt(wlargura,10)+temp+"px";ins='<div id="'+id+'_cabecalho" class="'+classe+'" >';if(i3GEO.configura!==undefined){ins+="<img id='"+id+"_imagemCabecalho' class='i3GeoAguardeJanela' style='visibility:hidden;' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde2.gif\' />"}if(icone!=""){ins+="<img class='i3GeoIconeJanela' src='"+icone+"' >"}ins+="<span style='font-size:10px;'>"+texto+"</span>";if(funcaoDuplica){ins+="<div id='"+id+"_duplicaJanela' class='container-duplica'></div>"}if(funcaoMinimiza){ins+="<div id='"+id+"_minimizaCabecalho' class='container-minimiza'></div>"}ins+='</div><div id="'+id+'_corpo" class="bd" style="'+this.ESTILOBD+'">';if(wsrc!==""){ins+='<iframe name="'+id+'i" id="'+id+'i" valign="top" style="border:0px white solid;width:100%"></iframe>'}ins+='</div>';ins+='<div class="ft"></div>';novoel=document.createElement("div");novoel.id=id;novoel.style.display="block";novoel.innerHTML=ins;if(this.TRANSICAOSUAVE&&transicao==="sim"){novoel.onmouseover=function(){YAHOO.util.Dom.setStyle(novoel,"opacity",1)};novoel.onmouseout=function(){YAHOO.util.Dom.setStyle(novoel,"opacity",i3GEO.janela.OPACIDADE/100)};YAHOO.util.Dom.setStyle(novoel,"opacity",1)}document.body.appendChild(novoel);wdocaiframe=$i(id+"i");if(wdocaiframe){temp=wdocaiframe.style;temp.height=waltura;temp.display="block";wdocaiframe.src=wsrc}else{if(waltura!=="auto"){$i(id+'_corpo').style.height=parseInt(waltura,10)+"px"}$i(id+'_corpo').style.width='100%';$i(id+'_corpo').style.overflow="auto"}if(waltura==="auto"||dimensionavel==false){janela=new YAHOO.widget.Panel(id,{iframe:ifr,modal:modal,width:wlargurA,underlay:underlay,fixedcenter:fix,constraintoviewport:true,visible:true,monitorresize:false,dragOnly:true,keylisteners:null})}else{janela=new YAHOO.widget.Panel(id,{hideMode:'offsets',iframe:ifr,underlay:underlay,modal:modal,width:wlargurA,fixedcenter:fix,constraintoviewport:true,visible:true,monitorresize:false,dragOnly:true,keylisteners:null});if(YAHOO.util.Resize){var resize=new YAHOO.util.Resize(id,{handles:['br'],autoRatio:false,minWidth:10,minHeight:10,status:false,proxy:true,ghost:false,animate:false,useShim:true});resize.on('resize',function(args){this.cfg.setProperty("height",args.height+"px");if(wdocaiframe){wdocaiframe.style.height=args.height-50+"px"}},janela,true);if(funcaoAposRedim&&funcaoAposRedim!=""){resize.on('endResize',function(args){funcaoAposRedim.call();i3GEO.janela.minimiza()},janela,true)}resize.getProxyEl().style.height="0px"}}if(nx!==""&&nx!=="center"){janela.moveTo(nx,ny+50)}YAHOO.i3GEO.janela.manager.register(janela);if(this.TRANSICAOSUAVE){janela.cfg.setProperty("effect",[{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.5}])}janela.cfg.setProperty("zIndex",[4]);janela.render();janela.bringToTop();if(navm&&id!=="i3geo_janelaMensagens"&&i3GEO.Interface&&i3GEO.Interface!=undefined&&i3GEO.Interface.ATUAL==="googleearth"){janela.moveTo(0,0)}if(ifr===true){janela.iframe.style.zIndex=4}YAHOO.util.Event.addListener($i(id+'_corpo'),"click",YAHOO.util.Event.stopPropagation);if(funcaoDuplica){$i(id+'_duplicaJanela').onclick=funcaoDuplica}if(funcaoCabecalho){$i(id+'_cabecalho').onclick=funcaoCabecalho}if(funcaoMinimiza){$i(id+"_minimizaCabecalho").onclick=funcaoMinimiza}YAHOO.util.Event.addListener(janela.close,"click",i3GEO.janela.fecha,janela,{id:id},true);temp=$i(id+"_corpo");return([janela,$i(id+"_cabecalho"),temp])},minimiza:function(id,min){var temp=$i(id+"_corpo"),n,i,m=YAHOO.i3GEO.janela.manager.find(id),c=$i(id),t="min";if(temp){if(temp.style.display==="block"){temp.style.display="none";if(m){m.hideIframe()}m.winicial=c.style.width;if(min){c.style.width=min}}else{temp.style.display="block";if(m){m.showIframe()}c.style.width=m.winicial;t="max"}}temp=$i(id+"_resizehandle");if(temp){if(temp.style.display==="none"){temp.style.display="block"}else{temp.style.display="none"}}temp=$i(id+"_c");if(temp){temp=temp.getElementsByTagName("div");n=temp.length;for(i=0;i<n;i++){if(temp[i].className==="underlay"||temp[i].className==="bd"){if(temp[i].style.display==="none"){temp[i].style.display="block"}else{temp[i].style.display="none"}}}}temp=$i(id+"_corpo");if(temp){if(temp.style.display==="none"){temp.style.display="block"}else{temp.style.display="none"}}temp=$i(id);if(temp){if(temp.style.display==="none"){temp.style.height="100%"}else{temp.style.height="10%"}}return t},fecha:function(event,args){var i,id;i3GEO.util.escondeBox();if(i3GEO.janela.ANTESFECHA){for(i=0;i<i3GEO.janela.ANTESFECHA.length;i++){eval(i3GEO.janela.ANTESFECHA[i])}}if(i3GEO.janela.id){id=i3GEO.janela.id}else{id=event.id}if(id==undefined){id=args.id}i3GEO.janela.destroi(id)},destroi:function(id){var janela=YAHOO.i3GEO.janela.manager.find(id);i3GEO.util.removeScriptTag(id+"_script");i3GEO.util.removeScriptTag(id+".dicionario_script");if(janela){YAHOO.i3GEO.janela.manager.remove(janela);janela=$i(id+"_c");janela.parentNode.removeChild(janela)}},alteraTamanho:function(w,h,id){var i;if(arguments.length===3){i=$i(id)}else{i=$i("wdoca")}if(i){i.style.width=w+"px";i.style.height=h+"px"}},abreAguarde:function(id,texto){var pos,temp,janela;if(!id||id==undefined){return}janela=YAHOO.i3GEO.janela.managerAguarde.find(id);pos=[0,0];if(i3GEO.Interface&&$i(i3GEO.Interface.IDCORPO)){pos=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO))}else if($i("contemImg")){pos=YAHOO.util.Dom.getXY($i("contemImg"))}if(i3GEO.janela.AGUARDEMODAL==true){texto+="<br><span style='color:navy;cursor:pointer;font-size:9px;' onclick='javascript:if(i3GEO.janela.AGUARDEMODAL == true){i3GEO.janela.AGUARDEMODAL = false;}else{i3GEO.janela.AGUARDEMODAL = true;}'>bloquear/desbloquear</span>"}if(!janela){janela=new YAHOO.widget.Panel(id,{width:"240px",fixedcenter:false,underlay:"none",close:true,draggable:false,modal:i3GEO.janela.AGUARDEMODAL,monitorresize:false});janela.render(document.body);YAHOO.i3GEO.janela.managerAguarde.register(janela)}if(i3GEO.janela.ESTILOAGUARDE==="normal"||i3GEO.janela.ESTILOAGUARDE==="reduzida"){janela.setBody(texto);janela.body.style.padding="5px"}if(i3GEO.janela.ESTILOAGUARDE==="normal"||i3GEO.janela.ESTILOAGUARDE==="minima"){janela.setHeader("<span><img id=aguardeGifAberto src='"+i3GEO.configura.locaplic+"/imagens/aguarde.gif' /></span> <span style=font-size:8px >"+YAHOO.i3GEO.janela.managerAguarde.overlays.length+"</span>")}if(i3GEO.parametros&&i3GEO.parametros.w>0){janela.moveTo(pos[0]+(i3GEO.parametros.w/2)-120,pos[1])}else{janela.moveTo(pos[0],pos[1])}janela.show();if(janela.header){janela.header.style.height="20px"}temp=$i(id+"_c");if(temp){temp.style.backgroundColor=""}YAHOO.util.Dom.setStyle(temp,"opacity",i3GEO.janela.OPACIDADEAGUARDE/100)},fechaAguarde:function(id){if(id!=undefined){var janela=YAHOO.i3GEO.janela.managerAguarde.find(id);if(janela){YAHOO.i3GEO.janela.managerAguarde.remove(janela);janela.destroy()}}},tempoMsg:function(texto,tempo){if(!YAHOO.util.Easing){return}var pos,janela,attributes,anim,altura=40;janela=YAHOO.i3GEO.janela.managerAguarde.find("i3geoTempoMsg");pos=[0,0];if(i3GEO.Interface&&$i(i3GEO.Interface.IDCORPO)){pos=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO))}else if($i("contemImg")){pos=YAHOO.util.Dom.getXY($i("contemImg"))}if(!janela){janela=new YAHOO.widget.Panel("i3geoTempoMsg",{width:"220px",fixedcenter:false,underlay:"none",close:false,draggable:false,modal:false,monitorresize:false,iframe:true});janela.render(document.body);YAHOO.i3GEO.janela.managerAguarde.register(janela)}janela.setBody(texto);altura=70;janela.body.style.padding="5px";janela.body.style.backgroundColor="yellow";if(i3GEO.Interface&&i3GEO.Interface.ATUAL!="googleearth"){janela.body.style.height="0px"}else{janela.body.style.height=altura+"px"}janela.body.style.overflow="hidden";janela.body.onclick=function(){var janela=YAHOO.i3GEO.janela.managerAguarde.find("i3geoTempoMsg");if(janela){janela.destroy()}};if(i3GEO.parametros&&i3GEO.parametros.w>0){janela.moveTo(pos[0]+(i3GEO.parametros.w/2)-120,pos[1])}else{janela.moveTo(pos[0],pos[1])}janela.show();if(i3GEO.Interface&&i3GEO.Interface.ATUAL!="googleearth"){attributes={height:{to:altura}};anim=new YAHOO.util.Anim(janela.body,attributes,.5,YAHOO.util.Easing.easeNone);anim.onComplete.subscribe(function(){janela.body.style.overflow="auto";janela.body.style.display="block";$i("i3geoTempoMsg_c").style.zIndex=100000});anim.animate()}if(!tempo){tempo=4000}setTimeout(function(){var attributes,anim,janela=YAHOO.i3GEO.janela.managerAguarde.find("i3geoTempoMsg");if(i3GEO.Interface&&i3GEO.Interface.ATUAL!="googleearth"){if(janela){janela.body.style.overflow="hidden";attributes={height:{to:0}};anim=new YAHOO.util.Anim(janela.body,attributes,.5,YAHOO.util.Easing.easeNone);anim.onComplete.subscribe(function(){janela.destroy()});anim.animate()}}else{janela.destroy()}},tempo)},ativaAlerta:function(){window.alert=function(texto){var textoI,janela=YAHOO.i3GEO.janela.managerAguarde.find("alerta");if(!janela){janela=new YAHOO.widget.SimpleDialog("alerta",{width:"300px",fixedcenter:true,visible:false,draggable:false,zIndex:100000,textAlign:"left",close:true,modal:false,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},constraintoviewport:true,buttons:[{text:$trad("x74"),handler:function(){this.destroy()},isDefault:true}],icon:YAHOO.widget.SimpleDialog.ICON_WARN,text:""});YAHOO.i3GEO.janela.managerAguarde.register(janela);janela.setHeader(" ");janela.render(document.body)}textoI=janela.cfg.getProperty("text");if(textoI!=""){textoI+="<br>"}texto=textoI+texto;janela.cfg.setProperty("text",texto);janela.show()}},confirma:function(pergunta,w,resposta1,resposta2,funcao1,funcao2){var b,f1,f2,f3,janela=YAHOO.i3GEO.janela.managerAguarde.find("confirma");if(!w||w==""){w=300}if(!funcao1||funcao1==""){f1=function(){YAHOO.i3GEO.janela.managerAguarde.find("confirma").destroy();return true}}else{f1=function(){funcao1.call();YAHOO.i3GEO.janela.managerAguarde.find("confirma").destroy()}}if(!funcao2||funcao2==""){f2=function(){YAHOO.i3GEO.janela.managerAguarde.find("confirma").destroy();return false}}else{f2=function(){funcao2.call();YAHOO.i3GEO.janela.managerAguarde.find("confirma").destroy()}}f3=function(){YAHOO.i3GEO.janela.managerAguarde.find("confirma").destroy()};if(!resposta1||resposta1==""){resposta1=$trad("x58")}if(janela){janela.destroy()}b=[{text:$trad("x75"),handler:f3},{text:resposta1,handler:f1}];if(resposta2&&resposta2!=""){b.push({text:resposta2,handler:f2})}janela=new YAHOO.widget.SimpleDialog("confirma",{width:w+"px",fixedcenter:true,visible:false,draggable:false,zIndex:100000,textAlign:"left",close:false,modal:false,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},constraintoviewport:true,buttons:b,icon:YAHOO.widget.SimpleDialog.ICON_HELP,text:"<p class=paragrafo >"+pergunta});YAHOO.i3GEO.janela.managerAguarde.register(janela);janela.setHeader(" ");janela.render(document.body);janela.show()},prompt:function(pergunta,funcaoOk,valorDefault){if($i("i3GEOjanelaprompt")){return}if(!valorDefault){valorDefault=""}var i="<br><div class='i3geoForm i3geoFormIconeEdita' ><input id='i3GEOjanelaprompt' type=text value='"+valorDefault+"' />";i3GEO.janela.confirma(pergunta+i,"","","",funcaoOk)},mensagemSimples:function(texto,cabecalho,largura,altura){var janela;if(!largura){largura=300}if(!altura){altura=300}if(!cabecalho){cabecalho=""}janela=new YAHOO.widget.SimpleDialog(YAHOO.util.Dom.generateId(),{width:parseInt(largura,10)+"px",height:parseInt(altura,10)+"px",fixedcenter:true,visible:true,draggable:true,zIndex:100000,textAlign:"left",close:true,modal:false,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},constraintoviewport:true,text:""});YAHOO.i3GEO.janela.manager.register(janela);janela.setHeader(cabecalho);janela.render(document.body);janela.setHeader(cabecalho);janela.cfg.setProperty("text",texto);janela.bringToTop();janela.show();return janela},tip:function(){var Nid,novoel,res;Nid=YAHOO.util.Dom.generateId();novoel=document.createElement("div");novoel.className="i3GEObalaoInfo";novoel.id=Nid;document.body.appendChild(novoel);i3GEO.janela.TIPS.push($i(Nid));res="<div id='"+Nid+"cabecatip' style='text-align:left;background-color:rgb(240,240,240)'></div>";novoel.innerHTML="<table style='text-align:left'><tr><td style='text-align:left'>"+res+"</td></tr></table>";ist=novoel.style;ist.top=objposicaocursor.telay-9+"px";ist.left=objposicaocursor.telax-5+"px";ist.display="block";i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.janela.excluiTips('todos')"]);return(Nid)},excluiTips:function(tipo){var ot,i;if(arguments.length===0){tipo="todos"}if(i3GEO.janela.TIPS.length>0){ot=i3GEO.janela.TIPS.length-1;if(ot>=0){do{if(tipo==='todos'){if(i3GEO.janela.TIPS[ot]){i=$i(i3GEO.janela.TIPS[ot].id);document.body.removeChild(i)}}if(tipo==='naofixos'){if($i(i3GEO.janela.TIPS[ot])){if($i(i3GEO.janela.TIPS[ot].id+"cabecatip").innerHTML!==""){document.body.removeChild($i(i3GEO.janela.TIPS[ot].id))}}}}while(ot--);if(tipo==="todos"){i3GEO.janela.TIPS=[]}}}},slider:function(funcao,inicial){var scaleFactor,bottomConstraint,topConstraint,janela,novoel,Event,slider="",bg,thumb;janela=i3GEO.janela.cria(230,200,"","","",$trad("t20"),"opacidadeG");novoel=document.createElement("div");novoel.id="slider-bg";novoel.tabindex="-1";novoel.innerHTML='<div style="cursor:default;position:absolute;top:4px" id="slider-thumb"><img src="'+i3GEO.configura.locaplic+'/imagens/thumb-n.gif"></div>';janela[2].appendChild(novoel);Event=YAHOO.util.Event;bg="slider-bg";thumb="slider-thumb";novoel.style.position="relative";novoel.style.background='url('+i3GEO.configura.locaplic+'/imagens/bg-fader.gif) 5px 0 no-repeat';novoel.style.height="28px";novoel.style.width="228px";topConstraint=0;bottomConstraint=200;scaleFactor=1;Event.onDOMReady(function(){slider=YAHOO.widget.Slider.getHorizSlider(bg,thumb,topConstraint,bottomConstraint,20);slider.setValue(parseInt(inicial,10));slider.getRealValue=function(){return Math.round(this.getValue()*scaleFactor)};slider.subscribe("slideEnd",function(offsetFromStart){var actualValue=slider.getRealValue();eval(funcao+"("+actualValue+")")})});Event.on("putval","click",function(e){slider.setValue(100,false)})},comboCabecalhoTemas:function(idDiv,idCombo,ferramenta,tipo,onButtonClick){var temp=$i(idDiv);if(temp&&!($i(idCombo))){i3GEO.util.comboTemas(temp.id+"Sel",function(retorno){var tema,container=$i(idDiv),botao;container.innerHTML=retorno.dados;botao=new YAHOO.widget.Button(idCombo,{type:"menu",menu:idCombo+"select"});if(i3GEO.temaAtivo!=""){tema=i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo);botao.set("label","<span class='cabecalhoTemas' >"+tema.tema+"</span> ")}else{botao.set("label","<span class='cabecalhoTemas' >"+$trad("x92")+"</span> ")}if(!onButtonClick){onButtonClick=function(p_sType,p_aArgs){var oMenuItem=p_aArgs[1];if(oMenuItem){i3GEO.mapa.ativaTema(oMenuItem.value);if(oMenuItem.value===""){i3GEO.temaAtivo="";botao.set("label","<span class='cabecalhoTemas' >"+$trad("x92")+"</span> ")}else{botao.set("label","<span class='cabecalhoTemas' >"+oMenuItem.cfg.getProperty("text")+"</span> ")}if(i3GEOF[ferramenta]){i3GEOF[ferramenta].tema=oMenuItem.value;if($i("i3GEOF."+ferramenta+"_corpo")){$i("i3GEOF."+ferramenta+"_corpo").innerHTML="";eval("i3GEOF."+ferramenta+".inicia('i3GEOF."+ferramenta+"_corpo');")}}}}}botao.getMenu().subscribe("click",onButtonClick,botao)},temp.id,"",false,tipo,"",true,true)}if(i3GEO.eventos.ATUALIZAARVORECAMADAS.length>20){i3GEO.eventos.ATUALIZAARVORECAMADAS=[]}temp="i3GEO.janela.comboCabecalhoTemas('"+idDiv+"','"+idCombo+"','"+ferramenta+"','"+tipo+"')";i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",[temp])}}; |
| 1644 | 1644 | // |
| 1645 | 1645 | //../classesjs/compactados/classe_editorol_compacto.js |
| 1646 | -if(!i3GEO||typeof(i3GEO)==='undefined'){var i3GEO={};i3GEO.Interface={};navn=false;navm=false;$i=function(id){return document.getElementById(id)};app=navigator.appName.substring(0,1);if(app==='N'){navn=true}else{navm=true}OpenLayers.ImgPath="../pacotes/openlayers/img/";OpenLayers.Lang.setCode("pt-BR")}i3GEO.editorOL={simbologia:{opacidade:0.8,texto:"",fillColor:"250,180,15",strokeWidth:2,strokeColor:"250,150,0",pointRadius:4,graphicName:"square",fontSize:"12px",fontColor:"0,0,0",externalGraphic:"",graphicHeight:25,graphicWidth:25},backup:new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}),nomeFuncaoSalvar:"i3GEO.editorOL.salvaGeo()",e_oce:new OpenLayers.Layer.ArcGIS93Rest("ESRI Ocean Basemap","http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_ims:new OpenLayers.Layer.ArcGIS93Rest("ESRI Imagery World 2D","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_wsm:new OpenLayers.Layer.ArcGIS93Rest("ESRI World Street Map","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),ol_mma:new OpenLayers.Layer.WMS("Base cartográfica","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",{layers:'baseraster',SRS:'EPSG:4618',FORMAT:'image/png'},{singleTile:false}),ol_wms:new OpenLayers.Layer.WMS("OpenLayers WMS","http://labs.metacarta.com/wms/vmap0",{layers:'basic'}),top_wms:new OpenLayers.Layer.WMS("Toponímia MMA","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&",{layers:"base",FORMAT:'image/png'}),est_wms:new OpenLayers.Layer.WMS("Estados do Brasil","http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&",{layers:"estadosl",FORMAT:'image/png'}),osm:new OpenLayers.Layer.OSM("OSM","http://tile.openstreetmap.org/${z}/${x}/${y}.png",{isBaseLayer:true,visibility:false}),fundo:"e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce",kml:[],layersIniciais:[],botoes:{'pan':true,'zoombox':true,'zoomtot':true,'zoomin':true,'zoomout':true,'legenda':true,'distancia':true,'area':true,'identifica':true,'linha':true,'ponto':true,'poligono':true,'texto':true,'edita':true,'listag':true,'corta':true,'apaga':true,'procura':true,'selecao':true,'selecaotudo':true,'salva':true,'ajuda':true,'propriedades':true,'fecha':false,'tools':true,'undo':false,'frente':false,'legenda':true,'rodadomouse':true},pontos:[],marca:"../pacotes/openlayers/img/marker-gold.png",controles:[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoomBar(),new OpenLayers.Control.LayerSwitcher({'ascending':false}),new OpenLayers.Control.ScaleLine(),new OpenLayers.Control.MousePosition({'separator':' '}),new OpenLayers.Control.OverviewMap(),new OpenLayers.Control.KeyboardDefaults()],tiles:true,incluilayergrafico:true,ativalayerswitcher:false,ativarodadomouse:true,legendahtml:false,numzoom:12,minresolution:0.703125,maxext:"",mapext:new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081),mapa:"",inicia:function(){var alayers=[],fundo=(i3GEO.editorOL.fundo).split(","),nfundo=fundo.length,ncontroles=i3GEO.editorOL.controles.length,i,n;if(i3GEO.editorOL.tiles===false||i3GEO.editorOL.tiles==="false"){single=true}if(i3GEO.editorOL.ativalayerswitcher==="false"){i3GEO.editorOL.ativalayerswitcher=false}if(i3GEO.editorOL.ativalayerswitcher==="true"){i3GEO.editorOL.ativalayerswitcher=true}if(i3GEO.editorOL.ativarodadomouse==="false"){i3GEO.editorOL.ativarodadomouse=false}if(i3GEO.editorOL.ativarodadomouse==="true"){i3GEO.editorOL.ativarodadomouse=true}if(i3GEO.editorOL.legendahtml==="false"){i3GEO.editorOL.legendahtml=false}if(i3GEO.editorOL.legendahtml==="true"){i3GEO.editorOL.legendahtml=true}if(i3GEO.editorOL.incluilayergrafico==="false"){i3GEO.editorOL.incluilayergrafico=false}if(i3GEO.editorOL.incluilayergrafico==="true"){i3GEO.editorOL.incluilayergrafico=true}if(i3GEO.editorOL.incluilayergrafico===true){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}}else{i3GEO.desenho.layergrafico="";i3GEO.editorOL.botoes.linha=false;i3GEO.editorOL.botoes.ponto=false;i3GEO.editorOL.botoes.poligono=false;i3GEO.editorOL.botoes.texto=false;i3GEO.editorOL.botoes.edita=false;i3GEO.editorOL.botoes.listag=false;i3GEO.editorOL.botoes.corta=false;i3GEO.editorOL.botoes.apaga=false;i3GEO.editorOL.botoes.selecao=false;i3GEO.editorOL.botoes.selecaotudo=false;i3GEO.editorOL.botoes.salva=false;i3GEO.editorOL.botoes.propriedades=false;i3GEO.editorOL.botoes.fecha=false;i3GEO.editorOL.botoes.tools=false;i3GEO.editorOL.botoes.undo=false;i3GEO.editorOL.botoes.frente=false}if(i3GEO.editorOL.mapa===""){alert("O objeto i3GEO.editorOL.mapa nao existe. Precisa ser criado com new OpenLayers.Map()");return}for(i=0;i<ncontroles;i++){i3GEO.editorOL.mapa.addControl(i3GEO.editorOL.controles[i])}if(i3GEO.editorOL.fundo!=""){for(i=nfundo-1;i>=0;i--){if(fundo[i]!=""){try{i3GEO.editorOL[fundo[i]].transitionEffect='resize';i3GEO.editorOL[fundo[i]].setVisibility(false);i3GEO.editorOL[fundo[i]].singleTile=false;alayers.push(i3GEO.editorOL[fundo[i]])}catch(e){if(alayers[0]){alayers[0].setVisibility(true)}}}}}i3GEO.editorOL.mapa.addLayers(alayers);if(i3GEO.editorOL.layersIniciais!==""){n=i3GEO.editorOL.layersIniciais.length;for(i=0;i<n;i++){i3GEO.editorOL.mapa.addLayer(i3GEO.editorOL.layersIniciais[i])}}if(!i3GEO.desenho.layergrafico&&i3GEO.editorOL.incluilayergrafico===true){i3GEO.editorOL.mapa.addLayers([i3GEO.desenho.layergrafico])}i3GEO.editorOL.adicionaKml();i3GEO.editorOL.adicionaMarcas();i3GEO.editorOL.coordenadas();i3GEO.editorOL.criaJanelaBusca();i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes);if(i3GEO.editorOL.ativalayerswitcher===true){i3GEO.editorOL.ativaLayerSwitcher()}if(i3GEO.editorOL.ativarodadomouse===false){i3GEO.editorOL.desativaRodaDoMouse()}if(i3GEO.editorOL.numzoom!==""){i3GEO.editorOL.mapa.setOptions({numZoomLevels:i3GEO.editorOL.numzoom})}if(i3GEO.editorOL.maxext!==""){i3GEO.editorOL.mapa.setOptions({maxExtent:i3GEO.editorOL.maxext})}if(i3GEO.editorOL.mapext!=""){var m=i3GEO.util.extGeo2OSM(i3GEO.editorOL.mapext);i3GEO.editorOL.mapa.zoomToExtent(m)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}i3GEO.editorOL.sobeLayersGraficos()},criaLayerGrafico:function(){i3GEO.desenho.openlayers.criaLayerGrafico()},layersLigados:function(){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,ins=[],i;for(i=0;i<nlayers;i++){if(layers[i].visibility===true){ins.push(layers[i])}}return ins},layersClonados:function(paramsLayers){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,i;for(i=0;i<nlayers;i++){if(layers[i].params&&layers[i].params.CLONETMS===paramsLayers){return(layers[i])}}return false},layertms2wms:function(tms){var layer,url;url=tms.url.replace("&cache=sim","&DESLIGACACHE=sim");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");layer=new OpenLayers.Layer.WMS(tms.layername+"_clone",url,{layers:tms.name,transparent:true},{gutter:0,isBaseLayer:false,displayInLayerSwitcher:false,opacity:1,visibility:true,singleTile:true});return layer},removeClone:function(){var nome=i3GEO.editorOL.layerAtivo().layername+"_clone",busca=i3GEO.editorOL.mapa.getLayersByName(nome);if(busca.length>0){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.mapa.getLayersByName(camada.name)[0],false)}},coordenadas:function(){var idcoord=i3GEO.editorOL.mapa.getControlsBy("separator"," ");if(idcoord[0]){i3GEO.editorOL.mapa.events.register("mousemove",i3GEO.editorOL.mapa,function(e){var p,lonlat,d;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(p);lonlat=i3GEO.util.projOSM2Geo(lonlat);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{$i(idcoord[0].id).innerHTML="Long: "+d[0]+"<br>Lat: "+d[1]}catch(e){}})}},criaJanelaBusca:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,ins,combo="<select id=i3GEOOLlistaTemasBusca ><option value=''>----</option>";for(i=0;i<nlayers;i++){combo+="<option value='"+i+"' >"+layers[i].name+"</option>"}combo+="</select>";ins="<div class=paragrafo >Tema:<br>"+combo;ins+="<br>Item:<br><span id=i3GEOOLcomboitens ></span>";ins+="<br>Procurar por:<br><input type=text size=20 id=i3GEOOLpalavraBusca >";ins+="<br><br><input type=button value='Procurar' id='i3GEOOLbotaoBusca' ></div>";ins+="<br>Resultado:<br><span id=i3GEOOLcomboresultado ></span>";try{YAHOO.namespace("procura.container");YAHOO.procura.container.panel=new YAHOO.widget.Panel("panelprocura",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.procura.container.panel.setHeader("Encontre no mapa");YAHOO.procura.container.panel.setBody(ins);YAHOO.procura.container.panel.setFooter("");YAHOO.procura.container.panel.render(document.body);YAHOO.procura.container.panel.center();document.getElementById("i3GEOOLbotaoBusca").onclick=function(){var layer=i3GEO.editorOL.layerAtivo(),item=document.getElementById("i3GEOOLbuscaItem").value,palavra=document.getElementById("i3GEOOLpalavraBusca").value;if(item===""||palavra===""){alert("Escolha o item e o texto de busca");return}i3GEO.editorOL.busca(layer,item,palavra,"i3GEOOLcomboresultado")};document.getElementById("i3GEOOLlistaTemasBusca").onchange=function(){i3GEO.editorOL.ativaTema(this.value);document.getElementById("i3GEOOLcomboitens").innerHTML="...";i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(),"i3GEOOLcomboitens","i3GEOOLbuscaItem")}}catch(e){}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",temp,combo="<select id=i3GEOOLlistaTemasAtivos style=width:235px; >";for(i=0;i<nlayers;i++){nometema="";if(i3GEO.arvoreDeCamadas&&i3GEO.arvoreDeCamadas.CAMADAS){temp=i3GEO.arvoreDeCamadas.pegaTema(layers[i].name,"","name");if(temp!=""){nometema=temp.tema+" - "}}combo+="<option value='"+i+"' >"+nometema+layers[i].name+"</option>"}combo+="</select>";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo);document.getElementById("i3GEOOLlistaTemasAtivos").onchange=function(){if(botaoIdentifica){botaoIdentifica.layers=[i3GEO.editorOL.layersLigados()[this.value]]}}},criaJanelaAtivaTema:function(){var temp;if(!document.getElementById("paneltemaativo")){YAHOO.namespace("temaativo.container");YAHOO.temaativo.container.panel=new YAHOO.widget.Panel("paneltemaativo",{zIndex:20000,iframe:true,width:"250px",visible:false,draggable:true,close:true});YAHOO.temaativo.container.panel.setBody("");if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.temaativo.container.panel.setHeader("Tema ativo<div id='paneltemaativo_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.temaativo.container.panel.setHeader("Tema ativo")}YAHOO.temaativo.container.panel.setFooter("");YAHOO.temaativo.container.panel.render(document.body);YAHOO.temaativo.container.panel.show();YAHOO.temaativo.container.panel.center();i3GEO.editorOL.atualizaJanelaAtivaTema();YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close,"click",function(){i3GEOpanelEditor.deactivate();i3GEOpanelEditor.activate();if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}}temp=$i("paneltemaativo_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("paneltemaativo")}}}else{YAHOO.temaativo.container.panel.show();i3GEO.editorOL.atualizaJanelaAtivaTema()}},ativaTema:function(id){document.getElementById("i3GEOOLlistaTemasAtivos").value=id},layerAtivo:function(){var id=document.getElementById("i3GEOOLlistaTemasAtivos");if(id){id=id.value}else{id=i3GEO.temaAtivo}if(id==""){return[]}else{return i3GEO.editorOL.layersLigados()[id]}},listaItens:function(layer,idonde,idobj){if(!layer){return}if(!layer.params){return}var u=layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0";u+="&typename="+layer.params.LAYERS;document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.WFSDescribeFeatureType({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),prop=gml.featureTypes[0].properties,nprop=prop.length,i,combo="<select id="+idobj+" ><option value=''>----</option>";for(i=0;i<nprop;i++){combo+="<option value="+prop[i].name+" >"+prop[i].name+"</option>"}combo+="</select>";document.getElementById(idonde).innerHTML=combo},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},busca:function(layer,item,palavra,onde){document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";var u=layer.url+"&request=getfeature&service=wfs&version=1.0.0";u=u.replace("Z=${z}&X=${x}&Y=${y}","");u+="&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS;u+="&filter=<Filter><PropertyIsLike wildcard=* singleChar=. escape=! ><PropertyName>"+item+"</PropertyName><Literal>*"+palavra+"*</Literal></PropertyIsLike></Filter>";document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";document.getElementById(onde).innerHTML="...";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),ngml=gml.length,i,ins="<select onchange='i3GEO.editorOL.zoomPara(this.value)'>";ins+="<option value=''>---</option>";for(i=0;i<ngml;i++){eval("var valor = gml[i].data."+item);var bounds=gml[i].geometry.getBounds();bounds=bounds.toBBOX();ins+="<option value='"+bounds+"'>"+valor+"</option>"}ins+="</select>";document.getElementById(onde).innerHTML=ins},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},zoomPara:function(bbox){var b=new OpenLayers.Bounds.fromString(bbox);i3GEO.editorOL.mapa.zoomToExtent(b)},mostraLegenda:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,ins="",i;for(i=0;i<nlayers;i++){try{if(layers[i].isBaseLayer===false){var url=layers[i].getFullRequestString({"request":"getlegendgraphic"});if(i3GEO.editorOL.legendahtml===true){url=url.replace("image%2Fpng","text/html");ins+=layers[i].name+"<br><div id=legendaL_"+i+" ></div><br>";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");var config={method:"GET",url:url,callback:f};OpenLayers.Request.issue(config)}else{url=url.replace("LAYERS","LAYER");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");ins+=layers[i].name+"<br><img src='"+url+"&SERVICE=wms' /><br>"}}}catch(e){}}if(!document.getElementById("panellegendaeditorOL")){YAHOO.namespace("legendaeditorOL.container");YAHOO.legendaeditorOL.container.panel=new YAHOO.widget.Panel("panellegendaeditorOL",{zIndex:20000,iframe:true,width:"auto",visible:false,draggable:true,close:true});YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.setHeader("Legenda");YAHOO.legendaeditorOL.container.panel.setFooter("");YAHOO.legendaeditorOL.container.panel.render(document.body);YAHOO.legendaeditorOL.container.panel.show();YAHOO.legendaeditorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.legendaeditorOL.container.panel.close,"click",function(){})}else{YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.show()}},captura:function(lonlat){var d=0.1,layers=[i3GEO.editorOL.layerAtivo()],xy=lonlat.split(","),u=layers[0].url+"&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS;u=u.replace("&cache=sim","&DESLIGACACHE=sim");u=u.replace("&Z=${z}&X=${x}&Y=${y}","");u=u.replace("Z=${z}&X=${x}&Y=${y}","");xy[0]=xy[0]*1;xy[1]=xy[1]*1;var poligono=(xy[0]-d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]+d);u+="&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:posList>"+poligono+"</gml:posList></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></Filter>";document.body.style.cursor="wait";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="wait"}OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}var i,n,f,fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText);n=gml.length;for(i=0;i<n;i++){f=gml[i];f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,registros:f["attributes"]}}i3GEO.desenho.layergrafico.addFeatures(gml)},failure:function(){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}alert("Erro")}})},salvaGeometrias:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="";if(n>0){if($i("panelsalvageometrias")){if(YAHOO.i3GEO){YAHOO.salvaGeometrias.container.panel=YAHOO.i3GEO.janela.manager.find("panelsalvageometrias")}YAHOO.salvaGeometrias.container.panel.show();YAHOO.salvaGeometrias.container.panel.bringToTop()}else{try{YAHOO.namespace("salvaGeometrias.container");YAHOO.salvaGeometrias.container.panel=new YAHOO.widget.Panel("panelsalvageometrias",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.salvaGeometrias.container.panel.setHeader("Geometrias");YAHOO.salvaGeometrias.container.panel.setBody("");YAHOO.salvaGeometrias.container.panel.setFooter("");YAHOO.salvaGeometrias.container.panel.render(document.body);YAHOO.salvaGeometrias.container.panel.center();if(YAHOO.i3GEO&&YAHOO.i3GEO.janela){YAHOO.i3GEO.janela.manager.register(YAHOO.salvaGeometrias.container.panel)}YAHOO.salvaGeometrias.container.panel.show()}catch(e){}}ins+="<p class=paragrafo >Foram encontrada(s) "+n+" geometria(s) selecionada(s) </p>";ins+="<p class=paragrafo ><a href='#' onclick='i3GEO.editorOL.listaGeometriasSel()' >Listar</a> ";if(i3GEO.arvoreDeCamadas){ins+="<a href='#' onclick='"+i3GEO.editorOL.nomeFuncaoSalvar+"' >Salvar dados</a> "}ins+="<a href='#' onclick='i3GEO.editorOL.incorporar()' >Incorporar ao mapa</a></p>";ins+="<p class=paragrafo>"+$trad("ajudaEditorOlSalva")+"</p>";YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{alert("Selecione pelo menos um elemento")}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="",i,a,w,g;for(i=0;i<n;i++){g=geos[i];ins+="<b>Geometria: "+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.geometry)+"<br><br>";ins+="<b>Atributos: "+i+"</b><br>";a=g.attributes;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}if(g.attributes.registros){ins+="<b>Registros: "+i+"</b><br>";a=g.attributes.registros;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}}ins+="<br>"}w=window.open();w.document.write(ins);w.document.close()},testeSalvar:function(){alert("Funcao nao disponivel. Defina o nome da funcao em i3GEO.editorOL.nomeFuncaoSalvar ")},salvaGeo:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,funcaoOK=function(){if(geos[0].geometry){var registros="",valorunico="",nometema=$i("editorOLcomboTemaEditavel").value,key="",tema,redesenha,p,g=i3GEO.editorOL.google2wgs(geos[0].geometry);if(nometema==""){return}tema=i3GEO.arvoreDeCamadas.pegaTema(nometema,"","name");if(geos[0].attributes.registros){registros=geos[0].attributes.registros;for(key in registros){if(registros[key]&&key==tema.colunaidunico){valorunico=registros[key]}}}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);i3GEO.Interface.atualizaTema("",nometema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto","Adicionando...");i3GEO.janela.AGUARDEMODAL=false;if(valorunico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+g)}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+g)}}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto="Salvar no tema:<br><div id=editorOLondeComboTemaEditavel ></div><br><br>";if(n!=1){i3GEO.janela.tempoMsg("Selecione apenas uma figura")}else{i3GEO.janela.confirma(texto,300,"Salva","Cancela",funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel")}},criaBotoes:function(botoes){var sketchSymbolizers={"Point":{pointRadius:4,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},"Line":{strokeWidth:3,strokeOpacity:1,strokeColor:"#666666",strokeDashstyle:"dash"},"Polygon":{strokeWidth:2,strokeOpacity:1,strokeColor:"#666666",fillColor:"white",fillOpacity:0.3}},style=new OpenLayers.Style(),styleMap=new OpenLayers.StyleMap({"default":style,"vertex":{strokeOpacity:1,strokeWidth:1,fillColor:"white",fillOpacity:0.45,pointRadius:3}},{extendDefault:false}),adiciona=false,button,controles=[];style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);i3GEOpanelEditor=new OpenLayers.Control.Panel({displayClass:"olControlEditingToolbar1 noprint",saveState:false,activateControl:function(c){this.deactivate();this.activate();try{i3GEO.editorOL.ModifyFeature.deactivate();if(i3GEO&&i3GEO.barraDeBotoes){i3GEO.barraDeBotoes.ativaPadrao()}}catch(e){}if(!c.trigger){c.activate()}else{c.trigger.call()}}});if(botoes.procura===true){button=new OpenLayers.Control.Button({displayClass:"editorOLprocura",trigger:function(){YAHOO.procura.container.panel.show()},title:"procura",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.pan===true){controles.push(new OpenLayers.Control.Navigation({title:"deslocar",displayClass:"editorOLpan",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoombox===true){controles.push(new OpenLayers.Control.ZoomBox({title:"zoombox",displayClass:"editorOLzoombox",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoomtot===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomtot",trigger:function(){if(i3GEO.editorOL.mapext&&i3GEO.editorOL.mapext!=""){i3GEO.editorOL.mapa.zoomToExtent(i3GEO.editorOL.mapext)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}},title:"ajusta extensao",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomin===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomin",trigger:function(){i3GEO.editorOL.mapa.zoomIn()},title:"aproxima",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomout===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomout",trigger:function(){i3GEO.editorOL.mapa.zoomOut()},title:"afasta",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.legenda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlegenda",trigger:function(){i3GEO.editorOL.mostraLegenda()},title:"legenda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.distancia===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Path,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLdistancia",title:"distancia",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units,measure=event.measure;alert("Distancia: "+measure.toFixed(3)+" "+units)}});controles.push(button);adiciona=true}if(botoes.area===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLarea",title:"area",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units;var measure=event.measure;alert("Área: "+measure.toFixed(3)+" "+units+" quadrados")}});controles.push(button);adiciona=true}if(botoes.identifica===true){botaoIdentifica=new OpenLayers.Control.WMSGetFeatureInfo({maxFeatures:1,infoFormat:'text/plain',layers:[i3GEO.editorOL.layerAtivo()],queryVisible:true,title:"identifica",type:OpenLayers.Control.TYPE_TOOL,displayClass:"editorOLidentifica",eventListeners:{getfeatureinfo:function(event){var lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),lonlattexto="<hr>",formata;if(botoes.linha===true||botoes.ponto===true||botoes.poligono===true||botoes.edita===true){lonlattexto+="<pre><span style=font-size:12px;color:blue;cursor:pointer onclick='i3GEO.editorOL.captura(\""+lonlat.lon+","+lonlat.lat+"\")'>edita geometria</span></pre><br>"}formata=function(texto){var temp,temp1,n,i,f=[],textoN=texto.split(":");try{if(textoN.length>1){temp=textoN[2].replace(/\n\r/g,"");temp=temp.replace(/'/g,"");temp=temp.replace(/\n/g,"|");temp=temp.replace(/_/g," ");temp=temp.replace(/=/g,":");temp=temp.split("|");n=temp.length;for(i=0;i<n;i++){temp1=temp[i].replace(/^\s+/,"");temp1=temp1.replace(/\s+$/,"");if(temp1!="")f.push(temp1)}texto=f.join("<br><br>")}}catch(e){}return texto};i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("chicken",i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),null,"<div style=text-align:left >"+lonlattexto+"<pre>"+formata(event.text)+"</pre></div>",null,true));i3GEO.editorOL.removeClone()},beforegetfeatureinfo:function(event){var ativo=[i3GEO.editorOL.layerAtivo()];if(ativo[0].serviceVersion==="&tms="||ativo[0].CLASS_NAME=="OpenLayers.Layer.TMS"||ativo[0].CLASS_NAME=="OpenLayers.Layer.OSM"){ativo=[i3GEO.editorOL.layertms2wms(ativo[0])]}ativo[0].projection=new OpenLayers.Projection("EPSG:4326");event.object.layers=ativo;botaoIdentifica.layers=ativo;botaoIdentifica.url=ativo[0].url},activate:function(){i3GEO.editorOL.criaJanelaAtivaTema()}}});controles.push(botaoIdentifica);adiciona=true}if(botoes.linha===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Path,{displayClass:"editorOLlinha",title:"digitalizar linha",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.ponto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLponto",title:"digitalizar ponto",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f,style_mark;if(i3GEO.editorOL.simbologia.externalGraphic!=""){style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=i3GEO.editorOL.simbologia.externalGraphic;style_mark.graphicWidth=i3GEO.editorOL.simbologia.graphicWidth;style_mark.graphicHeight=i3GEO.editorOL.simbologia.graphicHeight;style_mark.fillOpacity=i3GEO.editorOL.simbologia.opacidade;f=new OpenLayers.Feature.Vector(feature,null,style_mark)}else{f=new OpenLayers.Feature.Vector(feature)}f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,externalGraphic:i3GEO.editorOL.simbologia.externalGraphic,graphicHeight:i3GEO.editorOL.simbologia.graphicHeight,graphicWidth:i3GEO.editorOL.simbologia.graphicWidth};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.poligono===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLpoligono",title:"digitalizar poligono",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.texto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLtexto",title:"incluir texto",type:OpenLayers.Control.TYPE_TOOL,persist:true,callbacks:{done:function(feature){var texto=window.prompt("Texto",""),label=new OpenLayers.Feature.Vector(feature);label["attributes"]={opacidade:0.1,fillColor:"white",strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,texto:texto,pointRadius:2,graphicName:"square",strokeColor:"black",fontColor:i3GEO.editorOL.simbologia.fontColor,fontSize:i3GEO.editorOL.simbologia.fontSize,fontFamily:"Arial",fontWeight:"bold",labelAlign:"rt"};if(texto&&texto!==""){i3GEO.desenho.layergrafico.addFeatures([label])}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEO.editorOL.CortaFeature=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLcorta",title:"corta figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length!=1){alert("Selecione primeiro um elemento para ser cortado");i3GEO.editorOL.CortaFeature.deactivate()}else{i3GEO.editorOL.CortaFeature.activate()}},callbacks:{done:function(feature){var temp,sel=i3GEO.desenho.layergrafico.selectedFeatures[0].geometry,corta=feature;temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,sel+"|"+corta,"difference")}}});controles.push(i3GEO.editorOL.CortaFeature);adiciona=true}if(botoes.edita===true){i3GEO.editorOL.ModifyFeature=new OpenLayers.Control.ModifyFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLedita",title:"modifica figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,mode:OpenLayers.Control.ModifyFeature.RESHAPE,standalone:false,createVertices:true,styleMap:"default",vertexRenderIntent:"vertex"});controles.push(i3GEO.editorOL.ModifyFeature);adiciona=true}if(botoes.edita===true&&botoes.listag===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlistag",trigger:function(){i3GEO.editorOL.listaGeometrias()},title:"lista geometrias",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.frente===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfrente",trigger:function(){i3GEO.editorOL.trazParaFrente();if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},title:"traz para frente",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.tools===true&&i3GEO.php){button=new OpenLayers.Control.Button({displayClass:"editorOLtools",trigger:function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}},title:"ferramentas",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.selecao===true){i3GEO.editorOL.selbutton=new OpenLayers.Control.SelectFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLselecao",title:"seleciona elemento",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,multiple:false,hover:false,toggleKey:"ctrlKey",multipleKey:"shiftKey",box:false});controles.push(i3GEO.editorOL.selbutton);adiciona=true}if(botoes.selecaotudo===true){button=new OpenLayers.Control.Button({displayClass:"editorOLselecaoTudo",trigger:function(){var fs=i3GEO.desenho.layergrafico.features,n=fs.length,i;for(i=0;i<n;i++){i3GEO.editorOL.selbutton.select(fs[i])}},title:"seleciona tudo",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.apaga===true){button=new OpenLayers.Control.Button({displayClass:"editorOLapaga",trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length>0){var x=window.confirm("Exclui os elementos selecionados?");if(x){i3GEO.editorOL.guardaBackup();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.janela.tempoMsg("Para excluir registros do banco de dados utilize a ferramenta de identificacao")}}else{alert("Selecione pelo menos um elemento")}},title:"apaga selecionados",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.propriedades===true){button=new OpenLayers.Control.Button({displayClass:"editorOLpropriedades",trigger:function(){i3GEO.editorOL.propriedades()},title:"propriedades",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.salva===true){button=new OpenLayers.Control.Button({displayClass:"editorOLsalva",trigger:function(){i3GEO.editorOL.salvaGeometrias()},title:"salva",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.ajuda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLajuda",trigger:function(){try{window.open(i3GEO.configura.locaplic+"/mashups/openlayers_ajuda.php")}catch(e){window.open("openlayers_ajuda.php")}},title:"ajuda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.fecha===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfecha",trigger:function(){var temp=window.confirm($trad("x94"));if(i3GEO.eventos){i3GEO.eventos.cliquePerm.ativa()}i3GEOpanelEditor.destroy();try{YAHOO.temaativo.container.panel.destroy()}catch(e){}try{YAHOO.procura.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.listaGeometrias.panel.destroy()}catch(e){}try{YAHOO.editorOL.ferramentas.panel.destroy()}catch(e){}try{YAHOO.legendaeditorOL.container.panel.destroy()}catch(e){}try{YAHOO.salvaGeometrias.container.panel.destroy()}catch(e){}if(temp===true){try{if(i3GEO.desenho.layergrafico){i3GEO.editorOL.mapa.removeLayer(i3GEO.desenho.layergrafico);delete(i3GEO.desenho.layergrafico)}if(i3GEO.editorOL.backup){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.backup);delete(i3GEO.editorOL.backup)}}catch(e){}}},title:"fecha editor",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}i3GEOOLsnap=new OpenLayers.Control.Snapping({layer:i3GEO.desenho.layergrafico});i3GEOOLsplit=new OpenLayers.Control.Split({layer:i3GEO.desenho.layergrafico,source:i3GEO.desenho.layergrafico,tolerance:0.0001,eventListeners:{beforesplit:function(event){i3GEO.editorOL.guardaBackup()},aftersplit:function(event){i3GEO.editorOL.flashFeatures(event.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}}});if(adiciona===true){i3GEOpanelEditor.addControls(controles);i3GEO.editorOL.mapa.addControl(i3GEOpanelEditor)}},mudaSimbolo:function(estilo,id){var valor=$i(id).value,geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,i;i3GEO.editorOL.simbologia[estilo]=valor;for(i=0;i<n;i++){geos[i].attributes[estilo]=valor;geos[i].style[estilo]=valor}},adicionaMarcas:function(){if(i3GEO.editorOL.pontos.length===0){return}var f,SHADOW_Z_INDEX=10,MARKER_Z_INDEX=11,layer=new OpenLayers.Layer.Vector("pontos",{styleMap:new OpenLayers.StyleMap({externalGraphic:i3GEO.editorOL.marca,backgroundGraphic:"../pacotes/openlayers/img/marker_shadow.png",backgroundXOffset:0,backgroundYOffset:-7,graphicZIndex:MARKER_Z_INDEX,backgroundGraphicZIndex:SHADOW_Z_INDEX,pointRadius:10}),isBaseLayer:false,rendererOptions:{yOrdering:true},displayInLayerSwitcher:true,visibility:true}),index,x=[],y=[],features=[];for(index=0;index<i3GEO.editorOL.pontos.length;index=index+2){x.push(i3GEO.editorOL.pontos[index]);y.push(i3GEO.editorOL.pontos[index+1])}for(index=0;index<x.length;index++){f=new OpenLayers.Geometry.Point(x[index],y[index]);f=i3GEO.util.projGeo2OSM(f);f=new OpenLayers.Feature.Vector(f);features.push(f)}layer.addFeatures(features);i3GEO.editorOL.mapa.addLayer(layer)},adicionaKml:function(){var temp,n,i,id,url;n=i3GEO.editorOL.kml.length;for(i=0;i<n;i++){id="kml"+i;url=i3GEO.editorOL.kml[i];eval(id+" = new OpenLayers.Layer.Vector('"+id+"', {displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true, strategies: [new OpenLayers.Strategy.Fixed()],protocol: new OpenLayers.Protocol.HTTP({url: '"+url+"',format: new OpenLayers.Format.KML({extractStyles: true,extractAttributes: true,maxDepth: 5})})})");eval("i3GEO.editorOL.mapa.addLayer("+id+");");eval("temp = "+id+".div;");temp.onclick=function(e){var targ="",id,temp,features,n,i,g,html="";if(!e){e=window.event}if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ.id){temp=targ.id.split("_");if(temp[0]==="OpenLayers.Geometry.Point"){id=targ.id;temp=i3GEO.editorOL.mapa.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(var j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}}}},propriedades:function(){if(!document.getElementById("panelpropriedadesEditor")){YAHOO.namespace("editorOL.container");YAHOO.editorOL.container.panel=new YAHOO.widget.Panel("panelpropriedadesEditor",{zIndex:20000,iframe:true,width:"350px",height:"250px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo ><b>Estilos (utilize a cor no formato r,g,b):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td>Cor do contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(strokeColor,i3GEOEditorOLcorContorno)" type="text" style="cursor:text" id="i3GEOEditorOLcorContorno" size="12" value="'+i3GEO.editorOL.simbologia.strokeColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorContorno);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor do preenchimento</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fillColor,i3GEOEditorOLcorPre)" type="text" style="cursor:text" id="i3GEOEditorOLcorPre" size="12" value="'+i3GEO.editorOL.simbologia.fillColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorPre);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fontColor,i3GEOEditorOLcorFonte)" type="text" style="cursor:text" id="i3GEOEditorOLcorFonte" size="12" value="'+i3GEO.editorOL.simbologia.fontColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorFonte);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Tamanho da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fontSize,i3GEOEditorOLfontsize)" type="text" style="cursor:text" id="i3GEOEditorOLfontsize" size="3" value="'+i3GEO.editorOL.simbologia.fontSize+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Opacidade (de 0 a 1)</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(opacidade,i3GEOEditorOLopacidade)" type="text" style="cursor:text" id="i3GEOEditorOLopacidade" size="3" value="'+i3GEO.editorOL.simbologia.opacidade+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura da linha/contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(strokeWidth,i3GEOEditorOLlarguraLinha)" type="text" style="cursor:text" id="i3GEOEditorOLlarguraLinha" size="2" value="'+i3GEO.editorOL.simbologia.strokeWidth+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Url de uma figura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(externalGraphic,i3GEOEditorOLexternalGraphic)" type="text" style="cursor:text" id="i3GEOEditorOLexternalGraphic" size="22" value="'+i3GEO.editorOL.simbologia.externalGraphic+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura e altura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(graphicWidth,i3GEOEditorOLgraphicWidth)" type="text" style="cursor:text" id="i3GEOEditorOLgraphicWidth" size="4" value="'+i3GEO.editorOL.simbologia.graphicWidth+'" /> <input onchange="i3GEO.editorOL.mudaSimbolo(graphicHeight,i3GEOEditorOLgraphicHeight)" type="text" style="cursor:text" id="i3GEOEditorOLgraphicHeight" size="4" value="'+i3GEO.editorOL.simbologia.graphicHeight+'" /></td><td></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Ajusta nó em edição para o(a):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td></td><td>nó</td><td></td><td>vértice</td><td></td><td>borda</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_node" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_nodeTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_vertex" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_vertexTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_edge" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_edgeTolerance" type="text" size="3" value=15 /></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Divide intersecção ao digitalizar</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.split()" type="checkbox" id="edge_split_toggle" /></td><td>borda</td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Operação ativada pelo botão de modificação da figura</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input checked style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESHAPE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera figura</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESIZE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera tamanho</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.ROTATE;" type="radio" name=i3geoOLtipoEdita /></td><td>rotaciona</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.DRAG;" type="radio" name=i3geoOLtipoEdita /></td><td>desloca</td>'+' </tr>'+'</table>';YAHOO.editorOL.container.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.container.panel.setHeader("Propriedades<div id='panelpropriedadesEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.container.panel.setHeader("Propriedades")}YAHOO.editorOL.container.panel.setFooter("");YAHOO.editorOL.container.panel.render(document.body);YAHOO.editorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close,"click",function(){});temp=$i("panelpropriedadesEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelpropriedadesEditor")}}}YAHOO.editorOL.container.panel.show();temp=$i("panelpropriedadesEditor").getElementsByTagName("div");if(temp&&temp[2]){temp[2].style.overflow="auto"}},listaGeometrias:function(){if(!document.getElementById("panellistagEditor")){YAHOO.namespace("editorOL.listaGeometrias");YAHOO.editorOL.listaGeometrias.panel=new YAHOO.widget.Panel("panellistagEditor",{zIndex:20000,iframe:true,width:"320px",visible:false,draggable:true,close:true});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias <div id='panellistagEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias")}YAHOO.editorOL.listaGeometrias.panel.setFooter("");YAHOO.editorOL.listaGeometrias.panel.render(document.body);YAHOO.editorOL.listaGeometrias.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.listaGeometrias.panel.close,"click",function(){YAHOO.editorOL.listaGeometrias.panel.destroy()});temp=$i("panellistagEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panellistagEditor")}}}else{YAHOO.editorOL.listaGeometrias.panel.render(document.body)}var g,temp,geos=i3GEO.desenho.layergrafico.features,n=geos.length,ins="<table class=lista4 >";ins+="<tr><td><i>Geometrias</i></td><td><i>Opções</i></td><td></td><td></td></tr>";while(n>0){n-=1;g=geos[n].geometry;ins+="<tr><td>"+g.CLASS_NAME+"</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.selFeature("+n+")'>seleciona</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.unselFeature("+n+")'>limpa</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.flashFeaturesI("+n+")'>brilha</td></tr>"}ins+="</table>";if(geos.length===0){ins="Nenhum elemento gráfico encontrado. Utilize as opções de criação de geometrias."}YAHOO.editorOL.listaGeometrias.panel.show();if(i3GEO.configura){temp=$i("panellistagEditor").getElementsByTagName("div")[2]}else{temp=$i("panellistagEditor").getElementsByTagName("div")[1]}temp.style.overflow="auto";temp.style.height="100px";temp.innerHTML=ins},ferramentas:function(){if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo >Operações sobre as figuras selecionadas:</p>'+'<select onchange="i3GEO.editorOL.processageo(this.value);this.value = " >'+' <option value="">---</option>'+' <option value=union >União</option>';if(i3GEO.php){ins+=' <option value=intersection >Intersecção</option>'+' <option value=convexhull >Convex hull</option>'+' <option value=boundary >Bordas</option>'+' <option value=difference >Diferença</option>'+' <option value=symdifference >Diferença simétrica</option>'}ins+='</select>'+'<br><br><a class=paragrafo href=# onclick="i3GEO.desenho.layergrafico.destroyFeatures()" >Apaga tudo</a>';YAHOO.editorOL.ferramentas.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas <div id='panelferramentasEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas")}YAHOO.editorOL.ferramentas.panel.setFooter("");YAHOO.editorOL.ferramentas.panel.render(document.body);YAHOO.editorOL.ferramentas.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.ferramentas.panel.close,"click",function(){});temp=$i("panelferramentasEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelferramentasEditor")}}}else{YAHOO.editorOL.ferramentas.panel.render(document.body)}YAHOO.editorOL.ferramentas.panel.show()},snap:function(){var target=i3GEOOLsnap.targets[0],tipos=["node","vertex","edge"],ntipos=tipos.length,i,temp,ativa=false;i3GEOOLsnap.deactivate();for(i=0;i<ntipos;i++){temp=$i("target_"+tipos[i]);target[tipos[i]]=temp.checked;if(temp.checked===true){ativa=true}temp=$i("target_"+tipos[i]+"Tolerance");target[tipos[i]+"Tolerance"]=temp.value}if(ativa===true){i3GEOOLsnap.activate()}},split:function(){i3GEOOLsplit.deactivate();var temp=$i("edge_split_toggle");if(temp.checked===true){i3GEOOLsplit.activate()}},processageo:function(operacao){if(operacao===""){return}var geosel=i3GEO.desenho.layergrafico.selectedFeatures,polis,linhas,pontos,temp;if(geosel.length>0){polis=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Point");temp=function(retorno){if(i3GEO.janela){i3GEO.janela.fechaAguarde("i3GEO.editorPoli");i3GEO.janela.fechaAguarde("i3GEO.editorLinhas");i3GEO.janela.fechaAguarde("i3GEO.editorPontos")}if(retorno!=""&&retorno.data&&retorno.data!=""&&operacao!="converteSHP"){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}if(operacao==="converteSHP"){i3GEO.atualiza();i3GEO.janela.minimiza("paneltemaativo")}};if(operacao==="incorporar"){if(polis.length>0){temp=i3GEO.editorOL.merge(polis)}if(linhas.length>0){temp=i3GEO.editorOL.merge(linhas)}if(pontos.length>0){temp=i3GEO.editorOL.merge(pontos)}if(i3GEO.mapa){i3GEO.mapa.dialogo.wkt2layer(temp)}return}if(operacao==="union"&&!i3GEO.php){if(polis.length>0){temp=i3GEO.editorOL.uniaojts(polis);i3GEO.editorOL.substituiFeaturesSel(temp)}if(linhas.length>0){temp=i3GEO.editorOL.uniaojts(linhas);i3GEO.editorOL.substituiFeaturesSel(temp)}if(pontos.length>0){temp=i3GEO.editorOL.uniaojts(pontos);i3GEO.editorOL.substituiFeaturesSel(temp)}}else{if(polis.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos");i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),operacao)}if(linhas.length>0){i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas");i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),operacao)}if(pontos.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos");i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao)}}return}else{alert("Selecione pelo menos dois elementos")}},merge:function(geoms){var n=geoms.length,w=new Wkt.Wkt(),g,m,i;w.read(geoms[0].toString());if(n>1){for(i=1;i<n;i++){g=geoms[i].toString();m=new Wkt.Wkt();m.read(g);w.merge(m)}}return w.write()},uniaojts:function(geoms){var n=geoms.length,rwkt=new jsts.io.WKTReader(),wwkt=new jsts.io.WKTWriter(),fwkt=new OpenLayers.Format.WKT(),g,i,uniao;if(n>1){uniao=(fwkt.read(geoms[0]).geometry).toString();uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=(fwkt.read(geoms[i]).geometry).toString();uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.read(uniao)]}else{return false}},retornaGeometriasTipo:function(features,tipo){var n=features.length,lista=[],i,temp;for(i=0;i<n;i++){temp=features[i].geometry;if(temp.CLASS_NAME==tipo){lista.push(temp)}}return lista},guardaBackup:function(){return},unselTodos:function(){var n,i;n=i3GEO.desenho.layergrafico.features.length;for(i=0;i<n;i++){i3GEO.desenho.layergrafico.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[i])}},unselTodosBackup:function(){var n,i;n=i3GEO.editorOL.backup.features.length;for(i=0;i<n;i++){i3GEO.editorOL.backup.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.editorOL.backup.features[i])}},restauraBackup:function(){if(i3GEO.editorOL.backup.features.length>0){i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features)}if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},substituiFeaturesSel:function(wkt){i3GEO.editorOL.guardaBackup();try{var f,fwkt=new OpenLayers.Format.WKT();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);f=fwkt.read(wkt);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}catch(e){i3GEO.editorOL.restauraBackup()}},adicionaFeatureWkt:function(wkt,atributos){var f,fwkt=new OpenLayers.Format.WKT();if(atributos.externalGraphic&&atributos.externalGraphic!=""){var style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=atributos.externalGraphic;style_mark.graphicWidth=atributos.graphicWidth;style_mark.graphicHeight=atributos.graphicHeight;style_mark.fillOpacity=atributos.opacidade;f=fwkt.read(wkt);f["attributes"]=atributos;f["style"]=style_mark}else{f=fwkt.read(wkt);f["attributes"]=atributos}i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},flashFeaturesI:function(index){i3GEO.editorOL.flashFeatures([i3GEO.desenho.layergrafico.features[index]],0)},flashFeatures:function(features,index){if(!index){index=0}var current=features[index];if(current&¤t.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(features[index],"select")}var prev=features[index-1];if(prev&&prev.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(prev,"default")}++index;if(index<=features.length){window.setTimeout(function(){i3GEO.editorOL.flashFeatures(features,index)},75)}},selFeature:function(index){i3GEO.editorOL.selbutton.select(i3GEO.desenho.layergrafico.features[index])},unselFeature:function(index){i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[index])},carregajts:function(funcao){if(i3GEO.configura){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}else{i3GEO.util.scriptTag("../pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}},trazParaFrente:function(){var features=i3GEO.desenho.layergrafico.selectedFeatures;if(features.length>0){i3GEO.editorOL.backup=new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false});i3GEO.editorOL.backup.addFeatures(features);i3GEO.editorOL.unselTodosBackup();i3GEO.desenho.layergrafico.removeFeatures(features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}else{alert("Selecione pelo menos um elemento")}},pegaControle:function(classe){var n=i3GEO.editorOL.controles.length,i;for(i=0;i<n;i++){if(i3GEO.editorOL.controles[i].CLASS_NAME===classe){return i3GEO.editorOL.controles[i]}}return false},ativaLayerSwitcher:function(){var ls=i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher");if(ls){ls.maximizeDiv.click()}},desativaRodaDoMouse:function(){var controls=i3GEO.editorOL.mapa.getControlsByClass('OpenLayers.Control.Navigation');for(var i=0;i<controls.length;++i){controls[i].disableZoomWheel()}},google2wgs:function(obj){if(i3GEO.Interface.openlayers.googleLike===true){var projWGS84=new OpenLayers.Projection("EPSG:4326"),proj900913=new OpenLayers.Projection("EPSG:900913");return obj.transform(proj900913,projWGS84)}else{return obj}},sobeLayersGraficos:function(){var nlayers=i3GEO.editorOL.mapa.getNumLayers(),layers=i3GEO.editorOL.mapa.layers,i;for(i=0;i<nlayers;i++){if(layers[i].CLASS_NAME=="OpenLayers.Layer.Vector"&&layers[i].name!="Nenhum"){i3GEO.editorOL.mapa.raiseLayer(i3GEO.editorOL.mapa.layers[i],nlayers)}}}}; | |
| 1646 | +if(!i3GEO||typeof(i3GEO)==='undefined'){var i3GEO={};i3GEO.Interface={};navn=false;navm=false;$i=function(id){return document.getElementById(id)};app=navigator.appName.substring(0,1);if(app==='N'){navn=true}else{navm=true}OpenLayers.ImgPath="../pacotes/openlayers/img/";OpenLayers.Lang.setCode("pt-BR")}i3GEO.editorOL={simbologia:{opacidade:0.8,texto:"",fillColor:"250,180,15",strokeWidth:2,strokeColor:"250,150,0",pointRadius:4,graphicName:"square",fontSize:"12px",fontColor:"0,0,0",externalGraphic:"",graphicHeight:25,graphicWidth:25},backup:new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}),nomeFuncaoSalvar:"i3GEO.editorOL.salvaGeo()",e_oce:new OpenLayers.Layer.ArcGIS93Rest("ESRI Ocean Basemap","http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_ims:new OpenLayers.Layer.ArcGIS93Rest("ESRI Imagery World 2D","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_wsm:new OpenLayers.Layer.ArcGIS93Rest("ESRI World Street Map","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),ol_mma:new OpenLayers.Layer.WMS("Base cartográfica","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",{layers:'baseraster',SRS:'EPSG:4618',FORMAT:'image/png'},{singleTile:false}),ol_wms:new OpenLayers.Layer.WMS("OpenLayers WMS","http://labs.metacarta.com/wms/vmap0",{layers:'basic'}),top_wms:new OpenLayers.Layer.WMS("Toponímia MMA","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&",{layers:"base",FORMAT:'image/png'}),est_wms:new OpenLayers.Layer.WMS("Estados do Brasil","http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&",{layers:"estadosl",FORMAT:'image/png'}),osm:new OpenLayers.Layer.OSM("OSM","http://tile.openstreetmap.org/${z}/${x}/${y}.png",{isBaseLayer:true,visibility:false}),fundo:"e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce",kml:[],layersIniciais:[],botoes:{'pan':true,'zoombox':true,'zoomtot':true,'zoomin':true,'zoomout':true,'legenda':true,'distancia':true,'area':true,'identifica':true,'linha':true,'ponto':true,'poligono':true,'texto':true,'edita':true,'listag':true,'corta':true,'apaga':true,'procura':true,'selecao':true,'selecaotudo':true,'salva':true,'ajuda':true,'propriedades':true,'fecha':false,'tools':true,'undo':false,'frente':false,'legenda':true,'rodadomouse':true},pontos:[],marca:"../pacotes/openlayers/img/marker-gold.png",controles:[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoomBar(),new OpenLayers.Control.LayerSwitcher({'ascending':false}),new OpenLayers.Control.ScaleLine(),new OpenLayers.Control.MousePosition({'separator':' '}),new OpenLayers.Control.OverviewMap(),new OpenLayers.Control.KeyboardDefaults()],tiles:true,incluilayergrafico:true,ativalayerswitcher:false,ativarodadomouse:true,legendahtml:false,numzoom:12,minresolution:0.703125,maxext:"",mapext:new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081),mapa:"",inicia:function(){var alayers=[],fundo=(i3GEO.editorOL.fundo).split(","),nfundo=fundo.length,ncontroles=i3GEO.editorOL.controles.length,i,n,temp;if(i3GEO.editorOL.ativalayerswitcher==="false"){i3GEO.editorOL.ativalayerswitcher=false}if(i3GEO.editorOL.ativalayerswitcher==="true"){i3GEO.editorOL.ativalayerswitcher=true}if(i3GEO.editorOL.ativarodadomouse==="false"){i3GEO.editorOL.ativarodadomouse=false}if(i3GEO.editorOL.ativarodadomouse==="true"){i3GEO.editorOL.ativarodadomouse=true}if(i3GEO.editorOL.legendahtml==="false"){i3GEO.editorOL.legendahtml=false}if(i3GEO.editorOL.legendahtml==="true"){i3GEO.editorOL.legendahtml=true}if(i3GEO.editorOL.incluilayergrafico==="false"){i3GEO.editorOL.incluilayergrafico=false}if(i3GEO.editorOL.incluilayergrafico==="true"){i3GEO.editorOL.incluilayergrafico=true}if(i3GEO.editorOL.incluilayergrafico===true){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}}else{i3GEO.desenho.layergrafico="";i3GEO.editorOL.botoes.linha=false;i3GEO.editorOL.botoes.ponto=false;i3GEO.editorOL.botoes.poligono=false;i3GEO.editorOL.botoes.texto=false;i3GEO.editorOL.botoes.edita=false;i3GEO.editorOL.botoes.listag=false;i3GEO.editorOL.botoes.corta=false;i3GEO.editorOL.botoes.apaga=false;i3GEO.editorOL.botoes.selecao=false;i3GEO.editorOL.botoes.selecaotudo=false;i3GEO.editorOL.botoes.salva=false;i3GEO.editorOL.botoes.propriedades=false;i3GEO.editorOL.botoes.fecha=false;i3GEO.editorOL.botoes.tools=false;i3GEO.editorOL.botoes.undo=false;i3GEO.editorOL.botoes.frente=false}if(i3GEO.editorOL.mapa===""){alert("O objeto i3GEO.editorOL.mapa nao existe. Precisa ser criado com new OpenLayers.Map()");return}for(i=0;i<ncontroles;i++){i3GEO.editorOL.mapa.addControl(i3GEO.editorOL.controles[i])}if(i3GEO.editorOL.fundo!=""){for(i=nfundo-1;i>=0;i--){if(fundo[i]!=""){try{i3GEO.editorOL[fundo[i]].transitionEffect='resize';i3GEO.editorOL[fundo[i]].setVisibility(false);i3GEO.editorOL[fundo[i]].singleTile=false;alayers.push(i3GEO.editorOL[fundo[i]])}catch(e){if(alayers[0]){alayers[0].setVisibility(true)}}}}}i3GEO.editorOL.mapa.addLayers(alayers);if(i3GEO.editorOL.layersIniciais!==""){n=i3GEO.editorOL.layersIniciais.length;for(i=0;i<n;i++){i3GEO.editorOL.mapa.addLayer(i3GEO.editorOL.layersIniciais[i])}}if(!i3GEO.desenho.layergrafico&&i3GEO.editorOL.incluilayergrafico===true){i3GEO.editorOL.mapa.addLayers([i3GEO.desenho.layergrafico])}i3GEO.editorOL.adicionaKml();i3GEO.editorOL.adicionaMarcas();i3GEO.editorOL.coordenadas();i3GEO.editorOL.criaJanelaBusca();i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes);if(i3GEO.editorOL.ativalayerswitcher===true){i3GEO.editorOL.ativaLayerSwitcher()}if(i3GEO.editorOL.ativarodadomouse===false){i3GEO.editorOL.desativaRodaDoMouse()}if(i3GEO.editorOL.numzoom!==""){i3GEO.editorOL.mapa.setOptions({numZoomLevels:i3GEO.editorOL.numzoom})}if(i3GEO.editorOL.maxext!==""){i3GEO.editorOL.mapa.setOptions({maxExtent:i3GEO.editorOL.maxext})}if(i3GEO.editorOL.mapext!=""){var m=i3GEO.util.extGeo2OSM(i3GEO.editorOL.mapext);i3GEO.editorOL.mapa.zoomToExtent(m)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}i3GEO.editorOL.sobeLayersGraficos();temp=i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher");if(temp){temp=temp.dataLayersDiv.getElementsByTagName("label");n=temp.length;for(i=0;i<n;i++){temp[i].onclick=""}}},criaLayerGrafico:function(){i3GEO.desenho.openlayers.criaLayerGrafico()},layersLigados:function(){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,ins=[],i;for(i=0;i<nlayers;i++){if(layers[i].visibility===true){ins.push(layers[i])}}return ins},layersClonados:function(paramsLayers){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,i;for(i=0;i<nlayers;i++){if(layers[i].params&&layers[i].params.CLONETMS===paramsLayers){return(layers[i])}}return false},layertms2wms:function(tms){var layer,url;url=tms.url.replace("&cache=sim","&DESLIGACACHE=sim");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");layer=new OpenLayers.Layer.WMS(tms.layername+"_clone",url,{layers:tms.name,transparent:true},{gutter:0,isBaseLayer:false,displayInLayerSwitcher:false,opacity:1,visibility:true,singleTile:true});return layer},removeClone:function(){var nome=i3GEO.editorOL.layerAtivo().layername+"_clone",busca=i3GEO.editorOL.mapa.getLayersByName(nome);if(busca.length>0){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.mapa.getLayersByName(camada.name)[0],false)}},coordenadas:function(){var idcoord=i3GEO.editorOL.mapa.getControlsBy("separator"," ");if(idcoord[0]){i3GEO.editorOL.mapa.events.register("mousemove",i3GEO.editorOL.mapa,function(e){var p,lonlat,d;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(p);lonlat=i3GEO.util.projOSM2Geo(lonlat);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{$i(idcoord[0].id).innerHTML="Long: "+d[0]+"<br>Lat: "+d[1]}catch(e){}})}},criaJanelaBusca:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,ins,combo="<select id=i3GEOOLlistaTemasBusca ><option value=''>----</option>";for(i=0;i<nlayers;i++){combo+="<option value='"+i+"' >"+layers[i].name+"</option>"}combo+="</select>";ins="<div class=paragrafo >Tema:<br>"+combo;ins+="<br>Item:<br><span id=i3GEOOLcomboitens ></span>";ins+="<br>Procurar por:<br><input type=text size=20 id=i3GEOOLpalavraBusca >";ins+="<br><br><input type=button value='Procurar' id='i3GEOOLbotaoBusca' ></div>";ins+="<br>Resultado:<br><span id=i3GEOOLcomboresultado ></span>";try{YAHOO.namespace("procura.container");YAHOO.procura.container.panel=new YAHOO.widget.Panel("panelprocura",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.procura.container.panel.setHeader("Encontre no mapa");YAHOO.procura.container.panel.setBody(ins);YAHOO.procura.container.panel.setFooter("");YAHOO.procura.container.panel.render(document.body);YAHOO.procura.container.panel.center();document.getElementById("i3GEOOLbotaoBusca").onclick=function(){var layer=i3GEO.editorOL.layerAtivo(),item=document.getElementById("i3GEOOLbuscaItem").value,palavra=document.getElementById("i3GEOOLpalavraBusca").value;if(item===""||palavra===""){alert("Escolha o item e o texto de busca");return}i3GEO.editorOL.busca(layer,item,palavra,"i3GEOOLcomboresultado")};document.getElementById("i3GEOOLlistaTemasBusca").onchange=function(){i3GEO.editorOL.ativaTema(this.value);document.getElementById("i3GEOOLcomboitens").innerHTML="...";i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(),"i3GEOOLcomboitens","i3GEOOLbuscaItem")}}catch(e){}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",temp,combo="<select id=i3GEOOLlistaTemasAtivos style=width:235px; >";for(i=0;i<nlayers;i++){nometema="";if(i3GEO.arvoreDeCamadas&&i3GEO.arvoreDeCamadas.CAMADAS){temp=i3GEO.arvoreDeCamadas.pegaTema(layers[i].name,"","name");if(temp!=""){nometema=temp.tema+" - "}}combo+="<option value='"+i+"' >"+nometema+layers[i].name+"</option>"}combo+="</select>";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo);document.getElementById("i3GEOOLlistaTemasAtivos").onchange=function(){if(botaoIdentifica){botaoIdentifica.layers=[i3GEO.editorOL.layersLigados()[this.value]]}}},criaJanelaAtivaTema:function(){var temp;if(!document.getElementById("paneltemaativo")){YAHOO.namespace("temaativo.container");YAHOO.temaativo.container.panel=new YAHOO.widget.Panel("paneltemaativo",{zIndex:20000,iframe:true,width:"250px",visible:false,draggable:true,close:true});YAHOO.temaativo.container.panel.setBody("");if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.temaativo.container.panel.setHeader("Tema ativo<div id='paneltemaativo_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.temaativo.container.panel.setHeader("Tema ativo")}YAHOO.temaativo.container.panel.setFooter("");YAHOO.temaativo.container.panel.render(document.body);YAHOO.temaativo.container.panel.show();YAHOO.temaativo.container.panel.center();i3GEO.editorOL.atualizaJanelaAtivaTema();YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close,"click",function(){i3GEOpanelEditor.deactivate();i3GEOpanelEditor.activate();if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}}temp=$i("paneltemaativo_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("paneltemaativo")}}}else{YAHOO.temaativo.container.panel.show();i3GEO.editorOL.atualizaJanelaAtivaTema()}},ativaTema:function(id){document.getElementById("i3GEOOLlistaTemasAtivos").value=id},layerAtivo:function(){var id=document.getElementById("i3GEOOLlistaTemasAtivos");if(id){id=id.value}else{id=i3GEO.temaAtivo}if(id==""){return[]}else{return i3GEO.editorOL.layersLigados()[id]}},listaItens:function(layer,idonde,idobj){if(!layer){return}if(!layer.params){return}var u=layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0";u+="&typename="+layer.params.LAYERS;document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.WFSDescribeFeatureType({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),prop=gml.featureTypes[0].properties,nprop=prop.length,i,combo="<select id="+idobj+" ><option value=''>----</option>";for(i=0;i<nprop;i++){combo+="<option value="+prop[i].name+" >"+prop[i].name+"</option>"}combo+="</select>";document.getElementById(idonde).innerHTML=combo},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},busca:function(layer,item,palavra,onde){document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";var u=layer.url+"&request=getfeature&service=wfs&version=1.0.0";u=u.replace("Z=${z}&X=${x}&Y=${y}","");u+="&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS;u+="&filter=<Filter><PropertyIsLike wildcard=* singleChar=. escape=! ><PropertyName>"+item+"</PropertyName><Literal>*"+palavra+"*</Literal></PropertyIsLike></Filter>";document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";document.getElementById(onde).innerHTML="...";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),ngml=gml.length,i,ins="<select onchange='i3GEO.editorOL.zoomPara(this.value)'>";ins+="<option value=''>---</option>";for(i=0;i<ngml;i++){eval("var valor = gml[i].data."+item);var bounds=gml[i].geometry.getBounds();bounds=bounds.toBBOX();ins+="<option value='"+bounds+"'>"+valor+"</option>"}ins+="</select>";document.getElementById(onde).innerHTML=ins},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},zoomPara:function(bbox){var b=new OpenLayers.Bounds.fromString(bbox);i3GEO.editorOL.mapa.zoomToExtent(b)},mostraLegenda:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,ins="",i,icone="";for(i=0;i<nlayers;i++){try{if(layers[i].isBaseLayer===false){var url=layers[i].getFullRequestString({"request":"getlegendgraphic"});if(i3GEO.editorOL.legendahtml===true){url=url.replace("image%2Fpng","text/html");if(layers[i].options.plugini3geo){icone=i3GEO.pluginI3geo[layers[i].options.plugini3geo].iconeArvoreDeCamadas(layers[i].params.LAYERS)}ins+=icone+layers[i].name+"<br><div id=legendaL_"+i+" ></div><br>";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");var config={method:"GET",url:url,callback:f};OpenLayers.Request.issue(config)}else{url=url.replace("LAYERS","LAYER");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");ins+=layers[i].name+"<br><img src='"+url+"&SERVICE=wms' /><br>"}}}catch(e){}}if(!document.getElementById("panellegendaeditorOL")){YAHOO.namespace("legendaeditorOL.container");YAHOO.legendaeditorOL.container.panel=new YAHOO.widget.Panel("panellegendaeditorOL",{zIndex:20000,iframe:true,width:"auto",visible:false,draggable:true,close:true});YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.setHeader("Legenda");YAHOO.legendaeditorOL.container.panel.setFooter("");YAHOO.legendaeditorOL.container.panel.render(document.body);YAHOO.legendaeditorOL.container.panel.show();YAHOO.legendaeditorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.legendaeditorOL.container.panel.close,"click",function(){YAHOO.legendaeditorOL.container.panel.destroy()})}else{YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.show()}},captura:function(lonlat){var d=0.1,layers=[i3GEO.editorOL.layerAtivo()],xy=lonlat.split(","),u=layers[0].url+"&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS;u=u.replace("&cache=sim","&DESLIGACACHE=sim");u=u.replace("&Z=${z}&X=${x}&Y=${y}","");u=u.replace("Z=${z}&X=${x}&Y=${y}","");xy[0]=xy[0]*1;xy[1]=xy[1]*1;var poligono=(xy[0]-d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]+d);u+="&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:posList>"+poligono+"</gml:posList></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></Filter>";document.body.style.cursor="wait";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="wait"}OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}var i,n,f,fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText);n=gml.length;for(i=0;i<n;i++){f=gml[i];f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,registros:f["attributes"]}}i3GEO.desenho.layergrafico.addFeatures(gml)},failure:function(){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}alert("Erro")}})},salvaGeometrias:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="";if(n>0){if($i("panelsalvageometrias")){if(YAHOO.i3GEO){YAHOO.salvaGeometrias.container.panel=YAHOO.i3GEO.janela.manager.find("panelsalvageometrias")}YAHOO.salvaGeometrias.container.panel.show();YAHOO.salvaGeometrias.container.panel.bringToTop()}else{try{YAHOO.namespace("salvaGeometrias.container");YAHOO.salvaGeometrias.container.panel=new YAHOO.widget.Panel("panelsalvageometrias",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.salvaGeometrias.container.panel.setHeader("Geometrias");YAHOO.salvaGeometrias.container.panel.setBody("");YAHOO.salvaGeometrias.container.panel.setFooter("");YAHOO.salvaGeometrias.container.panel.render(document.body);YAHOO.salvaGeometrias.container.panel.center();if(YAHOO.i3GEO&&YAHOO.i3GEO.janela){YAHOO.i3GEO.janela.manager.register(YAHOO.salvaGeometrias.container.panel)}YAHOO.salvaGeometrias.container.panel.show()}catch(e){}}ins+="<p class=paragrafo >Foram encontrada(s) "+n+" geometria(s) selecionada(s) </p>";ins+="<p class=paragrafo ><a href='#' onclick='i3GEO.editorOL.listaGeometriasSel()' >Listar</a> ";if(i3GEO.arvoreDeCamadas){ins+="<a href='#' onclick='"+i3GEO.editorOL.nomeFuncaoSalvar+"' >Salvar dados</a> "}ins+="<a href='#' onclick='i3GEO.editorOL.incorporar()' >Incorporar ao mapa</a></p>";ins+="<p class=paragrafo>"+$trad("ajudaEditorOlSalva")+"</p>";YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{alert("Selecione pelo menos um elemento")}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="",i,a,w,g;for(i=0;i<n;i++){g=geos[i];ins+="<b>Geometria: "+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.geometry)+"<br><br>";ins+="<b>Atributos: "+i+"</b><br>";a=g.attributes;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}if(g.attributes.registros){ins+="<b>Registros: "+i+"</b><br>";a=g.attributes.registros;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}}ins+="<br>"}w=window.open();w.document.write(ins);w.document.close()},testeSalvar:function(){alert("Funcao nao disponivel. Defina o nome da funcao em i3GEO.editorOL.nomeFuncaoSalvar ")},salvaGeo:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,funcaoOK=function(){if(geos[0].geometry){var registros="",valorunico="",nometema=$i("editorOLcomboTemaEditavel").value,key="",tema,redesenha,p,g=i3GEO.editorOL.google2wgs(geos[0].geometry);if(nometema==""){return}tema=i3GEO.arvoreDeCamadas.pegaTema(nometema,"","name");if(geos[0].attributes.registros){registros=geos[0].attributes.registros;for(key in registros){if(registros[key]&&key==tema.colunaidunico){valorunico=registros[key]}}}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);i3GEO.Interface.atualizaTema("",nometema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto","Adicionando...");i3GEO.janela.AGUARDEMODAL=false;if(valorunico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+g)}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+g)}}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto="Salvar no tema:<br><div id=editorOLondeComboTemaEditavel ></div><br><br>";if(n!=1){i3GEO.janela.tempoMsg("Selecione apenas uma figura")}else{i3GEO.janela.confirma(texto,300,"Salva","Cancela",funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel")}},criaBotoes:function(botoes){var sketchSymbolizers={"Point":{pointRadius:4,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},"Line":{strokeWidth:3,strokeOpacity:1,strokeColor:"#666666",strokeDashstyle:"dash"},"Polygon":{strokeWidth:2,strokeOpacity:1,strokeColor:"#666666",fillColor:"white",fillOpacity:0.3}},style=new OpenLayers.Style(),styleMap=new OpenLayers.StyleMap({"default":style,"vertex":{strokeOpacity:1,strokeWidth:1,fillColor:"white",fillOpacity:0.45,pointRadius:3}},{extendDefault:false}),adiciona=false,button,controles=[];style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);i3GEOpanelEditor=new OpenLayers.Control.Panel({displayClass:"olControlEditingToolbar1 noprint",saveState:false,activateControl:function(c){this.deactivate();this.activate();try{i3GEO.editorOL.ModifyFeature.deactivate();if(i3GEO&&i3GEO.barraDeBotoes){i3GEO.barraDeBotoes.ativaPadrao()}}catch(e){}if(!c.trigger){c.activate()}else{c.trigger.call()}}});if(botoes.procura===true){button=new OpenLayers.Control.Button({displayClass:"editorOLprocura",trigger:function(){YAHOO.procura.container.panel.show()},title:"procura",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.pan===true){controles.push(new OpenLayers.Control.Navigation({title:"deslocar",displayClass:"editorOLpan",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoombox===true){controles.push(new OpenLayers.Control.ZoomBox({title:"zoombox",displayClass:"editorOLzoombox",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoomtot===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomtot",trigger:function(){if(i3GEO.editorOL.mapext&&i3GEO.editorOL.mapext!=""){i3GEO.editorOL.mapa.zoomToExtent(i3GEO.editorOL.mapext)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}},title:"ajusta extensao",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomin===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomin",trigger:function(){i3GEO.editorOL.mapa.zoomIn()},title:"aproxima",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomout===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomout",trigger:function(){i3GEO.editorOL.mapa.zoomOut()},title:"afasta",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.legenda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlegenda",trigger:function(){i3GEO.editorOL.mostraLegenda()},title:"legenda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.distancia===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Path,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLdistancia",title:"distancia",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units,measure=event.measure;alert("Distancia: "+measure.toFixed(3)+" "+units)}});controles.push(button);adiciona=true}if(botoes.area===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLarea",title:"area",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units;var measure=event.measure;alert("Área: "+measure.toFixed(3)+" "+units+" quadrados")}});controles.push(button);adiciona=true}if(botoes.identifica===true){botaoIdentifica=new OpenLayers.Control.WMSGetFeatureInfo({maxFeatures:1,infoFormat:'text/plain',layers:[i3GEO.editorOL.layerAtivo()],queryVisible:true,title:"identifica",type:OpenLayers.Control.TYPE_TOOL,displayClass:"editorOLidentifica",eventListeners:{getfeatureinfo:function(event){var lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),lonlattexto="<hr>",formata;if(botoes.linha===true||botoes.ponto===true||botoes.poligono===true||botoes.edita===true){lonlattexto+="<pre><span style=font-size:12px;color:blue;cursor:pointer onclick='i3GEO.editorOL.captura(\""+lonlat.lon+","+lonlat.lat+"\")'>edita geometria</span></pre><br>"}formata=function(texto){var temp,temp1,n,i,f=[],textoN=texto.split(":");try{if(textoN.length>1){temp=textoN[2].replace(/\n\r/g,"");temp=temp.replace(/'/g,"");temp=temp.replace(/\n/g,"|");temp=temp.replace(/_/g," ");temp=temp.replace(/=/g,":");temp=temp.split("|");n=temp.length;for(i=0;i<n;i++){temp1=temp[i].replace(/^\s+/,"");temp1=temp1.replace(/\s+$/,"");if(temp1!="")f.push(temp1)}texto=f.join("<br><br>")}}catch(e){}return texto};i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("chicken",i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),null,"<div style=text-align:left >"+lonlattexto+"<pre>"+formata(event.text)+"</pre></div>",null,true));i3GEO.editorOL.removeClone()},beforegetfeatureinfo:function(event){var ativo=[i3GEO.editorOL.layerAtivo()];if(ativo[0].serviceVersion==="&tms="||ativo[0].CLASS_NAME=="OpenLayers.Layer.TMS"||ativo[0].CLASS_NAME=="OpenLayers.Layer.OSM"){ativo=[i3GEO.editorOL.layertms2wms(ativo[0])]}ativo[0].projection=new OpenLayers.Projection("EPSG:4326");event.object.layers=ativo;botaoIdentifica.layers=ativo;botaoIdentifica.url=ativo[0].url},activate:function(){i3GEO.editorOL.criaJanelaAtivaTema()}}});controles.push(botaoIdentifica);adiciona=true}if(botoes.linha===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Path,{displayClass:"editorOLlinha",title:"digitalizar linha",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.ponto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLponto",title:"digitalizar ponto",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f,style_mark;if(i3GEO.editorOL.simbologia.externalGraphic!=""){style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=i3GEO.editorOL.simbologia.externalGraphic;style_mark.graphicWidth=i3GEO.editorOL.simbologia.graphicWidth;style_mark.graphicHeight=i3GEO.editorOL.simbologia.graphicHeight;style_mark.fillOpacity=i3GEO.editorOL.simbologia.opacidade;f=new OpenLayers.Feature.Vector(feature,null,style_mark)}else{f=new OpenLayers.Feature.Vector(feature)}f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,externalGraphic:i3GEO.editorOL.simbologia.externalGraphic,graphicHeight:i3GEO.editorOL.simbologia.graphicHeight,graphicWidth:i3GEO.editorOL.simbologia.graphicWidth};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.poligono===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLpoligono",title:"digitalizar poligono",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.texto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLtexto",title:"incluir texto",type:OpenLayers.Control.TYPE_TOOL,persist:true,callbacks:{done:function(feature){var texto=window.prompt("Texto",""),label=new OpenLayers.Feature.Vector(feature);label["attributes"]={opacidade:0.1,fillColor:"white",strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,texto:texto,pointRadius:2,graphicName:"square",strokeColor:"black",fontColor:i3GEO.editorOL.simbologia.fontColor,fontSize:i3GEO.editorOL.simbologia.fontSize,fontFamily:"Arial",fontWeight:"bold",labelAlign:"rt"};if(texto&&texto!==""){i3GEO.desenho.layergrafico.addFeatures([label])}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEO.editorOL.CortaFeature=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLcorta",title:"corta figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length!=1){alert("Selecione primeiro um elemento para ser cortado");i3GEO.editorOL.CortaFeature.deactivate()}else{i3GEO.editorOL.CortaFeature.activate()}},callbacks:{done:function(feature){var temp,sel=i3GEO.desenho.layergrafico.selectedFeatures[0].geometry,corta=feature;temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,sel+"|"+corta,"difference")}}});controles.push(i3GEO.editorOL.CortaFeature);adiciona=true}if(botoes.edita===true){i3GEO.editorOL.ModifyFeature=new OpenLayers.Control.ModifyFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLedita",title:"modifica figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,mode:OpenLayers.Control.ModifyFeature.RESHAPE,standalone:false,createVertices:true,styleMap:"default",vertexRenderIntent:"vertex"});controles.push(i3GEO.editorOL.ModifyFeature);adiciona=true}if(botoes.edita===true&&botoes.listag===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlistag",trigger:function(){i3GEO.editorOL.listaGeometrias()},title:"lista geometrias",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.frente===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfrente",trigger:function(){i3GEO.editorOL.trazParaFrente();if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},title:"traz para frente",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.tools===true&&i3GEO.php){button=new OpenLayers.Control.Button({displayClass:"editorOLtools",trigger:function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}},title:"ferramentas",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.selecao===true){i3GEO.editorOL.selbutton=new OpenLayers.Control.SelectFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLselecao",title:"seleciona elemento",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,multiple:false,hover:false,toggleKey:"ctrlKey",multipleKey:"shiftKey",box:false});controles.push(i3GEO.editorOL.selbutton);adiciona=true}if(botoes.selecaotudo===true){button=new OpenLayers.Control.Button({displayClass:"editorOLselecaoTudo",trigger:function(){var fs=i3GEO.desenho.layergrafico.features,n=fs.length,i;for(i=0;i<n;i++){i3GEO.editorOL.selbutton.select(fs[i])}},title:"seleciona tudo",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.apaga===true){button=new OpenLayers.Control.Button({displayClass:"editorOLapaga",trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length>0){var x=window.confirm("Exclui os elementos selecionados?");if(x){i3GEO.editorOL.guardaBackup();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.janela.tempoMsg("Para excluir registros do banco de dados utilize a ferramenta de identificacao")}}else{alert("Selecione pelo menos um elemento")}},title:"apaga selecionados",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.propriedades===true){button=new OpenLayers.Control.Button({displayClass:"editorOLpropriedades",trigger:function(){i3GEO.editorOL.propriedades()},title:"propriedades",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.salva===true){button=new OpenLayers.Control.Button({displayClass:"editorOLsalva",trigger:function(){i3GEO.editorOL.salvaGeometrias()},title:"salva",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.ajuda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLajuda",trigger:function(){try{window.open(i3GEO.configura.locaplic+"/mashups/openlayers_ajuda.php")}catch(e){window.open("openlayers_ajuda.php")}},title:"ajuda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.fecha===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfecha",trigger:function(){var temp=window.confirm($trad("x94"));if(i3GEO.eventos){i3GEO.eventos.cliquePerm.ativa()}i3GEOpanelEditor.destroy();try{YAHOO.temaativo.container.panel.destroy()}catch(e){}try{YAHOO.procura.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.listaGeometrias.panel.destroy()}catch(e){}try{YAHOO.editorOL.ferramentas.panel.destroy()}catch(e){}try{YAHOO.legendaeditorOL.container.panel.destroy()}catch(e){}try{YAHOO.salvaGeometrias.container.panel.destroy()}catch(e){}if(temp===true){try{if(i3GEO.desenho.layergrafico){i3GEO.editorOL.mapa.removeLayer(i3GEO.desenho.layergrafico);delete(i3GEO.desenho.layergrafico)}if(i3GEO.editorOL.backup){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.backup);delete(i3GEO.editorOL.backup)}}catch(e){}}},title:"fecha editor",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}i3GEOOLsnap=new OpenLayers.Control.Snapping({layer:i3GEO.desenho.layergrafico});i3GEOOLsplit=new OpenLayers.Control.Split({layer:i3GEO.desenho.layergrafico,source:i3GEO.desenho.layergrafico,tolerance:0.0001,eventListeners:{beforesplit:function(event){i3GEO.editorOL.guardaBackup()},aftersplit:function(event){i3GEO.editorOL.flashFeatures(event.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}}});if(adiciona===true){i3GEOpanelEditor.addControls(controles);i3GEO.editorOL.mapa.addControl(i3GEOpanelEditor)}},mudaSimbolo:function(estilo,id){var valor=$i(id).value,geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,i;i3GEO.editorOL.simbologia[estilo]=valor;for(i=0;i<n;i++){geos[i].attributes[estilo]=valor;geos[i].style[estilo]=valor}},adicionaMarcas:function(){if(i3GEO.editorOL.pontos.length===0){return}var f,SHADOW_Z_INDEX=10,MARKER_Z_INDEX=11,layer=new OpenLayers.Layer.Vector("pontos",{styleMap:new OpenLayers.StyleMap({externalGraphic:i3GEO.editorOL.marca,backgroundGraphic:"../pacotes/openlayers/img/marker_shadow.png",backgroundXOffset:0,backgroundYOffset:-7,graphicZIndex:MARKER_Z_INDEX,backgroundGraphicZIndex:SHADOW_Z_INDEX,pointRadius:10}),isBaseLayer:false,rendererOptions:{yOrdering:true},displayInLayerSwitcher:true,visibility:true}),index,x=[],y=[],features=[];for(index=0;index<i3GEO.editorOL.pontos.length;index=index+2){x.push(i3GEO.editorOL.pontos[index]);y.push(i3GEO.editorOL.pontos[index+1])}for(index=0;index<x.length;index++){f=new OpenLayers.Geometry.Point(x[index],y[index]);f=i3GEO.util.projGeo2OSM(f);f=new OpenLayers.Feature.Vector(f);features.push(f)}layer.addFeatures(features);i3GEO.editorOL.mapa.addLayer(layer)},adicionaKml:function(){var temp,n,i,id,url;n=i3GEO.editorOL.kml.length;for(i=0;i<n;i++){id="kml"+i;url=i3GEO.editorOL.kml[i];eval(id+" = new OpenLayers.Layer.Vector('"+id+"', {displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true, strategies: [new OpenLayers.Strategy.Fixed()],protocol: new OpenLayers.Protocol.HTTP({url: '"+url+"',format: new OpenLayers.Format.KML({extractStyles: true,extractAttributes: true,maxDepth: 5})})})");eval("i3GEO.editorOL.mapa.addLayer("+id+");");eval("temp = "+id+".div;");temp.onclick=function(e){var targ="",id,temp,features,n,i,g,html="";if(!e){e=window.event}if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ.id){temp=targ.id.split("_");if(temp[0]==="OpenLayers.Geometry.Point"){id=targ.id;temp=i3GEO.editorOL.mapa.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(var j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}}}},propriedades:function(){if(!document.getElementById("panelpropriedadesEditor")){YAHOO.namespace("editorOL.container");YAHOO.editorOL.container.panel=new YAHOO.widget.Panel("panelpropriedadesEditor",{zIndex:20000,iframe:true,width:"350px",height:"250px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo ><b>Estilos (utilize a cor no formato r,g,b):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td>Cor do contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(strokeColor,i3GEOEditorOLcorContorno)" type="text" style="cursor:text" id="i3GEOEditorOLcorContorno" size="12" value="'+i3GEO.editorOL.simbologia.strokeColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorContorno);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor do preenchimento</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fillColor,i3GEOEditorOLcorPre)" type="text" style="cursor:text" id="i3GEOEditorOLcorPre" size="12" value="'+i3GEO.editorOL.simbologia.fillColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorPre);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fontColor,i3GEOEditorOLcorFonte)" type="text" style="cursor:text" id="i3GEOEditorOLcorFonte" size="12" value="'+i3GEO.editorOL.simbologia.fontColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorFonte);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Tamanho da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fontSize,i3GEOEditorOLfontsize)" type="text" style="cursor:text" id="i3GEOEditorOLfontsize" size="3" value="'+i3GEO.editorOL.simbologia.fontSize+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Opacidade (de 0 a 1)</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(opacidade,i3GEOEditorOLopacidade)" type="text" style="cursor:text" id="i3GEOEditorOLopacidade" size="3" value="'+i3GEO.editorOL.simbologia.opacidade+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura da linha/contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(strokeWidth,i3GEOEditorOLlarguraLinha)" type="text" style="cursor:text" id="i3GEOEditorOLlarguraLinha" size="2" value="'+i3GEO.editorOL.simbologia.strokeWidth+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Url de uma figura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(externalGraphic,i3GEOEditorOLexternalGraphic)" type="text" style="cursor:text" id="i3GEOEditorOLexternalGraphic" size="22" value="'+i3GEO.editorOL.simbologia.externalGraphic+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura e altura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(graphicWidth,i3GEOEditorOLgraphicWidth)" type="text" style="cursor:text" id="i3GEOEditorOLgraphicWidth" size="4" value="'+i3GEO.editorOL.simbologia.graphicWidth+'" /> <input onchange="i3GEO.editorOL.mudaSimbolo(graphicHeight,i3GEOEditorOLgraphicHeight)" type="text" style="cursor:text" id="i3GEOEditorOLgraphicHeight" size="4" value="'+i3GEO.editorOL.simbologia.graphicHeight+'" /></td><td></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Ajusta nó em edição para o(a):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td></td><td>nó</td><td></td><td>vértice</td><td></td><td>borda</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_node" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_nodeTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_vertex" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_vertexTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_edge" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_edgeTolerance" type="text" size="3" value=15 /></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Divide intersecção ao digitalizar</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.split()" type="checkbox" id="edge_split_toggle" /></td><td>borda</td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Operação ativada pelo botão de modificação da figura</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input checked style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESHAPE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera figura</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESIZE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera tamanho</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.ROTATE;" type="radio" name=i3geoOLtipoEdita /></td><td>rotaciona</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.DRAG;" type="radio" name=i3geoOLtipoEdita /></td><td>desloca</td>'+' </tr>'+'</table>';YAHOO.editorOL.container.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.container.panel.setHeader("Propriedades<div id='panelpropriedadesEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.container.panel.setHeader("Propriedades")}YAHOO.editorOL.container.panel.setFooter("");YAHOO.editorOL.container.panel.render(document.body);YAHOO.editorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close,"click",function(){});temp=$i("panelpropriedadesEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelpropriedadesEditor")}}}YAHOO.editorOL.container.panel.show();temp=$i("panelpropriedadesEditor").getElementsByTagName("div");if(temp&&temp[2]){temp[2].style.overflow="auto"}},listaGeometrias:function(){if(!document.getElementById("panellistagEditor")){YAHOO.namespace("editorOL.listaGeometrias");YAHOO.editorOL.listaGeometrias.panel=new YAHOO.widget.Panel("panellistagEditor",{zIndex:20000,iframe:true,width:"320px",visible:false,draggable:true,close:true});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias <div id='panellistagEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias")}YAHOO.editorOL.listaGeometrias.panel.setFooter("");YAHOO.editorOL.listaGeometrias.panel.render(document.body);YAHOO.editorOL.listaGeometrias.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.listaGeometrias.panel.close,"click",function(){YAHOO.editorOL.listaGeometrias.panel.destroy()});temp=$i("panellistagEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panellistagEditor")}}}else{YAHOO.editorOL.listaGeometrias.panel.render(document.body)}var g,temp,geos=i3GEO.desenho.layergrafico.features,n=geos.length,ins="<table class=lista4 >";ins+="<tr><td><i>Geometrias</i></td><td><i>Opções</i></td><td></td><td></td></tr>";while(n>0){n-=1;g=geos[n].geometry;ins+="<tr><td>"+g.CLASS_NAME+"</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.selFeature("+n+")'>seleciona</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.unselFeature("+n+")'>limpa</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.flashFeaturesI("+n+")'>brilha</td></tr>"}ins+="</table>";if(geos.length===0){ins="Nenhum elemento gráfico encontrado. Utilize as opções de criação de geometrias."}YAHOO.editorOL.listaGeometrias.panel.show();if(i3GEO.configura){temp=$i("panellistagEditor").getElementsByTagName("div")[2]}else{temp=$i("panellistagEditor").getElementsByTagName("div")[1]}temp.style.overflow="auto";temp.style.height="100px";temp.innerHTML=ins},ferramentas:function(){if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo >Operações sobre as figuras selecionadas:</p>'+'<select onchange="i3GEO.editorOL.processageo(this.value);this.value = " >'+' <option value="">---</option>'+' <option value=union >União</option>';if(i3GEO.php){ins+=' <option value=intersection >Intersecção</option>'+' <option value=convexhull >Convex hull</option>'+' <option value=boundary >Bordas</option>'+' <option value=difference >Diferença</option>'+' <option value=symdifference >Diferença simétrica</option>'}ins+='</select>'+'<br><br><a class=paragrafo href=# onclick="i3GEO.desenho.layergrafico.destroyFeatures()" >Apaga tudo</a>';YAHOO.editorOL.ferramentas.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas <div id='panelferramentasEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas")}YAHOO.editorOL.ferramentas.panel.setFooter("");YAHOO.editorOL.ferramentas.panel.render(document.body);YAHOO.editorOL.ferramentas.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.ferramentas.panel.close,"click",function(){});temp=$i("panelferramentasEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelferramentasEditor")}}}else{YAHOO.editorOL.ferramentas.panel.render(document.body)}YAHOO.editorOL.ferramentas.panel.show()},snap:function(){var target=i3GEOOLsnap.targets[0],tipos=["node","vertex","edge"],ntipos=tipos.length,i,temp,ativa=false;i3GEOOLsnap.deactivate();for(i=0;i<ntipos;i++){temp=$i("target_"+tipos[i]);target[tipos[i]]=temp.checked;if(temp.checked===true){ativa=true}temp=$i("target_"+tipos[i]+"Tolerance");target[tipos[i]+"Tolerance"]=temp.value}if(ativa===true){i3GEOOLsnap.activate()}},split:function(){i3GEOOLsplit.deactivate();var temp=$i("edge_split_toggle");if(temp.checked===true){i3GEOOLsplit.activate()}},processageo:function(operacao){if(operacao===""){return}var geosel=i3GEO.desenho.layergrafico.selectedFeatures,polis,linhas,pontos,temp;if(geosel.length>0){polis=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Point");temp=function(retorno){if(i3GEO.janela){i3GEO.janela.fechaAguarde("i3GEO.editorPoli");i3GEO.janela.fechaAguarde("i3GEO.editorLinhas");i3GEO.janela.fechaAguarde("i3GEO.editorPontos")}if(retorno!=""&&retorno.data&&retorno.data!=""&&operacao!="converteSHP"){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}if(operacao==="converteSHP"){i3GEO.atualiza();i3GEO.janela.minimiza("paneltemaativo")}};if(operacao==="incorporar"){if(polis.length>0){temp=i3GEO.editorOL.merge(polis)}if(linhas.length>0){temp=i3GEO.editorOL.merge(linhas)}if(pontos.length>0){temp=i3GEO.editorOL.merge(pontos)}if(i3GEO.mapa){i3GEO.mapa.dialogo.wkt2layer(temp)}return}if(operacao==="union"&&!i3GEO.php){if(polis.length>0){temp=i3GEO.editorOL.uniaojts(polis);i3GEO.editorOL.substituiFeaturesSel(temp)}if(linhas.length>0){temp=i3GEO.editorOL.uniaojts(linhas);i3GEO.editorOL.substituiFeaturesSel(temp)}if(pontos.length>0){temp=i3GEO.editorOL.uniaojts(pontos);i3GEO.editorOL.substituiFeaturesSel(temp)}}else{if(polis.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos");i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),operacao)}if(linhas.length>0){i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas");i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),operacao)}if(pontos.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos");i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao)}}return}else{alert("Selecione pelo menos dois elementos")}},merge:function(geoms){var n=geoms.length,w=new Wkt.Wkt(),g,m,i;w.read(geoms[0].toString());if(n>1){for(i=1;i<n;i++){g=geoms[i].toString();m=new Wkt.Wkt();m.read(g);w.merge(m)}}return w.write()},uniaojts:function(geoms){var n=geoms.length,rwkt=new jsts.io.WKTReader(),wwkt=new jsts.io.WKTWriter(),fwkt=new OpenLayers.Format.WKT(),g,i,uniao;if(n>1){uniao=(fwkt.read(geoms[0]).geometry).toString();uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=(fwkt.read(geoms[i]).geometry).toString();uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.read(uniao)]}else{return false}},retornaGeometriasTipo:function(features,tipo){var n=features.length,lista=[],i,temp;for(i=0;i<n;i++){temp=features[i].geometry;if(temp.CLASS_NAME==tipo){lista.push(temp)}}return lista},guardaBackup:function(){return},unselTodos:function(){var n,i;n=i3GEO.desenho.layergrafico.features.length;for(i=0;i<n;i++){i3GEO.desenho.layergrafico.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[i])}},unselTodosBackup:function(){var n,i;n=i3GEO.editorOL.backup.features.length;for(i=0;i<n;i++){i3GEO.editorOL.backup.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.editorOL.backup.features[i])}},restauraBackup:function(){if(i3GEO.editorOL.backup.features.length>0){i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features)}if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},substituiFeaturesSel:function(wkt){i3GEO.editorOL.guardaBackup();try{var f,fwkt=new OpenLayers.Format.WKT();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);f=fwkt.read(wkt);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}catch(e){i3GEO.editorOL.restauraBackup()}},adicionaFeatureWkt:function(wkt,atributos){var f,fwkt=new OpenLayers.Format.WKT();if(atributos.externalGraphic&&atributos.externalGraphic!=""){var style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=atributos.externalGraphic;style_mark.graphicWidth=atributos.graphicWidth;style_mark.graphicHeight=atributos.graphicHeight;style_mark.fillOpacity=atributos.opacidade;f=fwkt.read(wkt);f["attributes"]=atributos;f["style"]=style_mark}else{f=fwkt.read(wkt);f["attributes"]=atributos}i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},flashFeaturesI:function(index){i3GEO.editorOL.flashFeatures([i3GEO.desenho.layergrafico.features[index]],0)},flashFeatures:function(features,index){if(!index){index=0}var current=features[index];if(current&¤t.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(features[index],"select")}var prev=features[index-1];if(prev&&prev.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(prev,"default")}++index;if(index<=features.length){window.setTimeout(function(){i3GEO.editorOL.flashFeatures(features,index)},75)}},selFeature:function(index){i3GEO.editorOL.selbutton.select(i3GEO.desenho.layergrafico.features[index])},unselFeature:function(index){i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[index])},carregajts:function(funcao){if(i3GEO.configura){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}else{i3GEO.util.scriptTag("../pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}},trazParaFrente:function(){var features=i3GEO.desenho.layergrafico.selectedFeatures;if(features.length>0){i3GEO.editorOL.backup=new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false});i3GEO.editorOL.backup.addFeatures(features);i3GEO.editorOL.unselTodosBackup();i3GEO.desenho.layergrafico.removeFeatures(features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}else{alert("Selecione pelo menos um elemento")}},pegaControle:function(classe){var n=i3GEO.editorOL.controles.length,i;for(i=0;i<n;i++){if(i3GEO.editorOL.controles[i].CLASS_NAME===classe){return i3GEO.editorOL.controles[i]}}return false},ativaLayerSwitcher:function(){var ls=i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher");if(ls){ls.maximizeDiv.click()}},desativaRodaDoMouse:function(){var controls=i3GEO.editorOL.mapa.getControlsByClass('OpenLayers.Control.Navigation');for(var i=0;i<controls.length;++i){controls[i].disableZoomWheel()}},google2wgs:function(obj){if(i3GEO.Interface.openlayers.googleLike===true){var projWGS84=new OpenLayers.Projection("EPSG:4326"),proj900913=new OpenLayers.Projection("EPSG:900913");return obj.transform(proj900913,projWGS84)}else{return obj}},sobeLayersGraficos:function(){var nlayers=i3GEO.editorOL.mapa.getNumLayers(),layers=i3GEO.editorOL.mapa.layers,i;for(i=0;i<nlayers;i++){if(layers[i].CLASS_NAME=="OpenLayers.Layer.Vector"&&layers[i].name!="Nenhum"){i3GEO.editorOL.mapa.raiseLayer(i3GEO.editorOL.mapa.layers[i],nlayers)}}}}; | |
| 1647 | 1647 | // |
| 1648 | 1648 | //compactados/dicionario_compacto.js |
| 1649 | 1649 | g_traducao={"p1":[{pt:"O i3Geo é software livre! Para download clique <a href='http://mapas.mma.gov.br/download' target=blank >aqui</a>. <b><a href='http://"+window.location.host+"/i3geo/mobile/qrcode.htm' target=blank >Qrcode mobile</a></b>",en:"I3geo is a open source software! <a href='http://mapas.mma.gov.br/download' target=blank >Click</a> to download.",es:"I3Geo es software libre!. <a href='http://mapas.mma.gov.br/download' target=blank > Descargar</a>"}],"p2":[{pt:"Filtro de cores",en:"Image type",es:"Tipo de imagen"}],"p3":[{pt:"Legenda",en:"Legend",es:"Leyenda"}],"p4":[{pt:"Escala",en:"Scale",es:"Escala"}],"p5":[{pt:"Tamanho",en:"Size",es:"Tamaño"}],"p6":[{pt:"Ativa/desativa entorno",en:"Enable/Disable Border",es:"Activar/desactivar entorno"}],"p7":[{pt:"Ativa/desativa logo",en:"Enable/Disable Logo",es:"Activar/desactivar Logo"}],"p8":[{pt:"Cor da selecao",en:"Color of Selection",es:"Color de la selección"}],"p9":[{pt:"Cor do fundo",en:"Background color",es:"Color de fondo"}],"p10":[{pt:"Grade de coordenadas",en:"Graticule",es:"Gratíla"}],"p11":[{pt:"Template",en:"Template",es:"Plantilla"}],"p12":[{pt:"Temporizador",en:"Timer",es:"Temporizador"}],"p13":[{pt:"Propriedades",en:"Properties",es:"Propiedades"}],"p14":[{pt:"Aplicar",en:"Apply",es:"Aplicar"}],"p15":[{pt:"Formato da imagem do mapa",en:"Format of Image Map",es:"Formato de la imagen del mapa"}],"p16":[{pt:"Fundo",en:"Base layers",es:"Capas Base"}],"p17":[{pt:"Imprime legenda",en:"Enable legend",es:"Activar Leyenda"}],"p18":[{pt:"Não imprime a legenda",en:"Disable legend",es:"Desactivar Leyenda"}],"p19":[{pt:"Ativa ou desativa a legenda de um tema na opção de impressão do mapa",en:"Enable or disable the legend of a theme in the print option of the map",es:"Activa o desactiva la leyenda de un tema en la opción de impresión del mapa"}],"p20":[{pt:"Tela remota",en:"Remote screen",es:"Pantalla remota"}],"p21":[{pt:"Animação",en:"Animation",es:"Animación"}],"s1":[{pt:"Ajuda",en:"Help",es:"Ayuda"}],"s2":[{pt:"Análise",en:"Analysis",es:"Análisis"}],"s3":[{pt:"Janelas",en:"Windows",es:"Ventanas"}],"s4":[{pt:"Arquivo",en:"Files",es:"Archivo"}],"s5":[{pt:"Propriedades",en:"Properties",es:"Propiedades"}],"u1":[{pt:"Sobre o i3Geo",en:"About i3Geo",es:"Acerca de i3Geo"}],"u2":[{pt:"Doc. dos códigos",en:"Doc. of the codes",es:"Doc. de los códigos"}],"u3":[{pt:"WikiBook",en:"WikiBook",es:"WikiBook"}],"u4":[{pt:"Tutoriais",en:"Tutorials",es:"Tutoriales"}],"u4a":[{pt:"Manual do usuário",en:"User manual",es:"Manual de usuario"}],"u5":[{pt:"Blog",en:"Blog",es:"Blog"}],"u5a":[{pt:"Software público",en:"Software público Brazil",es:"Software público Brasil"}],"u5b":[{pt:"Lista de funções",en:"Function list",es:"Lista de funciones"}],"u5c":[{pt:"Redes sociais",en:"Social networks",es:"Redes sociales"}],"u6":[{pt:"Geometrias",en:"Geometries",es:"Geometrías"}],"u7":[{pt:"Grade de polígonos",en:"Polygon grid",es:"Grado de polígonos"}],"u8":[{pt:"Grade de pontos",en:"Grid of Points",es:"Gratíla de puntos"}],"u9":[{pt:"Grade de hexágonos",en:"Grid of Hexagons",es:"Gratíla de hexágonos"}],"u10":[{pt:"Entorno(Buffer)",en:"Buffer",es:"Area Influencia (Buffer)"}],"u11":[{pt:"Centróide",en:"Centroid",es:"Centroide"}],"u11a":[{pt:"Distância entre pontos",en:"Distance between points",es:"Distancia entre puntos"}],"u12":[{pt:"N pontos em poligono",en:"N points in polygon",es:"N puntos en polígono"}],"u13":[{pt:"Ponto em poligono/raster",en:"Point in polygon/raster",es:"Punto en polígono/raster"}],"u14":[{pt:"Distribuição de pontos",en:"Points distribution",es:"Distribución de puntos"}],"u15":[{pt:"Barras de ferramentas",en:"Toolbars",es:"Barras de herramientas"}],"u15a":[{pt:"Ferramentas",en:"Tools",es:"Herramientas"}],"u16":[{pt:"Janela de mensagens",en:"Message window",es:"Ventana de mensajes"}],"u17":[{pt:"Salvar mapa",en:"Save map",es:"Guardar mapa"}],"u18":[{pt:"Carregar mapfile local",en:"Load mapfile",es:"Cargar mapfile"}],"u19":[{pt:"Pegar imagens",en:"Get pictures",es:"Captar imágenes"}],"u20":[{pt:"Converter em WMS e WMC",en:"Convert to WMS and WMC",es:"Convertir en WMS y WMC"}],"u20a":[{pt:"Converter em KML",en:"Convert to KML",es:"Convertir en KML"}],"u21":[{pt:"Gerador de links",en:"Link generator",es:"Generador de enlaces"}],"u22":[{pt:"Grade",en:"Graticule",es:"Gratíla"}],"u23":[{pt:"Ponto",en:"Point",es:"Punto"}],"u24":[{pt:"Polígono",en:"Polygon",es:"Polígonos"}],"u25":[{pt:"Dissolve",en:"Dissolve",es:"Disolver"}],"u26":[{pt:"Agrupa",en:"Group",es:"Agrupar"}],"u27":[{pt:"Outros",en:"Others",es:"Otros"}],"u28":[{pt:"Centro médio",en:"Middle center",es:"Centro medio"}],"u29":[{pt:"Editor vetorial",en:"Vector editor",es:"Editor vetorial"}],"t1":[{pt:"Camadas",en:"Layers",es:"Capas"}],"t2":[{pt:"Arraste o tema aqui ou clique para excluir",en:"Drag the layer here or make click to remove",es:"Arrastre el tema aquí ó haga clic para excluir"}],"t2a":[{pt:"Filtra a lista de camadas",en:"Filters the list of layers",es:"Filtra la lista de capas"}],"t2b":[{pt:"Abre a legenda do mapa",en:"Opens the map legend",es:"Despliega la leyenda del mapa"}],"t3":[{pt:"Clique para ligar ou desligar esse tema, mostrando-o ou não no mapa. Após alterar o estado do tema, aguarde alguns instantes para o mapa ser redesenhado, ou clique no botão aplicar que será mostrado.",en:"Click to enable or disable this theme, showing it or not on the map. After changing the status of the theme, wait a few moments to get the map to be reloaded, or click the Apply button that will be display.",es:"Haga clic para activar o desactivar este tema, mostrándolo o no en el mapa. Después de cambiar el estado del tema, espere algunos instantes para que el mapa sea recargado, o haga clic en el botón aplicar que se mostrará."}],"t3a":[{pt:"Clique para ligar todos os temas",en:"Turn on all layers",es:"Haga clic para activar todos los temas"}],"t3b":[{pt:"Clique para desligar todos os temas",en:"Turn off all layers",es:"Haga clic para desactivar todos los temas"}],"t4":[{pt:"limpa seleção",en:"Clear selection",es:"Limpia la selección"}],"t4a":[{pt:"zoom para a seleção",en:"Zoom to selection",es:"Zoom a la selección"}],"t5":[{pt:"Limpa seleção existente nesse tema",en:"Clear selection existing in this theme",es:"Limpia la selección existente en este tema"}],"t6":[{pt:"Clique para fazer o download desse tema no formato shapefile",en:"Click to download this theme in shapefile format",es:"Haga clic para descargar este tema en formato shape"}],"t7":[{pt:"clique e arraste",en:"Dragging",es:"Haga clic y arrastre"}],"t7a":[{pt:"Clique e arraste para mudar a ordem. Arraste e solte na lixeira para remover. Aguarde para ver a legenda.",en:"Click and Dragg to rearrange order. Drag and drop to remove. Please to wait to see the legend",es:"Haga clic y arrastre para cambiar el orden. Arrastre y suelte remover. Aguarde para ver la leyenda."}],"t8":[{pt:"arraste para mudar a ordem",en:"drag to change the order",es:"Arrastre para cambiar el orden"}],"t9":[{pt:"A escala do tema é compatível com a escala do mapa",en:"The scale of the theme is compatible with the scale of the map",es:"La escala del tema es compatible con la escala del mapa"}],"t10":[{pt:"A escala do tema é incompatível com a escala do mapa",en:"The scale of the theme is incompatible with the scale of the map",es:"La escala del tema es incompatible con la escala del mapa"}],"t11":[{pt:"A escala do tema não é conhecida",en:"The scale of the layer is unknown",es:"La escala del tema no es conocida"}],"t12":[{pt:"Excluir",en:"Delete",es:"Eliminar"}],"t12a":[{pt:"Clique para excluir esse tema do mapa.",en:"Delete this layer of the map.",es:"Haga clic para excluir este tema del mapa"}],"t13":[{pt:"sobe",en:"Up",es:"Subir"}],"t14":[{pt:"Clique para subir esse tema na ordem de desenho",en:"Click to move up the layer in design order",es:"Haga clic para subir ese tema en la orden de diseño"}],"t15":[{pt:"desce",en:"Down",es:"Bajar"}],"t16":[{pt:"Clique para descer esse tema na ordem de desenho",en:"Click to move down the layer in design order",es:"Haga clic para bajar este tema en la orden de diseño"}],"t17":[{pt:"zoom para o tema",en:"Zoom to layer",es:"Zoom al tema"}],"t18":[{pt:"Clique para ajustar o mapa de forma a mostrar todo o tema",en:"Zoom all",es:"Zoom a todo"}],"t18a":[{pt:"Opções e propriedades",en:"Options",es:"Opciones"}],"t18b":[{pt:"Legenda",en:"Legend",es:"Leyenda"}],"t19":[{pt:"Altera a transparência do tema, possibilitando que as camadas inferiores possam ser vistas.",en:"Change the layer transparency. It make possible to see inferior layers",es:"Altera la transparencia del tema, haciendo posible que las capas inferiores puedan verse"}],"t20":[{pt:"Opacidade",en:"Opacity",es:"Opacidad"}],"t22":[{pt:"Localize elementos no tema com base em seus atributos descritivos.",en:"Find elements on the layer based on their descriptive attributes.",es:"Ubique elementos en el tema en base a sus atributos descriptivos"}],"t23":[{pt:"Procurar",en:"Search...",es:"Buscar..."}],"t24":[{pt:"Crie uma nova camada no mapa para apresentar textos descritivos sobre esse tema, tendo como base a tabela de atributos.",en:"Create a new layer to display descriptive texts about this theme, based on table of attributes.",es:"Crear una nueva capa en el mapa para presentar textos descriptivos sobre este tema, teniendo como base la tabla de atributos"}],"t25":[{pt:"Etiquetas baseadas em atributos",en:"Label...",es:"Etiquetas.."}],"t26":[{pt:"Defina as etiquetas que serão mostradas quando o mouse é estacionado sobre um elemento desse tema.",en:"Define the label that will be shown when the mouse is over one element of this theme.",es:"Defina las etiquetas que se mostrarán cuando el ratón se estaciona sobre un elemento de este tema"}],"t27":[{pt:"Ativar etiquetas",en:"Label...",es:"Etiquetas..."}],"t28":[{pt:"Insira um filtro nesse tema para mostrar apenas determinadas informações, com base na tabela de atributos.",en:"Insert a Filter in this theme for show specific information, based on the table of attributes.",es:"Inserte un filtro en este tema para mostrar solo determinadas informaciones, con base en la tabla de atributos"}],"t29":[{pt:"Filtrar",en:"Filter...",es:"Filtrar..."}],"t30":[{pt:"Veja a tabela de atributos relacionada a esse tema.",en:"See the table of attributes related to this theme.",es:"Vea la tabla de atributos relacionada con este tema"}],"t31":[{pt:"Tabela com os dados",en:"Table of attributes...",es:"Tabla de atributos..."}],"t32":[{pt:"Abre o editor de legenda, permitindo a alteração da forma de representação desse tema.",en:"Opens the legend editor, allowing the modification of the form of representation of this theme.",es:"Abre el editor de leyenda, permitiendo la alteración de la forma de representación de este tema"}],"t33":[{pt:"Editar legenda",en:"Edit Legend...",es:"Editar leyenda..."}],"t34":[{pt:"Mostra os dados desse tema em uma janela que acompanha o mouse.",en:"Shows the data of this layer in a window that tracks the mouse.",es:"Muestra los datos de este tema en una ventana que acompaña el ratón"}],"t35":[{pt:"Mostra em janela",en:"Show in window",es:"Mostrar en la ventana..."}],"t36":[{pt:"tema visível apenas em determinadas escalas",en:"Layer is visible in specific scales",es:"Capa visible en ciertas escalas"}],"t37":[{pt:"Gráfico",en:"Graphic",es:"Gráfico"}],"t37a":[{pt:"Tema com gráficos",en:"Theme with chart",es:"Tema con Gráfico"}],"t37b":[{pt:"Gráfico interativo",en:"Interactive chart",es:"Gráfico Interactivo"}],"t38":[{pt:"Exporta a legenda para o padrão SLD.",en:"Export the legend to standard SLD.",es:"Exporta la leyenda para estándar SLD."}],"t39":[{pt:"Exportar SLD",en:"Export to SLD...",es:"Exportar a SLD..."}],"t40":[{pt:"Abre a ferramenta que permite alterar o SQL de acesso aos dados",en:"Opens the tool that lets you change the SQL data access",es:"Abre una herramienta que permite alterar el SQL de acceso a los datos"}],"t41":[{pt:"Editar SQL",en:"Edit SQL...",es:"Editar SQL..."}],"t42":[{pt:"Efeito cortina",en:"Curtain efect...",es:"Efecto Cortina..."}],"t43":[{pt:"Aplicar SLD",en:"Apply SLD...",es:"Aplicar SLD..."}],"t44":[{pt:"Salvar mapfile",en:"Save mapfile",es:"Guardar mapfile"}],"t45":[{pt:"Comentar",en:"Comment",es:"Comentar"}],"t46":[{pt:"Mais populares",en:"Most popular",es:"Mas populares"}],"t48":[{pt:"Temporizador",en:"Timer",es:"Temporizador"}],"t49":[{pt:"Mapa temático 3D",en:"Thematic map 3D",es:"Mapa temático 3D"}],"a1":[{pt:"procurar tema:",en:"Search layer:",es:"Buscar Tema:"}],"a2":[{pt:"Upload de shape file",en:"Upload shape file",es:"Subir archivo shape"}],"a2b":[{pt:"Upload de arquivo dbf ou CSV",en:"Upload DBF or CSV file",es:"Subir archivo DBF o CSV"}],"a3":[{pt:"Download de dados",en:"Data download",es:"Descarga de datos"}],"a3a":[{pt:"Importar Web Map Context (WMC)",en:"Import Web Map Context (WMC)",es:"Importar Web Map Context (WMC)"}],"a4":[{pt:"Conectar com servidor WMS",en:"Connect to WMS Server",es:"Conectar al servidor WMS"}],"a4b":[{pt:"Conectar com servidor WMS-T",en:"Connect to WMS-T Server",es:"Conectar al servidor WMS-T"}],"a5":[{pt:"Conectar com GeoRss",en:"Connect to GeoRss",es:"Conectar con GeoRss"}],"a5a":[{pt:"Nuvem de tags",en:"Tags cloud",es:"Nube de Tags"}],"a6":[{pt:"Acesso aos arquivos do servidor",en:"Access files in server directory",es:"Acceso a los archivos del servidor"}],"a7":[{pt:"Temas",en:"Layers",es:"Temas"}],"a8":[{pt:"Clique no box ao lado do tema para ligar ou desligar, mostrando-o ou não no mapa. Após alterar o estado do tema, aguarde alguns instantes para o mapa ser redesenhado, ou clique no botão aplicar que será mostrado.",en:"Click to connect or disconnect this layer, showing it or not on the map. After changing the layer status, wait a few moments to be reloaded on the map, or click in the button Apply that will be shown.",es:"Haga clic para conectar o desconectar este tema, mostrándolo o no en el mapa. Después de alterar el estado del tema, espere algunos instantes para que el mapa sea recargado, o haga clic en el botón aplicar que aparecerá"}],"a9":[{pt:"Fonte",en:"Font",es:"Fuente"}],"a10":[{pt:"código:",en:"Code",es:"Código"}],"a11":[{pt:"Sistemas",en:"Systems",es:"Sistemas"}],"a12":[{pt:"Abrir sistema",en:"Open system",es:"Abrir sistema"}],"a13":[{pt:"Abrir no Google Earth",en:"Open in Google Earth",es:"Abrir en Google Earth"}],"a14":[{pt:"Upload SHP, CSV, DBF, GPX, KML",en:"Upload SHP, CSV, DBF, GPX, KML",es:"Subir SHP, CSV, DBF, GPX, KML"}],"a15":[{pt:"Conexões",en:"Conections",es:"Conexiones"}],"a16":[{pt:"Serviços",en:"Services",es:"Servicios"}],"g1":[{pt:"Temas",en:"Layer",es:"Temas"}],"g1a":[{pt:"Catálogo",en:"Catalog",es:"Catálogo"}],"g2":[{pt:"Adiciona",en:"Add",es:"Agregar"}],"g3":[{pt:"Legenda",en:"Legend",es:"Leyenda"}],"g4":[{pt:"Mapas",en:"Maps",es:"Mapas"}],"g4a":[{pt:"Mapa",en:"Map",es:"Mapa"}],"o1":[{pt:"Aguarde...",en:"Wait...",es:"Espere..."}],"o2":[{pt:"Busca rápida",en:"Quick search",es:"Búsqueda rápida"}],"o3":[{pt:"Lendo imagem...",en:"Loading images...",es:"Leyendo imagen..."}],"o4":[{pt:"Aguarde...abrindo lente",en:"Wait...Opening lens...",es:"Espere...abriendo lente"}],"o5":[{pt:"Aguarde...iniciando",en:"Wait...initializing",es:"Espere...iniciando"}],"o6":[{pt:"dinâmico",en:"Dynamic",es:"Dinámico"}],"d1":[{pt:"Digite as coordenadas de um ponto (X=longitude e Y=latitude) para localiz´-lo no mapa. O centro do mapa ser´ deslocado para o ponto digitado.",en:"Enter the coordinates of a point (X=longitude and Y=latitude) to localize it on the map. The center of the map is move to the point entered.",es:"Digite las coordenadas de un punto (X=longitud e Y=latitud) para ubicarlas en el mapa. El centro del mapa se desplazará para el punto digitado."}],"d2":[{pt:"Altera a escala do mapa ajustando-a para mostrar a mesma abrangência geográfica da inicialização.",en:"Change the scale of the map adjusting it to show the same initial geographical cover.",es:"Modifica la escala del mapa ajustándola para mostrar la misma área geográfica inicial"}],"d2t":[{pt:"Enquadramento inicial",en:"Initial extent",es:"Encuadre inicial"}],"d3":[{pt:"Amplia o mapa - desloca o ponto clicado para centro da tela ou amplia a região indicada por um retângulo. Após ativada, clique e arraste o mouse sobre o mapa na área de zoom desejada.",en:"Extends the map - places the point where you clicked in the center of the screen or extends to the region indicated by a rectangle. Once activated, click and drag the mouse over the map in the desired zoom area",es:"Amplía el mapa - coloca el punto donde se hizo clic en el centro de la pantalla o amplía a la región indicada con un rectángulo. Después de activarla, haga clic y arrastre el ratón sobre el mapa en el área de zoom deseada"}],"d3t":[{pt:"clique e arraste para ampliar",en:"Click and drag to enlarge",es:"Haga click y arraste para ampliar"}],"d4":[{pt:"Desloca a região visível no mapa. Após ativada, clique e arraste o mouse sobre o mapa para deslocar a região visível.",en:"Moves the visible region on the map. Once activated, click and drag the mouse over the map to move the visible region.",es:"Desplaza la región visible en el mapa. Después de activada, haga clic y arrastre el ratón sobre el mapa para mover la región visible."}],"d4t":[{pt:"clique e arraste para deslocar",en:"Click and drag to move",es:"Haga Click y arraste para mover"}],"d5":[{pt:"Amplia o mapa tendo como referência o centro atual.",en:"Magnify the map with the reference the current center.",es:"Amplía el mapa teniendo como referencia el centro actual"}],"d5t":[{pt:"aproximar",en:"zoom in",es:"Acercar"}],"d6":[{pt:"Reduz o mapa tendo como referência o centro atual.",en:"Reduces the map with the reference of the current center.",es:"Reduce el mapa teniendo como referencia el centro actual"}],"d6t":[{pt:"afastar",en:"Zoom out",es:"Alejar",it:"afastar"}],"d7":[{pt:"Mostra informações sobre um ponto no mapa. Após ativada, clique sobre o mapa.",en:"Displays information about a point on the map. Once activated, click on the map.",es:"Muestra información sobre un punto en el mapa. Después de activarla haga clic sobre el mapa."}],"d7t":[{pt:"Clique para identificar",en:"Click to identify",es:"Click para identificar"}],"d7a":[{pt:"Mostra informações resumidas sobre um ponto clicado no mapa. Não é necessário clicar nesse ícone para ativar, basta clicar no mapa a qualquer tempo.",en:"",es:""}],"d7at":[{pt:"etiqueta",en:"Label",es:"Etiqueta"}],"d8":[{pt:"Mostra a extensão geográfica atual em coordenadas geográficas",en:"Shows the current extend in geographic coordinates",es:"Muestra la extensión geográfica actual en coordenadas geográficas"}],"d8t":[{pt:"Extensão atual",en:"Actual extent",es:"Extensió actual"}],"d9":[{pt:"Abre/fecha o mapa de referência",en:"Open/close the reference map ",es:"Abre/cierra el mapa de referencia"}],"d9t":[{pt:"mapa de referência",en:"Reference map",es:"Mapa de referencia"}],"d10":[{pt:"Digite o novo valor de escala e clique no botão aplicar para alterar a escala do mapa",en:"Enter the new value of scale and click the button Apply to change the scale of the map",es:"Digite el nuevo valor de escala y haga clic en el botón aplicar para modificar la escala del mapa"}],"d11":[{pt:"Busca dados na Wikipedia na abrangência atual do mapa. Faça um zoom no mapa antes de abrir essa opção. Regiôes muito extensas podem tornar a busca muito demorada",en:"Search data on Wikipedia in the current extend of the map. Make a zoom on the map before opening this option. Regions very extensive can make a very slow search ",es:"Busca datos en Wikipedia en el alcance actual del mapa. Haga zoom en el mapa antes de abrir esta opción. Regiones muy extensas pueden ocasionar una búsqueda muy lentas"}],"d11t":[{pt:"buscar na Wikipédia",en:"search in Wikipedia",es:"buscar na Wikipedia"}],"d12":[{pt:"Imprime o mapa",en:"Print the map",es:"Imprime el mapa"}],"d13":[{pt:"Localiza o IP do usuário no mapa",en:"Locates the user's IP on the map",es:"Ubica el IP del usuario en el mapa"}],"d14":[{pt:"Gera arquivo para 3D",en:"Generates file for 3D",es:"Genera archivo para 3D"}],"d15":[{pt:"Abre o Google Maps, mostrando uma imagem de satélite da região vista no mapa principal",en:"Open Google Maps, showing a satellite image of the region on the map",es:"Abre Google Maps, mostrando una imagen de satélite de la región en el mapa principal"}],"d15t":[{pt:"Google Maps",en:"Google Maps",es:"Google Maps"}],"d16":[{pt:"Pesquisa documentos na base de dados Scielo (dados preliminares)",en:"Search documents in the database Scielo (preliminary data)",es:"Buscar documentos en la base de datos Scielo (datos preliminares)"}],"d16t":[{pt:"Scielo",en:"Scielo",es:"Scielo"}],"d17":[{pt:"Projeto Confluence. Pontos de intersecção de coordenadas observadas em campo",en:"Confluence Project. Points of intersection of coordinates observed in field",es:"Proyecto Confluence. Puntos de intersección de coordenadas observadas en campo"}],"d17t":[{pt:"confluências",en:"Confluences",es:"Confluencias"}],"d18":[{pt:"Abre lente de ampliação",en:"Opens magnifying lens",es:"Abrir lupa"}],"d18t":[{pt:"lente",en:"lens",es:"lente"}],"d19":[{pt:"Coloca as guias em uma janela móvel",en:"Open the tabs in a window mobile",es:"Coloca las guías en una ventana móvil"}],"d20":[{pt:"Redesenha o mapa com as configuraçôes iniciais.",en:"Reload the map with the initial configurations.",es:"Recarga el mapa con las configuraciones iniciales"}],"d20t":[{pt:"reinicia",en:"restart",es:"reinicia",it:"reinicia"}],"d21":[{pt:"Mede a distância entre dois ou mais pontos clicados no mapa (menor distância). O cálculo de distância é aproximado e sua precisão depende da escala do mapa.",en:"It measures the distance between two or more clicked points on the map (shortest distance). The calculation of distance is approximate and their accuracy depends on the scale of the map.",es:"Mide la distancia entre dos o más puntos marcados en el mapa (menor distancia). El cálculo de distancia es aproximado y su precisión depende de la escala del mapa."}],"d21t":[{pt:"distância",en:"distance",es:"distancia"}],"d21a":[{pt:"Mede a área de um polígono desenhado na tela. O cálculo de área é aproximado e sua precisão depende da escala do mapa.",en:"It measures the area of a polgono drawn on the screen. The calculation of area is approximate and their accuracy depends on the scale of the map.",es:"Mide el área de un polígono dibujado sobre la pantalla. El cálculo del área es aproximado y su precisión depende de la escala del mapa."}],"d21at":[{pt:"área",en:"area",es:"área"}],"d22":[{pt:"Insere pontos no mapa em coordenadas geográficas. Ospontos incluídos podem ser transformados em linhas ou polígonos. Os pontos são armazenados em um tema temporário, podendo-se fazer o download do arquivo shapefile.",en:"Insert points on the map in geographical coordinates. The points included can be converted into lines or polygons. The points are stored in a temporary layer, and we can download it like shapefile.",es:"Inserte puntos en el mapa en coordenadas geográficas. Los puntos incluidos pueden transformarse en líneas o polígonos. Los puntos se almacenan en un tema temporal, pudiendo hacerse la descarga en formato de archivo shape."}],"d22t":[{pt:"inserir pontos",en:"insert points",es:"insertar puntos"}],"d23":[{pt:"Insere um gráfico no ponto clicado conforme os atributos existentes no tema escolhido. O tema deve possuir itens com valores numéricos na tabela de atributos.",en:"Insert a graphic of the existing attributes on the selected layer in the clicked point. The layer must have columns with numerical values in the table of attributes.",es:"Inserte un gráfico en el punto marcado según los atributos existentes en el tema seleccionado. El tema debe tener campos con valores numéricos en la tabla de atributos."}],"d24":[{pt:"Abre as ferramentas para seleção de elementos de um tema. Os elementos selecionados podem ser utilizados em outras operaçôes, como buffer e seleção por tema.",en:"Opens the tools to select elements of a layer. The elements selected can be used in other operations like buffer or selection by theme.",es:"Abre las herramientas para selección de elementos de un tema. Los elementos seleccionados pueden utilizarse en otras operaciones como áreas de influencia o selección por tema"}],"d24t":[{pt:"Selecionar",en:"Select",es:"Seleccionar"}],"d25":[{pt:"Insere texto no mapa clicando em um ponto. Utilize essa opção para adicionar informaçôes ao mapa.",en:"Insert text on the map by clicking on a point. Use this option to add information on the map.",es:"Inserte texto en el mapa haciendo clic en un punto. Utilice esta opción para agregar información al mapa"}],"d25t":[{pt:"Inserir texto",en:"Insert text",es:"Insertar texto"}],"d26":[{pt:"Escolha o visual para os botões e outras características visuais do mapa",en:"Choose the visual for the buttons and other map's visual characteristics",es:"Elija la vista para los botones y otras características visuales del mapa"}],"d27":[{pt:"Interface",en:"Interface",es:"Interface"}],"d28":[{pt:"Aguarde...gerando os arquivos",en:"Wait... generating files",es:"Espere... generando los archivos"}],"d29":[{pt:"Estações METAR",en:"METAR-Br Stations",es:"Estaciones METAR-Br"}],"d30":[{pt:"Linha do tempo",en:"Timeline",es:"Línea del tiempo"}],"d31":[{pt:"Não existe nenhuma camada com etiquetas ativas",en:"There is no layer with active labels",es:"No existe ninguna capa con etiquetas activas"}],"d32":[{pt:"Aplicativos",en:"Applications",es:"Aplicaciones"}],"ge1":[{pt:"Navegação com o mouse",en:"Mouse navigation",es:"Navegación con el ratón"}],"ge2":[{pt:"Barra de status",en:"Status bar",es:"Barra de estado"}],"ge3":[{pt:"Mapa de referência",en:"Reference map",es:"Mapa de referencia"}],"ge4":[{pt:"Escala e legenda",en:"Scale and legend",es:"Escala y leyenda"}],"ge5":[{pt:"Atmosfera",en:"Atmosphere",es:"Atmósfera"}],"ge6":[{pt:"Grade de coordenadas",en:"Coordinates grid",es:"Grilla de coordenadas"}],"ge7":[{pt:"Luz do sol",en:"Sunshine",es:"Luz del sol"}],"ge8":[{pt:"Limites políticos",en:"Political boundaries",es:"Límites políticos"}],"ge9":[{pt:"Construções em 3D",en:"Buildings in 3D",es:"Construciones en 3D"}],"ge10":[{pt:"Estradas",en:"Roads",es:"Carreteras"}],"ge11":[{pt:"Terreno",en:"Terrain",es:"Terreno"}],"x1":[{pt:"Página principal",en:"Home",es:"Inicio"}],"x2":[{pt:"Lista de menus",en:"Menu list",es:"Lista de menús"}],"x3":[{pt:"Miniaturas",en:"Thumbnails",es:"Miniaturas"}],"x4":[{pt:"Pesquisa na INDE",en:"Search in SDI of INDE-Br",es:"Buscar en IDE del INDE-Br"}],"x5":[{pt:"Editar subgrupos",en:"Edit subgroups",es:"Editar subgrupos"}],"x6":[{pt:"Editar temas",en:"Edit Theme",es:"Editar temas"}],"x7":[{pt:"opção visível apenas para editores",en:"option visible only for editors",es:"opción visible solo para editores"}],"x8":[{pt:"Sistema de administração",en:"Admin. System",es:"Sistema de administración"}],"x9":[{pt:"Editar árvore",en:"Edit tree",es:"Editar árbol"}],"x10":[{pt:"Editar menus do catálogo",en:"Edit menus",es:"Editar menus"}],"x11":[{pt:"Mostra a legenda em uma janela",en:"Show the legend in a window",es:"Muestra una leyenda en una ventana"}],"x13":[{pt:"&Acute;rvore de camadas não encontrada",en:"Tree layers not found",es:"Arboles de capas no se encuentra"}],"x14":[{pt:"sim",en:"si",es:"yes"}],"x15":[{pt:"não",en:"no",es:"no"}],"x16":[{pt:"Valor não definido",en:"Value not set",es:"Valor no establecido"}],"x17":[{pt:"Essa opção afeta apenas a impressão do mapa",en:"This option only affects the printing of the map",es:"Esta opción s&ocaute;lo afecta a la impresi&ocaute;n del mapa"}],"x18":[{pt:"Nome não definido",en:"El nombre no se ha definido",es:"Name was not defined"}],"x19":[{pt:"Comentários de",en:"Reviews",es:"Comentarios"}],"x20":[{pt:"Clique no mapa para desenhar o polígono",en:"Click the map to draw the polygon",es:"Haga clic en el mapa para dibujar el polígono"}],"x21":[{pt:"Essa operação não funciona nessa interface",en:"This operation does not work on this interface",es:"Esta operación no funciona en esta interfaz"}],"x22":[{pt:"Opção não disponível",en:"Option not available",es:"Opción no disponible"}],"x23":[{pt:"Direção",en:"",es:"Dirección"}],"x25":[{pt:"Método para calcular distâncias",en:"Method to calculate distances",es:"Método para calcular distancias"}],"x26":[{pt:"Voce quer mesmo encerrar a sessao?",en:"Do you really want to logout?",es:"Realmente desea salir?"}],"x27":[{pt:"Usuário",en:"User",es:"Usuario"}],"x28":[{pt:"Senha",en:"Password",es:"Contraseña"}],"x29":[{pt:"Enviar",en:"Send",es:"Enviar"}],"x30":[{pt:"Ativo",en:"Active",es:"Activo"}],"x31":[{pt:"Erro",en:"Error",es:"Erro"}],"x32":[{pt:"Recuperar senha",en:"Send password",es:"Enviar la contrasena"}],"x33":[{pt:"Escolha um tema da lista",en:"Choose a layer from the list",es:"Elegir un tema de la lista"}],"x34":[{pt:"Lugar",en:"Place",es:"Lugar"}],"x35":[{pt:"Escolha um tipo de busca nas propriedades",en:"Choose a search type in the properties",es:"Elija una forma de buscar en las propiedades"}],"x36":[{pt:"Digite uma palavra para busca!",en:"Enter a keyword to search!",es:"Introduzca una palabra clave para buscar!"}],"x37":[{pt:"Onde será feita a busca",en:"Where the search will be done",es:"Donde se hace la búsqueda"}],"x38":[{pt:"Serviços de busca externos",en:"External searchs services",es:"Servicios de búsqueda externos"}],"x39":[{pt:"Temas existentes no mapa",en:"Existing layers on the map",es:"Temas existentes en el mapa"}],"x40":[{pt:"Apenas os temas especialmente configurados pelo administrador do i3Geo podem receber operações de busca",en:"Only the layers specially configarated by the i3Geo administrator can receive search operations",es:"Sólo los temas especialmente configurados por el administrador del i3Geo pueden recibir las operaciones de búsqueda"}],"x41":[{pt:"Nada encontrado nos temas ou nenhum tema permite busca",en:"Nothing found in layers or none layer allows search",es:"No se encontró nada en los temas o ningúno tema permite búsqueda"}],"x42":[{pt:"Nada encontrado em ",en:"Nothing found at ",es:"No se encontró nada en "}],"x43":[{pt:"Erro ao acessar o serviço",en:"Error accessing the service",es:"Error de acceso al servicio"}],"x44":[{pt:"Nuvem Flash",en:"Cloud Flash",es:"Nube Flash"}],"x45":[{pt:"Diretórios",en:"Directories",es:"Directorios"}],"x46":[{pt:"Conexão WMS-T",en:"WMS-T connection",es:"Conexión WMS-T"}],"x47":[{pt:"Conexão GeoRSS",en:"GeoRSS connection",es:"Conexión WMS-T"}],"x48":[{pt:"Rota",en:"Route",es:"Ruta"}],"x49":[{pt:"Coordenadas aproximadas",en:"Approximate coordinates",es:"Coordenadas aproximadas"}],"x50":[{pt:"Feche para parar",en:"Close to stop",es:"Cierre para parar"}],"x51":[{pt:"Seleção",en:"Selection",es:"Selecci&ocute;n"}],"x52":[{pt:"Alterar senha",en:"Change password",es:"Cambiar contraseńa"}],"x53":[{pt:"Upload de WMC",en:"WMC upload",es:"Subir WMC"}],"x54":[{pt:"Perfil",en:"Profile",es:"Perfil"}],"x55":[{pt:"Salva o tema",en:"Save layer",es:"Guarda el tema"}],"x56":[{pt:"Toponímia",en:"Toponymy",es:"Toponimia"}],"x57":[{pt:"Cartogramas estatísticos",en:"Statistical cartograms",es:"Cartogramas estadísticos"}],"x58":[{pt:"Continua",en:"Continue",es:"Seguir"}],"x59":[{pt:"Localiza limite",en:"Locate limit",es:"Localiza límite"}],"x60":[{pt:"Cartogramas",en:"Cartograms",es:"Cartogramas"}],"x61":[{pt:"Filtra limite",en:"Filter limit",es:""}],"x62":[{pt:"Remover",en:"Remove",es:"Eliminar"}],"x63":[{pt:"Para salvar as configurações de uma camada,<br> utilize a opção existente na árvore de camadas no nó correspondente ao tema (basta expandir o tema para visualizar as opções)<br><br>",en:"To save the settings for a layer, use the option available in the layers tree corresponding to the theme node (just expand the layer to view options)",es:"Para guardar la configuración de un tema, utilice la opción disponible en la árbol de temas en el nodo correspondiente a lo tema (sólo ampliar el tema para ver las opciones)"}],"x64a":[{pt:"Congela a visão atual",en:"Freezes the current view",es:"Congela la vista actual"}],"x64":[{pt:"Ítem",en:"Item",es:"Ítem"}],"x65":[{pt:"Buscando ítens...",en:"Buscando ítens...",es:"Searching items..."}],"x66":[{pt:"Ocorreu um erro",en:"An error ocurred",es:"Ha ocurrido un error"}],"x67":[{pt:"Comunidade i3Geo",en:"i3Geo community",es:"Comunidad i3Geo"}],"x68":[{pt:"Versão",en:"Version",es:"Versió"}],"x69":[{pt:"Pressione a tecla CTRL junto com o botão esquerdo do mouse e arraste para definir a área que será aproximada",en:"Press the CTRL key along with the left mouse button and drag to define the area to be approximate",es:"Pulse la tecla CTRL junto con el bot&oacurte;n izquierdo del rat&oacurte;n y arrastre para definir el &aacurte;rea a ser aproximado"}],"x70":[{pt:"Utilize os dedos em um movimento de pinça para definir a área que será aproximada ou afastada",en:"Use the fingers in a pincer movement to define the area to be zoomed in or out",es:"Utilice los dedos en un movimiento de pinzas para definir el área a ser aproximada o alejada"}],"x71":[{pt:"Aplicativos estatísticos cadastrados",en:"Registered statistical applications",es:"Aplicaciones estadísticas registrados"}],"x72":[{pt:"Lista de mapas cadastrados",en:"Registered map list",es:"Lista de los mapas registrados"}],"x73":[{pt:"Redirecionar para a versão adaptada para dispositivos móveis?",en:"Redirect to mobile version?",es:"Redireccionar a una versión adaptada para dispositivos móviles?"}],"x74":[{pt:"Fecha",en:"Close",es:"Cierra"}],"x75":[{pt:"Cancela",en:"Cancel",es:"Cancela"}],"x76":[{pt:"O tema já existe no mapa. Adiciona novamente?",en:"Layer already exists in the map. Add again?",es:"El tema ya existe en el mapa. Añade otra vez?"}],"x77":[{pt:"Nome do novo marcador",en:"New bookmark name",es:"Nombre del nuevo marcador"}],"x78":[{pt:"Copie os marcadores e cole em um editor para guardá-los",en:"Copy and paste the bookmarks in an editor to save",es:"Copie y pegue los marcadores en un editor para salvarlos"}],"x79":[{pt:"Marcadores",en:"Bookmarks",es:"Marcadores"}],"x80":[{pt:"Exportar",en:"Export",es:"Exportar"}],"x81":[{pt:"Importar",en:"Import",es:"Importar"}],"x82":[{pt:"Marcar região",en:"Mark region",es:"Marcar regió"}],"x83":[{pt:"Cole os marcadores para importá-los",en:"Paste the bookmarks to import",es:"Pegue los marcadores para importarlos"}],"x84":[{pt:"Exportar SHP",en:"Export SHP",es:"Exportar SHP"}],"x85":[{pt:"Visualizador de WMS da INDE-Br",en:"INDE-Br WMS viewer",es:"Visualizador de WMS de la INDE-Br"}],"x86":[{pt:"Preferências",en:"Preferences",es:"Preferencias"}],"x87":[{pt:"Limites e localidades",en:"Limits and places",es:"Límites y ubicaciones"}],"x88":[{pt:"Preferências",en:"Preferences",es:"Preferencias"}],"x89":[{pt:"Editar cadastro",en:"Edit registry",es:"Editar registro"}],"x90":[{pt:"Mapas cadastrados",en:"Registered maps",es:"Mapas registrados"}],"x91":[{pt:"Feche para parar. Desligue o tema para ver o efeito",en:"Close to stop. Disable the layer to see the effect",es:"Cierre para detener. Desactive el tema para ver el efecto"}],"x92":[{pt:"Escolha uma camada",en:"Select a layer",es:"Seleccione una capa"}],"x93":[{pt:"Localização do usuário",en:"User location",es:"Ubicación del usuario"}],"x94":[{pt:"Remove as figuras da tela",en:"Remove the pictures",es:"Retire las figuras"}],"x95":[{pt:"trecho",en:"stretch",es:"tramo"}],"x96":[{pt:"atual",en:"current",es:"corriente"}],"x97":[{pt:"total",en:"total",es:"total"}],"x98":[{pt:"perímetro",en:"perimeter",es:"perímetro"}],"x99":[{pt:"Cálculo não pode ser realizado. Falta carregar a API de geometria do GM",en:"",es:""}],"x101":[{pt:"Cópia",en:"",es:""}],"x102":[{pt:"Mapa de calor",en:"Heatmap",es:""}],"x103":[{pt:"Links para abrir o mapa",en:"",es:""}],"x104":[{pt:"Mapa de agrupamentos",en:"",es:""}],"x105":[{pt:"Navegação",en:"",es:""}],"mais":[{pt:"Mais...",en:"",es:""}],"uploadArquivoGeo":[{pt:"Upload de arquivo geo",en:"",es:""}],"conexaoServicoGeo":[{pt:"Conexão com serviços geo",en:"",es:""}],"saikuAba":[{pt:"SAIKU - OLAP (abrir em nova aba)",en:"",es:""}],"saikuMapa":[{pt:"SAIKU - OLAP (abrir em janela interna)",en:"",es:""}],"refMapaAtual":[{pt:"Mapa atual",en:"",es:""}],"refMapaDinamico":[{pt:"Mapa dinâmico",en:"",es:""}],"naoPermitido":[{pt:"Operacao nao autorizada para esse usuario",en:"",es:""}],"melhorcaminho":[{pt:"Melhor caminho (raster)",en:"",es:""}],"tolerancia":[{pt:"Tolerância de busca (em pixels)",en:"",es:""}],"naoInstalado":[{pt:"Ferramenta não disponível nessa instalação do i3Geo",en:"",es:""}],"variaEscala":[{pt:"Dependência da escala",en:"",es:""}],"mostraTodosLegenda":[{pt:"todos",en:"",es:""}],"mostraSoLegenda":[{pt:"só legenda",en:"",es:""}],"removerDoMapa":[{pt:"Remove a camada do mapa?",en:"",es:""}],"dicaBuscaRapida":[{pt:"Abre uma janela flutuante com opções de busca de dados em serviços como o Google Maps ou nas camadas exsitentes no mapa",en:"",es:""}],"refresh":[{pt:"Refaz a árvore, reconstruindo os ícones e lista de camadas",en:"",es:""}],"lixeira":[{pt:"Clique para ver a lista de camadas em uma janela flutuante com opção para remover um ou mais camadas do mapa. Arraste uma camada sobre esse ícone para removê-la individualmente",en:"",es:""}],"filtraCam":[{pt:"Permite filtrar a lista de camadas mostradas na árvore conforme propriedades específicas de cada uma",en:"",es:""}],"legenda":[{pt:"Abre a legenda do mapa em uma janela flutuante",en:"",es:""}],"ferramMapa":[{pt:"Mostra a lista de ferramentas que atuam sobre o mapa",en:"",es:""}],"ferramCamadas":[{pt:"Mostra a lista de ferramentas que atuam sobre camadas",en:"",es:""}],"ajudaEditorOlSalva":[{pt:"Para editar os atributos, utilize a ferramenta de identificação. É necessário que exista uma coluna com identificadores únicos na tabela a ser editada e que essa coluna esteja visível na ferramenta de identificação.",en:"",es:""}]}; | ... | ... |
mashups/openlayers_compacto.js.php
| ... | ... | @@ -1643,7 +1643,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.desenho={layergrafico:null,es |
| 1643 | 1643 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}YAHOO.namespace("i3GEO.janela");YAHOO.i3GEO.janela.manager=new YAHOO.widget.OverlayManager();YAHOO.namespace("janelaDoca.xp");YAHOO.janelaDoca.xp.manager=new YAHOO.widget.OverlayManager();YAHOO.i3GEO.janela.managerAguarde=new YAHOO.widget.OverlayManager();i3GEO.janela={ESTILOBD:"display:block;padding:5px 1px 5px 1px;",ESTILOAGUARDE:"normal",AGUARDEMODAL:false,ANTESCRIA:["i3GEO.janela.prepara()"],ANTESFECHA:[],TRANSICAOSUAVE:true,OPACIDADE:65,OPACIDADEAGUARDE:50,TIPS:[],ULTIMOZINDEX:5,prepara:function(){var iu=i3GEO.util;iu.escondeBox()},cria:function(wlargura,waltura,wsrc,nx,ny,texto,id,modal,classe,funcaoCabecalho,funcaoMinimiza,funcaoAposRedim,dimensionavel,icone,funcaoDuplica,transicao){if(!transicao){transicao="sim"}if(!dimensionavel){dimensionavel=true}if(!icone){icone=""}var i,wlargurA,ins,novoel,wdocaiframe,temp,fix,underlay,ifr,janela;if($i(id)){janela=YAHOO.i3GEO.janela.manager.find(id);janela.show();janela.bringToTop();return}if(navm&&!chro){this.TRANSICAOSUAVE=false}if(this.ANTESCRIA){for(i=0;i<this.ANTESCRIA.length;i++){eval(this.ANTESCRIA[i])}}if(!classe||classe==""){classe="hd"}if(!id||id===""){id="wdoca"}if(!modal||modal===""){modal=false}ifr=false;if(i3GEO.Interface&&i3GEO.Interface!=undefined&&i3GEO.Interface.ATUAL==="googleearth"){i3GEO.janela.TRANSICAOSUAVE=false;ifr=true}fix="contained";if(nx===""||nx==="center"){fix=true}if(modal===true){underlay="none"}else{underlay="shadow"}temp=navm?0:2;wlargurA=parseInt(wlargura,10)+temp+"px";ins='<div id="'+id+'_cabecalho" class="'+classe+'" >';if(i3GEO.configura!==undefined){ins+="<img id='"+id+"_imagemCabecalho' class='i3GeoAguardeJanela' style='visibility:hidden;' src=\'"+i3GEO.configura.locaplic+"/imagens/aguarde2.gif\' />"}if(icone!=""){ins+="<img class='i3GeoIconeJanela' src='"+icone+"' >"}ins+="<span style='font-size:10px;'>"+texto+"</span>";if(funcaoDuplica){ins+="<div id='"+id+"_duplicaJanela' class='container-duplica'></div>"}if(funcaoMinimiza){ins+="<div id='"+id+"_minimizaCabecalho' class='container-minimiza'></div>"}ins+='</div><div id="'+id+'_corpo" class="bd" style="'+this.ESTILOBD+'">';if(wsrc!==""){ins+='<iframe name="'+id+'i" id="'+id+'i" valign="top" style="border:0px white solid;width:100%"></iframe>'}ins+='</div>';ins+='<div class="ft"></div>';novoel=document.createElement("div");novoel.id=id;novoel.style.display="block";novoel.innerHTML=ins;if(this.TRANSICAOSUAVE&&transicao==="sim"){novoel.onmouseover=function(){YAHOO.util.Dom.setStyle(novoel,"opacity",1)};novoel.onmouseout=function(){YAHOO.util.Dom.setStyle(novoel,"opacity",i3GEO.janela.OPACIDADE/100)};YAHOO.util.Dom.setStyle(novoel,"opacity",1)}document.body.appendChild(novoel);wdocaiframe=$i(id+"i");if(wdocaiframe){temp=wdocaiframe.style;temp.height=waltura;temp.display="block";wdocaiframe.src=wsrc}else{if(waltura!=="auto"){$i(id+'_corpo').style.height=parseInt(waltura,10)+"px"}$i(id+'_corpo').style.width='100%';$i(id+'_corpo').style.overflow="auto"}if(waltura==="auto"||dimensionavel==false){janela=new YAHOO.widget.Panel(id,{iframe:ifr,modal:modal,width:wlargurA,underlay:underlay,fixedcenter:fix,constraintoviewport:true,visible:true,monitorresize:false,dragOnly:true,keylisteners:null})}else{janela=new YAHOO.widget.Panel(id,{hideMode:'offsets',iframe:ifr,underlay:underlay,modal:modal,width:wlargurA,fixedcenter:fix,constraintoviewport:true,visible:true,monitorresize:false,dragOnly:true,keylisteners:null});if(YAHOO.util.Resize){var resize=new YAHOO.util.Resize(id,{handles:['br'],autoRatio:false,minWidth:10,minHeight:10,status:false,proxy:true,ghost:false,animate:false,useShim:true});resize.on('resize',function(args){this.cfg.setProperty("height",args.height+"px");if(wdocaiframe){wdocaiframe.style.height=args.height-50+"px"}},janela,true);if(funcaoAposRedim&&funcaoAposRedim!=""){resize.on('endResize',function(args){funcaoAposRedim.call();i3GEO.janela.minimiza()},janela,true)}resize.getProxyEl().style.height="0px"}}if(nx!==""&&nx!=="center"){janela.moveTo(nx,ny+50)}YAHOO.i3GEO.janela.manager.register(janela);if(this.TRANSICAOSUAVE){janela.cfg.setProperty("effect",[{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.5}])}janela.cfg.setProperty("zIndex",[4]);janela.render();janela.bringToTop();if(navm&&id!=="i3geo_janelaMensagens"&&i3GEO.Interface&&i3GEO.Interface!=undefined&&i3GEO.Interface.ATUAL==="googleearth"){janela.moveTo(0,0)}if(ifr===true){janela.iframe.style.zIndex=4}YAHOO.util.Event.addListener($i(id+'_corpo'),"click",YAHOO.util.Event.stopPropagation);if(funcaoDuplica){$i(id+'_duplicaJanela').onclick=funcaoDuplica}if(funcaoCabecalho){$i(id+'_cabecalho').onclick=funcaoCabecalho}if(funcaoMinimiza){$i(id+"_minimizaCabecalho").onclick=funcaoMinimiza}YAHOO.util.Event.addListener(janela.close,"click",i3GEO.janela.fecha,janela,{id:id},true);temp=$i(id+"_corpo");return([janela,$i(id+"_cabecalho"),temp])},minimiza:function(id,min){var temp=$i(id+"_corpo"),n,i,m=YAHOO.i3GEO.janela.manager.find(id),c=$i(id),t="min";if(temp){if(temp.style.display==="block"){temp.style.display="none";if(m){m.hideIframe()}m.winicial=c.style.width;if(min){c.style.width=min}}else{temp.style.display="block";if(m){m.showIframe()}c.style.width=m.winicial;t="max"}}temp=$i(id+"_resizehandle");if(temp){if(temp.style.display==="none"){temp.style.display="block"}else{temp.style.display="none"}}temp=$i(id+"_c");if(temp){temp=temp.getElementsByTagName("div");n=temp.length;for(i=0;i<n;i++){if(temp[i].className==="underlay"||temp[i].className==="bd"){if(temp[i].style.display==="none"){temp[i].style.display="block"}else{temp[i].style.display="none"}}}}temp=$i(id+"_corpo");if(temp){if(temp.style.display==="none"){temp.style.display="block"}else{temp.style.display="none"}}temp=$i(id);if(temp){if(temp.style.display==="none"){temp.style.height="100%"}else{temp.style.height="10%"}}return t},fecha:function(event,args){var i,id;i3GEO.util.escondeBox();if(i3GEO.janela.ANTESFECHA){for(i=0;i<i3GEO.janela.ANTESFECHA.length;i++){eval(i3GEO.janela.ANTESFECHA[i])}}if(i3GEO.janela.id){id=i3GEO.janela.id}else{id=event.id}if(id==undefined){id=args.id}i3GEO.janela.destroi(id)},destroi:function(id){var janela=YAHOO.i3GEO.janela.manager.find(id);i3GEO.util.removeScriptTag(id+"_script");i3GEO.util.removeScriptTag(id+".dicionario_script");if(janela){YAHOO.i3GEO.janela.manager.remove(janela);janela=$i(id+"_c");janela.parentNode.removeChild(janela)}},alteraTamanho:function(w,h,id){var i;if(arguments.length===3){i=$i(id)}else{i=$i("wdoca")}if(i){i.style.width=w+"px";i.style.height=h+"px"}},abreAguarde:function(id,texto){var pos,temp,janela;if(!id||id==undefined){return}janela=YAHOO.i3GEO.janela.managerAguarde.find(id);pos=[0,0];if(i3GEO.Interface&&$i(i3GEO.Interface.IDCORPO)){pos=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO))}else if($i("contemImg")){pos=YAHOO.util.Dom.getXY($i("contemImg"))}if(i3GEO.janela.AGUARDEMODAL==true){texto+="<br><span style='color:navy;cursor:pointer;font-size:9px;' onclick='javascript:if(i3GEO.janela.AGUARDEMODAL == true){i3GEO.janela.AGUARDEMODAL = false;}else{i3GEO.janela.AGUARDEMODAL = true;}'>bloquear/desbloquear</span>"}if(!janela){janela=new YAHOO.widget.Panel(id,{width:"240px",fixedcenter:false,underlay:"none",close:true,draggable:false,modal:i3GEO.janela.AGUARDEMODAL,monitorresize:false});janela.render(document.body);YAHOO.i3GEO.janela.managerAguarde.register(janela)}if(i3GEO.janela.ESTILOAGUARDE==="normal"||i3GEO.janela.ESTILOAGUARDE==="reduzida"){janela.setBody(texto);janela.body.style.padding="5px"}if(i3GEO.janela.ESTILOAGUARDE==="normal"||i3GEO.janela.ESTILOAGUARDE==="minima"){janela.setHeader("<span><img id=aguardeGifAberto src='"+i3GEO.configura.locaplic+"/imagens/aguarde.gif' /></span> <span style=font-size:8px >"+YAHOO.i3GEO.janela.managerAguarde.overlays.length+"</span>")}if(i3GEO.parametros&&i3GEO.parametros.w>0){janela.moveTo(pos[0]+(i3GEO.parametros.w/2)-120,pos[1])}else{janela.moveTo(pos[0],pos[1])}janela.show();if(janela.header){janela.header.style.height="20px"}temp=$i(id+"_c");if(temp){temp.style.backgroundColor=""}YAHOO.util.Dom.setStyle(temp,"opacity",i3GEO.janela.OPACIDADEAGUARDE/100)},fechaAguarde:function(id){if(id!=undefined){var janela=YAHOO.i3GEO.janela.managerAguarde.find(id);if(janela){YAHOO.i3GEO.janela.managerAguarde.remove(janela);janela.destroy()}}},tempoMsg:function(texto,tempo){if(!YAHOO.util.Easing){return}var pos,janela,attributes,anim,altura=40;janela=YAHOO.i3GEO.janela.managerAguarde.find("i3geoTempoMsg");pos=[0,0];if(i3GEO.Interface&&$i(i3GEO.Interface.IDCORPO)){pos=YAHOO.util.Dom.getXY($i(i3GEO.Interface.IDCORPO))}else if($i("contemImg")){pos=YAHOO.util.Dom.getXY($i("contemImg"))}if(!janela){janela=new YAHOO.widget.Panel("i3geoTempoMsg",{width:"220px",fixedcenter:false,underlay:"none",close:false,draggable:false,modal:false,monitorresize:false,iframe:true});janela.render(document.body);YAHOO.i3GEO.janela.managerAguarde.register(janela)}janela.setBody(texto);altura=70;janela.body.style.padding="5px";janela.body.style.backgroundColor="yellow";if(i3GEO.Interface&&i3GEO.Interface.ATUAL!="googleearth"){janela.body.style.height="0px"}else{janela.body.style.height=altura+"px"}janela.body.style.overflow="hidden";janela.body.onclick=function(){var janela=YAHOO.i3GEO.janela.managerAguarde.find("i3geoTempoMsg");if(janela){janela.destroy()}};if(i3GEO.parametros&&i3GEO.parametros.w>0){janela.moveTo(pos[0]+(i3GEO.parametros.w/2)-120,pos[1])}else{janela.moveTo(pos[0],pos[1])}janela.show();if(i3GEO.Interface&&i3GEO.Interface.ATUAL!="googleearth"){attributes={height:{to:altura}};anim=new YAHOO.util.Anim(janela.body,attributes,.5,YAHOO.util.Easing.easeNone);anim.onComplete.subscribe(function(){janela.body.style.overflow="auto";janela.body.style.display="block";$i("i3geoTempoMsg_c").style.zIndex=100000});anim.animate()}if(!tempo){tempo=4000}setTimeout(function(){var attributes,anim,janela=YAHOO.i3GEO.janela.managerAguarde.find("i3geoTempoMsg");if(i3GEO.Interface&&i3GEO.Interface.ATUAL!="googleearth"){if(janela){janela.body.style.overflow="hidden";attributes={height:{to:0}};anim=new YAHOO.util.Anim(janela.body,attributes,.5,YAHOO.util.Easing.easeNone);anim.onComplete.subscribe(function(){janela.destroy()});anim.animate()}}else{janela.destroy()}},tempo)},ativaAlerta:function(){window.alert=function(texto){var textoI,janela=YAHOO.i3GEO.janela.managerAguarde.find("alerta");if(!janela){janela=new YAHOO.widget.SimpleDialog("alerta",{width:"300px",fixedcenter:true,visible:false,draggable:false,zIndex:100000,textAlign:"left",close:true,modal:false,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},constraintoviewport:true,buttons:[{text:$trad("x74"),handler:function(){this.destroy()},isDefault:true}],icon:YAHOO.widget.SimpleDialog.ICON_WARN,text:""});YAHOO.i3GEO.janela.managerAguarde.register(janela);janela.setHeader(" ");janela.render(document.body)}textoI=janela.cfg.getProperty("text");if(textoI!=""){textoI+="<br>"}texto=textoI+texto;janela.cfg.setProperty("text",texto);janela.show()}},confirma:function(pergunta,w,resposta1,resposta2,funcao1,funcao2){var b,f1,f2,f3,janela=YAHOO.i3GEO.janela.managerAguarde.find("confirma");if(!w||w==""){w=300}if(!funcao1||funcao1==""){f1=function(){YAHOO.i3GEO.janela.managerAguarde.find("confirma").destroy();return true}}else{f1=function(){funcao1.call();YAHOO.i3GEO.janela.managerAguarde.find("confirma").destroy()}}if(!funcao2||funcao2==""){f2=function(){YAHOO.i3GEO.janela.managerAguarde.find("confirma").destroy();return false}}else{f2=function(){funcao2.call();YAHOO.i3GEO.janela.managerAguarde.find("confirma").destroy()}}f3=function(){YAHOO.i3GEO.janela.managerAguarde.find("confirma").destroy()};if(!resposta1||resposta1==""){resposta1=$trad("x58")}if(janela){janela.destroy()}b=[{text:$trad("x75"),handler:f3},{text:resposta1,handler:f1}];if(resposta2&&resposta2!=""){b.push({text:resposta2,handler:f2})}janela=new YAHOO.widget.SimpleDialog("confirma",{width:w+"px",fixedcenter:true,visible:false,draggable:false,zIndex:100000,textAlign:"left",close:false,modal:false,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},constraintoviewport:true,buttons:b,icon:YAHOO.widget.SimpleDialog.ICON_HELP,text:"<p class=paragrafo >"+pergunta});YAHOO.i3GEO.janela.managerAguarde.register(janela);janela.setHeader(" ");janela.render(document.body);janela.show()},prompt:function(pergunta,funcaoOk,valorDefault){if($i("i3GEOjanelaprompt")){return}if(!valorDefault){valorDefault=""}var i="<br><div class='i3geoForm i3geoFormIconeEdita' ><input id='i3GEOjanelaprompt' type=text value='"+valorDefault+"' />";i3GEO.janela.confirma(pergunta+i,"","","",funcaoOk)},mensagemSimples:function(texto,cabecalho,largura,altura){var janela;if(!largura){largura=300}if(!altura){altura=300}if(!cabecalho){cabecalho=""}janela=new YAHOO.widget.SimpleDialog(YAHOO.util.Dom.generateId(),{width:parseInt(largura,10)+"px",height:parseInt(altura,10)+"px",fixedcenter:true,visible:true,draggable:true,zIndex:100000,textAlign:"left",close:true,modal:false,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},constraintoviewport:true,text:""});YAHOO.i3GEO.janela.manager.register(janela);janela.setHeader(cabecalho);janela.render(document.body);janela.setHeader(cabecalho);janela.cfg.setProperty("text",texto);janela.bringToTop();janela.show();return janela},tip:function(){var Nid,novoel,res;Nid=YAHOO.util.Dom.generateId();novoel=document.createElement("div");novoel.className="i3GEObalaoInfo";novoel.id=Nid;document.body.appendChild(novoel);i3GEO.janela.TIPS.push($i(Nid));res="<div id='"+Nid+"cabecatip' style='text-align:left;background-color:rgb(240,240,240)'></div>";novoel.innerHTML="<table style='text-align:left'><tr><td style='text-align:left'>"+res+"</td></tr></table>";ist=novoel.style;ist.top=objposicaocursor.telay-9+"px";ist.left=objposicaocursor.telax-5+"px";ist.display="block";i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.janela.excluiTips('todos')"]);return(Nid)},excluiTips:function(tipo){var ot,i;if(arguments.length===0){tipo="todos"}if(i3GEO.janela.TIPS.length>0){ot=i3GEO.janela.TIPS.length-1;if(ot>=0){do{if(tipo==='todos'){if(i3GEO.janela.TIPS[ot]){i=$i(i3GEO.janela.TIPS[ot].id);document.body.removeChild(i)}}if(tipo==='naofixos'){if($i(i3GEO.janela.TIPS[ot])){if($i(i3GEO.janela.TIPS[ot].id+"cabecatip").innerHTML!==""){document.body.removeChild($i(i3GEO.janela.TIPS[ot].id))}}}}while(ot--);if(tipo==="todos"){i3GEO.janela.TIPS=[]}}}},slider:function(funcao,inicial){var scaleFactor,bottomConstraint,topConstraint,janela,novoel,Event,slider="",bg,thumb;janela=i3GEO.janela.cria(230,200,"","","",$trad("t20"),"opacidadeG");novoel=document.createElement("div");novoel.id="slider-bg";novoel.tabindex="-1";novoel.innerHTML='<div style="cursor:default;position:absolute;top:4px" id="slider-thumb"><img src="'+i3GEO.configura.locaplic+'/imagens/thumb-n.gif"></div>';janela[2].appendChild(novoel);Event=YAHOO.util.Event;bg="slider-bg";thumb="slider-thumb";novoel.style.position="relative";novoel.style.background='url('+i3GEO.configura.locaplic+'/imagens/bg-fader.gif) 5px 0 no-repeat';novoel.style.height="28px";novoel.style.width="228px";topConstraint=0;bottomConstraint=200;scaleFactor=1;Event.onDOMReady(function(){slider=YAHOO.widget.Slider.getHorizSlider(bg,thumb,topConstraint,bottomConstraint,20);slider.setValue(parseInt(inicial,10));slider.getRealValue=function(){return Math.round(this.getValue()*scaleFactor)};slider.subscribe("slideEnd",function(offsetFromStart){var actualValue=slider.getRealValue();eval(funcao+"("+actualValue+")")})});Event.on("putval","click",function(e){slider.setValue(100,false)})},comboCabecalhoTemas:function(idDiv,idCombo,ferramenta,tipo,onButtonClick){var temp=$i(idDiv);if(temp&&!($i(idCombo))){i3GEO.util.comboTemas(temp.id+"Sel",function(retorno){var tema,container=$i(idDiv),botao;container.innerHTML=retorno.dados;botao=new YAHOO.widget.Button(idCombo,{type:"menu",menu:idCombo+"select"});if(i3GEO.temaAtivo!=""){tema=i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo);botao.set("label","<span class='cabecalhoTemas' >"+tema.tema+"</span> ")}else{botao.set("label","<span class='cabecalhoTemas' >"+$trad("x92")+"</span> ")}if(!onButtonClick){onButtonClick=function(p_sType,p_aArgs){var oMenuItem=p_aArgs[1];if(oMenuItem){i3GEO.mapa.ativaTema(oMenuItem.value);if(oMenuItem.value===""){i3GEO.temaAtivo="";botao.set("label","<span class='cabecalhoTemas' >"+$trad("x92")+"</span> ")}else{botao.set("label","<span class='cabecalhoTemas' >"+oMenuItem.cfg.getProperty("text")+"</span> ")}if(i3GEOF[ferramenta]){i3GEOF[ferramenta].tema=oMenuItem.value;if($i("i3GEOF."+ferramenta+"_corpo")){$i("i3GEOF."+ferramenta+"_corpo").innerHTML="";eval("i3GEOF."+ferramenta+".inicia('i3GEOF."+ferramenta+"_corpo');")}}}}}botao.getMenu().subscribe("click",onButtonClick,botao)},temp.id,"",false,tipo,"",true,true)}if(i3GEO.eventos.ATUALIZAARVORECAMADAS.length>20){i3GEO.eventos.ATUALIZAARVORECAMADAS=[]}temp="i3GEO.janela.comboCabecalhoTemas('"+idDiv+"','"+idCombo+"','"+ferramenta+"','"+tipo+"')";i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",[temp])}}; |
| 1644 | 1644 | // |
| 1645 | 1645 | //../classesjs/compactados/classe_editorol_compacto.js |
| 1646 | -if(!i3GEO||typeof(i3GEO)==='undefined'){var i3GEO={};i3GEO.Interface={};navn=false;navm=false;$i=function(id){return document.getElementById(id)};app=navigator.appName.substring(0,1);if(app==='N'){navn=true}else{navm=true}OpenLayers.ImgPath="../pacotes/openlayers/img/";OpenLayers.Lang.setCode("pt-BR")}i3GEO.editorOL={simbologia:{opacidade:0.8,texto:"",fillColor:"250,180,15",strokeWidth:2,strokeColor:"250,150,0",pointRadius:4,graphicName:"square",fontSize:"12px",fontColor:"0,0,0",externalGraphic:"",graphicHeight:25,graphicWidth:25},backup:new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}),nomeFuncaoSalvar:"i3GEO.editorOL.salvaGeo()",e_oce:new OpenLayers.Layer.ArcGIS93Rest("ESRI Ocean Basemap","http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_ims:new OpenLayers.Layer.ArcGIS93Rest("ESRI Imagery World 2D","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_wsm:new OpenLayers.Layer.ArcGIS93Rest("ESRI World Street Map","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),ol_mma:new OpenLayers.Layer.WMS("Base cartográfica","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",{layers:'baseraster',SRS:'EPSG:4618',FORMAT:'image/png'},{singleTile:false}),ol_wms:new OpenLayers.Layer.WMS("OpenLayers WMS","http://labs.metacarta.com/wms/vmap0",{layers:'basic'}),top_wms:new OpenLayers.Layer.WMS("Toponímia MMA","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&",{layers:"base",FORMAT:'image/png'}),est_wms:new OpenLayers.Layer.WMS("Estados do Brasil","http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&",{layers:"estadosl",FORMAT:'image/png'}),osm:new OpenLayers.Layer.OSM("OSM","http://tile.openstreetmap.org/${z}/${x}/${y}.png",{isBaseLayer:true,visibility:false}),fundo:"e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce",kml:[],layersIniciais:[],botoes:{'pan':true,'zoombox':true,'zoomtot':true,'zoomin':true,'zoomout':true,'legenda':true,'distancia':true,'area':true,'identifica':true,'linha':true,'ponto':true,'poligono':true,'texto':true,'edita':true,'listag':true,'corta':true,'apaga':true,'procura':true,'selecao':true,'selecaotudo':true,'salva':true,'ajuda':true,'propriedades':true,'fecha':false,'tools':true,'undo':false,'frente':false,'legenda':true,'rodadomouse':true},pontos:[],marca:"../pacotes/openlayers/img/marker-gold.png",controles:[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoomBar(),new OpenLayers.Control.LayerSwitcher({'ascending':false}),new OpenLayers.Control.ScaleLine(),new OpenLayers.Control.MousePosition({'separator':' '}),new OpenLayers.Control.OverviewMap(),new OpenLayers.Control.KeyboardDefaults()],tiles:true,incluilayergrafico:true,ativalayerswitcher:false,ativarodadomouse:true,legendahtml:false,numzoom:12,minresolution:0.703125,maxext:"",mapext:new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081),mapa:"",inicia:function(){var alayers=[],fundo=(i3GEO.editorOL.fundo).split(","),nfundo=fundo.length,ncontroles=i3GEO.editorOL.controles.length,i,n;if(i3GEO.editorOL.tiles===false||i3GEO.editorOL.tiles==="false"){single=true}if(i3GEO.editorOL.ativalayerswitcher==="false"){i3GEO.editorOL.ativalayerswitcher=false}if(i3GEO.editorOL.ativalayerswitcher==="true"){i3GEO.editorOL.ativalayerswitcher=true}if(i3GEO.editorOL.ativarodadomouse==="false"){i3GEO.editorOL.ativarodadomouse=false}if(i3GEO.editorOL.ativarodadomouse==="true"){i3GEO.editorOL.ativarodadomouse=true}if(i3GEO.editorOL.legendahtml==="false"){i3GEO.editorOL.legendahtml=false}if(i3GEO.editorOL.legendahtml==="true"){i3GEO.editorOL.legendahtml=true}if(i3GEO.editorOL.incluilayergrafico==="false"){i3GEO.editorOL.incluilayergrafico=false}if(i3GEO.editorOL.incluilayergrafico==="true"){i3GEO.editorOL.incluilayergrafico=true}if(i3GEO.editorOL.incluilayergrafico===true){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}}else{i3GEO.desenho.layergrafico="";i3GEO.editorOL.botoes.linha=false;i3GEO.editorOL.botoes.ponto=false;i3GEO.editorOL.botoes.poligono=false;i3GEO.editorOL.botoes.texto=false;i3GEO.editorOL.botoes.edita=false;i3GEO.editorOL.botoes.listag=false;i3GEO.editorOL.botoes.corta=false;i3GEO.editorOL.botoes.apaga=false;i3GEO.editorOL.botoes.selecao=false;i3GEO.editorOL.botoes.selecaotudo=false;i3GEO.editorOL.botoes.salva=false;i3GEO.editorOL.botoes.propriedades=false;i3GEO.editorOL.botoes.fecha=false;i3GEO.editorOL.botoes.tools=false;i3GEO.editorOL.botoes.undo=false;i3GEO.editorOL.botoes.frente=false}if(i3GEO.editorOL.mapa===""){alert("O objeto i3GEO.editorOL.mapa nao existe. Precisa ser criado com new OpenLayers.Map()");return}for(i=0;i<ncontroles;i++){i3GEO.editorOL.mapa.addControl(i3GEO.editorOL.controles[i])}if(i3GEO.editorOL.fundo!=""){for(i=nfundo-1;i>=0;i--){if(fundo[i]!=""){try{i3GEO.editorOL[fundo[i]].transitionEffect='resize';i3GEO.editorOL[fundo[i]].setVisibility(false);i3GEO.editorOL[fundo[i]].singleTile=false;alayers.push(i3GEO.editorOL[fundo[i]])}catch(e){if(alayers[0]){alayers[0].setVisibility(true)}}}}}i3GEO.editorOL.mapa.addLayers(alayers);if(i3GEO.editorOL.layersIniciais!==""){n=i3GEO.editorOL.layersIniciais.length;for(i=0;i<n;i++){i3GEO.editorOL.mapa.addLayer(i3GEO.editorOL.layersIniciais[i])}}if(!i3GEO.desenho.layergrafico&&i3GEO.editorOL.incluilayergrafico===true){i3GEO.editorOL.mapa.addLayers([i3GEO.desenho.layergrafico])}i3GEO.editorOL.adicionaKml();i3GEO.editorOL.adicionaMarcas();i3GEO.editorOL.coordenadas();i3GEO.editorOL.criaJanelaBusca();i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes);if(i3GEO.editorOL.ativalayerswitcher===true){i3GEO.editorOL.ativaLayerSwitcher()}if(i3GEO.editorOL.ativarodadomouse===false){i3GEO.editorOL.desativaRodaDoMouse()}if(i3GEO.editorOL.numzoom!==""){i3GEO.editorOL.mapa.setOptions({numZoomLevels:i3GEO.editorOL.numzoom})}if(i3GEO.editorOL.maxext!==""){i3GEO.editorOL.mapa.setOptions({maxExtent:i3GEO.editorOL.maxext})}if(i3GEO.editorOL.mapext!=""){var m=i3GEO.util.extGeo2OSM(i3GEO.editorOL.mapext);i3GEO.editorOL.mapa.zoomToExtent(m)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}i3GEO.editorOL.sobeLayersGraficos()},criaLayerGrafico:function(){i3GEO.desenho.openlayers.criaLayerGrafico()},layersLigados:function(){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,ins=[],i;for(i=0;i<nlayers;i++){if(layers[i].visibility===true){ins.push(layers[i])}}return ins},layersClonados:function(paramsLayers){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,i;for(i=0;i<nlayers;i++){if(layers[i].params&&layers[i].params.CLONETMS===paramsLayers){return(layers[i])}}return false},layertms2wms:function(tms){var layer,url;url=tms.url.replace("&cache=sim","&DESLIGACACHE=sim");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");layer=new OpenLayers.Layer.WMS(tms.layername+"_clone",url,{layers:tms.name,transparent:true},{gutter:0,isBaseLayer:false,displayInLayerSwitcher:false,opacity:1,visibility:true,singleTile:true});return layer},removeClone:function(){var nome=i3GEO.editorOL.layerAtivo().layername+"_clone",busca=i3GEO.editorOL.mapa.getLayersByName(nome);if(busca.length>0){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.mapa.getLayersByName(camada.name)[0],false)}},coordenadas:function(){var idcoord=i3GEO.editorOL.mapa.getControlsBy("separator"," ");if(idcoord[0]){i3GEO.editorOL.mapa.events.register("mousemove",i3GEO.editorOL.mapa,function(e){var p,lonlat,d;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(p);lonlat=i3GEO.util.projOSM2Geo(lonlat);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{$i(idcoord[0].id).innerHTML="Long: "+d[0]+"<br>Lat: "+d[1]}catch(e){}})}},criaJanelaBusca:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,ins,combo="<select id=i3GEOOLlistaTemasBusca ><option value=''>----</option>";for(i=0;i<nlayers;i++){combo+="<option value='"+i+"' >"+layers[i].name+"</option>"}combo+="</select>";ins="<div class=paragrafo >Tema:<br>"+combo;ins+="<br>Item:<br><span id=i3GEOOLcomboitens ></span>";ins+="<br>Procurar por:<br><input type=text size=20 id=i3GEOOLpalavraBusca >";ins+="<br><br><input type=button value='Procurar' id='i3GEOOLbotaoBusca' ></div>";ins+="<br>Resultado:<br><span id=i3GEOOLcomboresultado ></span>";try{YAHOO.namespace("procura.container");YAHOO.procura.container.panel=new YAHOO.widget.Panel("panelprocura",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.procura.container.panel.setHeader("Encontre no mapa");YAHOO.procura.container.panel.setBody(ins);YAHOO.procura.container.panel.setFooter("");YAHOO.procura.container.panel.render(document.body);YAHOO.procura.container.panel.center();document.getElementById("i3GEOOLbotaoBusca").onclick=function(){var layer=i3GEO.editorOL.layerAtivo(),item=document.getElementById("i3GEOOLbuscaItem").value,palavra=document.getElementById("i3GEOOLpalavraBusca").value;if(item===""||palavra===""){alert("Escolha o item e o texto de busca");return}i3GEO.editorOL.busca(layer,item,palavra,"i3GEOOLcomboresultado")};document.getElementById("i3GEOOLlistaTemasBusca").onchange=function(){i3GEO.editorOL.ativaTema(this.value);document.getElementById("i3GEOOLcomboitens").innerHTML="...";i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(),"i3GEOOLcomboitens","i3GEOOLbuscaItem")}}catch(e){}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",temp,combo="<select id=i3GEOOLlistaTemasAtivos style=width:235px; >";for(i=0;i<nlayers;i++){nometema="";if(i3GEO.arvoreDeCamadas&&i3GEO.arvoreDeCamadas.CAMADAS){temp=i3GEO.arvoreDeCamadas.pegaTema(layers[i].name,"","name");if(temp!=""){nometema=temp.tema+" - "}}combo+="<option value='"+i+"' >"+nometema+layers[i].name+"</option>"}combo+="</select>";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo);document.getElementById("i3GEOOLlistaTemasAtivos").onchange=function(){if(botaoIdentifica){botaoIdentifica.layers=[i3GEO.editorOL.layersLigados()[this.value]]}}},criaJanelaAtivaTema:function(){var temp;if(!document.getElementById("paneltemaativo")){YAHOO.namespace("temaativo.container");YAHOO.temaativo.container.panel=new YAHOO.widget.Panel("paneltemaativo",{zIndex:20000,iframe:true,width:"250px",visible:false,draggable:true,close:true});YAHOO.temaativo.container.panel.setBody("");if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.temaativo.container.panel.setHeader("Tema ativo<div id='paneltemaativo_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.temaativo.container.panel.setHeader("Tema ativo")}YAHOO.temaativo.container.panel.setFooter("");YAHOO.temaativo.container.panel.render(document.body);YAHOO.temaativo.container.panel.show();YAHOO.temaativo.container.panel.center();i3GEO.editorOL.atualizaJanelaAtivaTema();YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close,"click",function(){i3GEOpanelEditor.deactivate();i3GEOpanelEditor.activate();if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}}temp=$i("paneltemaativo_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("paneltemaativo")}}}else{YAHOO.temaativo.container.panel.show();i3GEO.editorOL.atualizaJanelaAtivaTema()}},ativaTema:function(id){document.getElementById("i3GEOOLlistaTemasAtivos").value=id},layerAtivo:function(){var id=document.getElementById("i3GEOOLlistaTemasAtivos");if(id){id=id.value}else{id=i3GEO.temaAtivo}if(id==""){return[]}else{return i3GEO.editorOL.layersLigados()[id]}},listaItens:function(layer,idonde,idobj){if(!layer){return}if(!layer.params){return}var u=layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0";u+="&typename="+layer.params.LAYERS;document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.WFSDescribeFeatureType({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),prop=gml.featureTypes[0].properties,nprop=prop.length,i,combo="<select id="+idobj+" ><option value=''>----</option>";for(i=0;i<nprop;i++){combo+="<option value="+prop[i].name+" >"+prop[i].name+"</option>"}combo+="</select>";document.getElementById(idonde).innerHTML=combo},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},busca:function(layer,item,palavra,onde){document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";var u=layer.url+"&request=getfeature&service=wfs&version=1.0.0";u=u.replace("Z=${z}&X=${x}&Y=${y}","");u+="&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS;u+="&filter=<Filter><PropertyIsLike wildcard=* singleChar=. escape=! ><PropertyName>"+item+"</PropertyName><Literal>*"+palavra+"*</Literal></PropertyIsLike></Filter>";document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";document.getElementById(onde).innerHTML="...";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),ngml=gml.length,i,ins="<select onchange='i3GEO.editorOL.zoomPara(this.value)'>";ins+="<option value=''>---</option>";for(i=0;i<ngml;i++){eval("var valor = gml[i].data."+item);var bounds=gml[i].geometry.getBounds();bounds=bounds.toBBOX();ins+="<option value='"+bounds+"'>"+valor+"</option>"}ins+="</select>";document.getElementById(onde).innerHTML=ins},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},zoomPara:function(bbox){var b=new OpenLayers.Bounds.fromString(bbox);i3GEO.editorOL.mapa.zoomToExtent(b)},mostraLegenda:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,ins="",i;for(i=0;i<nlayers;i++){try{if(layers[i].isBaseLayer===false){var url=layers[i].getFullRequestString({"request":"getlegendgraphic"});if(i3GEO.editorOL.legendahtml===true){url=url.replace("image%2Fpng","text/html");ins+=layers[i].name+"<br><div id=legendaL_"+i+" ></div><br>";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");var config={method:"GET",url:url,callback:f};OpenLayers.Request.issue(config)}else{url=url.replace("LAYERS","LAYER");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");ins+=layers[i].name+"<br><img src='"+url+"&SERVICE=wms' /><br>"}}}catch(e){}}if(!document.getElementById("panellegendaeditorOL")){YAHOO.namespace("legendaeditorOL.container");YAHOO.legendaeditorOL.container.panel=new YAHOO.widget.Panel("panellegendaeditorOL",{zIndex:20000,iframe:true,width:"auto",visible:false,draggable:true,close:true});YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.setHeader("Legenda");YAHOO.legendaeditorOL.container.panel.setFooter("");YAHOO.legendaeditorOL.container.panel.render(document.body);YAHOO.legendaeditorOL.container.panel.show();YAHOO.legendaeditorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.legendaeditorOL.container.panel.close,"click",function(){})}else{YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.show()}},captura:function(lonlat){var d=0.1,layers=[i3GEO.editorOL.layerAtivo()],xy=lonlat.split(","),u=layers[0].url+"&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS;u=u.replace("&cache=sim","&DESLIGACACHE=sim");u=u.replace("&Z=${z}&X=${x}&Y=${y}","");u=u.replace("Z=${z}&X=${x}&Y=${y}","");xy[0]=xy[0]*1;xy[1]=xy[1]*1;var poligono=(xy[0]-d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]+d);u+="&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:posList>"+poligono+"</gml:posList></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></Filter>";document.body.style.cursor="wait";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="wait"}OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}var i,n,f,fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText);n=gml.length;for(i=0;i<n;i++){f=gml[i];f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,registros:f["attributes"]}}i3GEO.desenho.layergrafico.addFeatures(gml)},failure:function(){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}alert("Erro")}})},salvaGeometrias:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="";if(n>0){if($i("panelsalvageometrias")){if(YAHOO.i3GEO){YAHOO.salvaGeometrias.container.panel=YAHOO.i3GEO.janela.manager.find("panelsalvageometrias")}YAHOO.salvaGeometrias.container.panel.show();YAHOO.salvaGeometrias.container.panel.bringToTop()}else{try{YAHOO.namespace("salvaGeometrias.container");YAHOO.salvaGeometrias.container.panel=new YAHOO.widget.Panel("panelsalvageometrias",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.salvaGeometrias.container.panel.setHeader("Geometrias");YAHOO.salvaGeometrias.container.panel.setBody("");YAHOO.salvaGeometrias.container.panel.setFooter("");YAHOO.salvaGeometrias.container.panel.render(document.body);YAHOO.salvaGeometrias.container.panel.center();if(YAHOO.i3GEO&&YAHOO.i3GEO.janela){YAHOO.i3GEO.janela.manager.register(YAHOO.salvaGeometrias.container.panel)}YAHOO.salvaGeometrias.container.panel.show()}catch(e){}}ins+="<p class=paragrafo >Foram encontrada(s) "+n+" geometria(s) selecionada(s) </p>";ins+="<p class=paragrafo ><a href='#' onclick='i3GEO.editorOL.listaGeometriasSel()' >Listar</a> ";if(i3GEO.arvoreDeCamadas){ins+="<a href='#' onclick='"+i3GEO.editorOL.nomeFuncaoSalvar+"' >Salvar dados</a> "}ins+="<a href='#' onclick='i3GEO.editorOL.incorporar()' >Incorporar ao mapa</a></p>";ins+="<p class=paragrafo>"+$trad("ajudaEditorOlSalva")+"</p>";YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{alert("Selecione pelo menos um elemento")}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="",i,a,w,g;for(i=0;i<n;i++){g=geos[i];ins+="<b>Geometria: "+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.geometry)+"<br><br>";ins+="<b>Atributos: "+i+"</b><br>";a=g.attributes;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}if(g.attributes.registros){ins+="<b>Registros: "+i+"</b><br>";a=g.attributes.registros;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}}ins+="<br>"}w=window.open();w.document.write(ins);w.document.close()},testeSalvar:function(){alert("Funcao nao disponivel. Defina o nome da funcao em i3GEO.editorOL.nomeFuncaoSalvar ")},salvaGeo:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,funcaoOK=function(){if(geos[0].geometry){var registros="",valorunico="",nometema=$i("editorOLcomboTemaEditavel").value,key="",tema,redesenha,p,g=i3GEO.editorOL.google2wgs(geos[0].geometry);if(nometema==""){return}tema=i3GEO.arvoreDeCamadas.pegaTema(nometema,"","name");if(geos[0].attributes.registros){registros=geos[0].attributes.registros;for(key in registros){if(registros[key]&&key==tema.colunaidunico){valorunico=registros[key]}}}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);i3GEO.Interface.atualizaTema("",nometema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto","Adicionando...");i3GEO.janela.AGUARDEMODAL=false;if(valorunico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+g)}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+g)}}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto="Salvar no tema:<br><div id=editorOLondeComboTemaEditavel ></div><br><br>";if(n!=1){i3GEO.janela.tempoMsg("Selecione apenas uma figura")}else{i3GEO.janela.confirma(texto,300,"Salva","Cancela",funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel")}},criaBotoes:function(botoes){var sketchSymbolizers={"Point":{pointRadius:4,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},"Line":{strokeWidth:3,strokeOpacity:1,strokeColor:"#666666",strokeDashstyle:"dash"},"Polygon":{strokeWidth:2,strokeOpacity:1,strokeColor:"#666666",fillColor:"white",fillOpacity:0.3}},style=new OpenLayers.Style(),styleMap=new OpenLayers.StyleMap({"default":style,"vertex":{strokeOpacity:1,strokeWidth:1,fillColor:"white",fillOpacity:0.45,pointRadius:3}},{extendDefault:false}),adiciona=false,button,controles=[];style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);i3GEOpanelEditor=new OpenLayers.Control.Panel({displayClass:"olControlEditingToolbar1 noprint",saveState:false,activateControl:function(c){this.deactivate();this.activate();try{i3GEO.editorOL.ModifyFeature.deactivate();if(i3GEO&&i3GEO.barraDeBotoes){i3GEO.barraDeBotoes.ativaPadrao()}}catch(e){}if(!c.trigger){c.activate()}else{c.trigger.call()}}});if(botoes.procura===true){button=new OpenLayers.Control.Button({displayClass:"editorOLprocura",trigger:function(){YAHOO.procura.container.panel.show()},title:"procura",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.pan===true){controles.push(new OpenLayers.Control.Navigation({title:"deslocar",displayClass:"editorOLpan",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoombox===true){controles.push(new OpenLayers.Control.ZoomBox({title:"zoombox",displayClass:"editorOLzoombox",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoomtot===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomtot",trigger:function(){if(i3GEO.editorOL.mapext&&i3GEO.editorOL.mapext!=""){i3GEO.editorOL.mapa.zoomToExtent(i3GEO.editorOL.mapext)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}},title:"ajusta extensao",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomin===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomin",trigger:function(){i3GEO.editorOL.mapa.zoomIn()},title:"aproxima",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomout===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomout",trigger:function(){i3GEO.editorOL.mapa.zoomOut()},title:"afasta",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.legenda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlegenda",trigger:function(){i3GEO.editorOL.mostraLegenda()},title:"legenda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.distancia===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Path,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLdistancia",title:"distancia",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units,measure=event.measure;alert("Distancia: "+measure.toFixed(3)+" "+units)}});controles.push(button);adiciona=true}if(botoes.area===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLarea",title:"area",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units;var measure=event.measure;alert("Área: "+measure.toFixed(3)+" "+units+" quadrados")}});controles.push(button);adiciona=true}if(botoes.identifica===true){botaoIdentifica=new OpenLayers.Control.WMSGetFeatureInfo({maxFeatures:1,infoFormat:'text/plain',layers:[i3GEO.editorOL.layerAtivo()],queryVisible:true,title:"identifica",type:OpenLayers.Control.TYPE_TOOL,displayClass:"editorOLidentifica",eventListeners:{getfeatureinfo:function(event){var lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),lonlattexto="<hr>",formata;if(botoes.linha===true||botoes.ponto===true||botoes.poligono===true||botoes.edita===true){lonlattexto+="<pre><span style=font-size:12px;color:blue;cursor:pointer onclick='i3GEO.editorOL.captura(\""+lonlat.lon+","+lonlat.lat+"\")'>edita geometria</span></pre><br>"}formata=function(texto){var temp,temp1,n,i,f=[],textoN=texto.split(":");try{if(textoN.length>1){temp=textoN[2].replace(/\n\r/g,"");temp=temp.replace(/'/g,"");temp=temp.replace(/\n/g,"|");temp=temp.replace(/_/g," ");temp=temp.replace(/=/g,":");temp=temp.split("|");n=temp.length;for(i=0;i<n;i++){temp1=temp[i].replace(/^\s+/,"");temp1=temp1.replace(/\s+$/,"");if(temp1!="")f.push(temp1)}texto=f.join("<br><br>")}}catch(e){}return texto};i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("chicken",i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),null,"<div style=text-align:left >"+lonlattexto+"<pre>"+formata(event.text)+"</pre></div>",null,true));i3GEO.editorOL.removeClone()},beforegetfeatureinfo:function(event){var ativo=[i3GEO.editorOL.layerAtivo()];if(ativo[0].serviceVersion==="&tms="||ativo[0].CLASS_NAME=="OpenLayers.Layer.TMS"||ativo[0].CLASS_NAME=="OpenLayers.Layer.OSM"){ativo=[i3GEO.editorOL.layertms2wms(ativo[0])]}ativo[0].projection=new OpenLayers.Projection("EPSG:4326");event.object.layers=ativo;botaoIdentifica.layers=ativo;botaoIdentifica.url=ativo[0].url},activate:function(){i3GEO.editorOL.criaJanelaAtivaTema()}}});controles.push(botaoIdentifica);adiciona=true}if(botoes.linha===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Path,{displayClass:"editorOLlinha",title:"digitalizar linha",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.ponto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLponto",title:"digitalizar ponto",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f,style_mark;if(i3GEO.editorOL.simbologia.externalGraphic!=""){style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=i3GEO.editorOL.simbologia.externalGraphic;style_mark.graphicWidth=i3GEO.editorOL.simbologia.graphicWidth;style_mark.graphicHeight=i3GEO.editorOL.simbologia.graphicHeight;style_mark.fillOpacity=i3GEO.editorOL.simbologia.opacidade;f=new OpenLayers.Feature.Vector(feature,null,style_mark)}else{f=new OpenLayers.Feature.Vector(feature)}f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,externalGraphic:i3GEO.editorOL.simbologia.externalGraphic,graphicHeight:i3GEO.editorOL.simbologia.graphicHeight,graphicWidth:i3GEO.editorOL.simbologia.graphicWidth};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.poligono===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLpoligono",title:"digitalizar poligono",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.texto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLtexto",title:"incluir texto",type:OpenLayers.Control.TYPE_TOOL,persist:true,callbacks:{done:function(feature){var texto=window.prompt("Texto",""),label=new OpenLayers.Feature.Vector(feature);label["attributes"]={opacidade:0.1,fillColor:"white",strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,texto:texto,pointRadius:2,graphicName:"square",strokeColor:"black",fontColor:i3GEO.editorOL.simbologia.fontColor,fontSize:i3GEO.editorOL.simbologia.fontSize,fontFamily:"Arial",fontWeight:"bold",labelAlign:"rt"};if(texto&&texto!==""){i3GEO.desenho.layergrafico.addFeatures([label])}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEO.editorOL.CortaFeature=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLcorta",title:"corta figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length!=1){alert("Selecione primeiro um elemento para ser cortado");i3GEO.editorOL.CortaFeature.deactivate()}else{i3GEO.editorOL.CortaFeature.activate()}},callbacks:{done:function(feature){var temp,sel=i3GEO.desenho.layergrafico.selectedFeatures[0].geometry,corta=feature;temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,sel+"|"+corta,"difference")}}});controles.push(i3GEO.editorOL.CortaFeature);adiciona=true}if(botoes.edita===true){i3GEO.editorOL.ModifyFeature=new OpenLayers.Control.ModifyFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLedita",title:"modifica figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,mode:OpenLayers.Control.ModifyFeature.RESHAPE,standalone:false,createVertices:true,styleMap:"default",vertexRenderIntent:"vertex"});controles.push(i3GEO.editorOL.ModifyFeature);adiciona=true}if(botoes.edita===true&&botoes.listag===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlistag",trigger:function(){i3GEO.editorOL.listaGeometrias()},title:"lista geometrias",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.frente===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfrente",trigger:function(){i3GEO.editorOL.trazParaFrente();if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},title:"traz para frente",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.tools===true&&i3GEO.php){button=new OpenLayers.Control.Button({displayClass:"editorOLtools",trigger:function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}},title:"ferramentas",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.selecao===true){i3GEO.editorOL.selbutton=new OpenLayers.Control.SelectFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLselecao",title:"seleciona elemento",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,multiple:false,hover:false,toggleKey:"ctrlKey",multipleKey:"shiftKey",box:false});controles.push(i3GEO.editorOL.selbutton);adiciona=true}if(botoes.selecaotudo===true){button=new OpenLayers.Control.Button({displayClass:"editorOLselecaoTudo",trigger:function(){var fs=i3GEO.desenho.layergrafico.features,n=fs.length,i;for(i=0;i<n;i++){i3GEO.editorOL.selbutton.select(fs[i])}},title:"seleciona tudo",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.apaga===true){button=new OpenLayers.Control.Button({displayClass:"editorOLapaga",trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length>0){var x=window.confirm("Exclui os elementos selecionados?");if(x){i3GEO.editorOL.guardaBackup();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.janela.tempoMsg("Para excluir registros do banco de dados utilize a ferramenta de identificacao")}}else{alert("Selecione pelo menos um elemento")}},title:"apaga selecionados",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.propriedades===true){button=new OpenLayers.Control.Button({displayClass:"editorOLpropriedades",trigger:function(){i3GEO.editorOL.propriedades()},title:"propriedades",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.salva===true){button=new OpenLayers.Control.Button({displayClass:"editorOLsalva",trigger:function(){i3GEO.editorOL.salvaGeometrias()},title:"salva",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.ajuda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLajuda",trigger:function(){try{window.open(i3GEO.configura.locaplic+"/mashups/openlayers_ajuda.php")}catch(e){window.open("openlayers_ajuda.php")}},title:"ajuda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.fecha===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfecha",trigger:function(){var temp=window.confirm($trad("x94"));if(i3GEO.eventos){i3GEO.eventos.cliquePerm.ativa()}i3GEOpanelEditor.destroy();try{YAHOO.temaativo.container.panel.destroy()}catch(e){}try{YAHOO.procura.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.listaGeometrias.panel.destroy()}catch(e){}try{YAHOO.editorOL.ferramentas.panel.destroy()}catch(e){}try{YAHOO.legendaeditorOL.container.panel.destroy()}catch(e){}try{YAHOO.salvaGeometrias.container.panel.destroy()}catch(e){}if(temp===true){try{if(i3GEO.desenho.layergrafico){i3GEO.editorOL.mapa.removeLayer(i3GEO.desenho.layergrafico);delete(i3GEO.desenho.layergrafico)}if(i3GEO.editorOL.backup){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.backup);delete(i3GEO.editorOL.backup)}}catch(e){}}},title:"fecha editor",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}i3GEOOLsnap=new OpenLayers.Control.Snapping({layer:i3GEO.desenho.layergrafico});i3GEOOLsplit=new OpenLayers.Control.Split({layer:i3GEO.desenho.layergrafico,source:i3GEO.desenho.layergrafico,tolerance:0.0001,eventListeners:{beforesplit:function(event){i3GEO.editorOL.guardaBackup()},aftersplit:function(event){i3GEO.editorOL.flashFeatures(event.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}}});if(adiciona===true){i3GEOpanelEditor.addControls(controles);i3GEO.editorOL.mapa.addControl(i3GEOpanelEditor)}},mudaSimbolo:function(estilo,id){var valor=$i(id).value,geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,i;i3GEO.editorOL.simbologia[estilo]=valor;for(i=0;i<n;i++){geos[i].attributes[estilo]=valor;geos[i].style[estilo]=valor}},adicionaMarcas:function(){if(i3GEO.editorOL.pontos.length===0){return}var f,SHADOW_Z_INDEX=10,MARKER_Z_INDEX=11,layer=new OpenLayers.Layer.Vector("pontos",{styleMap:new OpenLayers.StyleMap({externalGraphic:i3GEO.editorOL.marca,backgroundGraphic:"../pacotes/openlayers/img/marker_shadow.png",backgroundXOffset:0,backgroundYOffset:-7,graphicZIndex:MARKER_Z_INDEX,backgroundGraphicZIndex:SHADOW_Z_INDEX,pointRadius:10}),isBaseLayer:false,rendererOptions:{yOrdering:true},displayInLayerSwitcher:true,visibility:true}),index,x=[],y=[],features=[];for(index=0;index<i3GEO.editorOL.pontos.length;index=index+2){x.push(i3GEO.editorOL.pontos[index]);y.push(i3GEO.editorOL.pontos[index+1])}for(index=0;index<x.length;index++){f=new OpenLayers.Geometry.Point(x[index],y[index]);f=i3GEO.util.projGeo2OSM(f);f=new OpenLayers.Feature.Vector(f);features.push(f)}layer.addFeatures(features);i3GEO.editorOL.mapa.addLayer(layer)},adicionaKml:function(){var temp,n,i,id,url;n=i3GEO.editorOL.kml.length;for(i=0;i<n;i++){id="kml"+i;url=i3GEO.editorOL.kml[i];eval(id+" = new OpenLayers.Layer.Vector('"+id+"', {displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true, strategies: [new OpenLayers.Strategy.Fixed()],protocol: new OpenLayers.Protocol.HTTP({url: '"+url+"',format: new OpenLayers.Format.KML({extractStyles: true,extractAttributes: true,maxDepth: 5})})})");eval("i3GEO.editorOL.mapa.addLayer("+id+");");eval("temp = "+id+".div;");temp.onclick=function(e){var targ="",id,temp,features,n,i,g,html="";if(!e){e=window.event}if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ.id){temp=targ.id.split("_");if(temp[0]==="OpenLayers.Geometry.Point"){id=targ.id;temp=i3GEO.editorOL.mapa.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(var j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}}}},propriedades:function(){if(!document.getElementById("panelpropriedadesEditor")){YAHOO.namespace("editorOL.container");YAHOO.editorOL.container.panel=new YAHOO.widget.Panel("panelpropriedadesEditor",{zIndex:20000,iframe:true,width:"350px",height:"250px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo ><b>Estilos (utilize a cor no formato r,g,b):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td>Cor do contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(strokeColor,i3GEOEditorOLcorContorno)" type="text" style="cursor:text" id="i3GEOEditorOLcorContorno" size="12" value="'+i3GEO.editorOL.simbologia.strokeColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorContorno);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor do preenchimento</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fillColor,i3GEOEditorOLcorPre)" type="text" style="cursor:text" id="i3GEOEditorOLcorPre" size="12" value="'+i3GEO.editorOL.simbologia.fillColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorPre);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fontColor,i3GEOEditorOLcorFonte)" type="text" style="cursor:text" id="i3GEOEditorOLcorFonte" size="12" value="'+i3GEO.editorOL.simbologia.fontColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorFonte);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Tamanho da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fontSize,i3GEOEditorOLfontsize)" type="text" style="cursor:text" id="i3GEOEditorOLfontsize" size="3" value="'+i3GEO.editorOL.simbologia.fontSize+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Opacidade (de 0 a 1)</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(opacidade,i3GEOEditorOLopacidade)" type="text" style="cursor:text" id="i3GEOEditorOLopacidade" size="3" value="'+i3GEO.editorOL.simbologia.opacidade+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura da linha/contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(strokeWidth,i3GEOEditorOLlarguraLinha)" type="text" style="cursor:text" id="i3GEOEditorOLlarguraLinha" size="2" value="'+i3GEO.editorOL.simbologia.strokeWidth+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Url de uma figura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(externalGraphic,i3GEOEditorOLexternalGraphic)" type="text" style="cursor:text" id="i3GEOEditorOLexternalGraphic" size="22" value="'+i3GEO.editorOL.simbologia.externalGraphic+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura e altura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(graphicWidth,i3GEOEditorOLgraphicWidth)" type="text" style="cursor:text" id="i3GEOEditorOLgraphicWidth" size="4" value="'+i3GEO.editorOL.simbologia.graphicWidth+'" /> <input onchange="i3GEO.editorOL.mudaSimbolo(graphicHeight,i3GEOEditorOLgraphicHeight)" type="text" style="cursor:text" id="i3GEOEditorOLgraphicHeight" size="4" value="'+i3GEO.editorOL.simbologia.graphicHeight+'" /></td><td></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Ajusta nó em edição para o(a):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td></td><td>nó</td><td></td><td>vértice</td><td></td><td>borda</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_node" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_nodeTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_vertex" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_vertexTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_edge" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_edgeTolerance" type="text" size="3" value=15 /></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Divide intersecção ao digitalizar</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.split()" type="checkbox" id="edge_split_toggle" /></td><td>borda</td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Operação ativada pelo botão de modificação da figura</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input checked style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESHAPE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera figura</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESIZE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera tamanho</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.ROTATE;" type="radio" name=i3geoOLtipoEdita /></td><td>rotaciona</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.DRAG;" type="radio" name=i3geoOLtipoEdita /></td><td>desloca</td>'+' </tr>'+'</table>';YAHOO.editorOL.container.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.container.panel.setHeader("Propriedades<div id='panelpropriedadesEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.container.panel.setHeader("Propriedades")}YAHOO.editorOL.container.panel.setFooter("");YAHOO.editorOL.container.panel.render(document.body);YAHOO.editorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close,"click",function(){});temp=$i("panelpropriedadesEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelpropriedadesEditor")}}}YAHOO.editorOL.container.panel.show();temp=$i("panelpropriedadesEditor").getElementsByTagName("div");if(temp&&temp[2]){temp[2].style.overflow="auto"}},listaGeometrias:function(){if(!document.getElementById("panellistagEditor")){YAHOO.namespace("editorOL.listaGeometrias");YAHOO.editorOL.listaGeometrias.panel=new YAHOO.widget.Panel("panellistagEditor",{zIndex:20000,iframe:true,width:"320px",visible:false,draggable:true,close:true});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias <div id='panellistagEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias")}YAHOO.editorOL.listaGeometrias.panel.setFooter("");YAHOO.editorOL.listaGeometrias.panel.render(document.body);YAHOO.editorOL.listaGeometrias.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.listaGeometrias.panel.close,"click",function(){YAHOO.editorOL.listaGeometrias.panel.destroy()});temp=$i("panellistagEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panellistagEditor")}}}else{YAHOO.editorOL.listaGeometrias.panel.render(document.body)}var g,temp,geos=i3GEO.desenho.layergrafico.features,n=geos.length,ins="<table class=lista4 >";ins+="<tr><td><i>Geometrias</i></td><td><i>Opções</i></td><td></td><td></td></tr>";while(n>0){n-=1;g=geos[n].geometry;ins+="<tr><td>"+g.CLASS_NAME+"</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.selFeature("+n+")'>seleciona</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.unselFeature("+n+")'>limpa</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.flashFeaturesI("+n+")'>brilha</td></tr>"}ins+="</table>";if(geos.length===0){ins="Nenhum elemento gráfico encontrado. Utilize as opções de criação de geometrias."}YAHOO.editorOL.listaGeometrias.panel.show();if(i3GEO.configura){temp=$i("panellistagEditor").getElementsByTagName("div")[2]}else{temp=$i("panellistagEditor").getElementsByTagName("div")[1]}temp.style.overflow="auto";temp.style.height="100px";temp.innerHTML=ins},ferramentas:function(){if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo >Operações sobre as figuras selecionadas:</p>'+'<select onchange="i3GEO.editorOL.processageo(this.value);this.value = " >'+' <option value="">---</option>'+' <option value=union >União</option>';if(i3GEO.php){ins+=' <option value=intersection >Intersecção</option>'+' <option value=convexhull >Convex hull</option>'+' <option value=boundary >Bordas</option>'+' <option value=difference >Diferença</option>'+' <option value=symdifference >Diferença simétrica</option>'}ins+='</select>'+'<br><br><a class=paragrafo href=# onclick="i3GEO.desenho.layergrafico.destroyFeatures()" >Apaga tudo</a>';YAHOO.editorOL.ferramentas.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas <div id='panelferramentasEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas")}YAHOO.editorOL.ferramentas.panel.setFooter("");YAHOO.editorOL.ferramentas.panel.render(document.body);YAHOO.editorOL.ferramentas.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.ferramentas.panel.close,"click",function(){});temp=$i("panelferramentasEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelferramentasEditor")}}}else{YAHOO.editorOL.ferramentas.panel.render(document.body)}YAHOO.editorOL.ferramentas.panel.show()},snap:function(){var target=i3GEOOLsnap.targets[0],tipos=["node","vertex","edge"],ntipos=tipos.length,i,temp,ativa=false;i3GEOOLsnap.deactivate();for(i=0;i<ntipos;i++){temp=$i("target_"+tipos[i]);target[tipos[i]]=temp.checked;if(temp.checked===true){ativa=true}temp=$i("target_"+tipos[i]+"Tolerance");target[tipos[i]+"Tolerance"]=temp.value}if(ativa===true){i3GEOOLsnap.activate()}},split:function(){i3GEOOLsplit.deactivate();var temp=$i("edge_split_toggle");if(temp.checked===true){i3GEOOLsplit.activate()}},processageo:function(operacao){if(operacao===""){return}var geosel=i3GEO.desenho.layergrafico.selectedFeatures,polis,linhas,pontos,temp;if(geosel.length>0){polis=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Point");temp=function(retorno){if(i3GEO.janela){i3GEO.janela.fechaAguarde("i3GEO.editorPoli");i3GEO.janela.fechaAguarde("i3GEO.editorLinhas");i3GEO.janela.fechaAguarde("i3GEO.editorPontos")}if(retorno!=""&&retorno.data&&retorno.data!=""&&operacao!="converteSHP"){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}if(operacao==="converteSHP"){i3GEO.atualiza();i3GEO.janela.minimiza("paneltemaativo")}};if(operacao==="incorporar"){if(polis.length>0){temp=i3GEO.editorOL.merge(polis)}if(linhas.length>0){temp=i3GEO.editorOL.merge(linhas)}if(pontos.length>0){temp=i3GEO.editorOL.merge(pontos)}if(i3GEO.mapa){i3GEO.mapa.dialogo.wkt2layer(temp)}return}if(operacao==="union"&&!i3GEO.php){if(polis.length>0){temp=i3GEO.editorOL.uniaojts(polis);i3GEO.editorOL.substituiFeaturesSel(temp)}if(linhas.length>0){temp=i3GEO.editorOL.uniaojts(linhas);i3GEO.editorOL.substituiFeaturesSel(temp)}if(pontos.length>0){temp=i3GEO.editorOL.uniaojts(pontos);i3GEO.editorOL.substituiFeaturesSel(temp)}}else{if(polis.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos");i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),operacao)}if(linhas.length>0){i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas");i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),operacao)}if(pontos.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos");i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao)}}return}else{alert("Selecione pelo menos dois elementos")}},merge:function(geoms){var n=geoms.length,w=new Wkt.Wkt(),g,m,i;w.read(geoms[0].toString());if(n>1){for(i=1;i<n;i++){g=geoms[i].toString();m=new Wkt.Wkt();m.read(g);w.merge(m)}}return w.write()},uniaojts:function(geoms){var n=geoms.length,rwkt=new jsts.io.WKTReader(),wwkt=new jsts.io.WKTWriter(),fwkt=new OpenLayers.Format.WKT(),g,i,uniao;if(n>1){uniao=(fwkt.read(geoms[0]).geometry).toString();uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=(fwkt.read(geoms[i]).geometry).toString();uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.read(uniao)]}else{return false}},retornaGeometriasTipo:function(features,tipo){var n=features.length,lista=[],i,temp;for(i=0;i<n;i++){temp=features[i].geometry;if(temp.CLASS_NAME==tipo){lista.push(temp)}}return lista},guardaBackup:function(){return},unselTodos:function(){var n,i;n=i3GEO.desenho.layergrafico.features.length;for(i=0;i<n;i++){i3GEO.desenho.layergrafico.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[i])}},unselTodosBackup:function(){var n,i;n=i3GEO.editorOL.backup.features.length;for(i=0;i<n;i++){i3GEO.editorOL.backup.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.editorOL.backup.features[i])}},restauraBackup:function(){if(i3GEO.editorOL.backup.features.length>0){i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features)}if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},substituiFeaturesSel:function(wkt){i3GEO.editorOL.guardaBackup();try{var f,fwkt=new OpenLayers.Format.WKT();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);f=fwkt.read(wkt);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}catch(e){i3GEO.editorOL.restauraBackup()}},adicionaFeatureWkt:function(wkt,atributos){var f,fwkt=new OpenLayers.Format.WKT();if(atributos.externalGraphic&&atributos.externalGraphic!=""){var style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=atributos.externalGraphic;style_mark.graphicWidth=atributos.graphicWidth;style_mark.graphicHeight=atributos.graphicHeight;style_mark.fillOpacity=atributos.opacidade;f=fwkt.read(wkt);f["attributes"]=atributos;f["style"]=style_mark}else{f=fwkt.read(wkt);f["attributes"]=atributos}i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},flashFeaturesI:function(index){i3GEO.editorOL.flashFeatures([i3GEO.desenho.layergrafico.features[index]],0)},flashFeatures:function(features,index){if(!index){index=0}var current=features[index];if(current&¤t.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(features[index],"select")}var prev=features[index-1];if(prev&&prev.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(prev,"default")}++index;if(index<=features.length){window.setTimeout(function(){i3GEO.editorOL.flashFeatures(features,index)},75)}},selFeature:function(index){i3GEO.editorOL.selbutton.select(i3GEO.desenho.layergrafico.features[index])},unselFeature:function(index){i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[index])},carregajts:function(funcao){if(i3GEO.configura){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}else{i3GEO.util.scriptTag("../pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}},trazParaFrente:function(){var features=i3GEO.desenho.layergrafico.selectedFeatures;if(features.length>0){i3GEO.editorOL.backup=new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false});i3GEO.editorOL.backup.addFeatures(features);i3GEO.editorOL.unselTodosBackup();i3GEO.desenho.layergrafico.removeFeatures(features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}else{alert("Selecione pelo menos um elemento")}},pegaControle:function(classe){var n=i3GEO.editorOL.controles.length,i;for(i=0;i<n;i++){if(i3GEO.editorOL.controles[i].CLASS_NAME===classe){return i3GEO.editorOL.controles[i]}}return false},ativaLayerSwitcher:function(){var ls=i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher");if(ls){ls.maximizeDiv.click()}},desativaRodaDoMouse:function(){var controls=i3GEO.editorOL.mapa.getControlsByClass('OpenLayers.Control.Navigation');for(var i=0;i<controls.length;++i){controls[i].disableZoomWheel()}},google2wgs:function(obj){if(i3GEO.Interface.openlayers.googleLike===true){var projWGS84=new OpenLayers.Projection("EPSG:4326"),proj900913=new OpenLayers.Projection("EPSG:900913");return obj.transform(proj900913,projWGS84)}else{return obj}},sobeLayersGraficos:function(){var nlayers=i3GEO.editorOL.mapa.getNumLayers(),layers=i3GEO.editorOL.mapa.layers,i;for(i=0;i<nlayers;i++){if(layers[i].CLASS_NAME=="OpenLayers.Layer.Vector"&&layers[i].name!="Nenhum"){i3GEO.editorOL.mapa.raiseLayer(i3GEO.editorOL.mapa.layers[i],nlayers)}}}}; | |
| 1646 | +if(!i3GEO||typeof(i3GEO)==='undefined'){var i3GEO={};i3GEO.Interface={};navn=false;navm=false;$i=function(id){return document.getElementById(id)};app=navigator.appName.substring(0,1);if(app==='N'){navn=true}else{navm=true}OpenLayers.ImgPath="../pacotes/openlayers/img/";OpenLayers.Lang.setCode("pt-BR")}i3GEO.editorOL={simbologia:{opacidade:0.8,texto:"",fillColor:"250,180,15",strokeWidth:2,strokeColor:"250,150,0",pointRadius:4,graphicName:"square",fontSize:"12px",fontColor:"0,0,0",externalGraphic:"",graphicHeight:25,graphicWidth:25},backup:new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false}),nomeFuncaoSalvar:"i3GEO.editorOL.salvaGeo()",e_oce:new OpenLayers.Layer.ArcGIS93Rest("ESRI Ocean Basemap","http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_ims:new OpenLayers.Layer.ArcGIS93Rest("ESRI Imagery World 2D","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),e_wsm:new OpenLayers.Layer.ArcGIS93Rest("ESRI World Street Map","http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer/export",{format:"jpeg"},{isBaseLayer:true,visibility:false}),ol_mma:new OpenLayers.Layer.WMS("Base cartográfica","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",{layers:'baseraster',SRS:'EPSG:4618',FORMAT:'image/png'},{singleTile:false}),ol_wms:new OpenLayers.Layer.WMS("OpenLayers WMS","http://labs.metacarta.com/wms/vmap0",{layers:'basic'}),top_wms:new OpenLayers.Layer.WMS("Toponímia MMA","http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&",{layers:"base",FORMAT:'image/png'}),est_wms:new OpenLayers.Layer.WMS("Estados do Brasil","http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&",{layers:"estadosl",FORMAT:'image/png'}),osm:new OpenLayers.Layer.OSM("OSM","http://tile.openstreetmap.org/${z}/${x}/${y}.png",{isBaseLayer:true,visibility:false}),fundo:"e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce",kml:[],layersIniciais:[],botoes:{'pan':true,'zoombox':true,'zoomtot':true,'zoomin':true,'zoomout':true,'legenda':true,'distancia':true,'area':true,'identifica':true,'linha':true,'ponto':true,'poligono':true,'texto':true,'edita':true,'listag':true,'corta':true,'apaga':true,'procura':true,'selecao':true,'selecaotudo':true,'salva':true,'ajuda':true,'propriedades':true,'fecha':false,'tools':true,'undo':false,'frente':false,'legenda':true,'rodadomouse':true},pontos:[],marca:"../pacotes/openlayers/img/marker-gold.png",controles:[new OpenLayers.Control.Navigation(),new OpenLayers.Control.PanZoomBar(),new OpenLayers.Control.LayerSwitcher({'ascending':false}),new OpenLayers.Control.ScaleLine(),new OpenLayers.Control.MousePosition({'separator':' '}),new OpenLayers.Control.OverviewMap(),new OpenLayers.Control.KeyboardDefaults()],tiles:true,incluilayergrafico:true,ativalayerswitcher:false,ativarodadomouse:true,legendahtml:false,numzoom:12,minresolution:0.703125,maxext:"",mapext:new OpenLayers.Bounds(-76.5125927,-39.3925675209,-29.5851853,9.49014852081),mapa:"",inicia:function(){var alayers=[],fundo=(i3GEO.editorOL.fundo).split(","),nfundo=fundo.length,ncontroles=i3GEO.editorOL.controles.length,i,n,temp;if(i3GEO.editorOL.ativalayerswitcher==="false"){i3GEO.editorOL.ativalayerswitcher=false}if(i3GEO.editorOL.ativalayerswitcher==="true"){i3GEO.editorOL.ativalayerswitcher=true}if(i3GEO.editorOL.ativarodadomouse==="false"){i3GEO.editorOL.ativarodadomouse=false}if(i3GEO.editorOL.ativarodadomouse==="true"){i3GEO.editorOL.ativarodadomouse=true}if(i3GEO.editorOL.legendahtml==="false"){i3GEO.editorOL.legendahtml=false}if(i3GEO.editorOL.legendahtml==="true"){i3GEO.editorOL.legendahtml=true}if(i3GEO.editorOL.incluilayergrafico==="false"){i3GEO.editorOL.incluilayergrafico=false}if(i3GEO.editorOL.incluilayergrafico==="true"){i3GEO.editorOL.incluilayergrafico=true}if(i3GEO.editorOL.incluilayergrafico===true){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}}else{i3GEO.desenho.layergrafico="";i3GEO.editorOL.botoes.linha=false;i3GEO.editorOL.botoes.ponto=false;i3GEO.editorOL.botoes.poligono=false;i3GEO.editorOL.botoes.texto=false;i3GEO.editorOL.botoes.edita=false;i3GEO.editorOL.botoes.listag=false;i3GEO.editorOL.botoes.corta=false;i3GEO.editorOL.botoes.apaga=false;i3GEO.editorOL.botoes.selecao=false;i3GEO.editorOL.botoes.selecaotudo=false;i3GEO.editorOL.botoes.salva=false;i3GEO.editorOL.botoes.propriedades=false;i3GEO.editorOL.botoes.fecha=false;i3GEO.editorOL.botoes.tools=false;i3GEO.editorOL.botoes.undo=false;i3GEO.editorOL.botoes.frente=false}if(i3GEO.editorOL.mapa===""){alert("O objeto i3GEO.editorOL.mapa nao existe. Precisa ser criado com new OpenLayers.Map()");return}for(i=0;i<ncontroles;i++){i3GEO.editorOL.mapa.addControl(i3GEO.editorOL.controles[i])}if(i3GEO.editorOL.fundo!=""){for(i=nfundo-1;i>=0;i--){if(fundo[i]!=""){try{i3GEO.editorOL[fundo[i]].transitionEffect='resize';i3GEO.editorOL[fundo[i]].setVisibility(false);i3GEO.editorOL[fundo[i]].singleTile=false;alayers.push(i3GEO.editorOL[fundo[i]])}catch(e){if(alayers[0]){alayers[0].setVisibility(true)}}}}}i3GEO.editorOL.mapa.addLayers(alayers);if(i3GEO.editorOL.layersIniciais!==""){n=i3GEO.editorOL.layersIniciais.length;for(i=0;i<n;i++){i3GEO.editorOL.mapa.addLayer(i3GEO.editorOL.layersIniciais[i])}}if(!i3GEO.desenho.layergrafico&&i3GEO.editorOL.incluilayergrafico===true){i3GEO.editorOL.mapa.addLayers([i3GEO.desenho.layergrafico])}i3GEO.editorOL.adicionaKml();i3GEO.editorOL.adicionaMarcas();i3GEO.editorOL.coordenadas();i3GEO.editorOL.criaJanelaBusca();i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes);if(i3GEO.editorOL.ativalayerswitcher===true){i3GEO.editorOL.ativaLayerSwitcher()}if(i3GEO.editorOL.ativarodadomouse===false){i3GEO.editorOL.desativaRodaDoMouse()}if(i3GEO.editorOL.numzoom!==""){i3GEO.editorOL.mapa.setOptions({numZoomLevels:i3GEO.editorOL.numzoom})}if(i3GEO.editorOL.maxext!==""){i3GEO.editorOL.mapa.setOptions({maxExtent:i3GEO.editorOL.maxext})}if(i3GEO.editorOL.mapext!=""){var m=i3GEO.util.extGeo2OSM(i3GEO.editorOL.mapext);i3GEO.editorOL.mapa.zoomToExtent(m)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}i3GEO.editorOL.sobeLayersGraficos();temp=i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher");if(temp){temp=temp.dataLayersDiv.getElementsByTagName("label");n=temp.length;for(i=0;i<n;i++){temp[i].onclick=""}}},criaLayerGrafico:function(){i3GEO.desenho.openlayers.criaLayerGrafico()},layersLigados:function(){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,ins=[],i;for(i=0;i<nlayers;i++){if(layers[i].visibility===true){ins.push(layers[i])}}return ins},layersClonados:function(paramsLayers){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,i;for(i=0;i<nlayers;i++){if(layers[i].params&&layers[i].params.CLONETMS===paramsLayers){return(layers[i])}}return false},layertms2wms:function(tms){var layer,url;url=tms.url.replace("&cache=sim","&DESLIGACACHE=sim");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");layer=new OpenLayers.Layer.WMS(tms.layername+"_clone",url,{layers:tms.name,transparent:true},{gutter:0,isBaseLayer:false,displayInLayerSwitcher:false,opacity:1,visibility:true,singleTile:true});return layer},removeClone:function(){var nome=i3GEO.editorOL.layerAtivo().layername+"_clone",busca=i3GEO.editorOL.mapa.getLayersByName(nome);if(busca.length>0){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.mapa.getLayersByName(camada.name)[0],false)}},coordenadas:function(){var idcoord=i3GEO.editorOL.mapa.getControlsBy("separator"," ");if(idcoord[0]){i3GEO.editorOL.mapa.events.register("mousemove",i3GEO.editorOL.mapa,function(e){var p,lonlat,d;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(p);lonlat=i3GEO.util.projOSM2Geo(lonlat);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{$i(idcoord[0].id).innerHTML="Long: "+d[0]+"<br>Lat: "+d[1]}catch(e){}})}},criaJanelaBusca:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,ins,combo="<select id=i3GEOOLlistaTemasBusca ><option value=''>----</option>";for(i=0;i<nlayers;i++){combo+="<option value='"+i+"' >"+layers[i].name+"</option>"}combo+="</select>";ins="<div class=paragrafo >Tema:<br>"+combo;ins+="<br>Item:<br><span id=i3GEOOLcomboitens ></span>";ins+="<br>Procurar por:<br><input type=text size=20 id=i3GEOOLpalavraBusca >";ins+="<br><br><input type=button value='Procurar' id='i3GEOOLbotaoBusca' ></div>";ins+="<br>Resultado:<br><span id=i3GEOOLcomboresultado ></span>";try{YAHOO.namespace("procura.container");YAHOO.procura.container.panel=new YAHOO.widget.Panel("panelprocura",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.procura.container.panel.setHeader("Encontre no mapa");YAHOO.procura.container.panel.setBody(ins);YAHOO.procura.container.panel.setFooter("");YAHOO.procura.container.panel.render(document.body);YAHOO.procura.container.panel.center();document.getElementById("i3GEOOLbotaoBusca").onclick=function(){var layer=i3GEO.editorOL.layerAtivo(),item=document.getElementById("i3GEOOLbuscaItem").value,palavra=document.getElementById("i3GEOOLpalavraBusca").value;if(item===""||palavra===""){alert("Escolha o item e o texto de busca");return}i3GEO.editorOL.busca(layer,item,palavra,"i3GEOOLcomboresultado")};document.getElementById("i3GEOOLlistaTemasBusca").onchange=function(){i3GEO.editorOL.ativaTema(this.value);document.getElementById("i3GEOOLcomboitens").innerHTML="...";i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(),"i3GEOOLcomboitens","i3GEOOLbuscaItem")}}catch(e){}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",temp,combo="<select id=i3GEOOLlistaTemasAtivos style=width:235px; >";for(i=0;i<nlayers;i++){nometema="";if(i3GEO.arvoreDeCamadas&&i3GEO.arvoreDeCamadas.CAMADAS){temp=i3GEO.arvoreDeCamadas.pegaTema(layers[i].name,"","name");if(temp!=""){nometema=temp.tema+" - "}}combo+="<option value='"+i+"' >"+nometema+layers[i].name+"</option>"}combo+="</select>";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo);document.getElementById("i3GEOOLlistaTemasAtivos").onchange=function(){if(botaoIdentifica){botaoIdentifica.layers=[i3GEO.editorOL.layersLigados()[this.value]]}}},criaJanelaAtivaTema:function(){var temp;if(!document.getElementById("paneltemaativo")){YAHOO.namespace("temaativo.container");YAHOO.temaativo.container.panel=new YAHOO.widget.Panel("paneltemaativo",{zIndex:20000,iframe:true,width:"250px",visible:false,draggable:true,close:true});YAHOO.temaativo.container.panel.setBody("");if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.temaativo.container.panel.setHeader("Tema ativo<div id='paneltemaativo_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.temaativo.container.panel.setHeader("Tema ativo")}YAHOO.temaativo.container.panel.setFooter("");YAHOO.temaativo.container.panel.render(document.body);YAHOO.temaativo.container.panel.show();YAHOO.temaativo.container.panel.center();i3GEO.editorOL.atualizaJanelaAtivaTema();YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close,"click",function(){i3GEOpanelEditor.deactivate();i3GEOpanelEditor.activate();if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}}temp=$i("paneltemaativo_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("paneltemaativo")}}}else{YAHOO.temaativo.container.panel.show();i3GEO.editorOL.atualizaJanelaAtivaTema()}},ativaTema:function(id){document.getElementById("i3GEOOLlistaTemasAtivos").value=id},layerAtivo:function(){var id=document.getElementById("i3GEOOLlistaTemasAtivos");if(id){id=id.value}else{id=i3GEO.temaAtivo}if(id==""){return[]}else{return i3GEO.editorOL.layersLigados()[id]}},listaItens:function(layer,idonde,idobj){if(!layer){return}if(!layer.params){return}var u=layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0";u+="&typename="+layer.params.LAYERS;document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.WFSDescribeFeatureType({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),prop=gml.featureTypes[0].properties,nprop=prop.length,i,combo="<select id="+idobj+" ><option value=''>----</option>";for(i=0;i<nprop;i++){combo+="<option value="+prop[i].name+" >"+prop[i].name+"</option>"}combo+="</select>";document.getElementById(idonde).innerHTML=combo},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},busca:function(layer,item,palavra,onde){document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";var u=layer.url+"&request=getfeature&service=wfs&version=1.0.0";u=u.replace("Z=${z}&X=${x}&Y=${y}","");u+="&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS;u+="&filter=<Filter><PropertyIsLike wildcard=* singleChar=. escape=! ><PropertyName>"+item+"</PropertyName><Literal>*"+palavra+"*</Literal></PropertyIsLike></Filter>";document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";document.getElementById(onde).innerHTML="...";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),ngml=gml.length,i,ins="<select onchange='i3GEO.editorOL.zoomPara(this.value)'>";ins+="<option value=''>---</option>";for(i=0;i<ngml;i++){eval("var valor = gml[i].data."+item);var bounds=gml[i].geometry.getBounds();bounds=bounds.toBBOX();ins+="<option value='"+bounds+"'>"+valor+"</option>"}ins+="</select>";document.getElementById(onde).innerHTML=ins},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},zoomPara:function(bbox){var b=new OpenLayers.Bounds.fromString(bbox);i3GEO.editorOL.mapa.zoomToExtent(b)},mostraLegenda:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,ins="",i,icone="";for(i=0;i<nlayers;i++){try{if(layers[i].isBaseLayer===false){var url=layers[i].getFullRequestString({"request":"getlegendgraphic"});if(i3GEO.editorOL.legendahtml===true){url=url.replace("image%2Fpng","text/html");if(layers[i].options.plugini3geo){icone=i3GEO.pluginI3geo[layers[i].options.plugini3geo].iconeArvoreDeCamadas(layers[i].params.LAYERS)}ins+=icone+layers[i].name+"<br><div id=legendaL_"+i+" ></div><br>";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");var config={method:"GET",url:url,callback:f};OpenLayers.Request.issue(config)}else{url=url.replace("LAYERS","LAYER");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");ins+=layers[i].name+"<br><img src='"+url+"&SERVICE=wms' /><br>"}}}catch(e){}}if(!document.getElementById("panellegendaeditorOL")){YAHOO.namespace("legendaeditorOL.container");YAHOO.legendaeditorOL.container.panel=new YAHOO.widget.Panel("panellegendaeditorOL",{zIndex:20000,iframe:true,width:"auto",visible:false,draggable:true,close:true});YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.setHeader("Legenda");YAHOO.legendaeditorOL.container.panel.setFooter("");YAHOO.legendaeditorOL.container.panel.render(document.body);YAHOO.legendaeditorOL.container.panel.show();YAHOO.legendaeditorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.legendaeditorOL.container.panel.close,"click",function(){YAHOO.legendaeditorOL.container.panel.destroy()})}else{YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.show()}},captura:function(lonlat){var d=0.1,layers=[i3GEO.editorOL.layerAtivo()],xy=lonlat.split(","),u=layers[0].url+"&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename="+layers[0].params.LAYERS;u=u.replace("&cache=sim","&DESLIGACACHE=sim");u=u.replace("&Z=${z}&X=${x}&Y=${y}","");u=u.replace("Z=${z}&X=${x}&Y=${y}","");xy[0]=xy[0]*1;xy[1]=xy[1]*1;var poligono=(xy[0]-d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]+d);u+="&filter=<Filter><Intersects><PropertyName>Geometry</PropertyName><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:posList>"+poligono+"</gml:posList></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></Intersects></Filter>";document.body.style.cursor="wait";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="wait"}OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}var i,n,f,fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText);n=gml.length;for(i=0;i<n;i++){f=gml[i];f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,registros:f["attributes"]}}i3GEO.desenho.layergrafico.addFeatures(gml)},failure:function(){document.body.style.cursor="default";if(document.getElementById("i3geoMapa")){document.getElementById("i3geoMapa").style.cursor="default"}alert("Erro")}})},salvaGeometrias:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="";if(n>0){if($i("panelsalvageometrias")){if(YAHOO.i3GEO){YAHOO.salvaGeometrias.container.panel=YAHOO.i3GEO.janela.manager.find("panelsalvageometrias")}YAHOO.salvaGeometrias.container.panel.show();YAHOO.salvaGeometrias.container.panel.bringToTop()}else{try{YAHOO.namespace("salvaGeometrias.container");YAHOO.salvaGeometrias.container.panel=new YAHOO.widget.Panel("panelsalvageometrias",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true});YAHOO.salvaGeometrias.container.panel.setHeader("Geometrias");YAHOO.salvaGeometrias.container.panel.setBody("");YAHOO.salvaGeometrias.container.panel.setFooter("");YAHOO.salvaGeometrias.container.panel.render(document.body);YAHOO.salvaGeometrias.container.panel.center();if(YAHOO.i3GEO&&YAHOO.i3GEO.janela){YAHOO.i3GEO.janela.manager.register(YAHOO.salvaGeometrias.container.panel)}YAHOO.salvaGeometrias.container.panel.show()}catch(e){}}ins+="<p class=paragrafo >Foram encontrada(s) "+n+" geometria(s) selecionada(s) </p>";ins+="<p class=paragrafo ><a href='#' onclick='i3GEO.editorOL.listaGeometriasSel()' >Listar</a> ";if(i3GEO.arvoreDeCamadas){ins+="<a href='#' onclick='"+i3GEO.editorOL.nomeFuncaoSalvar+"' >Salvar dados</a> "}ins+="<a href='#' onclick='i3GEO.editorOL.incorporar()' >Incorporar ao mapa</a></p>";ins+="<p class=paragrafo>"+$trad("ajudaEditorOlSalva")+"</p>";YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{alert("Selecione pelo menos um elemento")}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,ins="",i,a,w,g;for(i=0;i<n;i++){g=geos[i];ins+="<b>Geometria: "+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.geometry)+"<br><br>";ins+="<b>Atributos: "+i+"</b><br>";a=g.attributes;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}if(g.attributes.registros){ins+="<b>Registros: "+i+"</b><br>";a=g.attributes.registros;for(key in a){if(a[key]){ins+=key+" = "+a[key]+"<br>"}}}ins+="<br>"}w=window.open();w.document.write(ins);w.document.close()},testeSalvar:function(){alert("Funcao nao disponivel. Defina o nome da funcao em i3GEO.editorOL.nomeFuncaoSalvar ")},salvaGeo:function(){var geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,funcaoOK=function(){if(geos[0].geometry){var registros="",valorunico="",nometema=$i("editorOLcomboTemaEditavel").value,key="",tema,redesenha,p,g=i3GEO.editorOL.google2wgs(geos[0].geometry);if(nometema==""){return}tema=i3GEO.arvoreDeCamadas.pegaTema(nometema,"","name");if(geos[0].attributes.registros){registros=geos[0].attributes.registros;for(key in registros){if(registros[key]&&key==tema.colunaidunico){valorunico=registros[key]}}}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);i3GEO.Interface.atualizaTema("",nometema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto","Adicionando...");i3GEO.janela.AGUARDEMODAL=false;if(valorunico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+nometema+"&wkt="+g)}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+valorunico+"&tema="+nometema+"&wkt="+g)}}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto="Salvar no tema:<br><div id=editorOLondeComboTemaEditavel ></div><br><br>";if(n!=1){i3GEO.janela.tempoMsg("Selecione apenas uma figura")}else{i3GEO.janela.confirma(texto,300,"Salva","Cancela",funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel")}},criaBotoes:function(botoes){var sketchSymbolizers={"Point":{pointRadius:4,graphicName:"square",fillColor:"white",fillOpacity:1,strokeWidth:1,strokeOpacity:1,strokeColor:"#333333"},"Line":{strokeWidth:3,strokeOpacity:1,strokeColor:"#666666",strokeDashstyle:"dash"},"Polygon":{strokeWidth:2,strokeOpacity:1,strokeColor:"#666666",fillColor:"white",fillOpacity:0.3}},style=new OpenLayers.Style(),styleMap=new OpenLayers.StyleMap({"default":style,"vertex":{strokeOpacity:1,strokeWidth:1,fillColor:"white",fillOpacity:0.45,pointRadius:3}},{extendDefault:false}),adiciona=false,button,controles=[];style.addRules([new OpenLayers.Rule({symbolizer:sketchSymbolizers})]);i3GEOpanelEditor=new OpenLayers.Control.Panel({displayClass:"olControlEditingToolbar1 noprint",saveState:false,activateControl:function(c){this.deactivate();this.activate();try{i3GEO.editorOL.ModifyFeature.deactivate();if(i3GEO&&i3GEO.barraDeBotoes){i3GEO.barraDeBotoes.ativaPadrao()}}catch(e){}if(!c.trigger){c.activate()}else{c.trigger.call()}}});if(botoes.procura===true){button=new OpenLayers.Control.Button({displayClass:"editorOLprocura",trigger:function(){YAHOO.procura.container.panel.show()},title:"procura",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.pan===true){controles.push(new OpenLayers.Control.Navigation({title:"deslocar",displayClass:"editorOLpan",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoombox===true){controles.push(new OpenLayers.Control.ZoomBox({title:"zoombox",displayClass:"editorOLzoombox",type:OpenLayers.Control.TYPE_TOOL}));adiciona=true}if(botoes.zoomtot===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomtot",trigger:function(){if(i3GEO.editorOL.mapext&&i3GEO.editorOL.mapext!=""){i3GEO.editorOL.mapa.zoomToExtent(i3GEO.editorOL.mapext)}else{i3GEO.editorOL.mapa.zoomToMaxExtent()}},title:"ajusta extensao",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomin===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomin",trigger:function(){i3GEO.editorOL.mapa.zoomIn()},title:"aproxima",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.zoomout===true){button=new OpenLayers.Control.Button({displayClass:"editorOLzoomout",trigger:function(){i3GEO.editorOL.mapa.zoomOut()},title:"afasta",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.legenda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlegenda",trigger:function(){i3GEO.editorOL.mostraLegenda()},title:"legenda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.distancia===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Path,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLdistancia",title:"distancia",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units,measure=event.measure;alert("Distancia: "+measure.toFixed(3)+" "+units)}});controles.push(button);adiciona=true}if(botoes.area===true){button=new OpenLayers.Control.Measure(OpenLayers.Handler.Polygon,{handlerOptions:{layerOptions:{styleMap:styleMap}},persist:true,displayClass:"editorOLarea",title:"area",type:OpenLayers.Control.TYPE_TOOL});button.events.on({"measure":function(event){var units=event.units;var measure=event.measure;alert("Área: "+measure.toFixed(3)+" "+units+" quadrados")}});controles.push(button);adiciona=true}if(botoes.identifica===true){botaoIdentifica=new OpenLayers.Control.WMSGetFeatureInfo({maxFeatures:1,infoFormat:'text/plain',layers:[i3GEO.editorOL.layerAtivo()],queryVisible:true,title:"identifica",type:OpenLayers.Control.TYPE_TOOL,displayClass:"editorOLidentifica",eventListeners:{getfeatureinfo:function(event){var lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),lonlattexto="<hr>",formata;if(botoes.linha===true||botoes.ponto===true||botoes.poligono===true||botoes.edita===true){lonlattexto+="<pre><span style=font-size:12px;color:blue;cursor:pointer onclick='i3GEO.editorOL.captura(\""+lonlat.lon+","+lonlat.lat+"\")'>edita geometria</span></pre><br>"}formata=function(texto){var temp,temp1,n,i,f=[],textoN=texto.split(":");try{if(textoN.length>1){temp=textoN[2].replace(/\n\r/g,"");temp=temp.replace(/'/g,"");temp=temp.replace(/\n/g,"|");temp=temp.replace(/_/g," ");temp=temp.replace(/=/g,":");temp=temp.split("|");n=temp.length;for(i=0;i<n;i++){temp1=temp[i].replace(/^\s+/,"");temp1=temp1.replace(/\s+$/,"");if(temp1!="")f.push(temp1)}texto=f.join("<br><br>")}}catch(e){}return texto};i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("chicken",i3GEO.editorOL.mapa.getLonLatFromPixel(event.xy),null,"<div style=text-align:left >"+lonlattexto+"<pre>"+formata(event.text)+"</pre></div>",null,true));i3GEO.editorOL.removeClone()},beforegetfeatureinfo:function(event){var ativo=[i3GEO.editorOL.layerAtivo()];if(ativo[0].serviceVersion==="&tms="||ativo[0].CLASS_NAME=="OpenLayers.Layer.TMS"||ativo[0].CLASS_NAME=="OpenLayers.Layer.OSM"){ativo=[i3GEO.editorOL.layertms2wms(ativo[0])]}ativo[0].projection=new OpenLayers.Projection("EPSG:4326");event.object.layers=ativo;botaoIdentifica.layers=ativo;botaoIdentifica.url=ativo[0].url},activate:function(){i3GEO.editorOL.criaJanelaAtivaTema()}}});controles.push(botaoIdentifica);adiciona=true}if(botoes.linha===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Path,{displayClass:"editorOLlinha",title:"digitalizar linha",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.ponto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLponto",title:"digitalizar ponto",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f,style_mark;if(i3GEO.editorOL.simbologia.externalGraphic!=""){style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=i3GEO.editorOL.simbologia.externalGraphic;style_mark.graphicWidth=i3GEO.editorOL.simbologia.graphicWidth;style_mark.graphicHeight=i3GEO.editorOL.simbologia.graphicHeight;style_mark.fillOpacity=i3GEO.editorOL.simbologia.opacidade;f=new OpenLayers.Feature.Vector(feature,null,style_mark)}else{f=new OpenLayers.Feature.Vector(feature)}f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName,externalGraphic:i3GEO.editorOL.simbologia.externalGraphic,graphicHeight:i3GEO.editorOL.simbologia.graphicHeight,graphicWidth:i3GEO.editorOL.simbologia.graphicWidth};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.poligono===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLpoligono",title:"digitalizar poligono",type:OpenLayers.Control.TYPE_TOOL,callbacks:{done:function(feature){var f=new OpenLayers.Feature.Vector(feature);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.texto===true){button=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Point,{displayClass:"editorOLtexto",title:"incluir texto",type:OpenLayers.Control.TYPE_TOOL,persist:true,callbacks:{done:function(feature){var texto=window.prompt("Texto",""),label=new OpenLayers.Feature.Vector(feature);label["attributes"]={opacidade:0.1,fillColor:"white",strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,texto:texto,pointRadius:2,graphicName:"square",strokeColor:"black",fontColor:i3GEO.editorOL.simbologia.fontColor,fontSize:i3GEO.editorOL.simbologia.fontSize,fontFamily:"Arial",fontWeight:"bold",labelAlign:"rt"};if(texto&&texto!==""){i3GEO.desenho.layergrafico.addFeatures([label])}i3GEO.editorOL.sobeLayersGraficos()}}});controles.push(button);adiciona=true}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEO.editorOL.CortaFeature=new OpenLayers.Control.DrawFeature(i3GEO.desenho.layergrafico,OpenLayers.Handler.Polygon,{displayClass:"editorOLcorta",title:"corta figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length!=1){alert("Selecione primeiro um elemento para ser cortado");i3GEO.editorOL.CortaFeature.deactivate()}else{i3GEO.editorOL.CortaFeature.activate()}},callbacks:{done:function(feature){var temp,sel=i3GEO.desenho.layergrafico.selectedFeatures[0].geometry,corta=feature;temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,sel+"|"+corta,"difference")}}});controles.push(i3GEO.editorOL.CortaFeature);adiciona=true}if(botoes.edita===true){i3GEO.editorOL.ModifyFeature=new OpenLayers.Control.ModifyFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLedita",title:"modifica figura",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,mode:OpenLayers.Control.ModifyFeature.RESHAPE,standalone:false,createVertices:true,styleMap:"default",vertexRenderIntent:"vertex"});controles.push(i3GEO.editorOL.ModifyFeature);adiciona=true}if(botoes.edita===true&&botoes.listag===true){button=new OpenLayers.Control.Button({displayClass:"editorOLlistag",trigger:function(){i3GEO.editorOL.listaGeometrias()},title:"lista geometrias",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.frente===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfrente",trigger:function(){i3GEO.editorOL.trazParaFrente();if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},title:"traz para frente",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.tools===true&&i3GEO.php){button=new OpenLayers.Control.Button({displayClass:"editorOLtools",trigger:function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}},title:"ferramentas",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.selecao===true){i3GEO.editorOL.selbutton=new OpenLayers.Control.SelectFeature(i3GEO.desenho.layergrafico,{displayClass:"editorOLselecao",title:"seleciona elemento",type:OpenLayers.Control.TYPE_TOOL,clickout:true,toggle:true,multiple:false,hover:false,toggleKey:"ctrlKey",multipleKey:"shiftKey",box:false});controles.push(i3GEO.editorOL.selbutton);adiciona=true}if(botoes.selecaotudo===true){button=new OpenLayers.Control.Button({displayClass:"editorOLselecaoTudo",trigger:function(){var fs=i3GEO.desenho.layergrafico.features,n=fs.length,i;for(i=0;i<n;i++){i3GEO.editorOL.selbutton.select(fs[i])}},title:"seleciona tudo",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.apaga===true){button=new OpenLayers.Control.Button({displayClass:"editorOLapaga",trigger:function(){if(i3GEO.desenho.layergrafico.selectedFeatures.length>0){var x=window.confirm("Exclui os elementos selecionados?");if(x){i3GEO.editorOL.guardaBackup();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}i3GEO.janela.tempoMsg("Para excluir registros do banco de dados utilize a ferramenta de identificacao")}}else{alert("Selecione pelo menos um elemento")}},title:"apaga selecionados",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.propriedades===true){button=new OpenLayers.Control.Button({displayClass:"editorOLpropriedades",trigger:function(){i3GEO.editorOL.propriedades()},title:"propriedades",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.salva===true){button=new OpenLayers.Control.Button({displayClass:"editorOLsalva",trigger:function(){i3GEO.editorOL.salvaGeometrias()},title:"salva",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.ajuda===true){button=new OpenLayers.Control.Button({displayClass:"editorOLajuda",trigger:function(){try{window.open(i3GEO.configura.locaplic+"/mashups/openlayers_ajuda.php")}catch(e){window.open("openlayers_ajuda.php")}},title:"ajuda",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}if(botoes.fecha===true){button=new OpenLayers.Control.Button({displayClass:"editorOLfecha",trigger:function(){var temp=window.confirm($trad("x94"));if(i3GEO.eventos){i3GEO.eventos.cliquePerm.ativa()}i3GEOpanelEditor.destroy();try{YAHOO.temaativo.container.panel.destroy()}catch(e){}try{YAHOO.procura.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.container.panel.destroy()}catch(e){}try{YAHOO.editorOL.listaGeometrias.panel.destroy()}catch(e){}try{YAHOO.editorOL.ferramentas.panel.destroy()}catch(e){}try{YAHOO.legendaeditorOL.container.panel.destroy()}catch(e){}try{YAHOO.salvaGeometrias.container.panel.destroy()}catch(e){}if(temp===true){try{if(i3GEO.desenho.layergrafico){i3GEO.editorOL.mapa.removeLayer(i3GEO.desenho.layergrafico);delete(i3GEO.desenho.layergrafico)}if(i3GEO.editorOL.backup){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.backup);delete(i3GEO.editorOL.backup)}}catch(e){}}},title:"fecha editor",type:OpenLayers.Control.TYPE_BUTTON});controles.push(button);adiciona=true}i3GEOOLsnap=new OpenLayers.Control.Snapping({layer:i3GEO.desenho.layergrafico});i3GEOOLsplit=new OpenLayers.Control.Split({layer:i3GEO.desenho.layergrafico,source:i3GEO.desenho.layergrafico,tolerance:0.0001,eventListeners:{beforesplit:function(event){i3GEO.editorOL.guardaBackup()},aftersplit:function(event){i3GEO.editorOL.flashFeatures(event.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}}});if(adiciona===true){i3GEOpanelEditor.addControls(controles);i3GEO.editorOL.mapa.addControl(i3GEOpanelEditor)}},mudaSimbolo:function(estilo,id){var valor=$i(id).value,geos=i3GEO.desenho.layergrafico.selectedFeatures,n=geos.length,i;i3GEO.editorOL.simbologia[estilo]=valor;for(i=0;i<n;i++){geos[i].attributes[estilo]=valor;geos[i].style[estilo]=valor}},adicionaMarcas:function(){if(i3GEO.editorOL.pontos.length===0){return}var f,SHADOW_Z_INDEX=10,MARKER_Z_INDEX=11,layer=new OpenLayers.Layer.Vector("pontos",{styleMap:new OpenLayers.StyleMap({externalGraphic:i3GEO.editorOL.marca,backgroundGraphic:"../pacotes/openlayers/img/marker_shadow.png",backgroundXOffset:0,backgroundYOffset:-7,graphicZIndex:MARKER_Z_INDEX,backgroundGraphicZIndex:SHADOW_Z_INDEX,pointRadius:10}),isBaseLayer:false,rendererOptions:{yOrdering:true},displayInLayerSwitcher:true,visibility:true}),index,x=[],y=[],features=[];for(index=0;index<i3GEO.editorOL.pontos.length;index=index+2){x.push(i3GEO.editorOL.pontos[index]);y.push(i3GEO.editorOL.pontos[index+1])}for(index=0;index<x.length;index++){f=new OpenLayers.Geometry.Point(x[index],y[index]);f=i3GEO.util.projGeo2OSM(f);f=new OpenLayers.Feature.Vector(f);features.push(f)}layer.addFeatures(features);i3GEO.editorOL.mapa.addLayer(layer)},adicionaKml:function(){var temp,n,i,id,url;n=i3GEO.editorOL.kml.length;for(i=0;i<n;i++){id="kml"+i;url=i3GEO.editorOL.kml[i];eval(id+" = new OpenLayers.Layer.Vector('"+id+"', {displayOutsideMaxExtent:true,displayInLayerSwitcher:false,visibility:true, strategies: [new OpenLayers.Strategy.Fixed()],protocol: new OpenLayers.Protocol.HTTP({url: '"+url+"',format: new OpenLayers.Format.KML({extractStyles: true,extractAttributes: true,maxDepth: 5})})})");eval("i3GEO.editorOL.mapa.addLayer("+id+");");eval("temp = "+id+".div;");temp.onclick=function(e){var targ="",id,temp,features,n,i,g,html="";if(!e){e=window.event}if(e.target){targ=e.target}else{if(e.srcElement){targ=e.srcElement}}if(targ.id){temp=targ.id.split("_");if(temp[0]==="OpenLayers.Geometry.Point"){id=targ.id;temp=i3GEO.editorOL.mapa.getLayer(this.id);features=temp.features;n=features.length;for(i=0;i<n;i++){if(features[i].geometry.id===id){for(var j in features[i].attributes){html+=j+": "+features[i].attributes[j]}g=features[i].geometry;i3GEO.editorOL.mapa.addPopup(new OpenLayers.Popup.FramedCloud("kml",new OpenLayers.LonLat(g.x,g.y),null,html,null,true))}}}}}}},propriedades:function(){if(!document.getElementById("panelpropriedadesEditor")){YAHOO.namespace("editorOL.container");YAHOO.editorOL.container.panel=new YAHOO.widget.Panel("panelpropriedadesEditor",{zIndex:20000,iframe:true,width:"350px",height:"250px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo ><b>Estilos (utilize a cor no formato r,g,b):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td>Cor do contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(strokeColor,i3GEOEditorOLcorContorno)" type="text" style="cursor:text" id="i3GEOEditorOLcorContorno" size="12" value="'+i3GEO.editorOL.simbologia.strokeColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorContorno);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor do preenchimento</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fillColor,i3GEOEditorOLcorPre)" type="text" style="cursor:text" id="i3GEOEditorOLcorPre" size="12" value="'+i3GEO.editorOL.simbologia.fillColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorPre);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Cor da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fontColor,i3GEOEditorOLcorFonte)" type="text" style="cursor:text" id="i3GEOEditorOLcorFonte" size="12" value="'+i3GEO.editorOL.simbologia.fontColor+'" /></td><td>';if(i3GEO.configura){ins+='<img alt="aquarela.gif" style=cursor:pointer src="'+i3GEO.configura.locaplic+'/imagens/aquarela.gif" onclick="i3GEO.util.abreCor(,i3GEOEditorOLcorFonte);" />'}ins+=""+' </td>'+' </tr>'+' <tr>'+' <td>Tamanho da fonte</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(fontSize,i3GEOEditorOLfontsize)" type="text" style="cursor:text" id="i3GEOEditorOLfontsize" size="3" value="'+i3GEO.editorOL.simbologia.fontSize+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Opacidade (de 0 a 1)</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(opacidade,i3GEOEditorOLopacidade)" type="text" style="cursor:text" id="i3GEOEditorOLopacidade" size="3" value="'+i3GEO.editorOL.simbologia.opacidade+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura da linha/contorno</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(strokeWidth,i3GEOEditorOLlarguraLinha)" type="text" style="cursor:text" id="i3GEOEditorOLlarguraLinha" size="2" value="'+i3GEO.editorOL.simbologia.strokeWidth+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Url de uma figura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(externalGraphic,i3GEOEditorOLexternalGraphic)" type="text" style="cursor:text" id="i3GEOEditorOLexternalGraphic" size="22" value="'+i3GEO.editorOL.simbologia.externalGraphic+'" /></td><td></td>'+' </tr>'+' <tr>'+' <td>Largura e altura</td><td><input onchange="i3GEO.editorOL.mudaSimbolo(graphicWidth,i3GEOEditorOLgraphicWidth)" type="text" style="cursor:text" id="i3GEOEditorOLgraphicWidth" size="4" value="'+i3GEO.editorOL.simbologia.graphicWidth+'" /> <input onchange="i3GEO.editorOL.mudaSimbolo(graphicHeight,i3GEOEditorOLgraphicHeight)" type="text" style="cursor:text" id="i3GEOEditorOLgraphicHeight" size="4" value="'+i3GEO.editorOL.simbologia.graphicHeight+'" /></td><td></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Ajusta nó em edição para o(a):</b></p>'+'<table class=lista7 >'+' <tr>'+' <td></td><td>nó</td><td></td><td>vértice</td><td></td><td>borda</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_node" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_nodeTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_vertex" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_vertexTolerance" type="text" size="3" value=15 /></td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.snap()" type="checkbox" id="target_edge" /></td><td><input onchange="i3GEO.editorOL.snap()" id="target_edgeTolerance" type="text" size="3" value=15 /></td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Divide intersecção ao digitalizar</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.split()" type="checkbox" id="edge_split_toggle" /></td><td>borda</td>'+' </tr>'+'</table>'+'<br />'+'<p class=paragrafo ><b>Operação ativada pelo botão de modificação da figura</b></p>'+'<table class=lista7 >'+' <tr>'+' <td><input checked style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESHAPE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera figura</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.RESIZE;" type="radio" name=i3geoOLtipoEdita /></td><td>altera tamanho</td>'+' </tr>'+' <tr>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.ROTATE;" type="radio" name=i3geoOLtipoEdita /></td><td>rotaciona</td>'+' <td><input style=cursor:pointer onclick="i3GEO.editorOL.ModifyFeature.mode = OpenLayers.Control.ModifyFeature.DRAG;" type="radio" name=i3geoOLtipoEdita /></td><td>desloca</td>'+' </tr>'+'</table>';YAHOO.editorOL.container.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.container.panel.setHeader("Propriedades<div id='panelpropriedadesEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.container.panel.setHeader("Propriedades")}YAHOO.editorOL.container.panel.setFooter("");YAHOO.editorOL.container.panel.render(document.body);YAHOO.editorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close,"click",function(){});temp=$i("panelpropriedadesEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelpropriedadesEditor")}}}YAHOO.editorOL.container.panel.show();temp=$i("panelpropriedadesEditor").getElementsByTagName("div");if(temp&&temp[2]){temp[2].style.overflow="auto"}},listaGeometrias:function(){if(!document.getElementById("panellistagEditor")){YAHOO.namespace("editorOL.listaGeometrias");YAHOO.editorOL.listaGeometrias.panel=new YAHOO.widget.Panel("panellistagEditor",{zIndex:20000,iframe:true,width:"320px",visible:false,draggable:true,close:true});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias <div id='panellistagEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader("Geometrias")}YAHOO.editorOL.listaGeometrias.panel.setFooter("");YAHOO.editorOL.listaGeometrias.panel.render(document.body);YAHOO.editorOL.listaGeometrias.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.listaGeometrias.panel.close,"click",function(){YAHOO.editorOL.listaGeometrias.panel.destroy()});temp=$i("panellistagEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panellistagEditor")}}}else{YAHOO.editorOL.listaGeometrias.panel.render(document.body)}var g,temp,geos=i3GEO.desenho.layergrafico.features,n=geos.length,ins="<table class=lista4 >";ins+="<tr><td><i>Geometrias</i></td><td><i>Opções</i></td><td></td><td></td></tr>";while(n>0){n-=1;g=geos[n].geometry;ins+="<tr><td>"+g.CLASS_NAME+"</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.selFeature("+n+")'>seleciona</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.unselFeature("+n+")'>limpa</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.flashFeaturesI("+n+")'>brilha</td></tr>"}ins+="</table>";if(geos.length===0){ins="Nenhum elemento gráfico encontrado. Utilize as opções de criação de geometrias."}YAHOO.editorOL.listaGeometrias.panel.show();if(i3GEO.configura){temp=$i("panellistagEditor").getElementsByTagName("div")[2]}else{temp=$i("panellistagEditor").getElementsByTagName("div")[1]}temp.style.overflow="auto";temp.style.height="100px";temp.innerHTML=ins},ferramentas:function(){if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",visible:false,draggable:true,close:true});var ins=""+'<p class=paragrafo >Operações sobre as figuras selecionadas:</p>'+'<select onchange="i3GEO.editorOL.processageo(this.value);this.value = " >'+' <option value="">---</option>'+' <option value=union >União</option>';if(i3GEO.php){ins+=' <option value=intersection >Intersecção</option>'+' <option value=convexhull >Convex hull</option>'+' <option value=boundary >Bordas</option>'+' <option value=difference >Diferença</option>'+' <option value=symdifference >Diferença simétrica</option>'}ins+='</select>'+'<br><br><a class=paragrafo href=# onclick="i3GEO.desenho.layergrafico.destroyFeatures()" >Apaga tudo</a>';YAHOO.editorOL.ferramentas.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas <div id='panelferramentasEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas")}YAHOO.editorOL.ferramentas.panel.setFooter("");YAHOO.editorOL.ferramentas.panel.render(document.body);YAHOO.editorOL.ferramentas.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.ferramentas.panel.close,"click",function(){});temp=$i("panelferramentasEditor_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("panelferramentasEditor")}}}else{YAHOO.editorOL.ferramentas.panel.render(document.body)}YAHOO.editorOL.ferramentas.panel.show()},snap:function(){var target=i3GEOOLsnap.targets[0],tipos=["node","vertex","edge"],ntipos=tipos.length,i,temp,ativa=false;i3GEOOLsnap.deactivate();for(i=0;i<ntipos;i++){temp=$i("target_"+tipos[i]);target[tipos[i]]=temp.checked;if(temp.checked===true){ativa=true}temp=$i("target_"+tipos[i]+"Tolerance");target[tipos[i]+"Tolerance"]=temp.value}if(ativa===true){i3GEOOLsnap.activate()}},split:function(){i3GEOOLsplit.deactivate();var temp=$i("edge_split_toggle");if(temp.checked===true){i3GEOOLsplit.activate()}},processageo:function(operacao){if(operacao===""){return}var geosel=i3GEO.desenho.layergrafico.selectedFeatures,polis,linhas,pontos,temp;if(geosel.length>0){polis=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo(geosel,"OpenLayers.Geometry.Point");temp=function(retorno){if(i3GEO.janela){i3GEO.janela.fechaAguarde("i3GEO.editorPoli");i3GEO.janela.fechaAguarde("i3GEO.editorLinhas");i3GEO.janela.fechaAguarde("i3GEO.editorPontos")}if(retorno!=""&&retorno.data&&retorno.data!=""&&operacao!="converteSHP"){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}if(operacao==="converteSHP"){i3GEO.atualiza();i3GEO.janela.minimiza("paneltemaativo")}};if(operacao==="incorporar"){if(polis.length>0){temp=i3GEO.editorOL.merge(polis)}if(linhas.length>0){temp=i3GEO.editorOL.merge(linhas)}if(pontos.length>0){temp=i3GEO.editorOL.merge(pontos)}if(i3GEO.mapa){i3GEO.mapa.dialogo.wkt2layer(temp)}return}if(operacao==="union"&&!i3GEO.php){if(polis.length>0){temp=i3GEO.editorOL.uniaojts(polis);i3GEO.editorOL.substituiFeaturesSel(temp)}if(linhas.length>0){temp=i3GEO.editorOL.uniaojts(linhas);i3GEO.editorOL.substituiFeaturesSel(temp)}if(pontos.length>0){temp=i3GEO.editorOL.uniaojts(pontos);i3GEO.editorOL.substituiFeaturesSel(temp)}}else{if(polis.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos");i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),operacao)}if(linhas.length>0){i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas");i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),operacao)}if(pontos.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos");i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao)}}return}else{alert("Selecione pelo menos dois elementos")}},merge:function(geoms){var n=geoms.length,w=new Wkt.Wkt(),g,m,i;w.read(geoms[0].toString());if(n>1){for(i=1;i<n;i++){g=geoms[i].toString();m=new Wkt.Wkt();m.read(g);w.merge(m)}}return w.write()},uniaojts:function(geoms){var n=geoms.length,rwkt=new jsts.io.WKTReader(),wwkt=new jsts.io.WKTWriter(),fwkt=new OpenLayers.Format.WKT(),g,i,uniao;if(n>1){uniao=(fwkt.read(geoms[0]).geometry).toString();uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=(fwkt.read(geoms[i]).geometry).toString();uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.read(uniao)]}else{return false}},retornaGeometriasTipo:function(features,tipo){var n=features.length,lista=[],i,temp;for(i=0;i<n;i++){temp=features[i].geometry;if(temp.CLASS_NAME==tipo){lista.push(temp)}}return lista},guardaBackup:function(){return},unselTodos:function(){var n,i;n=i3GEO.desenho.layergrafico.features.length;for(i=0;i<n;i++){i3GEO.desenho.layergrafico.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[i])}},unselTodosBackup:function(){var n,i;n=i3GEO.editorOL.backup.features.length;for(i=0;i<n;i++){i3GEO.editorOL.backup.features[i].renderIntent="default";i3GEO.editorOL.selbutton.unselect(i3GEO.editorOL.backup.features[i])}},restauraBackup:function(){if(i3GEO.editorOL.backup.features.length>0){i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features)}if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},substituiFeaturesSel:function(wkt){i3GEO.editorOL.guardaBackup();try{var f,fwkt=new OpenLayers.Format.WKT();i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.selectedFeatures);f=fwkt.read(wkt);f["attributes"]={opacidade:i3GEO.editorOL.simbologia.opacidade,texto:i3GEO.editorOL.simbologia.texto,fillColor:i3GEO.editorOL.simbologia.fillColor,strokeWidth:i3GEO.editorOL.simbologia.strokeWidth,strokeColor:i3GEO.editorOL.simbologia.strokeColor,pointRadius:i3GEO.editorOL.simbologia.pointRadius,graphicName:i3GEO.editorOL.simbologia.graphicName};i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}catch(e){i3GEO.editorOL.restauraBackup()}},adicionaFeatureWkt:function(wkt,atributos){var f,fwkt=new OpenLayers.Format.WKT();if(atributos.externalGraphic&&atributos.externalGraphic!=""){var style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=atributos.externalGraphic;style_mark.graphicWidth=atributos.graphicWidth;style_mark.graphicHeight=atributos.graphicHeight;style_mark.fillOpacity=atributos.opacidade;f=fwkt.read(wkt);f["attributes"]=atributos;f["style"]=style_mark}else{f=fwkt.read(wkt);f["attributes"]=atributos}i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},flashFeaturesI:function(index){i3GEO.editorOL.flashFeatures([i3GEO.desenho.layergrafico.features[index]],0)},flashFeatures:function(features,index){if(!index){index=0}var current=features[index];if(current&¤t.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(features[index],"select")}var prev=features[index-1];if(prev&&prev.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(prev,"default")}++index;if(index<=features.length){window.setTimeout(function(){i3GEO.editorOL.flashFeatures(features,index)},75)}},selFeature:function(index){i3GEO.editorOL.selbutton.select(i3GEO.desenho.layergrafico.features[index])},unselFeature:function(index){i3GEO.editorOL.selbutton.unselect(i3GEO.desenho.layergrafico.features[index])},carregajts:function(funcao){if(i3GEO.configura){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}else{i3GEO.util.scriptTag("../pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}},trazParaFrente:function(){var features=i3GEO.desenho.layergrafico.selectedFeatures;if(features.length>0){i3GEO.editorOL.backup=new OpenLayers.Layer.Vector("Backup",{displayInLayerSwitcher:false,visibility:false});i3GEO.editorOL.backup.addFeatures(features);i3GEO.editorOL.unselTodosBackup();i3GEO.desenho.layergrafico.removeFeatures(features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}else{alert("Selecione pelo menos um elemento")}},pegaControle:function(classe){var n=i3GEO.editorOL.controles.length,i;for(i=0;i<n;i++){if(i3GEO.editorOL.controles[i].CLASS_NAME===classe){return i3GEO.editorOL.controles[i]}}return false},ativaLayerSwitcher:function(){var ls=i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher");if(ls){ls.maximizeDiv.click()}},desativaRodaDoMouse:function(){var controls=i3GEO.editorOL.mapa.getControlsByClass('OpenLayers.Control.Navigation');for(var i=0;i<controls.length;++i){controls[i].disableZoomWheel()}},google2wgs:function(obj){if(i3GEO.Interface.openlayers.googleLike===true){var projWGS84=new OpenLayers.Projection("EPSG:4326"),proj900913=new OpenLayers.Projection("EPSG:900913");return obj.transform(proj900913,projWGS84)}else{return obj}},sobeLayersGraficos:function(){var nlayers=i3GEO.editorOL.mapa.getNumLayers(),layers=i3GEO.editorOL.mapa.layers,i;for(i=0;i<nlayers;i++){if(layers[i].CLASS_NAME=="OpenLayers.Layer.Vector"&&layers[i].name!="Nenhum"){i3GEO.editorOL.mapa.raiseLayer(i3GEO.editorOL.mapa.layers[i],nlayers)}}}}; | |
| 1647 | 1647 | // |
| 1648 | 1648 | //compactados/dicionario_compacto.js |
| 1649 | 1649 | g_traducao={"p1":[{pt:"O i3Geo é software livre! Para download clique <a href='http://mapas.mma.gov.br/download' target=blank >aqui</a>. <b><a href='http://"+window.location.host+"/i3geo/mobile/qrcode.htm' target=blank >Qrcode mobile</a></b>",en:"I3geo is a open source software! <a href='http://mapas.mma.gov.br/download' target=blank >Click</a> to download.",es:"I3Geo es software libre!. <a href='http://mapas.mma.gov.br/download' target=blank > Descargar</a>"}],"p2":[{pt:"Filtro de cores",en:"Image type",es:"Tipo de imagen"}],"p3":[{pt:"Legenda",en:"Legend",es:"Leyenda"}],"p4":[{pt:"Escala",en:"Scale",es:"Escala"}],"p5":[{pt:"Tamanho",en:"Size",es:"Tamaño"}],"p6":[{pt:"Ativa/desativa entorno",en:"Enable/Disable Border",es:"Activar/desactivar entorno"}],"p7":[{pt:"Ativa/desativa logo",en:"Enable/Disable Logo",es:"Activar/desactivar Logo"}],"p8":[{pt:"Cor da selecao",en:"Color of Selection",es:"Color de la selección"}],"p9":[{pt:"Cor do fundo",en:"Background color",es:"Color de fondo"}],"p10":[{pt:"Grade de coordenadas",en:"Graticule",es:"Gratíla"}],"p11":[{pt:"Template",en:"Template",es:"Plantilla"}],"p12":[{pt:"Temporizador",en:"Timer",es:"Temporizador"}],"p13":[{pt:"Propriedades",en:"Properties",es:"Propiedades"}],"p14":[{pt:"Aplicar",en:"Apply",es:"Aplicar"}],"p15":[{pt:"Formato da imagem do mapa",en:"Format of Image Map",es:"Formato de la imagen del mapa"}],"p16":[{pt:"Fundo",en:"Base layers",es:"Capas Base"}],"p17":[{pt:"Imprime legenda",en:"Enable legend",es:"Activar Leyenda"}],"p18":[{pt:"Não imprime a legenda",en:"Disable legend",es:"Desactivar Leyenda"}],"p19":[{pt:"Ativa ou desativa a legenda de um tema na opção de impressão do mapa",en:"Enable or disable the legend of a theme in the print option of the map",es:"Activa o desactiva la leyenda de un tema en la opción de impresión del mapa"}],"p20":[{pt:"Tela remota",en:"Remote screen",es:"Pantalla remota"}],"p21":[{pt:"Animação",en:"Animation",es:"Animación"}],"s1":[{pt:"Ajuda",en:"Help",es:"Ayuda"}],"s2":[{pt:"Análise",en:"Analysis",es:"Análisis"}],"s3":[{pt:"Janelas",en:"Windows",es:"Ventanas"}],"s4":[{pt:"Arquivo",en:"Files",es:"Archivo"}],"s5":[{pt:"Propriedades",en:"Properties",es:"Propiedades"}],"u1":[{pt:"Sobre o i3Geo",en:"About i3Geo",es:"Acerca de i3Geo"}],"u2":[{pt:"Doc. dos códigos",en:"Doc. of the codes",es:"Doc. de los códigos"}],"u3":[{pt:"WikiBook",en:"WikiBook",es:"WikiBook"}],"u4":[{pt:"Tutoriais",en:"Tutorials",es:"Tutoriales"}],"u4a":[{pt:"Manual do usuário",en:"User manual",es:"Manual de usuario"}],"u5":[{pt:"Blog",en:"Blog",es:"Blog"}],"u5a":[{pt:"Software público",en:"Software público Brazil",es:"Software público Brasil"}],"u5b":[{pt:"Lista de funções",en:"Function list",es:"Lista de funciones"}],"u5c":[{pt:"Redes sociais",en:"Social networks",es:"Redes sociales"}],"u6":[{pt:"Geometrias",en:"Geometries",es:"Geometrías"}],"u7":[{pt:"Grade de polígonos",en:"Polygon grid",es:"Grado de polígonos"}],"u8":[{pt:"Grade de pontos",en:"Grid of Points",es:"Gratíla de puntos"}],"u9":[{pt:"Grade de hexágonos",en:"Grid of Hexagons",es:"Gratíla de hexágonos"}],"u10":[{pt:"Entorno(Buffer)",en:"Buffer",es:"Area Influencia (Buffer)"}],"u11":[{pt:"Centróide",en:"Centroid",es:"Centroide"}],"u11a":[{pt:"Distância entre pontos",en:"Distance between points",es:"Distancia entre puntos"}],"u12":[{pt:"N pontos em poligono",en:"N points in polygon",es:"N puntos en polígono"}],"u13":[{pt:"Ponto em poligono/raster",en:"Point in polygon/raster",es:"Punto en polígono/raster"}],"u14":[{pt:"Distribuição de pontos",en:"Points distribution",es:"Distribución de puntos"}],"u15":[{pt:"Barras de ferramentas",en:"Toolbars",es:"Barras de herramientas"}],"u15a":[{pt:"Ferramentas",en:"Tools",es:"Herramientas"}],"u16":[{pt:"Janela de mensagens",en:"Message window",es:"Ventana de mensajes"}],"u17":[{pt:"Salvar mapa",en:"Save map",es:"Guardar mapa"}],"u18":[{pt:"Carregar mapfile local",en:"Load mapfile",es:"Cargar mapfile"}],"u19":[{pt:"Pegar imagens",en:"Get pictures",es:"Captar imágenes"}],"u20":[{pt:"Converter em WMS e WMC",en:"Convert to WMS and WMC",es:"Convertir en WMS y WMC"}],"u20a":[{pt:"Converter em KML",en:"Convert to KML",es:"Convertir en KML"}],"u21":[{pt:"Gerador de links",en:"Link generator",es:"Generador de enlaces"}],"u22":[{pt:"Grade",en:"Graticule",es:"Gratíla"}],"u23":[{pt:"Ponto",en:"Point",es:"Punto"}],"u24":[{pt:"Polígono",en:"Polygon",es:"Polígonos"}],"u25":[{pt:"Dissolve",en:"Dissolve",es:"Disolver"}],"u26":[{pt:"Agrupa",en:"Group",es:"Agrupar"}],"u27":[{pt:"Outros",en:"Others",es:"Otros"}],"u28":[{pt:"Centro médio",en:"Middle center",es:"Centro medio"}],"u29":[{pt:"Editor vetorial",en:"Vector editor",es:"Editor vetorial"}],"t1":[{pt:"Camadas",en:"Layers",es:"Capas"}],"t2":[{pt:"Arraste o tema aqui ou clique para excluir",en:"Drag the layer here or make click to remove",es:"Arrastre el tema aquí ó haga clic para excluir"}],"t2a":[{pt:"Filtra a lista de camadas",en:"Filters the list of layers",es:"Filtra la lista de capas"}],"t2b":[{pt:"Abre a legenda do mapa",en:"Opens the map legend",es:"Despliega la leyenda del mapa"}],"t3":[{pt:"Clique para ligar ou desligar esse tema, mostrando-o ou não no mapa. Após alterar o estado do tema, aguarde alguns instantes para o mapa ser redesenhado, ou clique no botão aplicar que será mostrado.",en:"Click to enable or disable this theme, showing it or not on the map. After changing the status of the theme, wait a few moments to get the map to be reloaded, or click the Apply button that will be display.",es:"Haga clic para activar o desactivar este tema, mostrándolo o no en el mapa. Después de cambiar el estado del tema, espere algunos instantes para que el mapa sea recargado, o haga clic en el botón aplicar que se mostrará."}],"t3a":[{pt:"Clique para ligar todos os temas",en:"Turn on all layers",es:"Haga clic para activar todos los temas"}],"t3b":[{pt:"Clique para desligar todos os temas",en:"Turn off all layers",es:"Haga clic para desactivar todos los temas"}],"t4":[{pt:"limpa seleção",en:"Clear selection",es:"Limpia la selección"}],"t4a":[{pt:"zoom para a seleção",en:"Zoom to selection",es:"Zoom a la selección"}],"t5":[{pt:"Limpa seleção existente nesse tema",en:"Clear selection existing in this theme",es:"Limpia la selección existente en este tema"}],"t6":[{pt:"Clique para fazer o download desse tema no formato shapefile",en:"Click to download this theme in shapefile format",es:"Haga clic para descargar este tema en formato shape"}],"t7":[{pt:"clique e arraste",en:"Dragging",es:"Haga clic y arrastre"}],"t7a":[{pt:"Clique e arraste para mudar a ordem. Arraste e solte na lixeira para remover. Aguarde para ver a legenda.",en:"Click and Dragg to rearrange order. Drag and drop to remove. Please to wait to see the legend",es:"Haga clic y arrastre para cambiar el orden. Arrastre y suelte remover. Aguarde para ver la leyenda."}],"t8":[{pt:"arraste para mudar a ordem",en:"drag to change the order",es:"Arrastre para cambiar el orden"}],"t9":[{pt:"A escala do tema é compatível com a escala do mapa",en:"The scale of the theme is compatible with the scale of the map",es:"La escala del tema es compatible con la escala del mapa"}],"t10":[{pt:"A escala do tema é incompatível com a escala do mapa",en:"The scale of the theme is incompatible with the scale of the map",es:"La escala del tema es incompatible con la escala del mapa"}],"t11":[{pt:"A escala do tema não é conhecida",en:"The scale of the layer is unknown",es:"La escala del tema no es conocida"}],"t12":[{pt:"Excluir",en:"Delete",es:"Eliminar"}],"t12a":[{pt:"Clique para excluir esse tema do mapa.",en:"Delete this layer of the map.",es:"Haga clic para excluir este tema del mapa"}],"t13":[{pt:"sobe",en:"Up",es:"Subir"}],"t14":[{pt:"Clique para subir esse tema na ordem de desenho",en:"Click to move up the layer in design order",es:"Haga clic para subir ese tema en la orden de diseño"}],"t15":[{pt:"desce",en:"Down",es:"Bajar"}],"t16":[{pt:"Clique para descer esse tema na ordem de desenho",en:"Click to move down the layer in design order",es:"Haga clic para bajar este tema en la orden de diseño"}],"t17":[{pt:"zoom para o tema",en:"Zoom to layer",es:"Zoom al tema"}],"t18":[{pt:"Clique para ajustar o mapa de forma a mostrar todo o tema",en:"Zoom all",es:"Zoom a todo"}],"t18a":[{pt:"Opções e propriedades",en:"Options",es:"Opciones"}],"t18b":[{pt:"Legenda",en:"Legend",es:"Leyenda"}],"t19":[{pt:"Altera a transparência do tema, possibilitando que as camadas inferiores possam ser vistas.",en:"Change the layer transparency. It make possible to see inferior layers",es:"Altera la transparencia del tema, haciendo posible que las capas inferiores puedan verse"}],"t20":[{pt:"Opacidade",en:"Opacity",es:"Opacidad"}],"t22":[{pt:"Localize elementos no tema com base em seus atributos descritivos.",en:"Find elements on the layer based on their descriptive attributes.",es:"Ubique elementos en el tema en base a sus atributos descriptivos"}],"t23":[{pt:"Procurar",en:"Search...",es:"Buscar..."}],"t24":[{pt:"Crie uma nova camada no mapa para apresentar textos descritivos sobre esse tema, tendo como base a tabela de atributos.",en:"Create a new layer to display descriptive texts about this theme, based on table of attributes.",es:"Crear una nueva capa en el mapa para presentar textos descriptivos sobre este tema, teniendo como base la tabla de atributos"}],"t25":[{pt:"Etiquetas baseadas em atributos",en:"Label...",es:"Etiquetas.."}],"t26":[{pt:"Defina as etiquetas que serão mostradas quando o mouse é estacionado sobre um elemento desse tema.",en:"Define the label that will be shown when the mouse is over one element of this theme.",es:"Defina las etiquetas que se mostrarán cuando el ratón se estaciona sobre un elemento de este tema"}],"t27":[{pt:"Ativar etiquetas",en:"Label...",es:"Etiquetas..."}],"t28":[{pt:"Insira um filtro nesse tema para mostrar apenas determinadas informações, com base na tabela de atributos.",en:"Insert a Filter in this theme for show specific information, based on the table of attributes.",es:"Inserte un filtro en este tema para mostrar solo determinadas informaciones, con base en la tabla de atributos"}],"t29":[{pt:"Filtrar",en:"Filter...",es:"Filtrar..."}],"t30":[{pt:"Veja a tabela de atributos relacionada a esse tema.",en:"See the table of attributes related to this theme.",es:"Vea la tabla de atributos relacionada con este tema"}],"t31":[{pt:"Tabela com os dados",en:"Table of attributes...",es:"Tabla de atributos..."}],"t32":[{pt:"Abre o editor de legenda, permitindo a alteração da forma de representação desse tema.",en:"Opens the legend editor, allowing the modification of the form of representation of this theme.",es:"Abre el editor de leyenda, permitiendo la alteración de la forma de representación de este tema"}],"t33":[{pt:"Editar legenda",en:"Edit Legend...",es:"Editar leyenda..."}],"t34":[{pt:"Mostra os dados desse tema em uma janela que acompanha o mouse.",en:"Shows the data of this layer in a window that tracks the mouse.",es:"Muestra los datos de este tema en una ventana que acompaña el ratón"}],"t35":[{pt:"Mostra em janela",en:"Show in window",es:"Mostrar en la ventana..."}],"t36":[{pt:"tema visível apenas em determinadas escalas",en:"Layer is visible in specific scales",es:"Capa visible en ciertas escalas"}],"t37":[{pt:"Gráfico",en:"Graphic",es:"Gráfico"}],"t37a":[{pt:"Tema com gráficos",en:"Theme with chart",es:"Tema con Gráfico"}],"t37b":[{pt:"Gráfico interativo",en:"Interactive chart",es:"Gráfico Interactivo"}],"t38":[{pt:"Exporta a legenda para o padrão SLD.",en:"Export the legend to standard SLD.",es:"Exporta la leyenda para estándar SLD."}],"t39":[{pt:"Exportar SLD",en:"Export to SLD...",es:"Exportar a SLD..."}],"t40":[{pt:"Abre a ferramenta que permite alterar o SQL de acesso aos dados",en:"Opens the tool that lets you change the SQL data access",es:"Abre una herramienta que permite alterar el SQL de acceso a los datos"}],"t41":[{pt:"Editar SQL",en:"Edit SQL...",es:"Editar SQL..."}],"t42":[{pt:"Efeito cortina",en:"Curtain efect...",es:"Efecto Cortina..."}],"t43":[{pt:"Aplicar SLD",en:"Apply SLD...",es:"Aplicar SLD..."}],"t44":[{pt:"Salvar mapfile",en:"Save mapfile",es:"Guardar mapfile"}],"t45":[{pt:"Comentar",en:"Comment",es:"Comentar"}],"t46":[{pt:"Mais populares",en:"Most popular",es:"Mas populares"}],"t48":[{pt:"Temporizador",en:"Timer",es:"Temporizador"}],"t49":[{pt:"Mapa temático 3D",en:"Thematic map 3D",es:"Mapa temático 3D"}],"a1":[{pt:"procurar tema:",en:"Search layer:",es:"Buscar Tema:"}],"a2":[{pt:"Upload de shape file",en:"Upload shape file",es:"Subir archivo shape"}],"a2b":[{pt:"Upload de arquivo dbf ou CSV",en:"Upload DBF or CSV file",es:"Subir archivo DBF o CSV"}],"a3":[{pt:"Download de dados",en:"Data download",es:"Descarga de datos"}],"a3a":[{pt:"Importar Web Map Context (WMC)",en:"Import Web Map Context (WMC)",es:"Importar Web Map Context (WMC)"}],"a4":[{pt:"Conectar com servidor WMS",en:"Connect to WMS Server",es:"Conectar al servidor WMS"}],"a4b":[{pt:"Conectar com servidor WMS-T",en:"Connect to WMS-T Server",es:"Conectar al servidor WMS-T"}],"a5":[{pt:"Conectar com GeoRss",en:"Connect to GeoRss",es:"Conectar con GeoRss"}],"a5a":[{pt:"Nuvem de tags",en:"Tags cloud",es:"Nube de Tags"}],"a6":[{pt:"Acesso aos arquivos do servidor",en:"Access files in server directory",es:"Acceso a los archivos del servidor"}],"a7":[{pt:"Temas",en:"Layers",es:"Temas"}],"a8":[{pt:"Clique no box ao lado do tema para ligar ou desligar, mostrando-o ou não no mapa. Após alterar o estado do tema, aguarde alguns instantes para o mapa ser redesenhado, ou clique no botão aplicar que será mostrado.",en:"Click to connect or disconnect this layer, showing it or not on the map. After changing the layer status, wait a few moments to be reloaded on the map, or click in the button Apply that will be shown.",es:"Haga clic para conectar o desconectar este tema, mostrándolo o no en el mapa. Después de alterar el estado del tema, espere algunos instantes para que el mapa sea recargado, o haga clic en el botón aplicar que aparecerá"}],"a9":[{pt:"Fonte",en:"Font",es:"Fuente"}],"a10":[{pt:"código:",en:"Code",es:"Código"}],"a11":[{pt:"Sistemas",en:"Systems",es:"Sistemas"}],"a12":[{pt:"Abrir sistema",en:"Open system",es:"Abrir sistema"}],"a13":[{pt:"Abrir no Google Earth",en:"Open in Google Earth",es:"Abrir en Google Earth"}],"a14":[{pt:"Upload SHP, CSV, DBF, GPX, KML",en:"Upload SHP, CSV, DBF, GPX, KML",es:"Subir SHP, CSV, DBF, GPX, KML"}],"a15":[{pt:"Conexões",en:"Conections",es:"Conexiones"}],"a16":[{pt:"Serviços",en:"Services",es:"Servicios"}],"g1":[{pt:"Temas",en:"Layer",es:"Temas"}],"g1a":[{pt:"Catálogo",en:"Catalog",es:"Catálogo"}],"g2":[{pt:"Adiciona",en:"Add",es:"Agregar"}],"g3":[{pt:"Legenda",en:"Legend",es:"Leyenda"}],"g4":[{pt:"Mapas",en:"Maps",es:"Mapas"}],"g4a":[{pt:"Mapa",en:"Map",es:"Mapa"}],"o1":[{pt:"Aguarde...",en:"Wait...",es:"Espere..."}],"o2":[{pt:"Busca rápida",en:"Quick search",es:"Búsqueda rápida"}],"o3":[{pt:"Lendo imagem...",en:"Loading images...",es:"Leyendo imagen..."}],"o4":[{pt:"Aguarde...abrindo lente",en:"Wait...Opening lens...",es:"Espere...abriendo lente"}],"o5":[{pt:"Aguarde...iniciando",en:"Wait...initializing",es:"Espere...iniciando"}],"o6":[{pt:"dinâmico",en:"Dynamic",es:"Dinámico"}],"d1":[{pt:"Digite as coordenadas de um ponto (X=longitude e Y=latitude) para localiz´-lo no mapa. O centro do mapa ser´ deslocado para o ponto digitado.",en:"Enter the coordinates of a point (X=longitude and Y=latitude) to localize it on the map. The center of the map is move to the point entered.",es:"Digite las coordenadas de un punto (X=longitud e Y=latitud) para ubicarlas en el mapa. El centro del mapa se desplazará para el punto digitado."}],"d2":[{pt:"Altera a escala do mapa ajustando-a para mostrar a mesma abrangência geográfica da inicialização.",en:"Change the scale of the map adjusting it to show the same initial geographical cover.",es:"Modifica la escala del mapa ajustándola para mostrar la misma área geográfica inicial"}],"d2t":[{pt:"Enquadramento inicial",en:"Initial extent",es:"Encuadre inicial"}],"d3":[{pt:"Amplia o mapa - desloca o ponto clicado para centro da tela ou amplia a região indicada por um retângulo. Após ativada, clique e arraste o mouse sobre o mapa na área de zoom desejada.",en:"Extends the map - places the point where you clicked in the center of the screen or extends to the region indicated by a rectangle. Once activated, click and drag the mouse over the map in the desired zoom area",es:"Amplía el mapa - coloca el punto donde se hizo clic en el centro de la pantalla o amplía a la región indicada con un rectángulo. Después de activarla, haga clic y arrastre el ratón sobre el mapa en el área de zoom deseada"}],"d3t":[{pt:"clique e arraste para ampliar",en:"Click and drag to enlarge",es:"Haga click y arraste para ampliar"}],"d4":[{pt:"Desloca a região visível no mapa. Após ativada, clique e arraste o mouse sobre o mapa para deslocar a região visível.",en:"Moves the visible region on the map. Once activated, click and drag the mouse over the map to move the visible region.",es:"Desplaza la región visible en el mapa. Después de activada, haga clic y arrastre el ratón sobre el mapa para mover la región visible."}],"d4t":[{pt:"clique e arraste para deslocar",en:"Click and drag to move",es:"Haga Click y arraste para mover"}],"d5":[{pt:"Amplia o mapa tendo como referência o centro atual.",en:"Magnify the map with the reference the current center.",es:"Amplía el mapa teniendo como referencia el centro actual"}],"d5t":[{pt:"aproximar",en:"zoom in",es:"Acercar"}],"d6":[{pt:"Reduz o mapa tendo como referência o centro atual.",en:"Reduces the map with the reference of the current center.",es:"Reduce el mapa teniendo como referencia el centro actual"}],"d6t":[{pt:"afastar",en:"Zoom out",es:"Alejar",it:"afastar"}],"d7":[{pt:"Mostra informações sobre um ponto no mapa. Após ativada, clique sobre o mapa.",en:"Displays information about a point on the map. Once activated, click on the map.",es:"Muestra información sobre un punto en el mapa. Después de activarla haga clic sobre el mapa."}],"d7t":[{pt:"Clique para identificar",en:"Click to identify",es:"Click para identificar"}],"d7a":[{pt:"Mostra informações resumidas sobre um ponto clicado no mapa. Não é necessário clicar nesse ícone para ativar, basta clicar no mapa a qualquer tempo.",en:"",es:""}],"d7at":[{pt:"etiqueta",en:"Label",es:"Etiqueta"}],"d8":[{pt:"Mostra a extensão geográfica atual em coordenadas geográficas",en:"Shows the current extend in geographic coordinates",es:"Muestra la extensión geográfica actual en coordenadas geográficas"}],"d8t":[{pt:"Extensão atual",en:"Actual extent",es:"Extensió actual"}],"d9":[{pt:"Abre/fecha o mapa de referência",en:"Open/close the reference map ",es:"Abre/cierra el mapa de referencia"}],"d9t":[{pt:"mapa de referência",en:"Reference map",es:"Mapa de referencia"}],"d10":[{pt:"Digite o novo valor de escala e clique no botão aplicar para alterar a escala do mapa",en:"Enter the new value of scale and click the button Apply to change the scale of the map",es:"Digite el nuevo valor de escala y haga clic en el botón aplicar para modificar la escala del mapa"}],"d11":[{pt:"Busca dados na Wikipedia na abrangência atual do mapa. Faça um zoom no mapa antes de abrir essa opção. Regiôes muito extensas podem tornar a busca muito demorada",en:"Search data on Wikipedia in the current extend of the map. Make a zoom on the map before opening this option. Regions very extensive can make a very slow search ",es:"Busca datos en Wikipedia en el alcance actual del mapa. Haga zoom en el mapa antes de abrir esta opción. Regiones muy extensas pueden ocasionar una búsqueda muy lentas"}],"d11t":[{pt:"buscar na Wikipédia",en:"search in Wikipedia",es:"buscar na Wikipedia"}],"d12":[{pt:"Imprime o mapa",en:"Print the map",es:"Imprime el mapa"}],"d13":[{pt:"Localiza o IP do usuário no mapa",en:"Locates the user's IP on the map",es:"Ubica el IP del usuario en el mapa"}],"d14":[{pt:"Gera arquivo para 3D",en:"Generates file for 3D",es:"Genera archivo para 3D"}],"d15":[{pt:"Abre o Google Maps, mostrando uma imagem de satélite da região vista no mapa principal",en:"Open Google Maps, showing a satellite image of the region on the map",es:"Abre Google Maps, mostrando una imagen de satélite de la región en el mapa principal"}],"d15t":[{pt:"Google Maps",en:"Google Maps",es:"Google Maps"}],"d16":[{pt:"Pesquisa documentos na base de dados Scielo (dados preliminares)",en:"Search documents in the database Scielo (preliminary data)",es:"Buscar documentos en la base de datos Scielo (datos preliminares)"}],"d16t":[{pt:"Scielo",en:"Scielo",es:"Scielo"}],"d17":[{pt:"Projeto Confluence. Pontos de intersecção de coordenadas observadas em campo",en:"Confluence Project. Points of intersection of coordinates observed in field",es:"Proyecto Confluence. Puntos de intersección de coordenadas observadas en campo"}],"d17t":[{pt:"confluências",en:"Confluences",es:"Confluencias"}],"d18":[{pt:"Abre lente de ampliação",en:"Opens magnifying lens",es:"Abrir lupa"}],"d18t":[{pt:"lente",en:"lens",es:"lente"}],"d19":[{pt:"Coloca as guias em uma janela móvel",en:"Open the tabs in a window mobile",es:"Coloca las guías en una ventana móvil"}],"d20":[{pt:"Redesenha o mapa com as configuraçôes iniciais.",en:"Reload the map with the initial configurations.",es:"Recarga el mapa con las configuraciones iniciales"}],"d20t":[{pt:"reinicia",en:"restart",es:"reinicia",it:"reinicia"}],"d21":[{pt:"Mede a distância entre dois ou mais pontos clicados no mapa (menor distância). O cálculo de distância é aproximado e sua precisão depende da escala do mapa.",en:"It measures the distance between two or more clicked points on the map (shortest distance). The calculation of distance is approximate and their accuracy depends on the scale of the map.",es:"Mide la distancia entre dos o más puntos marcados en el mapa (menor distancia). El cálculo de distancia es aproximado y su precisión depende de la escala del mapa."}],"d21t":[{pt:"distância",en:"distance",es:"distancia"}],"d21a":[{pt:"Mede a área de um polígono desenhado na tela. O cálculo de área é aproximado e sua precisão depende da escala do mapa.",en:"It measures the area of a polgono drawn on the screen. The calculation of area is approximate and their accuracy depends on the scale of the map.",es:"Mide el área de un polígono dibujado sobre la pantalla. El cálculo del área es aproximado y su precisión depende de la escala del mapa."}],"d21at":[{pt:"área",en:"area",es:"área"}],"d22":[{pt:"Insere pontos no mapa em coordenadas geográficas. Ospontos incluídos podem ser transformados em linhas ou polígonos. Os pontos são armazenados em um tema temporário, podendo-se fazer o download do arquivo shapefile.",en:"Insert points on the map in geographical coordinates. The points included can be converted into lines or polygons. The points are stored in a temporary layer, and we can download it like shapefile.",es:"Inserte puntos en el mapa en coordenadas geográficas. Los puntos incluidos pueden transformarse en líneas o polígonos. Los puntos se almacenan en un tema temporal, pudiendo hacerse la descarga en formato de archivo shape."}],"d22t":[{pt:"inserir pontos",en:"insert points",es:"insertar puntos"}],"d23":[{pt:"Insere um gráfico no ponto clicado conforme os atributos existentes no tema escolhido. O tema deve possuir itens com valores numéricos na tabela de atributos.",en:"Insert a graphic of the existing attributes on the selected layer in the clicked point. The layer must have columns with numerical values in the table of attributes.",es:"Inserte un gráfico en el punto marcado según los atributos existentes en el tema seleccionado. El tema debe tener campos con valores numéricos en la tabla de atributos."}],"d24":[{pt:"Abre as ferramentas para seleção de elementos de um tema. Os elementos selecionados podem ser utilizados em outras operaçôes, como buffer e seleção por tema.",en:"Opens the tools to select elements of a layer. The elements selected can be used in other operations like buffer or selection by theme.",es:"Abre las herramientas para selección de elementos de un tema. Los elementos seleccionados pueden utilizarse en otras operaciones como áreas de influencia o selección por tema"}],"d24t":[{pt:"Selecionar",en:"Select",es:"Seleccionar"}],"d25":[{pt:"Insere texto no mapa clicando em um ponto. Utilize essa opção para adicionar informaçôes ao mapa.",en:"Insert text on the map by clicking on a point. Use this option to add information on the map.",es:"Inserte texto en el mapa haciendo clic en un punto. Utilice esta opción para agregar información al mapa"}],"d25t":[{pt:"Inserir texto",en:"Insert text",es:"Insertar texto"}],"d26":[{pt:"Escolha o visual para os botões e outras características visuais do mapa",en:"Choose the visual for the buttons and other map's visual characteristics",es:"Elija la vista para los botones y otras características visuales del mapa"}],"d27":[{pt:"Interface",en:"Interface",es:"Interface"}],"d28":[{pt:"Aguarde...gerando os arquivos",en:"Wait... generating files",es:"Espere... generando los archivos"}],"d29":[{pt:"Estações METAR",en:"METAR-Br Stations",es:"Estaciones METAR-Br"}],"d30":[{pt:"Linha do tempo",en:"Timeline",es:"Línea del tiempo"}],"d31":[{pt:"Não existe nenhuma camada com etiquetas ativas",en:"There is no layer with active labels",es:"No existe ninguna capa con etiquetas activas"}],"d32":[{pt:"Aplicativos",en:"Applications",es:"Aplicaciones"}],"ge1":[{pt:"Navegação com o mouse",en:"Mouse navigation",es:"Navegación con el ratón"}],"ge2":[{pt:"Barra de status",en:"Status bar",es:"Barra de estado"}],"ge3":[{pt:"Mapa de referência",en:"Reference map",es:"Mapa de referencia"}],"ge4":[{pt:"Escala e legenda",en:"Scale and legend",es:"Escala y leyenda"}],"ge5":[{pt:"Atmosfera",en:"Atmosphere",es:"Atmósfera"}],"ge6":[{pt:"Grade de coordenadas",en:"Coordinates grid",es:"Grilla de coordenadas"}],"ge7":[{pt:"Luz do sol",en:"Sunshine",es:"Luz del sol"}],"ge8":[{pt:"Limites políticos",en:"Political boundaries",es:"Límites políticos"}],"ge9":[{pt:"Construções em 3D",en:"Buildings in 3D",es:"Construciones en 3D"}],"ge10":[{pt:"Estradas",en:"Roads",es:"Carreteras"}],"ge11":[{pt:"Terreno",en:"Terrain",es:"Terreno"}],"x1":[{pt:"Página principal",en:"Home",es:"Inicio"}],"x2":[{pt:"Lista de menus",en:"Menu list",es:"Lista de menús"}],"x3":[{pt:"Miniaturas",en:"Thumbnails",es:"Miniaturas"}],"x4":[{pt:"Pesquisa na INDE",en:"Search in SDI of INDE-Br",es:"Buscar en IDE del INDE-Br"}],"x5":[{pt:"Editar subgrupos",en:"Edit subgroups",es:"Editar subgrupos"}],"x6":[{pt:"Editar temas",en:"Edit Theme",es:"Editar temas"}],"x7":[{pt:"opção visível apenas para editores",en:"option visible only for editors",es:"opción visible solo para editores"}],"x8":[{pt:"Sistema de administração",en:"Admin. System",es:"Sistema de administración"}],"x9":[{pt:"Editar árvore",en:"Edit tree",es:"Editar árbol"}],"x10":[{pt:"Editar menus do catálogo",en:"Edit menus",es:"Editar menus"}],"x11":[{pt:"Mostra a legenda em uma janela",en:"Show the legend in a window",es:"Muestra una leyenda en una ventana"}],"x13":[{pt:"&Acute;rvore de camadas não encontrada",en:"Tree layers not found",es:"Arboles de capas no se encuentra"}],"x14":[{pt:"sim",en:"si",es:"yes"}],"x15":[{pt:"não",en:"no",es:"no"}],"x16":[{pt:"Valor não definido",en:"Value not set",es:"Valor no establecido"}],"x17":[{pt:"Essa opção afeta apenas a impressão do mapa",en:"This option only affects the printing of the map",es:"Esta opción s&ocaute;lo afecta a la impresi&ocaute;n del mapa"}],"x18":[{pt:"Nome não definido",en:"El nombre no se ha definido",es:"Name was not defined"}],"x19":[{pt:"Comentários de",en:"Reviews",es:"Comentarios"}],"x20":[{pt:"Clique no mapa para desenhar o polígono",en:"Click the map to draw the polygon",es:"Haga clic en el mapa para dibujar el polígono"}],"x21":[{pt:"Essa operação não funciona nessa interface",en:"This operation does not work on this interface",es:"Esta operación no funciona en esta interfaz"}],"x22":[{pt:"Opção não disponível",en:"Option not available",es:"Opción no disponible"}],"x23":[{pt:"Direção",en:"",es:"Dirección"}],"x25":[{pt:"Método para calcular distâncias",en:"Method to calculate distances",es:"Método para calcular distancias"}],"x26":[{pt:"Voce quer mesmo encerrar a sessao?",en:"Do you really want to logout?",es:"Realmente desea salir?"}],"x27":[{pt:"Usuário",en:"User",es:"Usuario"}],"x28":[{pt:"Senha",en:"Password",es:"Contraseña"}],"x29":[{pt:"Enviar",en:"Send",es:"Enviar"}],"x30":[{pt:"Ativo",en:"Active",es:"Activo"}],"x31":[{pt:"Erro",en:"Error",es:"Erro"}],"x32":[{pt:"Recuperar senha",en:"Send password",es:"Enviar la contrasena"}],"x33":[{pt:"Escolha um tema da lista",en:"Choose a layer from the list",es:"Elegir un tema de la lista"}],"x34":[{pt:"Lugar",en:"Place",es:"Lugar"}],"x35":[{pt:"Escolha um tipo de busca nas propriedades",en:"Choose a search type in the properties",es:"Elija una forma de buscar en las propiedades"}],"x36":[{pt:"Digite uma palavra para busca!",en:"Enter a keyword to search!",es:"Introduzca una palabra clave para buscar!"}],"x37":[{pt:"Onde será feita a busca",en:"Where the search will be done",es:"Donde se hace la búsqueda"}],"x38":[{pt:"Serviços de busca externos",en:"External searchs services",es:"Servicios de búsqueda externos"}],"x39":[{pt:"Temas existentes no mapa",en:"Existing layers on the map",es:"Temas existentes en el mapa"}],"x40":[{pt:"Apenas os temas especialmente configurados pelo administrador do i3Geo podem receber operações de busca",en:"Only the layers specially configarated by the i3Geo administrator can receive search operations",es:"Sólo los temas especialmente configurados por el administrador del i3Geo pueden recibir las operaciones de búsqueda"}],"x41":[{pt:"Nada encontrado nos temas ou nenhum tema permite busca",en:"Nothing found in layers or none layer allows search",es:"No se encontró nada en los temas o ningúno tema permite búsqueda"}],"x42":[{pt:"Nada encontrado em ",en:"Nothing found at ",es:"No se encontró nada en "}],"x43":[{pt:"Erro ao acessar o serviço",en:"Error accessing the service",es:"Error de acceso al servicio"}],"x44":[{pt:"Nuvem Flash",en:"Cloud Flash",es:"Nube Flash"}],"x45":[{pt:"Diretórios",en:"Directories",es:"Directorios"}],"x46":[{pt:"Conexão WMS-T",en:"WMS-T connection",es:"Conexión WMS-T"}],"x47":[{pt:"Conexão GeoRSS",en:"GeoRSS connection",es:"Conexión WMS-T"}],"x48":[{pt:"Rota",en:"Route",es:"Ruta"}],"x49":[{pt:"Coordenadas aproximadas",en:"Approximate coordinates",es:"Coordenadas aproximadas"}],"x50":[{pt:"Feche para parar",en:"Close to stop",es:"Cierre para parar"}],"x51":[{pt:"Seleção",en:"Selection",es:"Selecci&ocute;n"}],"x52":[{pt:"Alterar senha",en:"Change password",es:"Cambiar contraseńa"}],"x53":[{pt:"Upload de WMC",en:"WMC upload",es:"Subir WMC"}],"x54":[{pt:"Perfil",en:"Profile",es:"Perfil"}],"x55":[{pt:"Salva o tema",en:"Save layer",es:"Guarda el tema"}],"x56":[{pt:"Toponímia",en:"Toponymy",es:"Toponimia"}],"x57":[{pt:"Cartogramas estatísticos",en:"Statistical cartograms",es:"Cartogramas estadísticos"}],"x58":[{pt:"Continua",en:"Continue",es:"Seguir"}],"x59":[{pt:"Localiza limite",en:"Locate limit",es:"Localiza límite"}],"x60":[{pt:"Cartogramas",en:"Cartograms",es:"Cartogramas"}],"x61":[{pt:"Filtra limite",en:"Filter limit",es:""}],"x62":[{pt:"Remover",en:"Remove",es:"Eliminar"}],"x63":[{pt:"Para salvar as configurações de uma camada,<br> utilize a opção existente na árvore de camadas no nó correspondente ao tema (basta expandir o tema para visualizar as opções)<br><br>",en:"To save the settings for a layer, use the option available in the layers tree corresponding to the theme node (just expand the layer to view options)",es:"Para guardar la configuración de un tema, utilice la opción disponible en la árbol de temas en el nodo correspondiente a lo tema (sólo ampliar el tema para ver las opciones)"}],"x64a":[{pt:"Congela a visão atual",en:"Freezes the current view",es:"Congela la vista actual"}],"x64":[{pt:"Ítem",en:"Item",es:"Ítem"}],"x65":[{pt:"Buscando ítens...",en:"Buscando ítens...",es:"Searching items..."}],"x66":[{pt:"Ocorreu um erro",en:"An error ocurred",es:"Ha ocurrido un error"}],"x67":[{pt:"Comunidade i3Geo",en:"i3Geo community",es:"Comunidad i3Geo"}],"x68":[{pt:"Versão",en:"Version",es:"Versió"}],"x69":[{pt:"Pressione a tecla CTRL junto com o botão esquerdo do mouse e arraste para definir a área que será aproximada",en:"Press the CTRL key along with the left mouse button and drag to define the area to be approximate",es:"Pulse la tecla CTRL junto con el bot&oacurte;n izquierdo del rat&oacurte;n y arrastre para definir el &aacurte;rea a ser aproximado"}],"x70":[{pt:"Utilize os dedos em um movimento de pinça para definir a área que será aproximada ou afastada",en:"Use the fingers in a pincer movement to define the area to be zoomed in or out",es:"Utilice los dedos en un movimiento de pinzas para definir el área a ser aproximada o alejada"}],"x71":[{pt:"Aplicativos estatísticos cadastrados",en:"Registered statistical applications",es:"Aplicaciones estadísticas registrados"}],"x72":[{pt:"Lista de mapas cadastrados",en:"Registered map list",es:"Lista de los mapas registrados"}],"x73":[{pt:"Redirecionar para a versão adaptada para dispositivos móveis?",en:"Redirect to mobile version?",es:"Redireccionar a una versión adaptada para dispositivos móviles?"}],"x74":[{pt:"Fecha",en:"Close",es:"Cierra"}],"x75":[{pt:"Cancela",en:"Cancel",es:"Cancela"}],"x76":[{pt:"O tema já existe no mapa. Adiciona novamente?",en:"Layer already exists in the map. Add again?",es:"El tema ya existe en el mapa. Añade otra vez?"}],"x77":[{pt:"Nome do novo marcador",en:"New bookmark name",es:"Nombre del nuevo marcador"}],"x78":[{pt:"Copie os marcadores e cole em um editor para guardá-los",en:"Copy and paste the bookmarks in an editor to save",es:"Copie y pegue los marcadores en un editor para salvarlos"}],"x79":[{pt:"Marcadores",en:"Bookmarks",es:"Marcadores"}],"x80":[{pt:"Exportar",en:"Export",es:"Exportar"}],"x81":[{pt:"Importar",en:"Import",es:"Importar"}],"x82":[{pt:"Marcar região",en:"Mark region",es:"Marcar regió"}],"x83":[{pt:"Cole os marcadores para importá-los",en:"Paste the bookmarks to import",es:"Pegue los marcadores para importarlos"}],"x84":[{pt:"Exportar SHP",en:"Export SHP",es:"Exportar SHP"}],"x85":[{pt:"Visualizador de WMS da INDE-Br",en:"INDE-Br WMS viewer",es:"Visualizador de WMS de la INDE-Br"}],"x86":[{pt:"Preferências",en:"Preferences",es:"Preferencias"}],"x87":[{pt:"Limites e localidades",en:"Limits and places",es:"Límites y ubicaciones"}],"x88":[{pt:"Preferências",en:"Preferences",es:"Preferencias"}],"x89":[{pt:"Editar cadastro",en:"Edit registry",es:"Editar registro"}],"x90":[{pt:"Mapas cadastrados",en:"Registered maps",es:"Mapas registrados"}],"x91":[{pt:"Feche para parar. Desligue o tema para ver o efeito",en:"Close to stop. Disable the layer to see the effect",es:"Cierre para detener. Desactive el tema para ver el efecto"}],"x92":[{pt:"Escolha uma camada",en:"Select a layer",es:"Seleccione una capa"}],"x93":[{pt:"Localização do usuário",en:"User location",es:"Ubicación del usuario"}],"x94":[{pt:"Remove as figuras da tela",en:"Remove the pictures",es:"Retire las figuras"}],"x95":[{pt:"trecho",en:"stretch",es:"tramo"}],"x96":[{pt:"atual",en:"current",es:"corriente"}],"x97":[{pt:"total",en:"total",es:"total"}],"x98":[{pt:"perímetro",en:"perimeter",es:"perímetro"}],"x99":[{pt:"Cálculo não pode ser realizado. Falta carregar a API de geometria do GM",en:"",es:""}],"x101":[{pt:"Cópia",en:"",es:""}],"x102":[{pt:"Mapa de calor",en:"Heatmap",es:""}],"x103":[{pt:"Links para abrir o mapa",en:"",es:""}],"x104":[{pt:"Mapa de agrupamentos",en:"",es:""}],"x105":[{pt:"Navegação",en:"",es:""}],"mais":[{pt:"Mais...",en:"",es:""}],"uploadArquivoGeo":[{pt:"Upload de arquivo geo",en:"",es:""}],"conexaoServicoGeo":[{pt:"Conexão com serviços geo",en:"",es:""}],"saikuAba":[{pt:"SAIKU - OLAP (abrir em nova aba)",en:"",es:""}],"saikuMapa":[{pt:"SAIKU - OLAP (abrir em janela interna)",en:"",es:""}],"refMapaAtual":[{pt:"Mapa atual",en:"",es:""}],"refMapaDinamico":[{pt:"Mapa dinâmico",en:"",es:""}],"naoPermitido":[{pt:"Operacao nao autorizada para esse usuario",en:"",es:""}],"melhorcaminho":[{pt:"Melhor caminho (raster)",en:"",es:""}],"tolerancia":[{pt:"Tolerância de busca (em pixels)",en:"",es:""}],"naoInstalado":[{pt:"Ferramenta não disponível nessa instalação do i3Geo",en:"",es:""}],"variaEscala":[{pt:"Dependência da escala",en:"",es:""}],"mostraTodosLegenda":[{pt:"todos",en:"",es:""}],"mostraSoLegenda":[{pt:"só legenda",en:"",es:""}],"removerDoMapa":[{pt:"Remove a camada do mapa?",en:"",es:""}],"dicaBuscaRapida":[{pt:"Abre uma janela flutuante com opções de busca de dados em serviços como o Google Maps ou nas camadas exsitentes no mapa",en:"",es:""}],"refresh":[{pt:"Refaz a árvore, reconstruindo os ícones e lista de camadas",en:"",es:""}],"lixeira":[{pt:"Clique para ver a lista de camadas em uma janela flutuante com opção para remover um ou mais camadas do mapa. Arraste uma camada sobre esse ícone para removê-la individualmente",en:"",es:""}],"filtraCam":[{pt:"Permite filtrar a lista de camadas mostradas na árvore conforme propriedades específicas de cada uma",en:"",es:""}],"legenda":[{pt:"Abre a legenda do mapa em uma janela flutuante",en:"",es:""}],"ferramMapa":[{pt:"Mostra a lista de ferramentas que atuam sobre o mapa",en:"",es:""}],"ferramCamadas":[{pt:"Mostra a lista de ferramentas que atuam sobre camadas",en:"",es:""}],"ajudaEditorOlSalva":[{pt:"Para editar os atributos, utilize a ferramenta de identificação. É necessário que exista uma coluna com identificadores únicos na tabela a ser editada e que essa coluna esteja visível na ferramenta de identificação.",en:"",es:""}]}; | ... | ... |
ogc.php
| ... | ... | @@ -760,11 +760,22 @@ if(strtolower($req->getValueByName("REQUEST")) == "getlegendgraphic"){ |
| 760 | 760 | $l->set("minscaledenom",0); |
| 761 | 761 | $l->set("maxscaledenom",0); |
| 762 | 762 | if($req->getValueByName("FORMAT") == "text/html"){ |
| 763 | - $req->setParameter("FORMAT","image/png"); | |
| 763 | + //$req->setParameter("FORMAT","image/png"); | |
| 764 | 764 | $l = $oMap->getlayerbyname($req->getValueByName("LAYER")); |
| 765 | - $l->set("status",MS_DEFAULT); | |
| 765 | + $l->set("status",MS_DEFAULT); | |
| 766 | + //remove offset de simbolos pontuais | |
| 767 | + $nclass = $l->numclasses; | |
| 768 | + for($cc = 0; $cc < $nclass; $cc++){ | |
| 769 | + $classe = $l->getclass($cc); | |
| 770 | + if($classe->numstyles > 0){ | |
| 771 | + $estilo = $classe->getstyle(0); | |
| 772 | + if($estilo->symbolname != "" && file_exists($estilo->symbolname)){ | |
| 773 | + $estilo->set("offsetx",0); | |
| 774 | + $estilo->set("offsety",0); | |
| 775 | + } | |
| 776 | + } | |
| 777 | + } | |
| 766 | 778 | $legenda->set("template",$locaplic."/aplicmap/legendaOgc.html"); |
| 767 | - | |
| 768 | 779 | $tmparray["my_tag"] = "value_of_my_tag"; |
| 769 | 780 | if($leg = @$oMap->processlegendtemplate($tmparray)){ |
| 770 | 781 | if (function_exists("mb_convert_encoding")){ | ... | ... |
temas/_lbiomashp.map
| ... | ... | @@ -5,29 +5,17 @@ MAP |
| 5 | 5 | CONNECTION "" |
| 6 | 6 | DATA "/var/www/i3geo/aplicmap/dados/biomas.shp" |
| 7 | 7 | METADATA |
| 8 | - "METAESTAT_ID_MEDIDA_VARIAVEL" "" | |
| 9 | 8 | "TIP" "CD_LEGENDA" |
| 10 | 9 | #"cache" "sim" |
| 11 | 10 | "CLASSE" "SIM" |
| 12 | - "olopacity" "" | |
| 13 | 11 | "permitekmz" "nao" |
| 14 | - "gmopacity" "" | |
| 15 | - "gmstatus" "" | |
| 16 | 12 | "ITENSDESC" "Teste de acentuação" |
| 17 | - "METAESTAT_CODIGO_TIPO_REGIAO" "" | |
| 18 | - "arquivotemaoriginal" "" | |
| 19 | - "nomeoriginal" "" | |
| 20 | - "olstatus" "" | |
| 21 | 13 | "permitedownload" "sim" |
| 22 | - "metaestat" "" | |
| 23 | 14 | "download" "SIM" |
| 24 | 15 | "itembuscarapida" "CD_LEGENDA" |
| 25 | 16 | "ITENS" "CD_LEGENDA" |
| 26 | - "arquivodownload" "" | |
| 27 | - "arquivokmz" "" | |
| 28 | 17 | "permiteogc" "sim" |
| 29 | 18 | "permitekml" "sim" |
| 30 | - "convcaracter" "" | |
| 31 | 19 | "TEMA" "Biomas shapefile (acentuação)" |
| 32 | 20 | "ESCALA" "1000000" |
| 33 | 21 | #"TILES" "NAO" |
| ... | ... | @@ -97,6 +85,4 @@ MAP |
| 97 | 85 | TITLE "" |
| 98 | 86 | END # CLASS |
| 99 | 87 | END # LAYER |
| 100 | - | |
| 101 | 88 | END # MAP |
| 102 | - | ... | ... |
temas/_llocali.map
| 1 | -MAP | |
| 2 | - FONTSET "../symbols/fontes.txt" | |
| 3 | - SYMBOLSET "../symbols/simbolosv6.sym" | |
| 4 | - LAYER | |
| 5 | - CONNECTION "" | |
| 6 | - DATA "/var/www/i3geo/aplicmap/dados/locali.shp" | |
| 7 | - METADATA | |
| 8 | - "METAESTAT_ID_MEDIDA_VARIAVEL" "" | |
| 9 | - "TIP" "TIPO,NOMELOC,ANOCRIA" | |
| 10 | - "LTEMPOITEMIMAGEM" "" | |
| 11 | - #"cache" "SIM" | |
| 12 | - "CLASSE" "SIM" | |
| 13 | - "LTEMPOITEMDESCRICAO" "TIPO" | |
| 14 | - "olopacity" "" | |
| 15 | - "LTEMPOITEMINICIO" "ANOCRIA" | |
| 16 | - "palletestep" "" | |
| 17 | - "permitekmz" "sim" | |
| 18 | - "LTEMPOITEMTIP" "ANOCRIA" | |
| 19 | - "temporizador" "" | |
| 20 | - "gmopacity" "" | |
| 21 | - "gmstatus" "" | |
| 22 | - "ITENSDESC" "Município,TIPO,Localidade,ANOCRIA" | |
| 23 | - "iconetema" "" | |
| 24 | - "LTEMPOITEMTITULO" "NOMELOC" | |
| 25 | - "description_template" "" | |
| 26 | - "ITENSLINK" ",,," | |
| 27 | - "LTEMPOITEMLINK" "" | |
| 28 | - "TILES" "NAO" | |
| 29 | - "METAESTAT_CODIGO_TIPO_REGIAO" "" | |
| 30 | - "arquivotemaoriginal" "" | |
| 31 | - "palletefile" "" | |
| 32 | - "nomeoriginal" "" | |
| 33 | - "olstatus" "" | |
| 34 | - "permitedownload" "sim" | |
| 35 | - "LTEMPOFORMATODATA" "iso8601" | |
| 36 | - "FILTROORIGINAL" "" | |
| 37 | - "permitecomentario" "SIM" | |
| 38 | - "LTEMPOITEMICONE" "" | |
| 39 | - "DATAORIGINAL" "" | |
| 40 | - "PLUGINI3GEO" "" | |
| 41 | - "metaestat" "" | |
| 42 | - "download" "SIM" | |
| 43 | - "itembuscarapida" "NOMELOC" | |
| 44 | - "ITENS" "NOMEMUN,TIPO,NOMELOC,ANOCRIA" | |
| 45 | - "arquivodownload" "" | |
| 46 | - "arquivokmz" "" | |
| 47 | - "permitekml" "sim" | |
| 48 | - "permiteogc" "sim" | |
| 49 | - "transitioneffect" "NAO" | |
| 50 | - "TEMA" "Localidades (usar com timeline) para teste" | |
| 51 | - "convcaracter" "" | |
| 52 | - #"cortepixels" "30" | |
| 53 | - "editorsql" "" | |
| 54 | - "LTEMPOCONVENCODE" "SIM" | |
| 55 | - "LTEMPOITEMFIM" "" | |
| 56 | - "legendaimg" "" | |
| 57 | - END # METADATA | |
| 58 | - NAME "_llocali" | |
| 59 | - PROCESSING "LABEL_NO_CLIP=True" | |
| 60 | - PROCESSING "POLYLINE_NO_CLIP=True" | |
| 61 | - PROCESSING "LABEL_NO_CLIP=True" | |
| 62 | - PROCESSING "POLYLINE_NO_CLIP=True" | |
| 63 | - PROCESSING "LABEL_NO_CLIP=True" | |
| 64 | - PROCESSING "POLYLINE_NO_CLIP=True" | |
| 65 | - STATUS DEFAULT | |
| 66 | - TEMPLATE "none.htm" | |
| 67 | - TYPE POINT | |
| 68 | - UNITS METERS | |
| 69 | - CLASS | |
| 70 | - NAME "Vila" | |
| 71 | - EXPRESSION ('[TIPO]'eq'Vila') | |
| 72 | - STYLE | |
| 73 | - COLOR 250 193 4 | |
| 74 | - SIZE 20 | |
| 75 | - SYMBOL "/var/www/i3geo/imagens/google/condominium.png" | |
| 76 | - END # STYLE | |
| 77 | - TITLE "" | |
| 78 | - END # CLASS | |
| 79 | - CLASS | |
| 80 | - NAME "Cidade" | |
| 81 | - EXPRESSION ('[TIPO]'eq'Cidade') | |
| 82 | - STYLE | |
| 83 | - COLOR 62 9 41 | |
| 84 | - OFFSET 0 -10 | |
| 85 | - SIZE 20 | |
| 86 | - SYMBOL "/var/www/i3geo/imagens/google/condominium1.png" | |
| 87 | - END # STYLE | |
| 88 | - TITLE "" | |
| 89 | - END # CLASS | |
| 90 | - CLASS | |
| 91 | - NAME "Capital" | |
| 92 | - EXPRESSION ('[TIPO]'eq'Capital') | |
| 93 | - STYLE | |
| 94 | - COLOR 112 203 244 | |
| 95 | - SIZE 9 | |
| 96 | - SYMBOL "vila" | |
| 97 | - END # STYLE | |
| 98 | - TITLE "" | |
| 99 | - END # CLASS | |
| 100 | - END # LAYER | |
| 101 | - | |
| 102 | -END # MAP | |
| 103 | - | |
| 1 | +MAP | |
| 2 | + FONTSET "../symbols/fontes.txt" | |
| 3 | + SYMBOLSET "../symbols/simbolosv6.sym" | |
| 4 | + LAYER | |
| 5 | + CONNECTION "" | |
| 6 | + DATA "/var/www/i3geo/aplicmap/dados/locali.shp" | |
| 7 | + METADATA | |
| 8 | + "TIP" "TIPO,NOMELOC,ANOCRIA" | |
| 9 | + #"cache" "SIM" | |
| 10 | + "CLASSE" "SIM" | |
| 11 | + "LTEMPOITEMDESCRICAO" "TIPO" | |
| 12 | + "LTEMPOITEMINICIO" "ANOCRIA" | |
| 13 | + "permitekmz" "sim" | |
| 14 | + "LTEMPOITEMTIP" "ANOCRIA" | |
| 15 | + "ITENSDESC" "Município,TIPO,Localidade,ANOCRIA" | |
| 16 | + "LTEMPOITEMTITULO" "NOMELOC" | |
| 17 | + "ITENSLINK" ",,," | |
| 18 | + "TILES" "SIM" | |
| 19 | + "permitedownload" "sim" | |
| 20 | + "LTEMPOFORMATODATA" "iso8601" | |
| 21 | + "permitecomentario" "SIM" | |
| 22 | + "download" "SIM" | |
| 23 | + "itembuscarapida" "NOMELOC" | |
| 24 | + "ITENS" "NOMEMUN,TIPO,NOMELOC,ANOCRIA" | |
| 25 | + "permitekml" "sim" | |
| 26 | + "permiteogc" "sim" | |
| 27 | + "transitioneffect" "NAO" | |
| 28 | + "TEMA" "Localidades (usar com timeline) para teste" | |
| 29 | + #"cortepixels" "30" | |
| 30 | + "LTEMPOCONVENCODE" "SIM" | |
| 31 | + END # METADATA | |
| 32 | + NAME "_llocali" | |
| 33 | + PROCESSING "LABEL_NO_CLIP=True" | |
| 34 | + PROCESSING "POLYLINE_NO_CLIP=True" | |
| 35 | + STATUS DEFAULT | |
| 36 | + TEMPLATE "none.htm" | |
| 37 | + TYPE POINT | |
| 38 | + UNITS METERS | |
| 39 | + CLASS | |
| 40 | + NAME "Vila" | |
| 41 | + EXPRESSION ('[TIPO]'eq'Vila') | |
| 42 | + STYLE | |
| 43 | + COLOR 250 193 4 | |
| 44 | + SIZE 20 | |
| 45 | + SYMBOL "/var/www/i3geo/imagens/google/condominium.png" | |
| 46 | + END # STYLE | |
| 47 | + TITLE "" | |
| 48 | + END # CLASS | |
| 49 | + CLASS | |
| 50 | + NAME "Cidade" | |
| 51 | + EXPRESSION ('[TIPO]'eq'Cidade') | |
| 52 | + STYLE | |
| 53 | + COLOR 62 9 41 | |
| 54 | + OFFSET 0 -10 | |
| 55 | + SIZE 20 | |
| 56 | + SYMBOL "/var/www/i3geo/imagens/google/condominium1.png" | |
| 57 | + END # STYLE | |
| 58 | + TITLE "" | |
| 59 | + END # CLASS | |
| 60 | + CLASS | |
| 61 | + NAME "Capital" | |
| 62 | + EXPRESSION ('[TIPO]'eq'Capital') | |
| 63 | + STYLE | |
| 64 | + COLOR 112 203 244 | |
| 65 | + SIZE 9 | |
| 66 | + SYMBOL "vila" | |
| 67 | + END # STYLE | |
| 68 | + TITLE "" | |
| 69 | + END # CLASS | |
| 70 | + END # LAYER | |
| 71 | +END # MAP | ... | ... |