Commit 5773955fc5bdea532c0486c5fd70c94d4793b214
1 parent
38806e1e
Exists in
master
Atualização do código
Showing
52 changed files
with
347 additions
and
239 deletions
Show diff stats
ferramentas/animagif/exec.php
... | ... | @@ -15,7 +15,7 @@ if(empty($_GET)){ |
15 | 15 | &legenda = sim|nao<br> |
16 | 16 | &transparente = sim|nao<br> |
17 | 17 | &operador = operador que será utilizado no filtro. Por default utilza-se 'igual a'. Pode ser ainda lt (menor que) ou gt (maior que)<br> |
18 | - &nulos = lista de valores, separados por ',' que não serão considerados ao aplicar o filtro, por exemplo &nulos=-, ,0<br> | |
18 | + &nulos = lista de valores, separados por ',' que não serão considerados ao aplicar o filtro, por exemplo &nulos=-, ,0<br> | |
19 | 19 | &tipocolunat = string|numero tipo de dados existentes na coluna que contém os valores para o filtro<br> |
20 | 20 | O tema pode ter parâmetros já armazenados no METADATA animagif, criado pelo formulário do i3Geo. |
21 | 21 | Para forçar o uso desses parâmetros, basta passar &colunat como vazio. |
... | ... | @@ -28,6 +28,8 @@ if(empty($_GET)){ |
28 | 28 | include("../../ms_configura.php"); |
29 | 29 | include("../../classesphp/funcoes_gerais.php"); |
30 | 30 | include("../../classesphp/carrega_ext.php"); |
31 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
32 | +$_GET = array_merge($_GET,$_POST); | |
31 | 33 | // |
32 | 34 | //verifica se existem parametros definidos no proprio mapfile |
33 | 35 | // |
... | ... | @@ -50,8 +52,19 @@ if(empty($_GET["colunat"])){ |
50 | 52 | $_GET["nulos"] = $animagif["nulos"]; |
51 | 53 | $_GET["tipocolunat"] = $animagif["tipocolunat"]; |
52 | 54 | } |
53 | - | |
54 | -include("../../classesphp/pega_variaveis.php"); | |
55 | +//podem vir da url tbm | |
56 | +$tema = $_GET["tema"]; | |
57 | +$colunat = $_GET["colunat"]; | |
58 | +$tempo = $_GET["tempo"]; | |
59 | +$w = $_GET["w"]; | |
60 | +$h = $_GET["h"]; | |
61 | +$cache = $_GET["cache"]; | |
62 | +$mapext = $_GET["mapext"]; | |
63 | +$legenda = $_GET["legenda"]; | |
64 | +$transparente = $_GET["transparente"]; | |
65 | +$operador = $_GET["operador"]; | |
66 | +$nulos = $_GET["nulos"]; | |
67 | +$tipocolunat = $_GET["tipocolunat"]; | |
55 | 68 | |
56 | 69 | $v = versao(); |
57 | 70 | $vi = $v["inteiro"]; |
... | ... | @@ -62,6 +75,7 @@ if($cache == "nao"){ |
62 | 75 | } else { |
63 | 76 | $nometemp = md5(implode("",$_GET)); |
64 | 77 | } |
78 | +$nometemp = "animagif".$nometemp; | |
65 | 79 | if(empty($tempo)){ |
66 | 80 | $tempo = 40; |
67 | 81 | } |
... | ... | @@ -83,11 +97,13 @@ if(empty($operador)){ |
83 | 97 | else{ |
84 | 98 | if($operador == "lt"){ |
85 | 99 | $operador = "<"; |
86 | - } | |
87 | - if($operador == "gt"){ | |
100 | + } elseif ($operador == "gt"){ | |
88 | 101 | $operador = ">"; |
89 | 102 | } |
90 | 103 | } |
104 | +if(!in_array($operador,array("=","<",">"))){ | |
105 | + exit; | |
106 | +} | |
91 | 107 | |
92 | 108 | $nulos = explode(",",$nulos); |
93 | 109 | $arqtemp = $dir_tmp."/".$nometemp; |
... | ... | @@ -115,6 +131,7 @@ $versao = versao(); |
115 | 131 | $versao = $versao["principal"]; |
116 | 132 | |
117 | 133 | //cria um mapa temporario |
134 | +//base vem de ms_configura | |
118 | 135 | if($base == "" or !isset($base)){ |
119 | 136 | $base = ""; |
120 | 137 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ |
... | ... | @@ -202,7 +219,6 @@ for ($i=0;$i < $numlayers;$i++){ |
202 | 219 | } |
203 | 220 | |
204 | 221 | $mapa->save($arqtemp.".map"); |
205 | - | |
206 | 222 | //aplica a extensao geografica |
207 | 223 | $layer = $mapa->getlayerbyname($tema); |
208 | 224 | |
... | ... | @@ -257,6 +273,7 @@ if($transparente == "sim"){ |
257 | 273 | |
258 | 274 | $mapa->save($arqtemp.".map"); |
259 | 275 | $mapa = ms_newMapObj($arqtemp.".map"); |
276 | +restauraCon($arqtemp.".map",$postgis_mapa); | |
260 | 277 | |
261 | 278 | /* |
262 | 279 | if(validaAcessoTemas($arqtemp.".map",false) == true){ | ... | ... |
ferramentas/aplicarsld/upload.php
1 | 1 | <?php |
2 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
2 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
3 | 3 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
4 | 4 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
5 | 5 | error_reporting(0); |
6 | +$_GET = array_merge($_GET,$_POST); | |
6 | 7 | session_name("i3GeoPHP"); |
7 | -if (isset($g_sid)) | |
8 | -{session_id($g_sid);} | |
8 | +if (isset($_GET["g_sid"])) | |
9 | +{session_id($_GET["g_sid"]);} | |
9 | 10 | session_start(); |
10 | 11 | $map_file = $_SESSION["map_file"]; |
11 | 12 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
12 | 13 | require_once (dirname(__FILE__)."/../../ms_configura.php"); |
14 | +$tema = $_GET["tema"]; | |
13 | 15 | ?> |
14 | 16 | <html> |
15 | 17 | <head> |
... | ... | @@ -42,7 +44,7 @@ if (isset($_FILES['i3GEOaplicarsld']['name'])) |
42 | 44 | { |
43 | 45 | echo "<p class='paragrafo' >Arquivo enviado. Aplicando SLD...$tema</p>"; |
44 | 46 | $layer = $mapa->getlayerbyname($tema); |
45 | - $arq = $dirmap."/".$_FILES['i3GEOaplicarsld']['name']; | |
47 | + $arq = $dirmap."/".$ArquivoDest; | |
46 | 48 | $abre = fopen($arq, "r"); |
47 | 49 | $buffer = fread($abre, filesize($arq)); |
48 | 50 | fclose($abre); | ... | ... |
ferramentas/atalhoscamada/index.js
... | ... | @@ -26,6 +26,7 @@ i3GEOF.atalhoscamada = |
26 | 26 | dicionario["etiquetas"] = $trad("t27"); |
27 | 27 | dicionario["filtro"] = $trad("t29"); |
28 | 28 | dicionario["tabela"] = $trad("t31"); |
29 | + dicionario["selecao"] = $trad("x51"); | |
29 | 30 | dicionario["grafico"] = $trad("t37"); |
30 | 31 | dicionario["editaLegenda"] = $trad("t33"); |
31 | 32 | dicionario["destaca"] = $trad("t35"); |
... | ... | @@ -196,6 +197,16 @@ i3GEOF.atalhoscamada = |
196 | 197 | }); |
197 | 198 | b.addClass("abrir"); |
198 | 199 | } |
200 | + if (funcoes.selecao === true) { | |
201 | + b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaSelecao", { | |
202 | + onclick : { | |
203 | + fn : function() { | |
204 | + i3GEO.mapa.dialogo.selecao(); | |
205 | + } | |
206 | + } | |
207 | + }); | |
208 | + b.addClass("abrir"); | |
209 | + } | |
199 | 210 | if (funcoes.grafico === true) { |
200 | 211 | b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaGrafico", { |
201 | 212 | onclick : { | ... | ... |
ferramentas/atalhoscamada/template_mst.html
... | ... | @@ -48,6 +48,9 @@ |
48 | 48 | <input id='{{{idjanela}}}i3GEOFatalhoscamadaTabela' type='button' value='{{{tabela}}}' style='display:none;'/> |
49 | 49 | </p> |
50 | 50 | <p class='paragrafo'> |
51 | + <input id='{{{idjanela}}}i3GEOFatalhoscamadaSelecao' type='button' value='{{{selecao}}}' style='display:none;'/> | |
52 | + </p> | |
53 | + <p class='paragrafo'> | |
51 | 54 | <input id='{{{idjanela}}}i3GEOFatalhoscamadaGrafico' type='button' value='{{{grafico}}}' style='display:none;'/> |
52 | 55 | </p> |
53 | 56 | <p class='paragrafo'> |
... | ... | @@ -67,7 +70,7 @@ |
67 | 70 | </p> |
68 | 71 | <p class='paragrafo'> |
69 | 72 | <input id='{{{idjanela}}}i3GEOFatalhoscamadaStoryMap' type='button' value='StoryMap' style='display:none;'/> |
70 | - </p> | |
73 | + </p> | |
71 | 74 | <hr> |
72 | 75 | <p>Login:</p> |
73 | 76 | <br> | ... | ... |
ferramentas/atalhosmapa/index.js
... | ... | @@ -21,7 +21,7 @@ i3GEOF.atalhosmapa = |
21 | 21 | m = i3GEO.configura.oMenuDataOriginal.submenus.ferramentas; |
22 | 22 | n = m.length; |
23 | 23 | for(i=0;i<n;i++){ |
24 | - if(m[i].submenu.id === "mapa"){ | |
24 | + if(m[i] && m[i].submenu && m[i].submenu.id === "mapa"){ | |
25 | 25 | t = m[i].submenu.itemdata[0]; |
26 | 26 | } |
27 | 27 | } | ... | ... |
ferramentas/baseguias/index.htm
... | ... | @@ -8,7 +8,7 @@ div |
8 | 8 | {text-align:left;border: 0px solid #FFFFFF;font-family: Verdana, Arial, Helvetica, sans-serif;position:relative;display:block;font-size:10px;padding:0px;font-weight:normal;left:10px;} |
9 | 9 | #fundo |
10 | 10 | {background-color:rgb(245,245,245);overflow:hidden;position:absolute;top:0px;left:0px;} |
11 | -.guias | |
11 | +.guias | |
12 | 12 | {background-color:rgb(245,245,245);cursor:pointer;position:relative;text-align: left;top:8px;left:8px;padding:0px;margin:0px;} |
13 | 13 | .guia |
14 | 14 | {display:inline;background-color:rgb(230,230,230);color:rgb(150,150,150);position:relative;left:0px;top:0px;border: 0px solid white;font-size: 12px;z-index:1050;padding:0;margin-right:3px;border-left:1px solid rgb(230,230,230);border-top:1px solid rgb(230,230,230);border-right:1px solid rgb(230,230,230);} |
... | ... | @@ -42,7 +42,7 @@ div |
42 | 42 | </div> |
43 | 43 | <div id=guia3obj style="display:none"> |
44 | 44 | <div style="position:relative;top:5px;left:0px;width:90%" > |
45 | - Para que as operações atuem apenas sobre os elementos selecionados, | |
45 | + Para que as operações atuem apenas sobre os elementos selecionados, | |
46 | 46 | ative a seleção no mapa, para isso utilize, na guia "selecionados" |
47 | 47 | a opção "Ativa a seleção" |
48 | 48 | </div> |
... | ... | @@ -58,23 +58,22 @@ div |
58 | 58 | <script type="text/javascript"> |
59 | 59 | //eventos das guias |
60 | 60 | document.getElementById("guia1").onclick = function() |
61 | -{document.getElementById("guia1obj").style.display="block";} | |
61 | +{document.getElementById("guia1obj").style.display="block";}; | |
62 | 62 | document.getElementById("guia2").onclick = function() |
63 | -{document.getElementById("guia2obj").style.display="block";} | |
63 | +{document.getElementById("guia2obj").style.display="block";}; | |
64 | 64 | document.getElementById("guia3").onclick = function() |
65 | -{document.getElementById("guia3obj").style.display="block";} | |
65 | +{document.getElementById("guia3obj").style.display="block";}; | |
66 | 66 | document.getElementById("guia4").onclick = function() |
67 | -{document.getElementById("guia4obj").style.display="block";} | |
67 | +{document.getElementById("guia4obj").style.display="block";}; | |
68 | 68 | navm = false; // IE |
69 | 69 | navn = false; // netscape |
70 | -var app = navigator.appName.substring(0,1); | |
70 | +var i, j, app = navigator.appName.substring(0,1); | |
71 | 71 | if (app=='N') navn=true; else navm=true; |
72 | 72 | //verifica se existem guias |
73 | -reduzAltura = 30 | |
74 | -for (i=0;i<7;i++) | |
75 | -{ | |
73 | +reduzAltura = 30; | |
74 | +for (i=0;i<7;i++){ | |
76 | 75 | if (document.getElementById("guia"+i)) |
77 | - {reduzAltura = 50} | |
76 | + {reduzAltura = 50;} | |
78 | 77 | } |
79 | 78 | h = 500; //altura do corpo geral da guia |
80 | 79 | if (navn) |
... | ... | @@ -111,11 +110,11 @@ for (i=0;i<7;i++) |
111 | 110 | this.style.color="orange"; |
112 | 111 | this.style.backgroundColor="rgb(255,255,255)"; |
113 | 112 | //this.style.textDecoration="underline" |
114 | - } | |
113 | + }; | |
115 | 114 | document.getElementById("guia"+i).onmouseover = function() |
116 | - {this.style.borderTop="2px solid orange";} | |
115 | + {this.style.borderTop="2px solid orange";}; | |
117 | 116 | document.getElementById("guia"+i).onmouseout = function() |
118 | - {this.style.borderTop="1px solid rgb(230,230,230)";} | |
117 | + {this.style.borderTop="1px solid rgb(230,230,230)";}; | |
119 | 118 | } |
120 | 119 | } |
121 | 120 | ... | ... |
ferramentas/busca/index.js
... | ... | @@ -162,7 +162,7 @@ i3GEOF.busca = { |
162 | 162 | {alert($trad('erroTema',i3GEOF.busca.dicionario));} |
163 | 163 | var i = $i("i3GEOF.busca_c").style; |
164 | 164 | i3GEO.janela.ULTIMOZINDEX++; |
165 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | |
165 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; | |
166 | 166 | }, |
167 | 167 | /* |
168 | 168 | Function: montaListaItens | ... | ... |
ferramentas/buscafotos/funcoes.php
1 | 1 | <?php |
2 | 2 | error_reporting(0); |
3 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
3 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
4 | +$_GET = array_merge($_GET,$_POST); | |
4 | 5 | require_once(dirname(__FILE__)."/../../pacotes/cpaint/cpaint2.inc.php"); |
5 | 6 | require_once(dirname(__FILE__)."/../../ms_configura.php"); |
6 | 7 | require_once(dirname(__FILE__)."/../../pacotes/phpflickr/phpFlickr.php"); |
7 | 8 | error_reporting(0); |
9 | + | |
10 | + | |
11 | +$funcao = $_GET["funcao"]; | |
12 | +$key = $_GET["key"]; | |
13 | +$texto = $_GET["texto"]; | |
14 | +$page = $_GET["page"]; | |
15 | +$ret = $_GET["ret"]; | |
16 | +$ai = $_GET["ai"]; | |
17 | +$af = $_GET["af"]; | |
18 | + | |
8 | 19 | $cp = new cpaint(); |
9 | 20 | if($funcao == "listafotosflickr") |
10 | 21 | {$cp->register('listafotosflickr');} | ... | ... |
ferramentas/buscafotos/index.js
... | ... | @@ -214,7 +214,7 @@ i3GEOF.buscaFotos = { |
214 | 214 | {return;} |
215 | 215 | var i = $i("i3GEOF.buscaFotos_c").style; |
216 | 216 | i3GEO.janela.ULTIMOZINDEX++; |
217 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | |
217 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; | |
218 | 218 | }, |
219 | 219 | /* |
220 | 220 | Function: mostraMenu | ... | ... |
ferramentas/buscarapida/gadget.php
ferramentas/carregamapa/upload.php
... | ... | @@ -4,8 +4,9 @@ require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); |
4 | 4 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
5 | 5 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
6 | 6 | session_name("i3GeoPHP"); |
7 | -if (isset($g_sid)) | |
8 | -{session_id($g_sid);} | |
7 | +if (isset($g_sid)){ | |
8 | + session_id($g_sid); | |
9 | +} | |
9 | 10 | session_start(); |
10 | 11 | $map_file = $_SESSION["map_file"]; |
11 | 12 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
... | ... | @@ -71,9 +72,11 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) |
71 | 72 | $layertemp->setmetadata("download","nao"); |
72 | 73 | $layertemp->setmetadata("permitekml","nao"); |
73 | 74 | $layertemp->setmetadata("permiteogc","nao"); |
75 | + $layertemp->setmetadata("animagif",""); | |
74 | 76 | $layertemp->setmetadata("editorsql","nao"); |
75 | 77 | $layertemp->setmetadata("EDITAVEL","nao"); |
76 | 78 | $layertemp->setmetadata("PLUGINI3GEO",""); |
79 | + $layertemp->setmetadata("arquivodownload",""); | |
77 | 80 | if ($testa == 1) |
78 | 81 | { |
79 | 82 | echo "<p class='paragrafo' >Problemas em ".($layer->name).". Removido.</p><br>"; |
... | ... | @@ -81,6 +84,7 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) |
81 | 84 | } |
82 | 85 | } |
83 | 86 | $map->save($map_file); |
87 | + restauraCon($map_file,$postgis_mapa); | |
84 | 88 | $e = $mapt->extent; |
85 | 89 | $extatual = $e->minx." ".$e->miny." ".$e->maxx." ".$e->maxy; |
86 | 90 | echo "<p class='paragrafo' >Ok. redesenhando."; | ... | ... |
ferramentas/cesium/kml3d.php
1 | 1 | <?php |
2 | 2 | include("../../ms_configura.php"); |
3 | -include("../../classesphp/pega_variaveis.php"); | |
3 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
4 | +$_GET = array_merge($_GET,$_POST); | |
4 | 5 | include("../../classesphp/funcoes_gerais.php"); |
6 | +$kmlurl = $_GET ["kmlurl"]; | |
7 | +$legenda = $_GET ["legenda"]; | |
5 | 8 | //define o centro, pegando as coordenadas do mapa de inicializacao |
6 | 9 | $versao = versao(); |
7 | 10 | $versao = $versao["principal"]; |
8 | 11 | $centroX = -55; |
9 | 12 | $centroY = -13; |
10 | 13 | $extensao = "-180,-90,180,90"; |
11 | -if(!isset($mapext)){ | |
14 | +if(!isset($_GET["mapext"])){ | |
12 | 15 | if(isset($base) && $base != ""){ |
13 | 16 | if(file_exists($base)){ |
14 | 17 | $f = $base; |
... | ... | @@ -49,10 +52,10 @@ if(!isset($mapext)){ |
49 | 52 | } |
50 | 53 | } |
51 | 54 | else{ |
52 | - $c = explode(" ",$mapext); | |
55 | + $c = explode(" ",$_GET["mapext"]); | |
53 | 56 | $centroX = $c[2] - ($c[2] - $c[0]) / 2; |
54 | 57 | $centroY = $c[3] - ($c[3] - $c[1]) / 2; |
55 | - $extensao = $c[0].",".$c[1].",".$c[2].",".$c[3]; | |
58 | + $extensao = $c[0].",".$c[1].",".$c[2].",".$c[3]; | |
56 | 59 | } |
57 | 60 | ?> |
58 | 61 | <!DOCTYPE html> |
... | ... | @@ -127,13 +130,7 @@ body { |
127 | 130 | if('<?php echo $kmlurl;?>' != ''){ |
128 | 131 | viewer.dataSources.add(Cesium.KmlDataSource.load('<?php echo strip_tags($kmlurl);?>')) |
129 | 132 | } |
130 | - /* | |
131 | - var center = Cesium.Cartesian3.fromDegrees(<?php echo $centroX.",".$centroY;?>); | |
132 | - var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center); | |
133 | - var camera = viewer.camera; | |
134 | - camera.constrainedAxis = Cesium.Cartesian3.UNIT_Z; | |
135 | - camera.lookAtTransform(transform, new Cesium.Cartesian3(0,0, 12000000.0)); | |
136 | - */ | |
133 | + | |
137 | 134 | </script> |
138 | 135 | </body> |
139 | 136 | </html> | ... | ... |
ferramentas/colourramp/index.php
1 | 1 | <?php |
2 | - include_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
2 | + include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
3 | + $_GET = array_merge($_GET,$_POST); | |
3 | 4 | include_once(dirname(__FILE__)."/../../classesphp/class.palette.php"); |
4 | 5 | $m = new palette(); |
5 | 6 | $lista = implode(",",($m->listaColourRamps(dirname(__FILE__)."/../.."))); |
6 | 7 | if(!isset($ncores)) |
7 | 8 | {$ncores = 10;} |
8 | - if(empty($locaplic)){ | |
9 | + if(empty($_GET["locaplic"])){ | |
9 | 10 | $locaplic = "../.."; |
10 | 11 | } |
11 | 12 | ?> |
... | ... | @@ -106,7 +107,7 @@ p .boom { |
106 | 107 | </head> |
107 | 108 | <body class=" yui-skin-sam" style="margin:0px;width:253px;" > |
108 | 109 | <p class=paragrafo style="position:relative;left:6px;width:100%;" > |
109 | -Quantas cores você quer gerar? <input id=ncores type=text size=3 value=<?php echo $ncores; ?> /><br> | |
110 | +Quantas cores você quer gerar? <input id=ncores type=text size=3 value=<?php echo $_GET["ncores"]; ?> /><br> | |
110 | 111 | Clique para escolher o modelo de cores |
111 | 112 | </p> |
112 | 113 | <div id="imagens" ></div> |
... | ... | @@ -129,7 +130,7 @@ new YAHOO.widget.Button( |
129 | 130 | {onclick:{fn: function(){aplicarCores();}}} |
130 | 131 | ); |
131 | 132 | $i("voltar-button").style.width = "250px" |
132 | -var lista = "<?php echo $lista;?>"; | |
133 | +var lista = "<?php echo $_GET["lista"];?>"; | |
133 | 134 | lista = lista.split(","); |
134 | 135 | var n = lista.length; |
135 | 136 | var ins = ""; | ... | ... |
ferramentas/conectargeorss/index.htm
... | ... | @@ -91,15 +91,15 @@ function iniciaListaGEORSS(){ |
91 | 91 | } |
92 | 92 | function mostraRetornoRSS(retorno) |
93 | 93 | { |
94 | - aguarde("none") | |
94 | + aguarde("none"); | |
95 | 95 | var reg = /Erro/gi; |
96 | 96 | if (retorno.data.rss.search(reg) != -1) |
97 | 97 | { |
98 | 98 | i3GEO.janela.tempoMsg("OOps! Ocorreu um erro\n"+retorno.data); |
99 | 99 | return; |
100 | 100 | } |
101 | - var canais = retorno.data.canais | |
102 | - var ncanais = canais.length | |
101 | + var canais = retorno.data.canais; | |
102 | + var ncanais = canais.length; | |
103 | 103 | |
104 | 104 | $i("RSS").innerHTML = retorno.data.rss; |
105 | 105 | var i, ins = ""; | ... | ... |
ferramentas/confluence/index.js
... | ... | @@ -158,7 +158,7 @@ i3GEOF.confluence = { |
158 | 158 | ativaFoco: function(){ |
159 | 159 | var i = $i("i3GEOF.confluence_c").style; |
160 | 160 | i3GEO.janela.ULTIMOZINDEX++; |
161 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | |
161 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; | |
162 | 162 | }, |
163 | 163 | /* |
164 | 164 | Function: escondexy | ... | ... |
ferramentas/cores.htm
... | ... | @@ -44,11 +44,11 @@ navn = false; // netscape |
44 | 44 | var app = navigator.appName.substring(0,1); |
45 | 45 | if (app=='N') navn=true; else navm=true; |
46 | 46 | |
47 | -numl = 20 | |
48 | -numc = 20 | |
49 | -nco = 255 | |
47 | +numl = 20; | |
48 | +numc = 20; | |
49 | +nco = 255; | |
50 | 50 | |
51 | -inicia("vermelho") | |
51 | +inicia("vermelho"); | |
52 | 52 | function inicia(esquema) |
53 | 53 | { |
54 | 54 | intnl = Math.ceil(nco / numl); |
... | ... | @@ -56,7 +56,7 @@ function inicia(esquema) |
56 | 56 | r = 0; |
57 | 57 | g = 0; |
58 | 58 | b = 0; |
59 | - ins = "" | |
59 | + ins = ""; | |
60 | 60 | for (linhas = 1; linhas < numl; linhas++) |
61 | 61 | { |
62 | 62 | ins += "<tbody><tr>\n"; |
... | ... | @@ -79,29 +79,29 @@ function inicia(esquema) |
79 | 79 | if (esquema == "ciano"){b = 255; g = linhas; r = 0;} |
80 | 80 | if (esquema == "amarelo"){b = 0; g = linhas; r = 255;} |
81 | 81 | } |
82 | - document.getElementById("cores").innerHTML = "\<table cellpadding='0' cellspacing='0' border='0'\>"+ins+"\<\/table\>" | |
82 | + document.getElementById("cores").innerHTML = "\<table cellpadding='0' cellspacing='0' border='0'\>"+ins+"\<\/table\>"; | |
83 | 83 | } |
84 | 84 | function muda (e) |
85 | 85 | { |
86 | - inicia(e.value) | |
86 | + inicia(e.value); | |
87 | 87 | } |
88 | 88 | function mais() |
89 | 89 | { |
90 | - nco = nco + 20 | |
91 | - inicia(document.getElementById("esq").value) | |
90 | + nco = nco + 20; | |
91 | + inicia(document.getElementById("esq").value); | |
92 | 92 | } |
93 | 93 | function menos() |
94 | 94 | { |
95 | - nco = nco - 20 | |
96 | - inicia(document.getElementById("esq").value) | |
95 | + nco = nco - 20; | |
96 | + inicia(document.getElementById("esq").value); | |
97 | 97 | } |
98 | 98 | function aplicacor(c) |
99 | 99 | { |
100 | - var doc = unescape(((((window.location.href).split("doc="))[1]).split("&"))[0] ) | |
101 | - var doc = (navm) ? window.parent.frames(doc).document : window.parent.document.getElementById(doc).contentDocument | |
100 | + var doc = unescape(((((window.location.href).split("doc="))[1]).split("&"))[0] ); | |
101 | + var doc = (navm) ? window.parent.frames(doc).document : window.parent.document.getElementById(doc).contentDocument; | |
102 | 102 | var elemento = unescape(((((window.location.href).split("elemento="))[1]).split("&"))[0] ); |
103 | - doc.getElementById(elemento).value = c | |
104 | - window.parent.wdocafechaf('wdocac') | |
103 | + doc.getElementById(elemento).value = c; | |
104 | + window.parent.wdocafechaf('wdocac'); | |
105 | 105 | } |
106 | 106 | </script> |
107 | 107 | </body> | ... | ... |
ferramentas/editorol/editorol.js
... | ... | @@ -343,7 +343,7 @@ i3GEO.editorOL = |
343 | 343 | } |
344 | 344 | if (i3GEO.editorOL.fundo != "") { |
345 | 345 | for (i = nfundo - 1; i >= 0; i--) { |
346 | - if (fundo[i] != "") { | |
346 | + if (fundo[i] != "" && i3GEO.editorOL[fundo[i]]) { | |
347 | 347 | alayers.push(i3GEO.editorOL[fundo[i]]); |
348 | 348 | i3GEO.editorOL[fundo[i]].setVisibility(true); |
349 | 349 | } |
... | ... | @@ -705,7 +705,7 @@ i3GEO.editorOL = |
705 | 705 | i3GEO.editorOL.mapa.zoomToExtent(b); |
706 | 706 | }, |
707 | 707 | mostraLegenda : function() { |
708 | - var prop, layer, layers = i3GEO.editorOL.mapa.getLayers(), nlayers = layers.getLength(), ins = "", i, icone = "", url, f = ""; | |
708 | + var prop, layer, layers = i3GEO.editorOL.mapa.getLayers(), nlayers = layers.getLength(), ins = "", i, icone = "", url, f = "", fonte = ""; | |
709 | 709 | for (i = 0; i < nlayers; i++) { |
710 | 710 | layer = layers.item(i); |
711 | 711 | prop = layer.getProperties(); |
... | ... | @@ -750,7 +750,13 @@ i3GEO.editorOL = |
750 | 750 | } |
751 | 751 | } |
752 | 752 | */ |
753 | - ins += icone + prop.name + "<br><div id=legendaL_" + i + " ></div><br>"; | |
753 | + | |
754 | + fonte = ""; | |
755 | + if(prop.link_tema != ""){ | |
756 | + fonte = " <a class='i3GeoLinkFonte' href='" + prop.link_tema + "' target='_blank' >link</a>"; | |
757 | + } | |
758 | + | |
759 | + ins += icone + prop.name + fonte + "<br><div id=legendaL_" + i + " ></div><br>"; | |
754 | 760 | // necessario pq nao e sincrono |
755 | 761 | eval("var f = function(retorno){document.getElementById('legendaL_" + i |
756 | 762 | + "').innerHTML = retorno.responseText;};"); |
... | ... | @@ -760,7 +766,7 @@ i3GEO.editorOL = |
760 | 766 | url : url, |
761 | 767 | callback : f |
762 | 768 | }; |
763 | - OpenLayers.Request.issue(config); | |
769 | + //OpenLayers.Request.issue(config); | |
764 | 770 | } else if (prop.isBaseLayer === false && prop.visible === true) { |
765 | 771 | //caso a legenda seja aberta dentro do i3Geo |
766 | 772 | url = url.replace("LAYERS", "LAYER"); | ... | ... |
ferramentas/editorol/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}}i3GEO.editorOL={simbologia:{opacidade:0.8,texto:"",fillColor:"250,180,15",strokeWidth:5,strokeColor:"250,150,0",pointRadius:4,graphicName:"square",fontSize:"12px",fontColor:"0,0,0",externalGraphic:"",graphicHeight:25,graphicWidth:25},backup:new ol.layer.Vector({source:new ol.source.Vector({features:new ol.Collection(),useSpatialIndex:false,name:"Backup"}),visible:false}),e_oce:new ol.layer.Tile({title:"ESRI Ocean Basemap",visible:false,isBaseLayer:true,name:"oce",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer">ArcGIS</a>'})]})}),e_ims:new ol.layer.Tile({title:"ESRI Imagery World 2D",visible:false,isBaseLayer:true,name:"ims",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer">ArcGIS</a>'})]})}),e_wsm:new ol.layer.Tile({title:"ESRI World Street Map",visible:false,isBaseLayer:true,name:"wsm",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer">ArcGIS</a>'})]})}),ol_mma:new ol.layer.Tile({title:"Base carto MMA",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",params:{'layers':"baseraster",'srs':"EPSG:4326",'format':"image/png"}})}),e_tms:new ol.layer.Tile({title:"OSGEO",visible:false,isBaseLayer:true,name:"tms",source:new ol.source.TileWMS({url:"http://tilecache.osgeo.org/wms-c/Basic.py/",params:{'layers':"basic",'type':"png",'srs':"EPSG:4326",'format':"image/png",'VERSION':'1.1.1'},attributions:[new ol.Attribution({html:'© <a href="http://www.tilecache.org/">2006-2010, TileCache Contributors</a>'})]})}),top_wms:new ol.layer.Tile({title:"Toponímia MMA",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&",params:{'layers':"base",'srs':"EPSG:4326",'format':"image/png"}})}),est_wms:new ol.layer.Tile({title:"Estados do Brasil",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&",params:{'layers':"estadosl",'srs':"EPSG:4326",'format':"image/png"}})}),fundo:"e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce",nomeFuncaoSalvar:"i3GEO.editorOL.salvaGeo()",kml:[],layersIniciais:[],botoes:{'pan':true,'zoombox':true,'zoomtot':true,'zoomin':true,'zoomout':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,'novaaba':false},pontos:[],marca:"../pacotes/openlayers/img/marker-gold.png",controles:[],tiles:true,incluilayergrafico:true,ativalayerswitcher:false,ativarodadomouse:true,legendahtml:false,numzoom:12,minresolution:0.703125,maxext:"",mapext:[-76.5125927,-39.3925675209,-29.5851853,9.49014852081],mapa:"",idsSelecionados:[],featuresBackup:[],resolutions:[],matrixIds:[],inicia:function(){var projectionExtent,size,resolutions,matrixIds,z;if(i3GEO.Interface.openlayers.googleLike===true){projectionExtent=ol.proj.get('EPSG:3857').getExtent()}else{projectionExtent=ol.proj.get('EPSG:4326').getExtent()}size=ol.extent.getWidth(projectionExtent)/256;resolutions=new Array(40);matrixIds=new Array(40);for(z=0;z<40;++z){resolutions[z]=size/Math.pow(2,z);matrixIds[z]=z}i3GEO.editorOL.resolutions=resolutions;i3GEO.editorOL.matrixIds=matrixIds;i3GEO.editorOL.incluilayergrafico=true;i3GEO.Interface.openlayers.parametrosView={projection:"EPSG:4326",resolutions:resolutions,minResolution:i3GEO.editorOL.minresolution,maxResolution:resolutions[i3GEO.editorOL.numzoom]};i3GEO.Interface.openlayers.parametrosMap={target:"i3geoMapa",layers:[],controls:[]};i3GEO.Interface.openlayers.cria();i3GEO.editorOL.mapa=i3geoOL;if(i3GEO.editorOL.controles.length===0){i3GEO.editorOL.controles=[new ol.interaction.DoubleClickZoom(),new ol.interaction.KeyboardPan(),new ol.interaction.KeyboardZoom(),new ol.interaction.MouseWheelZoom(),new ol.interaction.PinchRotate(),new ol.interaction.PinchZoom(),new ol.interaction.DragZoom(),new ol.interaction.DragPan(),new ol.control.Zoom(),new ol.control.ZoomSlider(),new ol.control.ScaleLine()]}var alayers=[],fundo=(i3GEO.editorOL.fundo).split(","),nfundo=fundo.length,ncontroles=i3GEO.editorOL.controles.length,i,n,temp;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;i3GEO.editorOL.botoes.novaaba=false}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.criaBotoes(i3GEO.editorOL.botoes);if(i3GEO.editorOL.ativalayerswitcher===true){i3GEO.editorOL.ativaLayerSwitcher()}if(i3GEO.editorOL.ativarodadomouse===false){i3GEO.editorOL.desativaRodaDoMouse()}if(i3GEO.editorOL.maxext!==""){i3GEO.editorOL.mapa.getView().setProperties({extent:i3GEO.editorOL.maxext})}if(i3GEO.editorOL.mapext!=""){var m=i3GEO.util.extGeo2OSM(i3GEO.editorOL.mapext);i3GEO.editorOL.mapa.zoomToExtent(m)}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 l,layers=i3GEO.editorOL.mapa.getLayers(),nlayers=layers.getLength(),ins=[],i;for(i=0;i<nlayers;i++){l=layers.item(i);if(l.getVisible()===true){ins.push(l)}}return ins},layerPorParametro:function(parametro,valor){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,ins=[],i;for(i=0;i<nlayers;i++){if(layers[i][parametro]||layers[i][parametro.toLowerCase()]){if(layers[i][parametro]===valor||layers[i][parametro.toLowerCase()]===valor){ins.push(layers[i])}}else{if(layers[i].params&&layers[i].params[parametro]&&layers[i].params[parametro]===valor){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 >"+$trad("a7")+":<br>"+combo;ins+="<br>"+$trad("x64")+":<br><span id=i3GEOOLcomboitens ></span>";ins+="<br>"+$trad("t23")+":<br><input type=text size=20 id=i3GEOOLpalavraBusca >";ins+="<br><br><input type=button value='"+$trad("t23")+"' id='i3GEOOLbotaoBusca' ></div>";ins+="<br>'"+$trad("result")+"':<br><span id=i3GEOOLcomboresultado ></span>";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")}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",combo="<select id=i3GEOOLlistaTemasAtivos style=width:235px; >";for(i=0;i<nlayers;i++){nometema=layers[i].getProperties().title;combo+="<option value='"+layers[i].getProperties().name+"' >"+nometema+"</option>"}combo+="</select>";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo)},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($trad("tativo"))}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(){i3GEO.editorOL.marcaBotao();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 prop,layer,layers=i3GEO.editorOL.mapa.getLayers(),nlayers=layers.getLength(),ins="",i,icone="",url,f="";for(i=0;i<nlayers;i++){layer=layers.item(i);prop=layer.getProperties();if(prop.source.getUrls){url=prop.source.getUrls()[0];url=url.replace("&cache=sim","&DESLIGACACHE=sim");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");url+="&REQUEST=getlegendgraphic&service=wms&version=1.0.0";if(i3GEO.Interface.openlayers.googleLike===true){url+="&SRS=EPSG:3857"}icone="";if(i3GEO.editorOL.legendahtml===true){url=url.replace("image%2Fpng","text/html")+"&FORMAT=text/html&SERVICE=WMS";ins+=icone+prop.name+"<br><div id=legendaL_"+i+" ></div><br>";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");url=url.replace("LAYERS","LAYER");var config={method:"GET",url:url,callback:f};OpenLayers.Request.issue(config)}else if(prop.isBaseLayer===false&&prop.visible===true){url=url.replace("LAYERS","LAYER");url+="&FORMAT=image/png";ins+=prop.title+"<br><img src='"+url+"' /><br>"}}}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($trad("p3"));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(x,y,tema,idunico){var d=0.001,layer=i3geoOL.getLayersByName(tema)[0],xy=[x,y],u=layer.getSource().getUrls()[0],poligono,retorno;u+="&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename=undefined";if(i3GEO.Interface.openlayers.googleLike===true){u+="&SRS=EPSG:3857"}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;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>";retorno=function(r){var fs,c,format,f,n,i;format=new ol.format.WKT();fs=format.readFeatures(r[0]);n=fs.length;c=i3GEO.desenho.layergrafico.getSource();for(i=0;i<n;i++){f=fs[i];f.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'})}));f.setId(i3GEO.util.uid());f.setProperties({idUnico:idunico});c.addFeature(f)}};u=i3GEO.configura.locaplic+"/classesphp/proxy.php?"+u+"&tipoRetornoProxy=gml2wkt";cpJSON.call(u,"foo",retorno,"")},salvaGeometrias:function(){var n=i3GEO.editorOL.idsSelecionados.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($trad("u6"));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 >"+n+" "+$trad("geosel")+"</p>";ins+="<p class=paragrafo ><a href='#' onclick='i3GEO.editorOL.listaGeometriasSel()' >"+$trad("listar")+"</a> ";if(i3GEO.editorOL.nomeFuncaoSalvar&&i3GEO.editorOL.nomeFuncaoSalvar!=""){ins+="<a href='#' onclick='"+i3GEO.editorOL.nomeFuncaoSalvar+"' >"+$trad("sdados")+"</a> "}if(typeof i3geoOL!=="undefined"){ins+="<a href='#' onclick='i3GEO.editorOL.incorporar()' >"+$trad("incorpo")+"</a></p>";ins+="<p class=paragrafo>"+$trad("ajudaEditorOlSalva")+"</p>"}YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{i3GEO.janela.tempoMsg($trad("selum"))}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var n=i3GEO.editorOL.idsSelecionados.length,ins="",s=i3GEO.desenho.layergrafico.getSource(),i,w,g;for(i=0;i<n;i++){g=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);ins+="<b>"+$trad("u6")+": #"+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.getGeometry().getCoordinates())+"<br><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 s=i3GEO.desenho.layergrafico.getSource(),n=i3GEO.editorOL.idsSelecionados.length,funcaoOK=function(){var f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[0]),g=f.getGeometry(),tema=$i("editorOLcomboTemaEditavel").value,redesenha,p,format;g=i3GEO.editorOL.google2wgs(g);format=new ol.format.WKT();f.setGeometry(g);if(tema==""){return}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.editorOL.removeFeaturesSel();i3GEO.Interface.atualizaTema("",tema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto",$trad("adic")+"...");i3GEO.janela.AGUARDEMODAL=false;if(!f.getProperties().idUnico||f.getProperties().idUnico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+tema+"&wkt="+format.writeFeatures([f]))}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+f.getProperties().idUnico+"&tema="+tema+"&wkt="+format.writeFeatures([f]))}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto=$trad("stema")+":<br><div id=editorOLondeComboTemaEditavel ></div><p class=paragrafo >"+$trad("salvaDadosEditor")+"</p><br><br>";if(n!=1){i3GEO.janela.tempoMsg($trad("seluma"))}else{i3GEO.janela.confirma(texto,300,$trad("salva"),$trad("canc"),funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel")}},marcaBotao:function(classeBotao){var i,n,botoes=$i("i3GEObarraEdicao").getElementsByTagName("div");n=botoes.length;for(i=0;i<n;i++){botoes[i].className=botoes[i].className.replace("ItemActive","ItemInactive");if(classeBotao){botoes[i].className=botoes[i].className.replace(classeBotao+"ItemInactive",classeBotao+"ItemActive")}}i3GEO.editorOL.removeInteracoes()},interacoes:[],removeInteracoes:function(){var i,n;n=i3GEO.editorOL.interacoes.length;for(i=0;i<n;i++){i3geoOL.removeInteraction(i3GEO.editorOL.interacoes[i])}i3GEO.editorOL.interacoes=[]},botaoProcura:function(){var temp=document.createElement("div");temp.className="editorOLprocuraItemInactive olButton";temp.title=$trad("t23");temp.onclick=function(){i3GEO.editorOL.criaJanelaBusca();YAHOO.procura.container.panel.show()};return temp},botaoPan:function(){var temp=document.createElement("div");temp.className="editorOLpanItemInactive olButton";temp.title="pan";temp.onclick=function(){i3GEO.editorOL.marcaBotao("editorOLpan")};return temp},botaoZoomBox:function(){var temp=document.createElement("div");temp.className="editorOLzoomboxItemInactive olButton";temp.title="zoombox";temp.onclick=function(){i3GEO.barraDeBotoes.defBotao("zoomli").funcaoonclick()};return temp},botaoZoomTot:function(){var temp=document.createElement("div");temp.className="editorOLzoomtotItemInactive olButton";temp.title=$trad("d2t");temp.onclick=function(){if(i3GEO.editorOL.mapext&&i3GEO.editorOL.mapext!=""){i3GEO.Interface.openlayers.zoom2ext(i3GEO.editorOL.mapext.join(" "))}else{i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.extentTotal)}};return temp},botaoZoomIn:function(){var temp=document.createElement("div");temp.className="editorOLzoominItemInactive olButton";temp.title=$trad("d5t");temp.onclick=function(){var v=i3GEO.editorOL.mapa.getView();v.setZoom(v.getZoom()+1)};return temp},botaoZoomOut:function(){var temp=document.createElement("div");temp.className="editorOLzoomoutItemInactive olButton";temp.title=$trad("d5t");temp.onclick=function(){var v=i3GEO.editorOL.mapa.getView();v.setZoom(v.getZoom()-1)};return temp},botaoLegenda:function(){var temp=document.createElement("div");temp.className="editorOLlegendaItemInactive olButton";temp.title=$trad("p3");temp.onclick=function(){i3GEO.editorOL.mostraLegenda()};return temp},botaoDistancia:function(){var temp=document.createElement("div");temp.className="editorOLdistanciaItemInactive olButton";temp.onclick=function(){i3GEO.editorOL.marcaBotao("editorOLdistancia");i3GEO.barraDeBotoes.defBotao("mede").funcaoonclick()};return temp},botaoArea:function(){var temp=document.createElement("div");temp.className="editorOLareaItemInactive olButton";temp.onclick=function(){i3GEO.editorOL.marcaBotao("editorOLarea");i3GEO.barraDeBotoes.defBotao("area").funcaoonclick()};return temp},botaoLinha:function(){var temp=document.createElement("div");temp.className="editorOLlinhaItemInactive olButton";temp.title=$trad("dlinha");temp.onclick=function(){i3GEO.eventos.cliquePerm.desativa();i3GEO.editorOL.marcaBotao("editorOLlinha");var draw=new ol.interaction.Draw({type:"LineString"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){evt.feature.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'})}));evt.feature.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature);draw.setActive(false);draw.setActive(true);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}});i3geoOL.addInteraction(draw)};return temp},botaoPonto:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLpontoItemInactive olButton";temp.title=$trad("dponto");temp.onclick=function(){i3GEO.eventos.cliquePerm.desativa();i3GEO.editorOL.marcaBotao("editorOLponto");var draw=new ol.interaction.Draw({type:"Point"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){var simbolo,url;url=i3GEO.editorOL.simbologia.externalGraphic;if(url===""){simbolo=new ol.style.Circle({radius:i3GEO.editorOL.simbologia.pointRadius,fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'}),stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.pointRadius/3})})}else{simbolo=new ol.style.Icon({src:url,size:[i3GEO.editorOL.simbologia.graphicWidth,i3GEO.editorOL.simbologia.graphicHeight]})}evt.feature.setStyle(new ol.style.Style({image:simbolo}));evt.feature.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature);draw.setActive(false);draw.setActive(true);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}});i3geoOL.addInteraction(draw)};return temp},botaoPoligono:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLpoligonoItemInactive olButton";temp.title=$trad("dpol");temp.onclick=function(){i3GEO.editorOL.marcaBotao("editorOLpoligono");var draw=new ol.interaction.Draw({type:"Polygon"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){evt.feature.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'})}));evt.feature.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature);draw.setActive(false);draw.setActive(true);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}});i3geoOL.addInteraction(draw)};return temp},botaoTexto:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLtextoItemInactive olButton";temp.title=$trad("dtexto");temp.onclick=function(){i3GEO.eventos.cliquePerm.desativa();i3GEO.editorOL.marcaBotao("editorOLtexto");var draw=new ol.interaction.Draw({type:"Point"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){var texto=window.prompt("Texto","");evt.feature.setStyle(new ol.style.Style({text:new ol.style.Text({text:texto,font:'Bold '+parseInt(i3GEO.editorOL.simbologia.fontSize,10)+'px Arial',textAlign:'left',stroke:new ol.style.Stroke({color:'white',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:i3GEO.editorOL.simbologia.fontColor}),zIndex:2000})}));evt.feature.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature);draw.setActive(false);draw.setActive(true);i3GEO.editorOL.marcaBotao()});i3geoOL.addInteraction(draw)};return temp},botaoSelecao:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLselecaoItemInactive olButton";temp.title=$trad("d24t");temp.onclick=function(){i3GEO.editorOL.marcaBotao("editorOLselecao");var sel=new ol.interaction.Select();i3GEO.editorOL.interacoes.push(sel);i3GEO.Interface.openlayers.interacoes[0].setActive(false);sel.on("select",function(evt){var s,i,n,id,f;n=evt.selected.length;for(i=0;i<n;i++){f=evt.selected[i];id=f.getId();if(id&&i3GEO.util.in_array(id,i3GEO.editorOL.idsSelecionados)){i3GEO.editorOL.unselFeature(id)}else{id=i3GEO.util.uid();i3GEO.editorOL.idsSelecionados.push(id);f.setId(id);s=f.getStyle();if(s.getImage()){f.setStyle(new ol.style.Style({image:new ol.style.Circle({radius:i3GEO.editorOL.simbologia.pointRadius,fill:new ol.style.Fill({color:'rgba(255, 255, 255, 0.5)'}),stroke:new ol.style.Stroke({color:'blue',width:i3GEO.editorOL.simbologia.pointRadius/3})})}));if(!s.getImage().getSrc){f.setProperties({fillColor:s.getImage().getFill().getColor(),strokeColor:s.getImage().getStroke().getColor(),externalGraphic:"",graphicHeight:25,graphicWidth:25})}else{f.setProperties({fillColor:"",strokeColor:"",externalGraphic:s.getImage().getSrc(),graphicHeight:s.getImage().getSize()[1],graphicWidth:s.getImage().getSize()[0]})}}else{f.setProperties({fillColor:s.getFill().getColor(),strokeColor:s.getStroke().getColor(),externalGraphic:"",graphicHeight:25,graphicWidth:25});s.getFill().setColor('rgba(255, 255, 255, 0.5)');s.getStroke().setColor('blue')}}}if(n===0){i3GEO.editorOL.unselTodos()}});i3geoOL.addInteraction(sel)};return temp},botaoSelecaoTudo:function(){var temp=document.createElement("div");temp.className="editorOLselecaoTudoItemInactive olButton";temp.title=$trad("studo");temp.onclick=function(){i3GEO.editorOL.marcaBotao();i3GEO.editorOL.selTodos()};return temp},botaoApaga:function(){var temp=document.createElement("div");temp.className="editorOLapagaItemInactive olButton";temp.title=$trad("excsel");temp.onclick=function(){var x,nsel=i3GEO.editorOL.idsSelecionados.length;i3GEO.editorOL.featuresBackup=[];i3GEO.editorOL.marcaBotao();if(nsel>0){x=window.confirm($trad("excsel")+"?");if(x){i3GEO.editorOL.removeFeaturesSel();i3GEO.desenho.layergrafico.getSource().changed()}}else{i3GEO.janela.tempoMsg($trad("selum"))}};return temp},botaoFrente:function(){var temp=document.createElement("div");temp.className="editorOLfrenteItemInactive olButton";temp.title=$trad("frente");temp.onclick=function(){var nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel>0){i3GEO.editorOL.marcaBotao();i3GEO.editorOL.trazParaFrente()}else{i3GEO.janela.tempoMsg($trad("selum"))}};return temp},botaoEdita:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLeditaItemInactive olButton";temp.title=$trad("dpol");temp.onclick=function(){i3GEO.editorOL.featuresBackup=[];var draw,nsel,f,c;nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel>0){i3GEO.editorOL.marcaBotao("editorOLedita");f=i3GEO.desenho.layergrafico.getSource().getFeatureById(i3GEO.editorOL.idsSelecionados[nsel-1]);i3GEO.editorOL.featuresBackup.push(f.clone());c=new ol.Collection();c.push(f);draw=new ol.interaction.Modify({features:c});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);i3geoOL.addInteraction(draw)}else{i3GEO.janela.tempoMsg($trad("selum"))}};return temp},botaoCorta:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLcortaItemInactive olButton";temp.title=$trad("cortaf");temp.onclick=function(){var nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel!=1){alert("Selecione primeiro um elemento para ser cortado")}else{i3GEO.janela.tempoMsg("Desenhe um polígono");i3GEO.editorOL.marcaBotao("editorOLcorta");var draw=new ol.interaction.Draw({type:"Polygon"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){var temp,f,c,format,fwkt,cwkt;f=evt.feature;c=i3GEO.desenho.layergrafico.getSource().getFeatureById(i3GEO.editorOL.idsSelecionados[nsel-1]);i3GEO.editorOL.featuresBackup.push(c.clone());i3GEO.editorOL.marcaBotao();format=new ol.format.WKT();if(f&&c){fwkt=format.writeFeatures([f]);cwkt=format.writeFeatures([c]);if(fwkt&&cwkt){temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.janela.fechaAguarde("i3GEO.cortador");c.setGeometry(format.readGeometry(retorno.data));if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,cwkt+"|"+fwkt,"difference")}}});i3geoOL.addInteraction(draw)}};return temp},botaoListaGeometrias:function(){var temp=document.createElement("div");temp.className="editorOLlistagItemInactive olButton";temp.title=$trad("listag");temp.onclick=function(){i3GEO.editorOL.listaGeometrias()};return temp},botaoNovaaba:function(){var temp=document.createElement("div");temp.className="editorOLnovaabaItemInactive olButton";temp.title=$trad("novaaba");temp.onclick=function(){window.open(window.location,'_blank')};return temp},botaoAjuda:function(){var temp=document.createElement("div");temp.className="editorOLajudaItemInactive olButton";temp.title=$trad("s1");temp.onclick=function(){if(i3GEO.configura&&i3GEO.configura.locaplic){i3GEO.janela.cria("400px","200px",i3GEO.configura.locaplic+"/mashups/openlayers_ajuda.php?completo=none","","",$trad("s1"),"editorOlAjuda")}else{window.open("openlayers_ajuda.php")}};return temp},botaoFecha:function(){var temp=document.createElement("div");temp.className="editorOLfechaItemInactive olButton";temp.title=$trad("x74");temp.onclick=function(){i3GEO.editorOL.unselTodos();i3GEO.editorOL.featuresBackup=[];i3GEO.editorOL.marcaBotao();i3GEO.eventos.cliquePerm.ativa();$i("i3GEObarraEdicao").style.display="none"};return temp},botaoTools:function(){var temp=document.createElement("div");temp.className="editorOLtoolsItemInactive olButton";temp.title=$trad("u15a");temp.onclick=function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}};return temp},botaoPropriedades:function(){var temp=document.createElement("div");temp.className="editorOLpropriedadesItemInactive olButton";temp.title=$trad("p13");temp.onclick=function(){i3GEO.editorOL.propriedades()};return temp},botaoIdentifica:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLidentificaItemInactive olButton";temp.title=$trad("d7t");temp.onclick=function(){i3GEO.editorOL.criaJanelaAtivaTema();i3GEO.eventos.cliquePerm.desativa();i3GEO.editorOL.marcaBotao("editorOLidentifica");var draw=new ol.interaction.Draw({type:"Point"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){var xy,p,retorno,url,layer,tema=$i("i3GEOOLlistaTemasAtivos");if(tema){layer=i3geoOL.getLayersByName(tema.value)[0];url=layer.getSource().getUrls()[0];xy=evt.target.downPx_;retorno=function(r){var valorunico="",camada,texto="",lonlattexto,xy,temp,temp1,n,i,f=[],textoN=r.split(":");camada=i3GEO.arvoreDeCamadas.pegaTema(tema.value,"","name");xy=evt.feature.getGeometry().getFirstCoordinate();i3GEO.eventos.cliquePerm.ativo=true;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!=""){if(camada.colunaidunico!=""&&temp1.split(":")[0].trim()==camada.colunaidunico){valorunico=temp1.split(":")[1].trim();temp1="(*) "+temp1}f.push(temp1)}}texto="<pre>"+f.join("<br>")+"</pre>"}}catch(e){}lonlattexto="<span style=font-size:12px;color:blue;cursor:pointer onclick='i3GEO.editorOL.captura("+xy[0]+","+xy[1]+",\""+tema.value+"\""+",\""+valorunico+"\")'>edita geometria</span><br>";i3GEO.Interface.openlayers.balao("<div style='text-align:left' >"+lonlattexto+texto+"</div>","",xy[0],xy[1],false,false);i3GEO.eventos.cliquePerm.ativo=false};p=i3GEO.configura.locaplic+"/classesphp/proxy.php?"+url+"&tipoRetornoProxy=string&REQUEST=GetFeatureInfo&TIPOIMAGEM=nenhum&DESLIGACACHE=sim&STYLES=&SERVICE=WMS&VERSION=1.1.1&FEATURE_COUNT=1"+"&FORMAT=image/png&INFO_FORMAT=text/plain&SRS=EPSG:4326"+"&LAYERS="+tema.value+"&layer="+tema.value+"&QUERY_LAYERS="+tema.value+"&HEIGHT="+i3GEO.parametros.h+"&WIDTH="+i3GEO.parametros.w+"&BBOX="+i3geoOL.getExtent().toBBOX().split(",").join(" ")+"&X="+xy[0]+"&Y="+xy[1];cpJSON.call(p,"foo",retorno,"")}});i3geoOL.addInteraction(draw)};return temp},botaoSalva:function(){var temp=document.createElement("div");temp.className="editorOLsalvaItemInactive olButton";temp.title=$trad("salva");temp.onclick=function(){i3GEO.editorOL.salvaGeometrias()};return temp},criaBotoes:function(botoes){if($i("i3GEObarraEdicao")){$i("i3GEObarraEdicao").style.display="block";return}i3GEOpanelEditor=document.createElement("div");i3GEOpanelEditor.id="i3GEObarraEdicao";i3GEOpanelEditor.className="olControlEditingToolbar1 noprint";if(botoes.novaaba===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoNovaaba())}if(botoes.procura===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoProcura())}if(botoes.pan===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPan())}if(botoes.zoombox===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomBox())}if(botoes.zoomtot===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomTot())}if(botoes.zoomin===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomIn())}if(botoes.zoomout===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomOut())}if(botoes.legenda===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoLegenda())}if(botoes.distancia===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoDistancia())}if(botoes.area===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoArea())}if(botoes.identifica===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoIdentifica())}if(botoes.linha===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoLinha())}if(botoes.ponto===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPonto())}if(botoes.poligono===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPoligono())}if(botoes.texto===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoTexto())}if(botoes.edita===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoEdita())}if(botoes.selecao===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSelecao())}if(botoes.selecaotudo===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSelecaoTudo())}if(botoes.apaga===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoApaga())}if(botoes.frente===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoFrente())}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoCorta())}if(botoes.edita===true&&botoes.listag===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoListaGeometrias())}if(botoes.tools===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoTools())}if(botoes.propriedades===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPropriedades())}if(botoes.salva===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSalva())}if(botoes.ajuda===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoAjuda())}if(botoes.fecha===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoFecha())}i3GEOpanelEditor.style.width=i3GEOpanelEditor.getElementsByTagName("div").length*33+"px";i3GEO.editorOL.mapa.getViewport().getElementsByClassName("ol-overlaycontainer-stopevent")[0].appendChild(i3GEOpanelEditor)},removeFeaturesSel:function(){var s,i,nsel,f;nsel=i3GEO.editorOL.idsSelecionados.length;s=i3GEO.desenho.layergrafico.getSource();for(i=0;i<nsel;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f){i3GEO.editorOL.featuresBackup.push(f.clone());s.removeFeature(f)}}i3GEO.editorOL.idsSelecionados=[]},mudaSimbolo:function(estilo,id){var s,i,nsel,f;i3GEO.editorOL.simbologia[estilo]=$i(id).value;nsel=i3GEO.editorOL.idsSelecionados.length;s=i3GEO.desenho.layergrafico.getSource();for(i=0;i<nsel;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f){if(estilo==="externalGraphic"||estilo==="graphicWidth"||estilo==="graphicHeight"){f.setProperties({src:i3GEO.editorOL.simbologia.externalGraphic,size:[i3GEO.editorOL.simbologia.graphicWidth,i3GEO.editorOL.simbologia.graphicHeight]})}else{f.setProperties({fillColor:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')',strokeColor:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth,fontSize:i3GEO.editorOL.simbologia.fontSize,fontColor:i3GEO.editorOL.simbologia.fontColor,})}}}},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>'+'<p class=paragrafo >Cor do contorno</p>'+'<div class="i3geoForm100 i3geoFormIconeAquarela" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'strokeColor\',\'i3GEOEditorOLcorContorno\');return false;" type="text" id="i3GEOEditorOLcorContorno" value="'+i3GEO.editorOL.simbologia.strokeColor+'" />'+'</div>'+'<br><p class=paragrafo >Cor do preenchimento</p>'+'<div class="i3geoForm100 i3geoFormIconeAquarela" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'fillColor\',\'i3GEOEditorOLcorPre\');return false;" type="text" id="i3GEOEditorOLcorPre" value="'+i3GEO.editorOL.simbologia.fillColor+'" />'+'</div>'+'<br><p class=paragrafo >Cor da fonte</p>'+'<div class="i3geoForm100 i3geoFormIconeAquarela" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'fontColor\',\'i3GEOEditorOLcorFonte\');return false;" type="text" id="i3GEOEditorOLcorFonte" value="'+i3GEO.editorOL.simbologia.fontColor+'" />'+'</div>'+'<br><p class=paragrafo >Tamanho da fonte</p>'+'<div class="i3geoForm100 i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'fontSize\',\'i3GEOEditorOLfontsize\');return false;" type="text" id="i3GEOEditorOLfontsize" value="'+i3GEO.editorOL.simbologia.fontSize+'" />'+'</div>'+'<br><p class=paragrafo >Opacidade (de 0 a 1)</p>'+'<div class="i3geoForm100 i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'opacidade\',\'i3GEOEditorOLopacidade\');return false;" type="text" id="i3GEOEditorOLopacidade" value="'+i3GEO.editorOL.simbologia.opacidade+'" />'+'</div>'+'<br><p class=paragrafo >Largura da linha/contorno</p>'+'<div class="i3geoForm100 i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'strokeWidth\',\'i3GEOEditorOLlarguraLinha\');return false;" type="text" id="i3GEOEditorOLlarguraLinha" value="'+i3GEO.editorOL.simbologia.strokeWidth+'" />'+'</div>'+'<br><p class=paragrafo >Url de uma imagem</p>'+'<div class="i3geoForm i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'externalGraphic\',\'i3GEOEditorOLexternalGraphic\');return false;" type="text" id="i3GEOEditorOLexternalGraphic" value="'+i3GEO.editorOL.simbologia.externalGraphic+'" />'+'</div>'+'<br><p class=paragrafo >Largura da imagem</p>'+'<div class="i3geoForm100 i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'graphicWidth\',\'i3GEOEditorOLgraphicWidth\');return false;" type="text" id="i3GEOEditorOLgraphicWidth" value="'+i3GEO.editorOL.simbologia.graphicWidth+'" />'+'</div>'+'<br><p class=paragrafo >Altura da imagem</p>'+'<div class="i3geoForm100 i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'graphicHeight\',\'i3GEOEditorOLgraphicHeight\');return false;" type="text" id="i3GEOEditorOLgraphicHeight" value="'+i3GEO.editorOL.simbologia.graphicHeight+'" />'+'</div>';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")}}i3GEO.util.aplicaAquarela("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($trad("u6")+" <div id='panellistagEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader($trad("u6"))}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 id,temp,geos=i3GEO.desenho.layergrafico.getSource().getFeatures(),n=geos.length,ins="<table class=lista4 >";ins+="<tr><td><i>"+$trad("u6")+"</i></td><td><i>"+$trad("opcoes")+"</i></td><td></td></tr>";while(n>0){n-=1;id=geos[n].getId();if(id){ins+="<tr><td>"+id+"</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.marcaBotao();i3GEO.editorOL.selFeature(\""+id+"\")'>seleciona</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.unselFeature(\""+id+"\")'>limpa</td></tr>"}}ins+="</table>";if(geos.length===0){ins=$trad("meneditor2")}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(){var b,ins;if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",height:"150px",visible:false,draggable:true,close:true});ins=""+'<p class=paragrafo >'+$trad("opsel")+':</p>'+'<div class=styled-select >'+'<select id="panelferramentasEditorOpcoes">'+' <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></p>';ins+='</div>';ins+='<br><p class=paragrafo ><input id="panelferramentasEditorAplicar" type="button" value="'+$trad("p14")+'" />';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")}}b=new YAHOO.widget.Button("panelferramentasEditorAplicar",{onclick:{fn:function(){i3GEO.editorOL.processageo($i("panelferramentasEditorOpcoes").value)}}});b.addClass("rodar")}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 polis,linhas,pontos,temp,nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel>0){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"){polis=i3GEO.editorOL.retornaFeaturesTipo("Polygon");linhas=i3GEO.editorOL.retornaFeaturesTipo("LineString");pontos=i3GEO.editorOL.retornaFeaturesTipo("Point");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){polis=i3GEO.editorOL.retornaFeaturesTipo("Polygon");linhas=i3GEO.editorOL.retornaFeaturesTipo("LineString");pontos=i3GEO.editorOL.retornaFeaturesTipo("Point");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{polis=i3GEO.editorOL.retornaGeometriasTipo("Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo("LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo("Point");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)}}i3GEO.desenho.layergrafico.getSource().changed();return}else{i3GEO.janela.tempoMsg("Selecione pelo menos dois elementos")}},merge:function(geoms){var n=geoms.length,w=new Wkt.Wkt(),g,m,i,f,format=new ol.format.WKT();f=format.writeFeatures([geoms[0]]);w.read(f);if(n>1){for(i=1;i<n;i++){g=format.writeFeatures([geoms[i]]);m=new Wkt.Wkt();m.read(g);w.merge(m)}}return w.write()},uniaojts:function(geoms){var n=geoms.length,fwkt=new ol.format.WKT(),rwkt=new jsts.io.WKTReader(),wwkt=new jsts.io.WKTWriter(),g,i,uniao;if(n>1){uniao=fwkt.writeFeatures([geoms[0]]);uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=fwkt.writeFeatures([geoms[i]]);uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.readFeatures(uniao)]}else{return false}},retornaGeometriasTipo:function(tipo){var n=i3GEO.editorOL.idsSelecionados.length,lista=[],i,s=i3GEO.desenho.layergrafico.getSource(),fwkt=new ol.format.WKT();for(i=0;i<n;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f.getGeometry().getType()==tipo){lista.push(fwkt.writeFeatures([f]))}}return lista},retornaFeaturesTipo:function(tipo){var n=i3GEO.editorOL.idsSelecionados.length,lista=[],i,s=i3GEO.desenho.layergrafico.getSource();for(i=0;i<n;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f.getGeometry().getType()==tipo){lista.push(f)}}return lista},guardaBackup:function(){return},selTodos:function(){i3GEO.editorOL.unselTodos();var features,n,f,i,id,st;features=i3GEO.desenho.layergrafico.getSource().getFeatures();n=features.length;for(i=0;i<n;i++){f=features[i];id=f.getId();if(!id){id=i3GEO.util.uid();f.setId(id)}i3GEO.editorOL.idsSelecionados.push(id);st=f.getStyle();if(st&&st.getImage()){f.setStyle(new ol.style.Style({image:new ol.style.Circle({radius:i3GEO.editorOL.simbologia.pointRadius,fill:new ol.style.Fill({color:'rgba(255, 255, 255, 0.5)'}),stroke:new ol.style.Stroke({color:'blue',width:i3GEO.editorOL.simbologia.pointRadius/3})})}));if(st.getImage().getSrc){f.setProperties({fillColor:"",strokeColor:"",externalGraphic:st.getImage().getSrc(),graphicHeight:st.getImage().getSize()[1],graphicWidth:st.getImage().getSize()[0]})}else{f.setProperties({fillColor:st.getImage().getFill().getColor(),strokeColor:st.getImage().getStroke().getColor(),externalGraphic:"",graphicHeight:"",graphicWidth:""})}}else if(st){f.setProperties({fillColor:st.getFill().getColor(),strokeColor:st.getStroke().getColor()});st.getFill().setColor('rgba(255, 255, 255, 0.5)');st.getStroke().setColor('blue')}}i3GEO.desenho.layergrafico.getSource().changed()},unselTodos:function(){var i,n,f,s,st;s=i3GEO.desenho.layergrafico.getSource();n=i3GEO.editorOL.idsSelecionados.length;for(i=0;i<n;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f){st=f.getStyle();if(st&&st.getImage()){if(st.getImage().getSrc||f.getProperties().externalGraphic!=""){f.setStyle(new ol.style.Style({image:new ol.style.Icon({src:f.getProperties().externalGraphic,size:[f.getProperties().graphicWidth,f.getProperties().graphicHeight]})}))}else{f.setStyle(new ol.style.Style({image:new ol.style.Circle({radius:i3GEO.editorOL.simbologia.pointRadius,fill:new ol.style.Fill({color:f.getProperties().fillColor}),stroke:new ol.style.Stroke({color:f.getProperties().strokeColor,width:i3GEO.editorOL.simbologia.pointRadius/3})})}))}}else if(st){st.getFill().setColor(f.getProperties().fillColor);st.getStroke().setColor(f.getProperties().strokeColor)}}}i3GEO.editorOL.idsSelecionados=[];i3GEO.desenho.layergrafico.getSource().changed()},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])}},unselFeature:function(id){var f,s;s=i3GEO.desenho.layergrafico.getSource();f=s.getFeatureById(id);if(f){if(f.getStyle().getSrc()){f.getStyle().setSrc(f.getProperties().externalGraphic);f.getStyle().setSize([f.getProperties().graphicWidth,f.getProperties().graphicHeight])}else{f.getStyle().getFill().setColor(f.getProperties().fillColor);f.getStyle().getStroke().setColor(f.getProperties().strokeColor)}}i3GEO.editorOL.idsSelecionados.remove(id);i3GEO.desenho.layergrafico.getSource().changed()},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(f){i3GEO.editorOL.removeFeaturesSel();var fwkt=new ol.format.WKT();f=fwkt.readFeatures(f)[0];f.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'})}));f.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(f)},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(id){var s,f;s=i3GEO.desenho.layergrafico.getSource();f=s.getFeatureById(id);if(!i3GEO.util.in_array(id,i3GEO.editorOL.idsSelecionados)){i3GEO.editorOL.idsSelecionados.push(id);f.setProperties({fillColor:f.getStyle().getFill().getColor(),strokeColor:f.getStyle().getStroke().getColor(),externalGraphic:""});f.getStyle().getFill().setColor('rgba(255, 255, 255, 0.5)');f.getStyle().getStroke().setColor('blue');s.changed()}},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 s,i,nsel,id,clone;s=i3GEO.desenho.layergrafico.getSource();nsel=i3GEO.editorOL.idsSelecionados.length;for(i=0;i<nsel;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f){clone=f.clone();id=f.getId();s.removeFeature(f);clone.setId(id);s.addFeature(clone)}}s.changed()},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){return obj.transform("EPSG:900913","EPSG:4326")}else{return obj}},sobeLayersGraficos:function(){}};i3GEO.editorOL.backup.getFeatures=function(){return i3GEO.editorOL.backup.getSource().getFeatures()}; | |
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}}i3GEO.editorOL={simbologia:{opacidade:0.8,texto:"",fillColor:"250,180,15",strokeWidth:5,strokeColor:"250,150,0",pointRadius:4,graphicName:"square",fontSize:"12px",fontColor:"0,0,0",externalGraphic:"",graphicHeight:25,graphicWidth:25},backup:new ol.layer.Vector({source:new ol.source.Vector({features:new ol.Collection(),useSpatialIndex:false,name:"Backup"}),visible:false}),e_oce:new ol.layer.Tile({title:"ESRI Ocean Basemap",visible:false,isBaseLayer:true,name:"oce",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer">ArcGIS</a>'})]})}),e_ims:new ol.layer.Tile({title:"ESRI Imagery World 2D",visible:false,isBaseLayer:true,name:"ims",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer">ArcGIS</a>'})]})}),e_wsm:new ol.layer.Tile({title:"ESRI World Street Map",visible:false,isBaseLayer:true,name:"wsm",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer",attributions:[new ol.Attribution({html:'Tiles © <a href="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer">ArcGIS</a>'})]})}),ol_mma:new ol.layer.Tile({title:"Base carto MMA",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",params:{'layers':"baseraster",'srs':"EPSG:4326",'format':"image/png"}})}),e_tms:new ol.layer.Tile({title:"OSGEO",visible:false,isBaseLayer:true,name:"tms",source:new ol.source.TileWMS({url:"http://tilecache.osgeo.org/wms-c/Basic.py/",params:{'layers':"basic",'type':"png",'srs':"EPSG:4326",'format':"image/png",'VERSION':'1.1.1'},attributions:[new ol.Attribution({html:'© <a href="http://www.tilecache.org/">2006-2010, TileCache Contributors</a>'})]})}),top_wms:new ol.layer.Tile({title:"Toponímia MMA",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&",params:{'layers':"base",'srs':"EPSG:4326",'format':"image/png"}})}),est_wms:new ol.layer.Tile({title:"Estados do Brasil",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&",params:{'layers':"estadosl",'srs':"EPSG:4326",'format':"image/png"}})}),fundo:"e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce",nomeFuncaoSalvar:"i3GEO.editorOL.salvaGeo()",kml:[],layersIniciais:[],botoes:{'pan':true,'zoombox':true,'zoomtot':true,'zoomin':true,'zoomout':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,'novaaba':false},pontos:[],marca:"../pacotes/openlayers/img/marker-gold.png",controles:[],tiles:true,incluilayergrafico:true,ativalayerswitcher:false,ativarodadomouse:true,legendahtml:false,numzoom:12,minresolution:0.703125,maxext:"",mapext:[-76.5125927,-39.3925675209,-29.5851853,9.49014852081],mapa:"",idsSelecionados:[],featuresBackup:[],resolutions:[],matrixIds:[],inicia:function(){var projectionExtent,size,resolutions,matrixIds,z;if(i3GEO.Interface.openlayers.googleLike===true){projectionExtent=ol.proj.get('EPSG:3857').getExtent()}else{projectionExtent=ol.proj.get('EPSG:4326').getExtent()}size=ol.extent.getWidth(projectionExtent)/256;resolutions=new Array(40);matrixIds=new Array(40);for(z=0;z<40;++z){resolutions[z]=size/Math.pow(2,z);matrixIds[z]=z}i3GEO.editorOL.resolutions=resolutions;i3GEO.editorOL.matrixIds=matrixIds;i3GEO.editorOL.incluilayergrafico=true;i3GEO.Interface.openlayers.parametrosView={projection:"EPSG:4326",resolutions:resolutions,minResolution:i3GEO.editorOL.minresolution,maxResolution:resolutions[i3GEO.editorOL.numzoom]};i3GEO.Interface.openlayers.parametrosMap={target:"i3geoMapa",layers:[],controls:[]};i3GEO.Interface.openlayers.cria();i3GEO.editorOL.mapa=i3geoOL;if(i3GEO.editorOL.controles.length===0){i3GEO.editorOL.controles=[new ol.interaction.DoubleClickZoom(),new ol.interaction.KeyboardPan(),new ol.interaction.KeyboardZoom(),new ol.interaction.MouseWheelZoom(),new ol.interaction.PinchRotate(),new ol.interaction.PinchZoom(),new ol.interaction.DragZoom(),new ol.interaction.DragPan(),new ol.control.Zoom(),new ol.control.ZoomSlider(),new ol.control.ScaleLine()]}var alayers=[],fundo=(i3GEO.editorOL.fundo).split(","),nfundo=fundo.length,ncontroles=i3GEO.editorOL.controles.length,i,n,temp;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;i3GEO.editorOL.botoes.novaaba=false}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]!=""&&i3GEO.editorOL[fundo[i]]){alayers.push(i3GEO.editorOL[fundo[i]]);i3GEO.editorOL[fundo[i]].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.criaBotoes(i3GEO.editorOL.botoes);if(i3GEO.editorOL.ativalayerswitcher===true){i3GEO.editorOL.ativaLayerSwitcher()}if(i3GEO.editorOL.ativarodadomouse===false){i3GEO.editorOL.desativaRodaDoMouse()}if(i3GEO.editorOL.maxext!==""){i3GEO.editorOL.mapa.getView().setProperties({extent:i3GEO.editorOL.maxext})}if(i3GEO.editorOL.mapext!=""){var m=i3GEO.util.extGeo2OSM(i3GEO.editorOL.mapext);i3GEO.editorOL.mapa.zoomToExtent(m)}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 l,layers=i3GEO.editorOL.mapa.getLayers(),nlayers=layers.getLength(),ins=[],i;for(i=0;i<nlayers;i++){l=layers.item(i);if(l.getVisible()===true){ins.push(l)}}return ins},layerPorParametro:function(parametro,valor){var layers=i3GEO.editorOL.mapa.layers,nlayers=layers.length,ins=[],i;for(i=0;i<nlayers;i++){if(layers[i][parametro]||layers[i][parametro.toLowerCase()]){if(layers[i][parametro]===valor||layers[i][parametro.toLowerCase()]===valor){ins.push(layers[i])}}else{if(layers[i].params&&layers[i].params[parametro]&&layers[i].params[parametro]===valor){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].getProperties().name+"</option>"}combo+="</select>";ins="<div class=paragrafo >"+$trad("a7")+":<br>"+combo;ins+="<br>"+$trad("x64")+":<br><span id=i3GEOOLcomboitens ></span>";ins+="<br>"+$trad("t23")+":<br><input type=text size=20 id=i3GEOOLpalavraBusca >";ins+="<br><br><input type=button value='"+$trad("t23")+"' id='i3GEOOLbotaoBusca' ></div>";ins+="<br>'"+$trad("result")+"':<br><span id=i3GEOOLcomboresultado ></span>";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")}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",combo="<select id=i3GEOOLlistaTemasAtivos style=width:235px; >";for(i=0;i<nlayers;i++){nometema=layers[i].getProperties().title;combo+="<option value='"+layers[i].getProperties().name+"' >"+nometema+"</option>"}combo+="</select>";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo)},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($trad("tativo"))}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(){i3GEO.editorOL.marcaBotao();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 prop,layer,layers=i3GEO.editorOL.mapa.getLayers(),nlayers=layers.getLength(),ins="",i,icone="",url,f="",fonte="";for(i=0;i<nlayers;i++){layer=layers.item(i);prop=layer.getProperties();if(prop.source.getUrls){url=prop.source.getUrls()[0];url=url.replace("&cache=sim","&DESLIGACACHE=sim");url=url.replace("&Z=${z}&X=${x}&Y=${y}","");url=url.replace("Z=${z}&X=${x}&Y=${y}","");url+="&REQUEST=getlegendgraphic&service=wms&version=1.0.0";if(i3GEO.Interface.openlayers.googleLike===true){url+="&SRS=EPSG:3857"}icone="";if(i3GEO.editorOL.legendahtml===true){url=url.replace("image%2Fpng","text/html")+"&FORMAT=text/html&SERVICE=WMS";fonte="";if(prop.link_tema!=""){fonte=" <a class='i3GeoLinkFonte' href='"+prop.link_tema+"' target='_blank' >link</a>"}ins+=icone+prop.name+fonte+"<br><div id=legendaL_"+i+" ></div><br>";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");url=url.replace("LAYERS","LAYER");var config={method:"GET",url:url,callback:f}}else if(prop.isBaseLayer===false&&prop.visible===true){url=url.replace("LAYERS","LAYER");url+="&FORMAT=image/png";ins+=prop.title+"<br><img src='"+url+"' /><br>"}}}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($trad("p3"));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(x,y,tema,idunico){var d=0.001,layer=i3geoOL.getLayersByName(tema)[0],xy=[x,y],u=layer.getSource().getUrls()[0],poligono,retorno;u+="&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename=undefined";if(i3GEO.Interface.openlayers.googleLike===true){u+="&SRS=EPSG:3857"}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;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>";retorno=function(r){var fs,c,format,f,n,i;format=new ol.format.WKT();fs=format.readFeatures(r[0]);n=fs.length;c=i3GEO.desenho.layergrafico.getSource();for(i=0;i<n;i++){f=fs[i];f.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'})}));f.setId(i3GEO.util.uid());f.setProperties({idUnico:idunico});c.addFeature(f)}};u=i3GEO.configura.locaplic+"/classesphp/proxy.php?"+u+"&tipoRetornoProxy=gml2wkt";cpJSON.call(u,"foo",retorno,"")},salvaGeometrias:function(){var n=i3GEO.editorOL.idsSelecionados.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($trad("u6"));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 >"+n+" "+$trad("geosel")+"</p>";ins+="<p class=paragrafo ><a href='#' onclick='i3GEO.editorOL.listaGeometriasSel()' >"+$trad("listar")+"</a> ";if(i3GEO.editorOL.nomeFuncaoSalvar&&i3GEO.editorOL.nomeFuncaoSalvar!=""){ins+="<a href='#' onclick='"+i3GEO.editorOL.nomeFuncaoSalvar+"' >"+$trad("sdados")+"</a> "}if(typeof i3geoOL!=="undefined"){ins+="<a href='#' onclick='i3GEO.editorOL.incorporar()' >"+$trad("incorpo")+"</a></p>";ins+="<p class=paragrafo>"+$trad("ajudaEditorOlSalva")+"</p>"}YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{i3GEO.janela.tempoMsg($trad("selum"))}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var n=i3GEO.editorOL.idsSelecionados.length,ins="",s=i3GEO.desenho.layergrafico.getSource(),i,w,g;for(i=0;i<n;i++){g=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);ins+="<b>"+$trad("u6")+": #"+i+"</b><br>"+i3GEO.editorOL.google2wgs(g.getGeometry().getCoordinates())+"<br><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 s=i3GEO.desenho.layergrafico.getSource(),n=i3GEO.editorOL.idsSelecionados.length,funcaoOK=function(){var f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[0]),g=f.getGeometry(),tema=$i("editorOLcomboTemaEditavel").value,redesenha,p,format;g=i3GEO.editorOL.google2wgs(g);format=new ol.format.WKT();f.setGeometry(g);if(tema==""){return}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.editorOL.removeFeaturesSel();i3GEO.Interface.atualizaTema("",tema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto",$trad("adic")+"...");i3GEO.janela.AGUARDEMODAL=false;if(!f.getProperties().idUnico||f.getProperties().idUnico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+tema+"&wkt="+format.writeFeatures([f]))}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+f.getProperties().idUnico+"&tema="+tema+"&wkt="+format.writeFeatures([f]))}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto=$trad("stema")+":<br><div id=editorOLondeComboTemaEditavel ></div><p class=paragrafo >"+$trad("salvaDadosEditor")+"</p><br><br>";if(n!=1){i3GEO.janela.tempoMsg($trad("seluma"))}else{i3GEO.janela.confirma(texto,300,$trad("salva"),$trad("canc"),funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel")}},marcaBotao:function(classeBotao){var i,n,botoes=$i("i3GEObarraEdicao").getElementsByTagName("div");n=botoes.length;for(i=0;i<n;i++){botoes[i].className=botoes[i].className.replace("ItemActive","ItemInactive");if(classeBotao){botoes[i].className=botoes[i].className.replace(classeBotao+"ItemInactive",classeBotao+"ItemActive")}}i3GEO.editorOL.removeInteracoes()},interacoes:[],removeInteracoes:function(){var i,n;n=i3GEO.editorOL.interacoes.length;for(i=0;i<n;i++){i3geoOL.removeInteraction(i3GEO.editorOL.interacoes[i])}i3GEO.editorOL.interacoes=[]},botaoProcura:function(){var temp=document.createElement("div");temp.className="editorOLprocuraItemInactive olButton";temp.title=$trad("t23");temp.onclick=function(){i3GEO.editorOL.criaJanelaBusca();YAHOO.procura.container.panel.show()};return temp},botaoPan:function(){var temp=document.createElement("div");temp.className="editorOLpanItemInactive olButton";temp.title="pan";temp.onclick=function(){i3GEO.editorOL.marcaBotao("editorOLpan")};return temp},botaoZoomBox:function(){var temp=document.createElement("div");temp.className="editorOLzoomboxItemInactive olButton";temp.title="zoombox";temp.onclick=function(){i3GEO.barraDeBotoes.defBotao("zoomli").funcaoonclick()};return temp},botaoZoomTot:function(){var temp=document.createElement("div");temp.className="editorOLzoomtotItemInactive olButton";temp.title=$trad("d2t");temp.onclick=function(){if(i3GEO.editorOL.mapext&&i3GEO.editorOL.mapext!=""){i3GEO.Interface.openlayers.zoom2ext(i3GEO.editorOL.mapext.join(" "))}else{i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.extentTotal)}};return temp},botaoZoomIn:function(){var temp=document.createElement("div");temp.className="editorOLzoominItemInactive olButton";temp.title=$trad("d5t");temp.onclick=function(){var v=i3GEO.editorOL.mapa.getView();v.setZoom(v.getZoom()+1)};return temp},botaoZoomOut:function(){var temp=document.createElement("div");temp.className="editorOLzoomoutItemInactive olButton";temp.title=$trad("d5t");temp.onclick=function(){var v=i3GEO.editorOL.mapa.getView();v.setZoom(v.getZoom()-1)};return temp},botaoLegenda:function(){var temp=document.createElement("div");temp.className="editorOLlegendaItemInactive olButton";temp.title=$trad("p3");temp.onclick=function(){i3GEO.editorOL.mostraLegenda()};return temp},botaoDistancia:function(){var temp=document.createElement("div");temp.className="editorOLdistanciaItemInactive olButton";temp.onclick=function(){i3GEO.editorOL.marcaBotao("editorOLdistancia");i3GEO.barraDeBotoes.defBotao("mede").funcaoonclick()};return temp},botaoArea:function(){var temp=document.createElement("div");temp.className="editorOLareaItemInactive olButton";temp.onclick=function(){i3GEO.editorOL.marcaBotao("editorOLarea");i3GEO.barraDeBotoes.defBotao("area").funcaoonclick()};return temp},botaoLinha:function(){var temp=document.createElement("div");temp.className="editorOLlinhaItemInactive olButton";temp.title=$trad("dlinha");temp.onclick=function(){i3GEO.eventos.cliquePerm.desativa();i3GEO.editorOL.marcaBotao("editorOLlinha");var draw=new ol.interaction.Draw({type:"LineString"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){evt.feature.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'})}));evt.feature.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature);draw.setActive(false);draw.setActive(true);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}});i3geoOL.addInteraction(draw)};return temp},botaoPonto:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLpontoItemInactive olButton";temp.title=$trad("dponto");temp.onclick=function(){i3GEO.eventos.cliquePerm.desativa();i3GEO.editorOL.marcaBotao("editorOLponto");var draw=new ol.interaction.Draw({type:"Point"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){var simbolo,url;url=i3GEO.editorOL.simbologia.externalGraphic;if(url===""){simbolo=new ol.style.Circle({radius:i3GEO.editorOL.simbologia.pointRadius,fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'}),stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.pointRadius/3})})}else{simbolo=new ol.style.Icon({src:url,size:[i3GEO.editorOL.simbologia.graphicWidth,i3GEO.editorOL.simbologia.graphicHeight]})}evt.feature.setStyle(new ol.style.Style({image:simbolo}));evt.feature.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature);draw.setActive(false);draw.setActive(true);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}});i3geoOL.addInteraction(draw)};return temp},botaoPoligono:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLpoligonoItemInactive olButton";temp.title=$trad("dpol");temp.onclick=function(){i3GEO.editorOL.marcaBotao("editorOLpoligono");var draw=new ol.interaction.Draw({type:"Polygon"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){evt.feature.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'})}));evt.feature.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature);draw.setActive(false);draw.setActive(true);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}});i3geoOL.addInteraction(draw)};return temp},botaoTexto:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLtextoItemInactive olButton";temp.title=$trad("dtexto");temp.onclick=function(){i3GEO.eventos.cliquePerm.desativa();i3GEO.editorOL.marcaBotao("editorOLtexto");var draw=new ol.interaction.Draw({type:"Point"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){var texto=window.prompt("Texto","");evt.feature.setStyle(new ol.style.Style({text:new ol.style.Text({text:texto,font:'Bold '+parseInt(i3GEO.editorOL.simbologia.fontSize,10)+'px Arial',textAlign:'left',stroke:new ol.style.Stroke({color:'white',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:i3GEO.editorOL.simbologia.fontColor}),zIndex:2000})}));evt.feature.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature);draw.setActive(false);draw.setActive(true);i3GEO.editorOL.marcaBotao()});i3geoOL.addInteraction(draw)};return temp},botaoSelecao:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLselecaoItemInactive olButton";temp.title=$trad("d24t");temp.onclick=function(){i3GEO.editorOL.marcaBotao("editorOLselecao");var sel=new ol.interaction.Select();i3GEO.editorOL.interacoes.push(sel);i3GEO.Interface.openlayers.interacoes[0].setActive(false);sel.on("select",function(evt){var s,i,n,id,f;n=evt.selected.length;for(i=0;i<n;i++){f=evt.selected[i];id=f.getId();if(id&&i3GEO.util.in_array(id,i3GEO.editorOL.idsSelecionados)){i3GEO.editorOL.unselFeature(id)}else{id=i3GEO.util.uid();i3GEO.editorOL.idsSelecionados.push(id);f.setId(id);s=f.getStyle();if(s.getImage()){f.setStyle(new ol.style.Style({image:new ol.style.Circle({radius:i3GEO.editorOL.simbologia.pointRadius,fill:new ol.style.Fill({color:'rgba(255, 255, 255, 0.5)'}),stroke:new ol.style.Stroke({color:'blue',width:i3GEO.editorOL.simbologia.pointRadius/3})})}));if(!s.getImage().getSrc){f.setProperties({fillColor:s.getImage().getFill().getColor(),strokeColor:s.getImage().getStroke().getColor(),externalGraphic:"",graphicHeight:25,graphicWidth:25})}else{f.setProperties({fillColor:"",strokeColor:"",externalGraphic:s.getImage().getSrc(),graphicHeight:s.getImage().getSize()[1],graphicWidth:s.getImage().getSize()[0]})}}else{f.setProperties({fillColor:s.getFill().getColor(),strokeColor:s.getStroke().getColor(),externalGraphic:"",graphicHeight:25,graphicWidth:25});s.getFill().setColor('rgba(255, 255, 255, 0.5)');s.getStroke().setColor('blue')}}}if(n===0){i3GEO.editorOL.unselTodos()}});i3geoOL.addInteraction(sel)};return temp},botaoSelecaoTudo:function(){var temp=document.createElement("div");temp.className="editorOLselecaoTudoItemInactive olButton";temp.title=$trad("studo");temp.onclick=function(){i3GEO.editorOL.marcaBotao();i3GEO.editorOL.selTodos()};return temp},botaoApaga:function(){var temp=document.createElement("div");temp.className="editorOLapagaItemInactive olButton";temp.title=$trad("excsel");temp.onclick=function(){var x,nsel=i3GEO.editorOL.idsSelecionados.length;i3GEO.editorOL.featuresBackup=[];i3GEO.editorOL.marcaBotao();if(nsel>0){x=window.confirm($trad("excsel")+"?");if(x){i3GEO.editorOL.removeFeaturesSel();i3GEO.desenho.layergrafico.getSource().changed()}}else{i3GEO.janela.tempoMsg($trad("selum"))}};return temp},botaoFrente:function(){var temp=document.createElement("div");temp.className="editorOLfrenteItemInactive olButton";temp.title=$trad("frente");temp.onclick=function(){var nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel>0){i3GEO.editorOL.marcaBotao();i3GEO.editorOL.trazParaFrente()}else{i3GEO.janela.tempoMsg($trad("selum"))}};return temp},botaoEdita:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLeditaItemInactive olButton";temp.title=$trad("dpol");temp.onclick=function(){i3GEO.editorOL.featuresBackup=[];var draw,nsel,f,c;nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel>0){i3GEO.editorOL.marcaBotao("editorOLedita");f=i3GEO.desenho.layergrafico.getSource().getFeatureById(i3GEO.editorOL.idsSelecionados[nsel-1]);i3GEO.editorOL.featuresBackup.push(f.clone());c=new ol.Collection();c.push(f);draw=new ol.interaction.Modify({features:c});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);i3geoOL.addInteraction(draw)}else{i3GEO.janela.tempoMsg($trad("selum"))}};return temp},botaoCorta:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLcortaItemInactive olButton";temp.title=$trad("cortaf");temp.onclick=function(){var nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel!=1){alert("Selecione primeiro um elemento para ser cortado")}else{i3GEO.janela.tempoMsg("Desenhe um polígono");i3GEO.editorOL.marcaBotao("editorOLcorta");var draw=new ol.interaction.Draw({type:"Polygon"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){var temp,f,c,format,fwkt,cwkt;f=evt.feature;c=i3GEO.desenho.layergrafico.getSource().getFeatureById(i3GEO.editorOL.idsSelecionados[nsel-1]);i3GEO.editorOL.featuresBackup.push(c.clone());i3GEO.editorOL.marcaBotao();format=new ol.format.WKT();if(f&&c){fwkt=format.writeFeatures([f]);cwkt=format.writeFeatures([c]);if(fwkt&&cwkt){temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.janela.fechaAguarde("i3GEO.cortador");c.setGeometry(format.readGeometry(retorno.data));if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,cwkt+"|"+fwkt,"difference")}}});i3geoOL.addInteraction(draw)}};return temp},botaoListaGeometrias:function(){var temp=document.createElement("div");temp.className="editorOLlistagItemInactive olButton";temp.title=$trad("listag");temp.onclick=function(){i3GEO.editorOL.listaGeometrias()};return temp},botaoNovaaba:function(){var temp=document.createElement("div");temp.className="editorOLnovaabaItemInactive olButton";temp.title=$trad("novaaba");temp.onclick=function(){window.open(window.location,'_blank')};return temp},botaoAjuda:function(){var temp=document.createElement("div");temp.className="editorOLajudaItemInactive olButton";temp.title=$trad("s1");temp.onclick=function(){if(i3GEO.configura&&i3GEO.configura.locaplic){i3GEO.janela.cria("400px","200px",i3GEO.configura.locaplic+"/mashups/openlayers_ajuda.php?completo=none","","",$trad("s1"),"editorOlAjuda")}else{window.open("openlayers_ajuda.php")}};return temp},botaoFecha:function(){var temp=document.createElement("div");temp.className="editorOLfechaItemInactive olButton";temp.title=$trad("x74");temp.onclick=function(){i3GEO.editorOL.unselTodos();i3GEO.editorOL.featuresBackup=[];i3GEO.editorOL.marcaBotao();i3GEO.eventos.cliquePerm.ativa();$i("i3GEObarraEdicao").style.display="none"};return temp},botaoTools:function(){var temp=document.createElement("div");temp.className="editorOLtoolsItemInactive olButton";temp.title=$trad("u15a");temp.onclick=function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}};return temp},botaoPropriedades:function(){var temp=document.createElement("div");temp.className="editorOLpropriedadesItemInactive olButton";temp.title=$trad("p13");temp.onclick=function(){i3GEO.editorOL.propriedades()};return temp},botaoIdentifica:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLidentificaItemInactive olButton";temp.title=$trad("d7t");temp.onclick=function(){i3GEO.editorOL.criaJanelaAtivaTema();i3GEO.eventos.cliquePerm.desativa();i3GEO.editorOL.marcaBotao("editorOLidentifica");var draw=new ol.interaction.Draw({type:"Point"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.interacoes[0].setActive(false);draw.on("drawend",function(evt){var xy,p,retorno,url,layer,tema=$i("i3GEOOLlistaTemasAtivos");if(tema){layer=i3geoOL.getLayersByName(tema.value)[0];if(layer.getSource().getUrls){url=layer.getSource().getUrls()[0]}else{url=layer.getSource().getUrl()}xy=evt.target.downPx_;retorno=function(r){var valorunico="",camada=null,texto="",lonlattexto,xy,temp,temp1,n,i,f=[],textoN=r.split(":");if(i3GEO.arvoreDeCamadas){camada=i3GEO.arvoreDeCamadas.pegaTema(tema.value,"","name")}xy=evt.feature.getGeometry().getFirstCoordinate();i3GEO.eventos.cliquePerm.ativo=true;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!=""){if(camada&&camada.colunaidunico!=""&&temp1.split(":")[0].trim()==camada.colunaidunico){valorunico=temp1.split(":")[1].trim();temp1="(*) "+temp1}f.push(temp1)}}texto="<pre>"+f.join("<br>")+"</pre>"}}catch(e){}lonlattexto="<span style=font-size:12px;color:blue;cursor:pointer onclick='i3GEO.editorOL.captura("+xy[0]+","+xy[1]+",\""+tema.value+"\""+",\""+valorunico+"\")'>edita geometria</span><br>";i3GEO.Interface.openlayers.balao("<div style='text-align:left' >"+lonlattexto+texto+"</div>","",xy[0],xy[1],false,false);i3GEO.eventos.cliquePerm.ativo=false};p=i3GEO.configura.locaplic+"/classesphp/proxy.php?"+url+"&tipoRetornoProxy=string&REQUEST=GetFeatureInfo&TIPOIMAGEM=nenhum&DESLIGACACHE=sim&STYLES=&SERVICE=WMS&VERSION=1.1.1&FEATURE_COUNT=1"+"&FORMAT=image/png&INFO_FORMAT=text/plain&SRS=EPSG:4326"+"&LAYERS="+tema.value+"&layer="+tema.value+"&QUERY_LAYERS="+tema.value+"&HEIGHT="+i3geoOL.getSize()[1]+"&WIDTH="+i3geoOL.getSize()[0]+"&BBOX="+i3geoOL.getExtent().toBBOX().split(",").join(" ")+"&X="+xy[0]+"&Y="+xy[1];cpJSON.call(p,"foo",retorno,"")}});i3geoOL.addInteraction(draw)};return temp},botaoSalva:function(){var temp=document.createElement("div");temp.className="editorOLsalvaItemInactive olButton";temp.title=$trad("salva");temp.onclick=function(){i3GEO.editorOL.salvaGeometrias()};return temp},criaBotoes:function(botoes){if($i("i3GEObarraEdicao")){$i("i3GEObarraEdicao").style.display="block";return}i3GEOpanelEditor=document.createElement("div");i3GEOpanelEditor.id="i3GEObarraEdicao";i3GEOpanelEditor.className="olControlEditingToolbar1 noprint";if(botoes.novaaba===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoNovaaba())}if(botoes.procura===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoProcura())}if(botoes.pan===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPan())}if(botoes.zoombox===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomBox())}if(botoes.zoomtot===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomTot())}if(botoes.zoomin===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomIn())}if(botoes.zoomout===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomOut())}if(botoes.legenda===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoLegenda())}if(botoes.distancia===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoDistancia())}if(botoes.area===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoArea())}if(botoes.identifica===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoIdentifica())}if(botoes.linha===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoLinha())}if(botoes.ponto===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPonto())}if(botoes.poligono===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPoligono())}if(botoes.texto===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoTexto())}if(botoes.edita===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoEdita())}if(botoes.selecao===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSelecao())}if(botoes.selecaotudo===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSelecaoTudo())}if(botoes.apaga===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoApaga())}if(botoes.frente===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoFrente())}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoCorta())}if(botoes.edita===true&&botoes.listag===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoListaGeometrias())}if(botoes.tools===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoTools())}if(botoes.propriedades===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPropriedades())}if(botoes.salva===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSalva())}if(botoes.ajuda===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoAjuda())}if(botoes.fecha===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoFecha())}i3GEOpanelEditor.style.width=i3GEOpanelEditor.getElementsByTagName("div").length*33+"px";i3GEO.editorOL.mapa.getViewport().getElementsByClassName("ol-overlaycontainer-stopevent")[0].appendChild(i3GEOpanelEditor)},removeFeaturesSel:function(){var s,i,nsel,f;nsel=i3GEO.editorOL.idsSelecionados.length;s=i3GEO.desenho.layergrafico.getSource();for(i=0;i<nsel;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f){i3GEO.editorOL.featuresBackup.push(f.clone());s.removeFeature(f)}}i3GEO.editorOL.idsSelecionados=[]},mudaSimbolo:function(estilo,id){var s,i,nsel,f;i3GEO.editorOL.simbologia[estilo]=$i(id).value;nsel=i3GEO.editorOL.idsSelecionados.length;s=i3GEO.desenho.layergrafico.getSource();for(i=0;i<nsel;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f){if(estilo==="externalGraphic"||estilo==="graphicWidth"||estilo==="graphicHeight"){f.setProperties({src:i3GEO.editorOL.simbologia.externalGraphic,size:[i3GEO.editorOL.simbologia.graphicWidth,i3GEO.editorOL.simbologia.graphicHeight]})}else{f.setProperties({fillColor:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')',strokeColor:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth,fontSize:i3GEO.editorOL.simbologia.fontSize,fontColor:i3GEO.editorOL.simbologia.fontColor,})}}}},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>'+'<p class=paragrafo >Cor do contorno</p>'+'<div class="i3geoForm100 i3geoFormIconeAquarela" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'strokeColor\',\'i3GEOEditorOLcorContorno\');return false;" type="text" id="i3GEOEditorOLcorContorno" value="'+i3GEO.editorOL.simbologia.strokeColor+'" />'+'</div>'+'<br><p class=paragrafo >Cor do preenchimento</p>'+'<div class="i3geoForm100 i3geoFormIconeAquarela" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'fillColor\',\'i3GEOEditorOLcorPre\');return false;" type="text" id="i3GEOEditorOLcorPre" value="'+i3GEO.editorOL.simbologia.fillColor+'" />'+'</div>'+'<br><p class=paragrafo >Cor da fonte</p>'+'<div class="i3geoForm100 i3geoFormIconeAquarela" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'fontColor\',\'i3GEOEditorOLcorFonte\');return false;" type="text" id="i3GEOEditorOLcorFonte" value="'+i3GEO.editorOL.simbologia.fontColor+'" />'+'</div>'+'<br><p class=paragrafo >Tamanho da fonte</p>'+'<div class="i3geoForm100 i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'fontSize\',\'i3GEOEditorOLfontsize\');return false;" type="text" id="i3GEOEditorOLfontsize" value="'+i3GEO.editorOL.simbologia.fontSize+'" />'+'</div>'+'<br><p class=paragrafo >Opacidade (de 0 a 1)</p>'+'<div class="i3geoForm100 i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'opacidade\',\'i3GEOEditorOLopacidade\');return false;" type="text" id="i3GEOEditorOLopacidade" value="'+i3GEO.editorOL.simbologia.opacidade+'" />'+'</div>'+'<br><p class=paragrafo >Largura da linha/contorno</p>'+'<div class="i3geoForm100 i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'strokeWidth\',\'i3GEOEditorOLlarguraLinha\');return false;" type="text" id="i3GEOEditorOLlarguraLinha" value="'+i3GEO.editorOL.simbologia.strokeWidth+'" />'+'</div>'+'<br><p class=paragrafo >Url de uma imagem</p>'+'<div class="i3geoForm i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'externalGraphic\',\'i3GEOEditorOLexternalGraphic\');return false;" type="text" id="i3GEOEditorOLexternalGraphic" value="'+i3GEO.editorOL.simbologia.externalGraphic+'" />'+'</div>'+'<br><p class=paragrafo >Largura da imagem</p>'+'<div class="i3geoForm100 i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'graphicWidth\',\'i3GEOEditorOLgraphicWidth\');return false;" type="text" id="i3GEOEditorOLgraphicWidth" value="'+i3GEO.editorOL.simbologia.graphicWidth+'" />'+'</div>'+'<br><p class=paragrafo >Altura da imagem</p>'+'<div class="i3geoForm100 i3geoFormIconeEdita" >'+'<input onchange="i3GEO.editorOL.mudaSimbolo(\'graphicHeight\',\'i3GEOEditorOLgraphicHeight\');return false;" type="text" id="i3GEOEditorOLgraphicHeight" value="'+i3GEO.editorOL.simbologia.graphicHeight+'" />'+'</div>';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")}}i3GEO.util.aplicaAquarela("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($trad("u6")+" <div id='panellistagEditor_minimizaCabecalho' class='container-minimiza'></div>")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader($trad("u6"))}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 id,temp,geos=i3GEO.desenho.layergrafico.getSource().getFeatures(),n=geos.length,ins="<table class=lista4 >";ins+="<tr><td><i>"+$trad("u6")+"</i></td><td><i>"+$trad("opcoes")+"</i></td><td></td></tr>";while(n>0){n-=1;id=geos[n].getId();if(id){ins+="<tr><td>"+id+"</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.marcaBotao();i3GEO.editorOL.selFeature(\""+id+"\")'>seleciona</td><td style='cursor:pointer;color:blue' onclick='javascript:i3GEO.editorOL.unselFeature(\""+id+"\")'>limpa</td></tr>"}}ins+="</table>";if(geos.length===0){ins=$trad("meneditor2")}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(){var b,ins;if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",height:"150px",visible:false,draggable:true,close:true});ins=""+'<p class=paragrafo >'+$trad("opsel")+':</p>'+'<div class=styled-select >'+'<select id="panelferramentasEditorOpcoes">'+' <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></p>';ins+='</div>';ins+='<br><p class=paragrafo ><input id="panelferramentasEditorAplicar" type="button" value="'+$trad("p14")+'" />';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")}}b=new YAHOO.widget.Button("panelferramentasEditorAplicar",{onclick:{fn:function(){i3GEO.editorOL.processageo($i("panelferramentasEditorOpcoes").value)}}});b.addClass("rodar")}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 polis,linhas,pontos,temp,nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel>0){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"){polis=i3GEO.editorOL.retornaFeaturesTipo("Polygon");linhas=i3GEO.editorOL.retornaFeaturesTipo("LineString");pontos=i3GEO.editorOL.retornaFeaturesTipo("Point");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){polis=i3GEO.editorOL.retornaFeaturesTipo("Polygon");linhas=i3GEO.editorOL.retornaFeaturesTipo("LineString");pontos=i3GEO.editorOL.retornaFeaturesTipo("Point");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{polis=i3GEO.editorOL.retornaGeometriasTipo("Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo("LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo("Point");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)}}i3GEO.desenho.layergrafico.getSource().changed();return}else{i3GEO.janela.tempoMsg("Selecione pelo menos dois elementos")}},merge:function(geoms){var n=geoms.length,w=new Wkt.Wkt(),g,m,i,f,format=new ol.format.WKT();f=format.writeFeatures([geoms[0]]);w.read(f);if(n>1){for(i=1;i<n;i++){g=format.writeFeatures([geoms[i]]);m=new Wkt.Wkt();m.read(g);w.merge(m)}}return w.write()},uniaojts:function(geoms){var n=geoms.length,fwkt=new ol.format.WKT(),rwkt=new jsts.io.WKTReader(),wwkt=new jsts.io.WKTWriter(),g,i,uniao;if(n>1){uniao=fwkt.writeFeatures([geoms[0]]);uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=fwkt.writeFeatures([geoms[i]]);uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.readFeatures(uniao)]}else{return false}},retornaGeometriasTipo:function(tipo){var n=i3GEO.editorOL.idsSelecionados.length,lista=[],i,s=i3GEO.desenho.layergrafico.getSource(),fwkt=new ol.format.WKT();for(i=0;i<n;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f.getGeometry().getType()==tipo){lista.push(fwkt.writeFeatures([f]))}}return lista},retornaFeaturesTipo:function(tipo){var n=i3GEO.editorOL.idsSelecionados.length,lista=[],i,s=i3GEO.desenho.layergrafico.getSource();for(i=0;i<n;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f.getGeometry().getType()==tipo){lista.push(f)}}return lista},guardaBackup:function(){return},selTodos:function(){i3GEO.editorOL.unselTodos();var features,n,f,i,id,st;features=i3GEO.desenho.layergrafico.getSource().getFeatures();n=features.length;for(i=0;i<n;i++){f=features[i];id=f.getId();if(!id){id=i3GEO.util.uid();f.setId(id)}i3GEO.editorOL.idsSelecionados.push(id);st=f.getStyle();if(st&&st.getImage()){f.setStyle(new ol.style.Style({image:new ol.style.Circle({radius:i3GEO.editorOL.simbologia.pointRadius,fill:new ol.style.Fill({color:'rgba(255, 255, 255, 0.5)'}),stroke:new ol.style.Stroke({color:'blue',width:i3GEO.editorOL.simbologia.pointRadius/3})})}));if(st.getImage().getSrc){f.setProperties({fillColor:"",strokeColor:"",externalGraphic:st.getImage().getSrc(),graphicHeight:st.getImage().getSize()[1],graphicWidth:st.getImage().getSize()[0]})}else{f.setProperties({fillColor:st.getImage().getFill().getColor(),strokeColor:st.getImage().getStroke().getColor(),externalGraphic:"",graphicHeight:"",graphicWidth:""})}}else if(st){f.setProperties({fillColor:st.getFill().getColor(),strokeColor:st.getStroke().getColor()});st.getFill().setColor('rgba(255, 255, 255, 0.5)');st.getStroke().setColor('blue')}}i3GEO.desenho.layergrafico.getSource().changed()},unselTodos:function(){var i,n,f,s,st;s=i3GEO.desenho.layergrafico.getSource();n=i3GEO.editorOL.idsSelecionados.length;for(i=0;i<n;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f){st=f.getStyle();if(st&&st.getImage()){if(st.getImage().getSrc||f.getProperties().externalGraphic!=""){f.setStyle(new ol.style.Style({image:new ol.style.Icon({src:f.getProperties().externalGraphic,size:[f.getProperties().graphicWidth,f.getProperties().graphicHeight]})}))}else{f.setStyle(new ol.style.Style({image:new ol.style.Circle({radius:i3GEO.editorOL.simbologia.pointRadius,fill:new ol.style.Fill({color:f.getProperties().fillColor}),stroke:new ol.style.Stroke({color:f.getProperties().strokeColor,width:i3GEO.editorOL.simbologia.pointRadius/3})})}))}}else if(st){st.getFill().setColor(f.getProperties().fillColor);st.getStroke().setColor(f.getProperties().strokeColor)}}}i3GEO.editorOL.idsSelecionados=[];i3GEO.desenho.layergrafico.getSource().changed()},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])}},unselFeature:function(id){var f,s;s=i3GEO.desenho.layergrafico.getSource();f=s.getFeatureById(id);if(f){if(f.getStyle().getSrc()){f.getStyle().setSrc(f.getProperties().externalGraphic);f.getStyle().setSize([f.getProperties().graphicWidth,f.getProperties().graphicHeight])}else{f.getStyle().getFill().setColor(f.getProperties().fillColor);f.getStyle().getStroke().setColor(f.getProperties().strokeColor)}}i3GEO.editorOL.idsSelecionados.remove(id);i3GEO.desenho.layergrafico.getSource().changed()},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(f){i3GEO.editorOL.removeFeaturesSel();var fwkt=new ol.format.WKT();f=fwkt.readFeatures(f)[0];f.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'})}));f.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(f)},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(id){var s,f;s=i3GEO.desenho.layergrafico.getSource();f=s.getFeatureById(id);if(!i3GEO.util.in_array(id,i3GEO.editorOL.idsSelecionados)){i3GEO.editorOL.idsSelecionados.push(id);f.setProperties({fillColor:f.getStyle().getFill().getColor(),strokeColor:f.getStyle().getStroke().getColor(),externalGraphic:""});f.getStyle().getFill().setColor('rgba(255, 255, 255, 0.5)');f.getStyle().getStroke().setColor('blue');s.changed()}},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 s,i,nsel,id,clone;s=i3GEO.desenho.layergrafico.getSource();nsel=i3GEO.editorOL.idsSelecionados.length;for(i=0;i<nsel;i++){f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[i]);if(f){clone=f.clone();id=f.getId();s.removeFeature(f);clone.setId(id);s.addFeature(clone)}}s.changed()},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){return obj.transform("EPSG:900913","EPSG:4326")}else{return obj}},sobeLayersGraficos:function(){}};i3GEO.editorOL.backup.getFeatures=function(){return i3GEO.editorOL.backup.getSource().getFeatures()}; | |
3 | 3 | \ No newline at end of file | ... | ... |
ferramentas/geolocal/index.js
... | ... | @@ -43,14 +43,14 @@ i3GEOF.geolocal = |
43 | 43 | { |
44 | 44 | /* |
45 | 45 | * Variavel: posicoes |
46 | - * | |
46 | + * | |
47 | 47 | * Objetos capturados |
48 | 48 | */ |
49 | 49 | posicoes : [], |
50 | 50 | tempo : null, |
51 | 51 | /* |
52 | 52 | * Variavel: aguarde |
53 | - * | |
53 | + * | |
54 | 54 | * Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. |
55 | 55 | */ |
56 | 56 | aguarde : "", |
... | ... | @@ -68,11 +68,11 @@ i3GEOF.geolocal = |
68 | 68 | }, |
69 | 69 | /* |
70 | 70 | * Function: inicia |
71 | - * | |
71 | + * | |
72 | 72 | * Inicia a ferramenta. É chamado por criaJanelaFlutuante |
73 | - * | |
73 | + * | |
74 | 74 | * Parametro: |
75 | - * | |
75 | + * | |
76 | 76 | * iddiv {String} - id do div que receberá o conteudo HTML da ferramenta |
77 | 77 | */ |
78 | 78 | inicia : function(iddiv) { |
... | ... | @@ -100,11 +100,11 @@ i3GEOF.geolocal = |
100 | 100 | }, |
101 | 101 | /* |
102 | 102 | * Function: html |
103 | - * | |
103 | + * | |
104 | 104 | * Gera o código html para apresentação das opções da ferramenta |
105 | - * | |
105 | + * | |
106 | 106 | * Retorno: |
107 | - * | |
107 | + * | |
108 | 108 | * String com o código html |
109 | 109 | */ |
110 | 110 | html : function() { |
... | ... | @@ -113,7 +113,7 @@ i3GEOF.geolocal = |
113 | 113 | }, |
114 | 114 | /* |
115 | 115 | * Function: iniciaJanelaFlutuante |
116 | - * | |
116 | + * | |
117 | 117 | * Cria a janela flutuante para controle da ferramenta. |
118 | 118 | */ |
119 | 119 | iniciaJanelaFlutuante : function() { |
... | ... | @@ -134,7 +134,7 @@ i3GEOF.geolocal = |
134 | 134 | + "<a class=ajuda_usuario target=_blank href='" |
135 | 135 | + i3GEO.configura.locaplic |
136 | 136 | + "/ajuda_usuario.php?idcategoria=6&idajuda=118' ><b> </b></a></div>"; |
137 | - janela = i3GEO.janela.cria("290", "220", "", "", "", titulo, "i3GEOF.geolocal", false, "hd", cabecalho, minimiza); | |
137 | + janela = i3GEO.janela.cria("310", "230", "", "", "", titulo, "i3GEOF.geolocal", false, "hd", cabecalho, minimiza); | |
138 | 138 | divid = janela[2].id; |
139 | 139 | $i("i3GEOF.geolocal_corpo").style.backgroundColor = "white"; |
140 | 140 | $i("i3GEOF.geolocal_corpo").style.textAlign = "left"; |
... | ... | @@ -143,7 +143,7 @@ i3GEOF.geolocal = |
143 | 143 | temp = function() { |
144 | 144 | var api; |
145 | 145 | if (i3GEO.Interface["ATUAL"] === "openlayers") { |
146 | - if (typeof OpenLayers == "undefined") { | |
146 | + if (typeof OpenLayers.Control == "undefined") { | |
147 | 147 | api = "ol3"; |
148 | 148 | } else { |
149 | 149 | api = "openlayers"; |
... | ... | @@ -256,7 +256,7 @@ i3GEOF.geolocal = |
256 | 256 | limpa : function() { |
257 | 257 | i3GEOF.geolocal.posicoes = []; |
258 | 258 | if (i3GEO.Interface["ATUAL"] === "openlayers") { |
259 | - if (typeof OpenLayers == "undefined") { | |
259 | + if (typeof OpenLayers.Control == "undefined") { | |
260 | 260 | api = "ol3"; |
261 | 261 | } else { |
262 | 262 | api = "openlayers"; | ... | ... |
ferramentas/googlemaps1/endereco.php
1 | 1 | <?php |
2 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
2 | 3 | include(dirname(__FILE__)."/../../ms_configura.php"); |
3 | -include_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
4 | +$_GET = array_merge($_GET,$_POST); | |
5 | +$x = $_GET["x"]; | |
6 | +$y = $_GET["y"]; | |
7 | + | |
4 | 8 | ?> |
5 | 9 | <html> |
6 | 10 | <head> | ... | ... |
ferramentas/heatmap/funcoes.php
ferramentas/identifica/index.js
... | ... | @@ -45,7 +45,7 @@ if (typeof (i3GEOF) === 'undefined') { |
45 | 45 | } |
46 | 46 | /* |
47 | 47 | * Classe: i3GEOF.identifica |
48 | - * | |
48 | + * | |
49 | 49 | */ |
50 | 50 | |
51 | 51 | // TODO na listagem de atributos, incluir opcao para abrir os valores das variaveis associadas a uma regiao, quando codigo_tipo_regiao for |
... | ... | @@ -67,63 +67,64 @@ i3GEOF.identifica = |
67 | 67 | mustacheHash : function(idjanela) { |
68 | 68 | var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.identifica.dicionario); |
69 | 69 | dicionario["idjanelaA"] = idjanela; |
70 | + dicionario["locaplic"] = i3GEO.configura.locaplic; | |
70 | 71 | return dicionario; |
71 | 72 | }, |
72 | 73 | /* |
73 | 74 | * Propriedade: mostraLinkGeohack |
74 | - * | |
75 | + * | |
75 | 76 | * Mostra ou não o link para abrir o site GeoHack. |
76 | - * | |
77 | + * | |
77 | 78 | * Este site permite o uso de vários buscadores disponíveis na internet. |
78 | - * | |
79 | + * | |
79 | 80 | * Type: {boolean} |
80 | 81 | */ |
81 | 82 | mostraLinkGeohack : true, |
82 | 83 | /* |
83 | 84 | * Propriedade: mostraSistemasAdicionais |
84 | - * | |
85 | + * | |
85 | 86 | * Mostra ou não a lista de sistemas adicionais de busca de dados. |
86 | - * | |
87 | + * | |
87 | 88 | * Type: {boolean} |
88 | 89 | */ |
89 | 90 | mostraSistemasAdicionais : true, |
90 | 91 | /* |
91 | 92 | * Variavel: tema |
92 | - * | |
93 | + * | |
93 | 94 | * Código do tema que será pesquisado |
94 | - * | |
95 | + * | |
95 | 96 | * Type: {String} |
96 | 97 | */ |
97 | 98 | tema : "", |
98 | 99 | /* |
99 | 100 | * Variavel: x |
100 | - * | |
101 | + * | |
101 | 102 | * Coordenada x |
102 | - * | |
103 | + * | |
103 | 104 | * Type: {Numeric} |
104 | 105 | */ |
105 | 106 | x : 0, |
106 | 107 | /* |
107 | 108 | * Variavel: y |
108 | - * | |
109 | + * | |
109 | 110 | * Coordenada y |
110 | - * | |
111 | + * | |
111 | 112 | * Type: {Numeric} |
112 | 113 | */ |
113 | 114 | y : 0, |
114 | 115 | /* |
115 | 116 | * Variavel: sistemasAdicionais |
116 | - * | |
117 | + * | |
117 | 118 | * Guarda a lista de sistemas adicionais que são incluídos na seleção de temas |
118 | - * | |
119 | + * | |
119 | 120 | * Type: {Array} |
120 | 121 | */ |
121 | 122 | sistemasAdicionais : [], |
122 | 123 | /* |
123 | 124 | * Variavel: dadosIdentifica |
124 | - * | |
125 | + * | |
125 | 126 | * Guarda os dados obtidos com a chamada em AJAX de identificação |
126 | - * | |
127 | + * | |
127 | 128 | * Type: {Array} |
128 | 129 | */ |
129 | 130 | dadosIdentifica : [], |
... | ... | @@ -136,9 +137,9 @@ i3GEOF.identifica = |
136 | 137 | }, |
137 | 138 | /* |
138 | 139 | * Function: iniciaDicionario |
139 | - * | |
140 | + * | |
140 | 141 | * Carrega o dicionário e chama a função que inicia a ferramenta |
141 | - * | |
142 | + * | |
142 | 143 | * O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script |
143 | 144 | */ |
144 | 145 | iniciaDicionario : function(x, y, id) { |
... | ... | @@ -164,24 +165,24 @@ i3GEOF.identifica = |
164 | 165 | }, |
165 | 166 | /* |
166 | 167 | * Function: inicia |
167 | - * | |
168 | + * | |
168 | 169 | * Inicia a janela de informações |
169 | - * | |
170 | + * | |
170 | 171 | * Parameters: |
171 | - * | |
172 | + * | |
172 | 173 | * tema {String} - código do tema, existente no mapfile armazenado na seção, que será consultado |
173 | 174 | * já na inicialização |
174 | - * | |
175 | + * | |
175 | 176 | * x {Numeric} - coordenada x do ponto que será utilizado para busca dos atributos |
176 | - * | |
177 | + * | |
177 | 178 | * y {Numeric} - coordenada y do ponto |
178 | - * | |
179 | + * | |
179 | 180 | * iddiv {String} - id do elemento html onde o conteúdo da ferramenta será incluido |
180 | - * | |
181 | + * | |
181 | 182 | * mostraLinkGeohack {boolean} - mostra ou não o link para o site geohacks |
182 | - * | |
183 | + * | |
183 | 184 | * mostraSistemasAdicionais {boolean} - mostra ou não os sistemas adicionais de busca de dados |
184 | - * | |
185 | + * | |
185 | 186 | * idjanela {string} |
186 | 187 | */ |
187 | 188 | inicia : function(tema, x, y, iddiv, mostraLinkGeohack, mostraSistemasAdicionais, idjanela) { |
... | ... | @@ -325,7 +326,7 @@ i3GEOF.identifica = |
325 | 326 | }, |
326 | 327 | /* |
327 | 328 | * Function: iniciaJanelaFlutuante |
328 | - * | |
329 | + * | |
329 | 330 | * Cria a janela flutuante para controle da ferramenta. |
330 | 331 | */ |
331 | 332 | iniciaJanelaFlutuante : function(x, y) { |
... | ... | @@ -361,8 +362,8 @@ i3GEOF.identifica = |
361 | 362 | + "/ajuda_usuario.php?idcategoria=8&idajuda=70' ><b> </b></a></div>"; |
362 | 363 | janela = |
363 | 364 | i3GEO.janela.cria( |
364 | - "450px", | |
365 | - "250px", | |
365 | + "470px", | |
366 | + "270px", | |
366 | 367 | "", |
367 | 368 | "", |
368 | 369 | "", |
... | ... | @@ -429,7 +430,7 @@ i3GEOF.identifica = |
429 | 430 | }, |
430 | 431 | /* |
431 | 432 | * Function: ativaFoco |
432 | - * | |
433 | + * | |
433 | 434 | * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado |
434 | 435 | */ |
435 | 436 | ativaFoco : function(id) { |
... | ... | @@ -453,11 +454,11 @@ i3GEOF.identifica = |
453 | 454 | }, |
454 | 455 | /* |
455 | 456 | * Function: html |
456 | - * | |
457 | + * | |
457 | 458 | * Gera o código html para apresentação das opções da ferramenta |
458 | - * | |
459 | + * | |
459 | 460 | * Retorno: |
460 | - * | |
461 | + * | |
461 | 462 | * String com o código html |
462 | 463 | */ |
463 | 464 | html : function(idjanela) { |
... | ... | @@ -534,17 +535,17 @@ i3GEOF.identifica = |
534 | 535 | }, |
535 | 536 | /* |
536 | 537 | * Function: listaTemas |
537 | - * | |
538 | + * | |
538 | 539 | * Incluí a lista de temas para o usuário escolher |
539 | - * | |
540 | + * | |
540 | 541 | * Veja: |
541 | - * | |
542 | + * | |
542 | 543 | * <i3GEO.php.listaTemas> |
543 | - * | |
544 | + * | |
544 | 545 | * Parametros: |
545 | - * | |
546 | + * | |
546 | 547 | * tipo {String} - ligados|todos lista apenas os temas que estão visíveis no mapa ou todos os temas |
547 | - * | |
548 | + * | |
548 | 549 | * id {string} id da janela em foco |
549 | 550 | */ |
550 | 551 | listaTemas : function(tipo) { |
... | ... | @@ -562,13 +563,13 @@ i3GEOF.identifica = |
562 | 563 | }, |
563 | 564 | /* |
564 | 565 | * Function: montaListaTemas |
565 | - * | |
566 | + * | |
566 | 567 | * Monta a lista de temas na forma de botões 'radio' |
567 | - * | |
568 | + * | |
568 | 569 | * O resultado é inserido no div com id "listaTemas" |
569 | - * | |
570 | + * | |
570 | 571 | * Parametros: |
571 | - * | |
572 | + * | |
572 | 573 | * retorno {JSON} - objeto retornado por i3GEO.php.listaTemas ou por i3GEO.arvoreDeCamadas.filtraCamadas |
573 | 574 | */ |
574 | 575 | montaListaTemas : function(retorno) { |
... | ... | @@ -641,11 +642,11 @@ i3GEOF.identifica = |
641 | 642 | }, |
642 | 643 | /* |
643 | 644 | * Function: montaLinkGeohack |
644 | - * | |
645 | + * | |
645 | 646 | * Monta o link para o site geohack |
646 | - * | |
647 | + * | |
647 | 648 | * Return: |
648 | - * | |
649 | + * | |
649 | 650 | * {String} |
650 | 651 | */ |
651 | 652 | montaLinkGeohack : function() { |
... | ... | @@ -675,13 +676,13 @@ i3GEOF.identifica = |
675 | 676 | }, |
676 | 677 | /* |
677 | 678 | * Function: montaListaSistemas |
678 | - * | |
679 | + * | |
679 | 680 | * Obtém a lista de sistemas especiais de consulta. |
680 | - * | |
681 | + * | |
681 | 682 | * O resultado é inserido no div com id "listaSistemas". |
682 | - * | |
683 | + * | |
683 | 684 | * Cada sistema consiste em uma URL para a qual serão passados os parametros x e y. |
684 | - * | |
685 | + * | |
685 | 686 | */ |
686 | 687 | montaListaSistemas : function(retorno) { |
687 | 688 | var l, divins, ig, sistema, pub, exec, temp, t, linhas, ltema, i, idjanela, n = i3GEOF.identifica.janelas.length; |
... | ... | @@ -751,11 +752,11 @@ i3GEOF.identifica = |
751 | 752 | }, |
752 | 753 | /* |
753 | 754 | * Function: buscaDadosTema |
754 | - * | |
755 | + * | |
755 | 756 | * Obtém os dados de um tema para o ponto de coordenadas clicado no mapa |
756 | - * | |
757 | + * | |
757 | 758 | * Veja: |
758 | - * | |
759 | + * | |
759 | 760 | * <i3GEO.php.identifica3> |
760 | 761 | */ |
761 | 762 | buscaDadosTema : function(tema, x, y, idjanela) { |
... | ... | @@ -848,13 +849,13 @@ i3GEOF.identifica = |
848 | 849 | }, |
849 | 850 | /* |
850 | 851 | * Function: mostraDadosSistema |
851 | - * | |
852 | + * | |
852 | 853 | * Obtém os dados de um sistema para o ponto de coordenadas clicado no mapa |
853 | - * | |
854 | + * | |
854 | 855 | * Parametros: |
855 | - * | |
856 | + * | |
856 | 857 | * exec {String} - url que será aberta |
857 | - * | |
858 | + * | |
858 | 859 | * target {String} (depreciado) - _self|self| onde a url será aberta. Se for "self", será aberta na mesma janela, caso |
859 | 860 | * contrário, em uma nova página do navegador |
860 | 861 | */ |
... | ... | @@ -873,15 +874,15 @@ i3GEOF.identifica = |
873 | 874 | }, |
874 | 875 | /* |
875 | 876 | * Function abrejanelaIframe |
876 | - * | |
877 | + * | |
877 | 878 | * Abre uma janela flutuante contendo um iframe |
878 | - * | |
879 | + * | |
879 | 880 | * Parametros: |
880 | - * | |
881 | + * | |
881 | 882 | * w {string} - largura |
882 | - * | |
883 | + * | |
883 | 884 | * h {string} - altura |
884 | - * | |
885 | + * | |
885 | 886 | * s {string} - src do iframe |
886 | 887 | */ |
887 | 888 | abrejanelaIframe : function(w, h, s) { |
... | ... | @@ -912,14 +913,14 @@ i3GEOF.identifica = |
912 | 913 | }, |
913 | 914 | /* |
914 | 915 | * Function: mostraDadosTema |
915 | - * | |
916 | + * | |
916 | 917 | * Mostra os dados obtidos de um ou mais temas. |
917 | - * | |
918 | + * | |
918 | 919 | * Recebe o resultado em JSON da operação de consulta realizada pelo servidor e formata os dados para |
919 | 920 | * apresentação na tela. |
920 | - * | |
921 | + * | |
921 | 922 | * Parametros: |
922 | - * | |
923 | + * | |
923 | 924 | * retorno {JSON} - objeto JSON com os dados <i3GEO.php.identifica3> |
924 | 925 | */ |
925 | 926 | mostraDadosTema : function(retorno, idjanela) { |
... | ... | @@ -1108,7 +1109,7 @@ i3GEOF.identifica = |
1108 | 1109 | else{ |
1109 | 1110 | alvo = "_blank"; |
1110 | 1111 | } |
1111 | - res += | |
1112 | + res += | |
1112 | 1113 | "<div style='width:100%;text-align:left;background-color:" + cor |
1113 | 1114 | + "' >" |
1114 | 1115 | + tip | ... | ... |
ferramentas/identifica/template_mst.html
1 | 1 | <div id='{{{idjanelaA}}}i3GEOidentificaguiasYUI' class='yui-navset' style='overflow: hidden;top: 0px; cursor: pointer; left: 0px;'> |
2 | 2 | <ul class='yui-nav' style='border-width: 0pt 0pt 0px; border-color: rgb(240, 240, 240); border-bottom-color: white;'> |
3 | 3 | <li> |
4 | + <div id='{{{idjanelaA}}}i3GEOidentificaguia3' style='text-align: center; left: 0px;'> | |
5 | + <a> | |
6 | + <em><img class='ticPropriedades2' style='height: 14px' title='{{{propriedades}}}' src='{{{locaplic}}}/imagens/branco.gif'> </em> | |
7 | + </a> | |
8 | + </div> | |
9 | + </li> | |
10 | + <li> | |
4 | 11 | <div id='{{{idjanelaA}}}i3GEOidentificaguia1' style='text-align: center; left: 0px;'> |
5 | 12 | <a><em>{{{temasVisiveis}}}</em></a> |
6 | 13 | </div> |
... | ... | @@ -20,11 +27,6 @@ |
20 | 27 | <a><em>XY/buffer</em></a> |
21 | 28 | </div> |
22 | 29 | </li> |
23 | - <li> | |
24 | - <div id='{{{idjanelaA}}}i3GEOidentificaguia3' style='text-align: center; left: 0px;'> | |
25 | - <a><em>{{{propriedades}}}</em></a> | |
26 | - </div> | |
27 | - </li> | |
28 | 30 | </ul> |
29 | 31 | </div> |
30 | 32 | <div class='guiaobj' id='{{{idjanelaA}}}i3GEOidentificaguia1obj' style='overflow:auto;width:97%;height:90%;left: 1px;'> | ... | ... |
ferramentas/imprimir/a4lpaisagempdf.php
... | ... | @@ -2,11 +2,13 @@ |
2 | 2 | // |
3 | 3 | //escrito por Luis Henrique Weirich de Matos |
4 | 4 | // |
5 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
5 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
6 | +$_GET = array_merge($_GET,$_POST); | |
7 | +$mapexten = $_GET["mapexten"]; | |
6 | 8 | error_reporting(0); |
7 | 9 | session_name("i3GeoPHP"); |
8 | -if (isset($g_sid)) | |
9 | -{session_id($g_sid);} | |
10 | +if (isset($_GET["g_sid"])) | |
11 | +{session_id($_GET["g_sid"]);} | |
10 | 12 | session_start(); |
11 | 13 | $map_file = $_SESSION["map_file"]; |
12 | 14 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
... | ... | @@ -37,9 +39,8 @@ $nomes = nomeRandomico(); |
37 | 39 | $map = ms_newMapObj($map_file); |
38 | 40 | $temp = str_replace(".map","xxx.map",$map_file); |
39 | 41 | $map->save($temp); |
40 | -substituiCon($temp,$postgis_mapa); | |
41 | 42 | $map = ms_newMapObj($temp); |
42 | - | |
43 | +restauraCon($temp,$postgis_mapa); | |
43 | 44 | if($map->getmetadata("interface") == "googlemaps"){ |
44 | 45 | $proj4 = pegaProjecaoDefault("proj4"); |
45 | 46 | $map->setProjection($proj4); |
... | ... | @@ -83,7 +84,7 @@ foreach ($temas as $tema) |
83 | 84 | $map->save($temp); |
84 | 85 | removeLinha("classeNula",$temp); |
85 | 86 | $map = ms_newMapObj($temp); |
86 | - | |
87 | +substituiCon($temp,$postgis_mapa); | |
87 | 88 | $o = $map->outputformat; |
88 | 89 | if($mapexten != ""){ |
89 | 90 | $ext = explode(" ",$mapexten); |
... | ... | @@ -126,7 +127,9 @@ $nomer = ($imgo->imagepath)."leg".$nomeImagem.".PNG"; |
126 | 127 | $imgo->saveImage($nomer); |
127 | 128 | $pathlegenda = $dir_tmp."/".basename($imgo->imageurl)."/".basename($nomer); |
128 | 129 | $titulo = $_GET['titulo']; |
130 | + | |
129 | 131 | substituiCon($map_file,$postgis_mapa); |
132 | + | |
130 | 133 | require(dirname(__FILE__).'/../../pacotes/fpdf/fpdf.php'); |
131 | 134 | $pdf = new FPDF("L","mm","A4"); |
132 | 135 | $pdf->SetAutoPageBreak(false); | ... | ... |
ferramentas/imprimir/aggpng.php
... | ... | @@ -29,11 +29,13 @@ GNU junto com este programa; se n&atilde;o, escreva para a |
29 | 29 | Free Software Foundation, Inc., no endereço |
30 | 30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
31 | 31 | */ |
32 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
32 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
33 | +$_GET = array_merge($_GET,$_POST); | |
34 | +$mapexten = $_GET["mapexten"]; | |
33 | 35 | error_reporting(0); |
34 | 36 | session_name("i3GeoPHP"); |
35 | -if (isset($g_sid)) | |
36 | -{session_id($g_sid);} | |
37 | +if (isset($_GET["g_sid"])) | |
38 | +{session_id($_GET["g_sid"]);} | |
37 | 39 | session_start(); |
38 | 40 | $map_file = $_SESSION["map_file"]; |
39 | 41 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
... | ... | @@ -107,7 +109,7 @@ foreach ($temas as $tema) |
107 | 109 | $map->save($temp); |
108 | 110 | removeLinha("classeNula",$temp); |
109 | 111 | $map = ms_newMapObj($temp); |
110 | - | |
112 | +substituiCon($temp,$postgis_mapa); | |
111 | 113 | $o = $map->outputformat; |
112 | 114 | |
113 | 115 | if($mapexten != ""){ | ... | ... |
ferramentas/imprimir/geotif.php
... | ... | @@ -29,11 +29,14 @@ GNU junto com este programa; se n&atilde;o, escreva para a |
29 | 29 | Free Software Foundation, Inc., no endereço |
30 | 30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
31 | 31 | */ |
32 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
32 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
33 | +$_GET = array_merge($_GET,$_POST); | |
34 | +$mapexten = $_GET["mapexten"]; | |
33 | 35 | error_reporting(0); |
34 | 36 | session_name("i3GeoPHP"); |
35 | -if (isset($g_sid)) | |
36 | -{session_id($g_sid);} | |
37 | +if (isset($_GET["g_sid"])) | |
38 | +{session_id($_GET["g_sid"]);} | |
39 | + | |
37 | 40 | session_start(); |
38 | 41 | $map_file = $_SESSION["map_file"]; |
39 | 42 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
... | ... | @@ -60,7 +63,7 @@ require(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
60 | 63 | error_reporting(0); |
61 | 64 | $nomes = nomeRandomico(); |
62 | 65 | $map = ms_newMapObj($map_file); |
63 | -$temp = str_replace(".map","xxx.map",$map_file); | |
66 | +$temp = str_replace(".map","",$map_file)."xxx.map"; | |
64 | 67 | $map->save($temp); |
65 | 68 | substituiCon($temp,$postgis_mapa); |
66 | 69 | $of = $map->outputformat; |
... | ... | @@ -107,6 +110,7 @@ foreach ($temas as $tema) |
107 | 110 | $map->save($temp); |
108 | 111 | removeLinha("classeNula",$temp); |
109 | 112 | $map = ms_newMapObj($temp); |
113 | +substituiCon($temp,$postgis_mapa); | |
110 | 114 | $o = $map->outputformat; |
111 | 115 | if($mapexten != ""){ |
112 | 116 | $ext = explode(" ",$mapexten); | ... | ... |
ferramentas/imprimir/geraimagens.php
1 | 1 | <?php |
2 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
2 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
3 | +$_GET = array_merge($_GET,$_POST); | |
4 | +$mapexten = $_GET["mapexten"]; | |
3 | 5 | error_reporting(0); |
4 | 6 | session_name("i3GeoPHP"); |
5 | -if (isset($g_sid)) | |
6 | -{session_id($g_sid);} | |
7 | +if (isset($_GET["g_sid"])) | |
8 | +{session_id($_GET["g_sid"]);} | |
9 | + | |
7 | 10 | session_start(); |
8 | 11 | $map_file = $_SESSION["map_file"]; |
9 | 12 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
... | ... | @@ -34,7 +37,7 @@ $map = ms_newMapObj($map_file); |
34 | 37 | $map->save($temp); |
35 | 38 | substituiCon($temp,$postgis_mapa); |
36 | 39 | $map = ms_newMapObj($temp); |
37 | - | |
40 | +substituiCon($temp,$postgis_mapa); | |
38 | 41 | $w = $map->width; |
39 | 42 | $h = $map->height; |
40 | 43 | $legenda =$map->legend; | ... | ... |
ferramentas/imprimir/jpeg.php
... | ... | @@ -29,11 +29,13 @@ GNU junto com este programa; se n&atilde;o, escreva para a |
29 | 29 | Free Software Foundation, Inc., no endereço |
30 | 30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
31 | 31 | */ |
32 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
32 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
33 | +$_GET = array_merge($_GET,$_POST); | |
34 | +$mapexten = $_GET["mapexten"]; | |
33 | 35 | error_reporting(0); |
34 | 36 | session_name("i3GeoPHP"); |
35 | -if (isset($g_sid)) | |
36 | -{session_id($g_sid);} | |
37 | +if (isset($_GET["g_sid"])) | |
38 | +{session_id($_GET["g_sid"]);} | |
37 | 39 | session_start(); |
38 | 40 | $map_file = $_SESSION["map_file"]; |
39 | 41 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
... | ... | @@ -109,7 +111,7 @@ foreach ($temas as $tema) |
109 | 111 | $map->save($temp); |
110 | 112 | removeLinha("classeNula",$temp); |
111 | 113 | $map = ms_newMapObj($temp); |
112 | - | |
114 | +substituiCon($temp,$postgis_mapa); | |
113 | 115 | $o = $map->outputformat; |
114 | 116 | |
115 | 117 | if($mapexten != ""){ | ... | ... |
ferramentas/imprimir/svg.php
... | ... | @@ -29,11 +29,13 @@ GNU junto com este programa; se n&atilde;o, escreva para a |
29 | 29 | Free Software Foundation, Inc., no endereço |
30 | 30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
31 | 31 | */ |
32 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
32 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
33 | +$_GET = array_merge($_GET,$_POST); | |
34 | +$mapexten = $_GET["mapexten"]; | |
33 | 35 | error_reporting(0); |
34 | 36 | session_name("i3GeoPHP"); |
35 | -if (isset($g_sid)) | |
36 | -{session_id($g_sid);} | |
37 | +if (isset($_GET["g_sid"])) | |
38 | +{session_id($_GET["g_sid"]);} | |
37 | 39 | session_start(); |
38 | 40 | $map_file = $_SESSION["map_file"]; |
39 | 41 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
... | ... | @@ -131,7 +133,7 @@ for ($i=0;$i < $numlayers;$i++) |
131 | 133 | $map->save($temp); |
132 | 134 | removeLinha("classeNula",$temp); |
133 | 135 | $map = ms_newMapObj($temp); |
134 | - | |
136 | +substituiCon($temp,$postgis_mapa); | |
135 | 137 | $o = $map->outputformat; |
136 | 138 | if($mapexten != ""){ |
137 | 139 | $ext = explode(" ",$mapexten); | ... | ... |
ferramentas/imprimir/swf.php
1 | 1 | <?php |
2 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
2 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
3 | +$_GET = array_merge($_GET,$_POST); | |
3 | 4 | error_reporting(0); |
4 | 5 | session_name("i3GeoPHP"); |
5 | -if (isset($g_sid)) | |
6 | -{session_id($g_sid);} | |
6 | +if (isset($_GET["g_sid"])) | |
7 | +{session_id($_GET["g_sid"]);} | |
7 | 8 | session_start(); |
8 | -foreach(array_keys($_SESSION) as $k) | |
9 | -{ | |
10 | - eval("\$".$k."='".$_SESSION[$k]."';"); | |
11 | -} | |
9 | + | |
10 | +$map_file = $_SESSION["map_file"]; | |
12 | 11 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
13 | 12 | // |
14 | 13 | //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido | ... | ... |
ferramentas/inicia.php
... | ... | @@ -31,11 +31,20 @@ if(!empty($g_sid)){ |
31 | 31 | session_name("i3GeoPHP"); |
32 | 32 | session_id($g_sid); |
33 | 33 | session_start(); |
34 | - foreach(array_keys($_SESSION) as $k){ | |
35 | - if(!is_array($_SESSION[$k])) | |
36 | - eval("\$".$k."='".$_SESSION[$k]."';"); | |
37 | - } | |
38 | - $postgis_mapa = $_SESSION["postgis_mapa"]; | |
34 | + $statusFerramentas = $_SESSION["statusFerramentas"]; | |
35 | + $imgurl = $_SESSION["imgurl"]; | |
36 | + $tmpurl = $_SESSION["tmpurl"]; | |
37 | + $map_file = $_SESSION["map_file"]; | |
38 | + $mapext = $_SESSION["mapext"]; | |
39 | + $locaplic = $_SESSION["locaplic"]; | |
40 | + $mapext = $_SESSION["mapext"]; | |
41 | + $ler_extensoes = $_SESSION["ler_extensoes"]; | |
42 | + $perfil = $_SESSION["perfil"]; | |
43 | + $interface = $_SESSION["interface"]; | |
44 | + $kmlurl = $_SESSION["kmlurl"]; | |
45 | + $mapdir = $_SESSION["mapdir"]; | |
46 | + $imgdir = $_SESSION["imgdir"]; | |
47 | + $contadorsalva = $_SESSION["contadorsalva"]; | |
39 | 48 | } |
40 | 49 | include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); |
41 | 50 | if(isset($fingerprint) && !empty($g_sid)) { |
... | ... | @@ -55,9 +64,11 @@ if(!substituiCon($map_file,$postgis_mapa)){ |
55 | 64 | cpjson("erro",$cp); |
56 | 65 | return; |
57 | 66 | } |
67 | +// | |
58 | 68 | function redesenhaMapa() |
59 | 69 | { |
60 | 70 | global $map_file,$tipoimagem,$cp,$postgis_mapa,$utilizacgi,$locmapserv,$interface,$mapexten; |
71 | + substituiCon($map_file,$postgis_mapa); | |
61 | 72 | if($tipoimagem != "nenhum" && $tipoimagem != "") |
62 | 73 | {$utilizacgi = "nao";} |
63 | 74 | if (connection_aborted()){exit();} | ... | ... |
ferramentas/inseregrafico/index.js
... | ... | @@ -155,7 +155,7 @@ i3GEOF.insereGrafico = { |
155 | 155 | g_nomepin = "pin"+temp[1]; |
156 | 156 | var i = $i("i3GEOF.insereGrafico_c").style; |
157 | 157 | i3GEO.janela.ULTIMOZINDEX++; |
158 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | |
158 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; | |
159 | 159 | }, |
160 | 160 | /* |
161 | 161 | Function: insere | ... | ... |
ferramentas/inserexy2/index.js
... | ... | @@ -191,7 +191,7 @@ i3GEOF.inserexy = { |
191 | 191 | }; |
192 | 192 | titulo = "<span class='i3GEOiconeFerramenta i3GEOiconeInserexy'></span><div class='i3GeoTituloJanela'>" + $trad("d22t")+"<a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=5&idajuda=83' ><b> </b></a></div>"; |
193 | 193 | janela = i3GEO.janela.cria( |
194 | - "500px", | |
194 | + "520px", | |
195 | 195 | "310px", |
196 | 196 | "", |
197 | 197 | "", |
... | ... | @@ -231,7 +231,7 @@ i3GEOF.inserexy = { |
231 | 231 | i3GEO.barraDeBotoes.ativaIcone("inserexy"); |
232 | 232 | var i = $i("i3GEOF.inserexy_c").style; |
233 | 233 | i3GEO.janela.ULTIMOZINDEX++; |
234 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | |
234 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; | |
235 | 235 | }, |
236 | 236 | /* |
237 | 237 | Function: montaComboLocal | ... | ... |
ferramentas/loginusuario/template_mst_bt.html
1 | 1 | <li> |
2 | - <div id="i3GEOF_loginusuario_imagemCabecalho" style="visibility:hidden;"> | |
2 | + <div id="i3GEOF_loginusuario_imagemCabecalho" style="visibility: hidden;"> | |
3 | 3 | <i class="fa fa-spinner fa-spin" aria-hidden="true"></i> |
4 | 4 | </div> |
5 | 5 | <div class="row"> |
6 | 6 | <div class="col-md-12"> |
7 | 7 | <form class="form" role="form" method="post" action="#"> |
8 | 8 | <div class="form-group"> |
9 | - <label class="sr-only" for="i3geousuario">{{{usuario}}}</label> <input type="text" class="form-control" id="i3geousuario" placeholder="{{{usuario}}}" required> | |
9 | + <input style="text-align:left" type="text" | |
10 | + class="form-control" id="i3geousuario" placeholder="{{{usuario}}}" required> | |
10 | 11 | </div> |
11 | 12 | <div class="form-group"> |
12 | - <label class="sr-only" for="i3geosenha">{{{senha}}}</label> <input type="password" class="form-control" id="i3geosenha" placeholder="{{{senha}}}" required> | |
13 | + <input style="text-align:left" type="password" | |
14 | + class="form-control" id="i3geosenha" placeholder="{{{senha}}}" required> | |
13 | 15 | </div> |
14 | 16 | </form> |
15 | 17 | </div> |
... | ... | @@ -24,13 +26,14 @@ |
24 | 26 | </div> |
25 | 27 | <div class="row"> |
26 | 28 | <div class="col-md-12"> |
27 | - <a href="#" onclick="i3GEOF.loginusuario.recuperarSenha()">{{{recuperar}}}</a> | |
29 | + <a href="#" onclick="i3GEOF.loginusuario.recuperarSenha()">{{{recuperar}}}</a> | |
30 | + <span> </span> | |
28 | 31 | <a href="#" onclick="i3GEOF.loginusuario.alterarSenha()">{{{alterar}}}</a> |
29 | 32 | </div> |
30 | 33 | </div> |
31 | 34 | <div class="row"> |
32 | 35 | <div class="col-md-12"> |
33 | - <ph6 class="text-muted">{{{ativo}}}: {{{usuarioLogado}}}</h6> | |
36 | + <h6 class="text-muted">{{{ativo}}}: {{{usuarioLogado}}}</h6> | |
34 | 37 | </div> |
35 | 38 | </div> |
36 | 39 | </li> |
37 | 40 | \ No newline at end of file | ... | ... |
ferramentas/markercluster/funcoes.php
ferramentas/metar/index.js
... | ... | @@ -159,7 +159,7 @@ i3GEOF.metar = |
159 | 159 | ativaFoco : function() { |
160 | 160 | var i = $i("i3GEOF.metar_c").style; |
161 | 161 | i3GEO.janela.ULTIMOZINDEX++; |
162 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | |
162 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; | |
163 | 163 | }, |
164 | 164 | /* |
165 | 165 | * Function: lista | ... | ... |
ferramentas/metar/metarextensao.php
... | ... | @@ -36,10 +36,11 @@ Return: |
36 | 36 | */ |
37 | 37 | //set_time_limit(600); |
38 | 38 | require_once(dirname(__FILE__)."/../../pacotes/cpaint/cpaint2.inc.php"); |
39 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
39 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
40 | +$_GET = array_merge($_GET,$_POST); | |
40 | 41 | require_once(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
41 | 42 | error_reporting(0); |
42 | -$e = explode(" ",$ret); | |
43 | +$e = explode(" ",$_GET["ret"]); | |
43 | 44 | $url = "http://ws.geonames.org/weatherJSON?username=i3geo&lang=pt&north=".$e[3]."&south=".$e[1]."&east=".$e[2]."&west=".$e[0]."&maxRows=10"; |
44 | 45 | $s = file($url); |
45 | 46 | header("Content-type: text/ascii; charset=UTF-8"); | ... | ... |
ferramentas/metar/metarproxima.php
... | ... | @@ -45,7 +45,10 @@ echo "<html><style> |
45 | 45 | P |
46 | 46 | {padding-top:1px;COLOR: #2F4632;text-align: justify;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif;} |
47 | 47 | </style>"; |
48 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
48 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
49 | +$_GET = array_merge($_GET,$_POST); | |
50 | +$y = $_GET["y"]; | |
51 | +$x = $_GET["x"]; | |
49 | 52 | error_reporting(0); |
50 | 53 | $url = "http://ws.geonames.org/findNearByWeatherXML?username=i3geo&lat=$y&lng=$x&lang=pt"; |
51 | 54 | ... | ... |
ferramentas/minhaferramenta/index.htm
... | ... | @@ -9,20 +9,20 @@ Minha ferramenta! |
9 | 9 | <script> |
10 | 10 | //TODO remover i3geo_tudo_compacto.js.php |
11 | 11 | //essa funcao pega valores passados pela URL |
12 | -parametrosURL() | |
13 | -var secao = "<br>A seção atual é :"+ g_sid | |
14 | -var aplic = "<br>O i3geo está instalado em:"+g_locaplic | |
12 | +parametrosURL(); | |
13 | +var secao = "<br>A seção atual é :"+ g_sid; | |
14 | +var aplic = "<br>O i3geo está instalado em:"+g_locaplic; | |
15 | 15 | //$i é um alias para pegar um objeto |
16 | -$i("exemplos").innerHTML = secao+aplic | |
16 | +$i("exemplos").innerHTML = secao+aplic; | |
17 | 17 | function mudaext() |
18 | 18 | { |
19 | - aguarde("block") | |
19 | + aguarde("block"); | |
20 | 20 | //essa função só é executada quando ocorrer o retorno da chamada do objeto "cp" |
21 | 21 | var fim = function() |
22 | 22 | { |
23 | - aguarde("none") | |
24 | - window.parent.ajaxredesenha("") | |
25 | - } | |
23 | + aguarde("none"); | |
24 | + window.parent.ajaxredesenha(""); | |
25 | + }; | |
26 | 26 | var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&ext="+$i("valor").value+"&g_sid="+g_sid; |
27 | 27 | var cp = new cpaint(); |
28 | 28 | cp.set_response_type("JSON"); | ... | ... |
ferramentas/mostraexten/index.js
... | ... | @@ -145,7 +145,7 @@ i3GEOF.mostraExten = { |
145 | 145 | $i("i3GEOmostraExtenatual").innerHTML = i3GEO.parametros.mapexten; |
146 | 146 | var i = $i("i3GEOF.mostraExten_c").style; |
147 | 147 | i3GEO.janela.ULTIMOZINDEX++; |
148 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | |
148 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; | |
149 | 149 | }, |
150 | 150 | /* |
151 | 151 | Function: executa | ... | ... |
ferramentas/nuvemtags/index.js
... | ... | @@ -202,7 +202,7 @@ i3GEOF.nuvemtags = { |
202 | 202 | i3GEO.barraDeBotoes.ativaIcone("nuvemtags"); |
203 | 203 | var i = $i("i3GEOF.nuvemtags_c").style; |
204 | 204 | i3GEO.janela.ULTIMOZINDEX++; |
205 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | |
205 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; | |
206 | 206 | }, |
207 | 207 | /* |
208 | 208 | Function: montaNuvem | ... | ... |
ferramentas/nuvemtagsflash/index.htm
... | ... | @@ -47,7 +47,7 @@ |
47 | 47 | <script type="text/javascript" src="../../pacotes/wpcumulus/swfobject.js"></script> |
48 | 48 | <script> |
49 | 49 | //TODO remover i3geo_tudo_compacto.js.php |
50 | -iniciaNuvem() | |
50 | +iniciaNuvem(); | |
51 | 51 | </script> |
52 | 52 | </body> |
53 | 53 | </html> |
54 | 54 | \ No newline at end of file | ... | ... |
ferramentas/parametrossql/exec.php
1 | 1 | <?php |
2 | +exit; | |
2 | 3 | include_once(dirname(__FILE__)."/../inicia.php"); |
3 | 4 | // |
4 | 5 | //faz a busca da função que deve ser executada |
... | ... | @@ -130,8 +131,8 @@ switch (strtoupper($funcao)) |
130 | 131 | */ |
131 | 132 | case "INCLUDEPROG": |
132 | 133 | //evita redirecoina o programa para algum lugar indevido |
133 | - $prog = str_replace(".","",$prog); | |
134 | - $prog = $prog.".php"; | |
134 | + $prog = str_replace(".php","",$prog); | |
135 | + $prog = str_replace(".","",$prog).".php"; | |
135 | 136 | if(file_exists($locaplic."/".$prog)){ |
136 | 137 | include($locaplic."/".$prog); |
137 | 138 | } |
... | ... | @@ -144,4 +145,4 @@ else{ |
144 | 145 | exit(); |
145 | 146 | } |
146 | 147 | |
147 | -?> | |
148 | 148 | \ No newline at end of file |
149 | +?> | ... | ... |
ferramentas/preferencias/index.js
... | ... | @@ -194,10 +194,6 @@ i3GEOF.preferencias = { |
194 | 194 | tipo: "boolean", |
195 | 195 | elemento: "i3GEO.arvoreDeCamadas.OPCOESLEGENDA" |
196 | 196 | },{ |
197 | - titulo: $trad('ativaAguardeLegenda',i3GEOF.preferencias.dicionario), | |
198 | - tipo: "boolean", | |
199 | - elemento: "i3GEO.arvoreDeCamadas.AGUARDALEGENDA" | |
200 | - },{ | |
201 | 197 | titulo: $trad('mostraIconeTema',i3GEOF.preferencias.dicionario), |
202 | 198 | tipo: "boolean", |
203 | 199 | elemento: "i3GEO.arvoreDeCamadas.ICONETEMA" | ... | ... |
ferramentas/recline/default.php
1 | 1 | <?php |
2 | 2 | //pega a extensao geografica da camada |
3 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
4 | +$_GET = array_merge($_GET,$_POST); | |
3 | 5 | include("../../ms_configura.php"); |
4 | -include("../../classesphp/pega_variaveis.php"); | |
5 | 6 | include("../../classesphp/funcoes_gerais.php"); |
6 | 7 | $versao = versao(); |
7 | 8 | $versao = $versao["principal"]; | ... | ... |
ferramentas/recline/tabela.php
... | ... | @@ -5,8 +5,9 @@ |
5 | 5 | // |
6 | 6 | |
7 | 7 | //pega a extensao geografica da camada |
8 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
9 | +$_GET = array_merge($_GET,$_POST); | |
8 | 10 | include("../../ms_configura.php"); |
9 | -include("../../classesphp/pega_variaveis.php"); | |
10 | 11 | ?> |
11 | 12 | <!DOCTYPE html> |
12 | 13 | <html lang="en"> | ... | ... |
ferramentas/scielo/funcoes.php
1 | 1 | <?php |
2 | 2 | error_reporting(0); |
3 | -require_once("../../classesphp/pega_variaveis.php"); | |
3 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
4 | +$_GET = array_merge($_GET,$_POST); | |
5 | +$ret = $_GET["ret"]; | |
6 | +$servico = $_GET["servico"]; | |
4 | 7 | require_once("../../pacotes/cpaint/cpaint2.inc.php"); |
5 | 8 | require_once("../../ms_configura.php"); |
6 | 9 | require_once("../../pacotes/phpxbase/api_conversion.php"); | ... | ... |
ferramentas/selecao/index.js
... | ... | @@ -368,7 +368,7 @@ i3GEOF.selecao = |
368 | 368 | ]); |
369 | 369 | i3GEO.barraDeBotoes.ativaPadrao(); |
370 | 370 | if(i3GEO.Interface["ATUAL"] === "openlayers"){ |
371 | - if (typeof OpenLayers == "undefined") { | |
371 | + if (typeof OpenLayers.Control == "undefined") { | |
372 | 372 | api = "ol3"; |
373 | 373 | i3GEO.Interface.openlayers.interacoes[0].setActive(true);//duplo clique |
374 | 374 | } else { |
... | ... | @@ -396,7 +396,7 @@ i3GEOF.selecao = |
396 | 396 | i3GEOF.selecao.mudaicone(); |
397 | 397 | var i = $i("i3GEOF.selecao_c").style; |
398 | 398 | i3GEO.janela.ULTIMOZINDEX++; |
399 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | |
399 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; | |
400 | 400 | if (i3GEO.Interface.ATUAL != "openlayers") { |
401 | 401 | i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar(); |
402 | 402 | } |
... | ... | @@ -542,7 +542,7 @@ i3GEOF.selecao = |
542 | 542 | i3GEOF.selecao.fimSelecao(retorno); |
543 | 543 | }, tema = i3GEOF.selecao.pegaTemasSel(); |
544 | 544 | if (i3GEO.Interface["ATUAL"] === "openlayers") { |
545 | - if (typeof OpenLayers == "undefined") { | |
545 | + if (typeof OpenLayers.Control == "undefined") { | |
546 | 546 | api = "ol3"; |
547 | 547 | } else { |
548 | 548 | api = "openlayers"; | ... | ... |
ferramentas/tabela/index.js
ferramentas/tabela/relatorio.php
... | ... | @@ -7,18 +7,28 @@ |
7 | 7 | </head> |
8 | 8 | <?php |
9 | 9 | session_name("i3GeoPHP"); |
10 | -if (isset($g_sid)) | |
11 | -{session_id($g_sid);} | |
10 | + | |
11 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
12 | +$_GET = array_merge($_GET,$_POST); | |
13 | + | |
14 | +$nomesrel = $_GET["nomesrel"]; | |
15 | +$ordemrel = $_GET["ordemrel"]; | |
16 | +$itensrel = $_GET["itensrel"]; | |
17 | +$itemagruparel = $_GET["itemagruparel"]; | |
18 | + | |
19 | +if (isset($_GET["g_sid"])) | |
20 | +{session_id($_GET["g_sid"]);} | |
12 | 21 | session_start(); |
13 | -include(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
22 | + | |
14 | 23 | $map_file = $_SESSION["map_file"]; |
15 | 24 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
25 | + | |
16 | 26 | include (dirname(__FILE__)."/../../ms_configura.php"); |
17 | 27 | include(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
18 | 28 | include(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
19 | 29 | $versao = versao(); |
20 | 30 | $versao = $versao["principal"]; |
21 | -substituiCon($map_file,$postgis_mapa); | |
31 | + | |
22 | 32 | $temp = explode(",",$nomesrel); |
23 | 33 | $colunasTemp = array(); |
24 | 34 | foreach($temp as $t){ |
... | ... | @@ -61,7 +71,9 @@ foreach($temp as $t) |
61 | 71 | } |
62 | 72 | if($itemagruparel != "" && !in_array($itemagruparel,$itensrel)) |
63 | 73 | {$itensrel[] = $itemagruparel;} |
74 | + | |
64 | 75 | $mapa = ms_newMapObj($map_file); |
76 | +substituiConObj($temp,$postgis_mapa); | |
65 | 77 | if($ext && $ext != ""){ |
66 | 78 | $e = explode(" ",$ext); |
67 | 79 | $extatual = $mapa->extent; | ... | ... |
ferramentas/wiki/funcoes.php
... | ... | @@ -2,7 +2,9 @@ |
2 | 2 | $usuarioGeonames = "i3geo"; |
3 | 3 | //set_time_limit(600); |
4 | 4 | require_once(dirname(__FILE__)."/../../pacotes/cpaint/cpaint2.inc.php"); |
5 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | |
5 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | |
6 | +$_GET = array_merge($_GET,$_POST); | |
7 | +$ret = $_GET["ret"]; | |
6 | 8 | require_once(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
7 | 9 | error_reporting(0); |
8 | 10 | $cp = new cpaint(); | ... | ... |
ferramentas/wiki/index.js
... | ... | @@ -159,7 +159,7 @@ i3GEOF.wiki = { |
159 | 159 | ativaFoco: function(){ |
160 | 160 | var i = $i("i3GEOF.wiki_c").style; |
161 | 161 | i3GEO.janela.ULTIMOZINDEX++; |
162 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | |
162 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; | |
163 | 163 | }, |
164 | 164 | /* |
165 | 165 | Function: lista | ... | ... |