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,7 +15,7 @@ if(empty($_GET)){ | ||
15 | &legenda = sim|nao<br> | 15 | &legenda = sim|nao<br> |
16 | &transparente = sim|nao<br> | 16 | &transparente = sim|nao<br> |
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> | 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 | &tipocolunat = string|numero tipo de dados existentes na coluna que contém os valores para o filtro<br> | 19 | &tipocolunat = string|numero tipo de dados existentes na coluna que contém os valores para o filtro<br> |
20 | O tema pode ter parâmetros já armazenados no METADATA animagif, criado pelo formulário do i3Geo. | 20 | O tema pode ter parâmetros já armazenados no METADATA animagif, criado pelo formulário do i3Geo. |
21 | Para forçar o uso desses parâmetros, basta passar &colunat como vazio. | 21 | Para forçar o uso desses parâmetros, basta passar &colunat como vazio. |
@@ -28,6 +28,8 @@ if(empty($_GET)){ | @@ -28,6 +28,8 @@ if(empty($_GET)){ | ||
28 | include("../../ms_configura.php"); | 28 | include("../../ms_configura.php"); |
29 | include("../../classesphp/funcoes_gerais.php"); | 29 | include("../../classesphp/funcoes_gerais.php"); |
30 | include("../../classesphp/carrega_ext.php"); | 30 | include("../../classesphp/carrega_ext.php"); |
31 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | ||
32 | +$_GET = array_merge($_GET,$_POST); | ||
31 | // | 33 | // |
32 | //verifica se existem parametros definidos no proprio mapfile | 34 | //verifica se existem parametros definidos no proprio mapfile |
33 | // | 35 | // |
@@ -50,8 +52,19 @@ if(empty($_GET["colunat"])){ | @@ -50,8 +52,19 @@ if(empty($_GET["colunat"])){ | ||
50 | $_GET["nulos"] = $animagif["nulos"]; | 52 | $_GET["nulos"] = $animagif["nulos"]; |
51 | $_GET["tipocolunat"] = $animagif["tipocolunat"]; | 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 | $v = versao(); | 69 | $v = versao(); |
57 | $vi = $v["inteiro"]; | 70 | $vi = $v["inteiro"]; |
@@ -62,6 +75,7 @@ if($cache == "nao"){ | @@ -62,6 +75,7 @@ if($cache == "nao"){ | ||
62 | } else { | 75 | } else { |
63 | $nometemp = md5(implode("",$_GET)); | 76 | $nometemp = md5(implode("",$_GET)); |
64 | } | 77 | } |
78 | +$nometemp = "animagif".$nometemp; | ||
65 | if(empty($tempo)){ | 79 | if(empty($tempo)){ |
66 | $tempo = 40; | 80 | $tempo = 40; |
67 | } | 81 | } |
@@ -83,11 +97,13 @@ if(empty($operador)){ | @@ -83,11 +97,13 @@ if(empty($operador)){ | ||
83 | else{ | 97 | else{ |
84 | if($operador == "lt"){ | 98 | if($operador == "lt"){ |
85 | $operador = "<"; | 99 | $operador = "<"; |
86 | - } | ||
87 | - if($operador == "gt"){ | 100 | + } elseif ($operador == "gt"){ |
88 | $operador = ">"; | 101 | $operador = ">"; |
89 | } | 102 | } |
90 | } | 103 | } |
104 | +if(!in_array($operador,array("=","<",">"))){ | ||
105 | + exit; | ||
106 | +} | ||
91 | 107 | ||
92 | $nulos = explode(",",$nulos); | 108 | $nulos = explode(",",$nulos); |
93 | $arqtemp = $dir_tmp."/".$nometemp; | 109 | $arqtemp = $dir_tmp."/".$nometemp; |
@@ -115,6 +131,7 @@ $versao = versao(); | @@ -115,6 +131,7 @@ $versao = versao(); | ||
115 | $versao = $versao["principal"]; | 131 | $versao = $versao["principal"]; |
116 | 132 | ||
117 | //cria um mapa temporario | 133 | //cria um mapa temporario |
134 | +//base vem de ms_configura | ||
118 | if($base == "" or !isset($base)){ | 135 | if($base == "" or !isset($base)){ |
119 | $base = ""; | 136 | $base = ""; |
120 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ | 137 | if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ |
@@ -202,7 +219,6 @@ for ($i=0;$i < $numlayers;$i++){ | @@ -202,7 +219,6 @@ for ($i=0;$i < $numlayers;$i++){ | ||
202 | } | 219 | } |
203 | 220 | ||
204 | $mapa->save($arqtemp.".map"); | 221 | $mapa->save($arqtemp.".map"); |
205 | - | ||
206 | //aplica a extensao geografica | 222 | //aplica a extensao geografica |
207 | $layer = $mapa->getlayerbyname($tema); | 223 | $layer = $mapa->getlayerbyname($tema); |
208 | 224 | ||
@@ -257,6 +273,7 @@ if($transparente == "sim"){ | @@ -257,6 +273,7 @@ if($transparente == "sim"){ | ||
257 | 273 | ||
258 | $mapa->save($arqtemp.".map"); | 274 | $mapa->save($arqtemp.".map"); |
259 | $mapa = ms_newMapObj($arqtemp.".map"); | 275 | $mapa = ms_newMapObj($arqtemp.".map"); |
276 | +restauraCon($arqtemp.".map",$postgis_mapa); | ||
260 | 277 | ||
261 | /* | 278 | /* |
262 | if(validaAcessoTemas($arqtemp.".map",false) == true){ | 279 | if(validaAcessoTemas($arqtemp.".map",false) == true){ |
ferramentas/aplicarsld/upload.php
1 | <?php | 1 | <?php |
2 | -require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | 2 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); |
3 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); | 3 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
4 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); | 4 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
5 | error_reporting(0); | 5 | error_reporting(0); |
6 | +$_GET = array_merge($_GET,$_POST); | ||
6 | session_name("i3GeoPHP"); | 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 | session_start(); | 10 | session_start(); |
10 | $map_file = $_SESSION["map_file"]; | 11 | $map_file = $_SESSION["map_file"]; |
11 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 12 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
12 | require_once (dirname(__FILE__)."/../../ms_configura.php"); | 13 | require_once (dirname(__FILE__)."/../../ms_configura.php"); |
14 | +$tema = $_GET["tema"]; | ||
13 | ?> | 15 | ?> |
14 | <html> | 16 | <html> |
15 | <head> | 17 | <head> |
@@ -42,7 +44,7 @@ if (isset($_FILES['i3GEOaplicarsld']['name'])) | @@ -42,7 +44,7 @@ if (isset($_FILES['i3GEOaplicarsld']['name'])) | ||
42 | { | 44 | { |
43 | echo "<p class='paragrafo' >Arquivo enviado. Aplicando SLD...$tema</p>"; | 45 | echo "<p class='paragrafo' >Arquivo enviado. Aplicando SLD...$tema</p>"; |
44 | $layer = $mapa->getlayerbyname($tema); | 46 | $layer = $mapa->getlayerbyname($tema); |
45 | - $arq = $dirmap."/".$_FILES['i3GEOaplicarsld']['name']; | 47 | + $arq = $dirmap."/".$ArquivoDest; |
46 | $abre = fopen($arq, "r"); | 48 | $abre = fopen($arq, "r"); |
47 | $buffer = fread($abre, filesize($arq)); | 49 | $buffer = fread($abre, filesize($arq)); |
48 | fclose($abre); | 50 | fclose($abre); |
ferramentas/atalhoscamada/index.js
@@ -26,6 +26,7 @@ i3GEOF.atalhoscamada = | @@ -26,6 +26,7 @@ i3GEOF.atalhoscamada = | ||
26 | dicionario["etiquetas"] = $trad("t27"); | 26 | dicionario["etiquetas"] = $trad("t27"); |
27 | dicionario["filtro"] = $trad("t29"); | 27 | dicionario["filtro"] = $trad("t29"); |
28 | dicionario["tabela"] = $trad("t31"); | 28 | dicionario["tabela"] = $trad("t31"); |
29 | + dicionario["selecao"] = $trad("x51"); | ||
29 | dicionario["grafico"] = $trad("t37"); | 30 | dicionario["grafico"] = $trad("t37"); |
30 | dicionario["editaLegenda"] = $trad("t33"); | 31 | dicionario["editaLegenda"] = $trad("t33"); |
31 | dicionario["destaca"] = $trad("t35"); | 32 | dicionario["destaca"] = $trad("t35"); |
@@ -196,6 +197,16 @@ i3GEOF.atalhoscamada = | @@ -196,6 +197,16 @@ i3GEOF.atalhoscamada = | ||
196 | }); | 197 | }); |
197 | b.addClass("abrir"); | 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 | if (funcoes.grafico === true) { | 210 | if (funcoes.grafico === true) { |
200 | b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaGrafico", { | 211 | b = new YAHOO.widget.Button(idjanela+"i3GEOFatalhoscamadaGrafico", { |
201 | onclick : { | 212 | onclick : { |
ferramentas/atalhoscamada/template_mst.html
@@ -48,6 +48,9 @@ | @@ -48,6 +48,9 @@ | ||
48 | <input id='{{{idjanela}}}i3GEOFatalhoscamadaTabela' type='button' value='{{{tabela}}}' style='display:none;'/> | 48 | <input id='{{{idjanela}}}i3GEOFatalhoscamadaTabela' type='button' value='{{{tabela}}}' style='display:none;'/> |
49 | </p> | 49 | </p> |
50 | <p class='paragrafo'> | 50 | <p class='paragrafo'> |
51 | + <input id='{{{idjanela}}}i3GEOFatalhoscamadaSelecao' type='button' value='{{{selecao}}}' style='display:none;'/> | ||
52 | + </p> | ||
53 | + <p class='paragrafo'> | ||
51 | <input id='{{{idjanela}}}i3GEOFatalhoscamadaGrafico' type='button' value='{{{grafico}}}' style='display:none;'/> | 54 | <input id='{{{idjanela}}}i3GEOFatalhoscamadaGrafico' type='button' value='{{{grafico}}}' style='display:none;'/> |
52 | </p> | 55 | </p> |
53 | <p class='paragrafo'> | 56 | <p class='paragrafo'> |
@@ -67,7 +70,7 @@ | @@ -67,7 +70,7 @@ | ||
67 | </p> | 70 | </p> |
68 | <p class='paragrafo'> | 71 | <p class='paragrafo'> |
69 | <input id='{{{idjanela}}}i3GEOFatalhoscamadaStoryMap' type='button' value='StoryMap' style='display:none;'/> | 72 | <input id='{{{idjanela}}}i3GEOFatalhoscamadaStoryMap' type='button' value='StoryMap' style='display:none;'/> |
70 | - </p> | 73 | + </p> |
71 | <hr> | 74 | <hr> |
72 | <p>Login:</p> | 75 | <p>Login:</p> |
73 | <br> | 76 | <br> |
ferramentas/atalhosmapa/index.js
@@ -21,7 +21,7 @@ i3GEOF.atalhosmapa = | @@ -21,7 +21,7 @@ i3GEOF.atalhosmapa = | ||
21 | m = i3GEO.configura.oMenuDataOriginal.submenus.ferramentas; | 21 | m = i3GEO.configura.oMenuDataOriginal.submenus.ferramentas; |
22 | n = m.length; | 22 | n = m.length; |
23 | for(i=0;i<n;i++){ | 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 | t = m[i].submenu.itemdata[0]; | 25 | t = m[i].submenu.itemdata[0]; |
26 | } | 26 | } |
27 | } | 27 | } |
ferramentas/baseguias/index.htm
@@ -8,7 +8,7 @@ div | @@ -8,7 +8,7 @@ div | ||
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;} | 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 | #fundo | 9 | #fundo |
10 | {background-color:rgb(245,245,245);overflow:hidden;position:absolute;top:0px;left:0px;} | 10 | {background-color:rgb(245,245,245);overflow:hidden;position:absolute;top:0px;left:0px;} |
11 | -.guias | 11 | +.guias |
12 | {background-color:rgb(245,245,245);cursor:pointer;position:relative;text-align: left;top:8px;left:8px;padding:0px;margin:0px;} | 12 | {background-color:rgb(245,245,245);cursor:pointer;position:relative;text-align: left;top:8px;left:8px;padding:0px;margin:0px;} |
13 | .guia | 13 | .guia |
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);} | 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,7 +42,7 @@ div | ||
42 | </div> | 42 | </div> |
43 | <div id=guia3obj style="display:none"> | 43 | <div id=guia3obj style="display:none"> |
44 | <div style="position:relative;top:5px;left:0px;width:90%" > | 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 | ative a seleção no mapa, para isso utilize, na guia "selecionados" | 46 | ative a seleção no mapa, para isso utilize, na guia "selecionados" |
47 | a opção "Ativa a seleção" | 47 | a opção "Ativa a seleção" |
48 | </div> | 48 | </div> |
@@ -58,23 +58,22 @@ div | @@ -58,23 +58,22 @@ div | ||
58 | <script type="text/javascript"> | 58 | <script type="text/javascript"> |
59 | //eventos das guias | 59 | //eventos das guias |
60 | document.getElementById("guia1").onclick = function() | 60 | document.getElementById("guia1").onclick = function() |
61 | -{document.getElementById("guia1obj").style.display="block";} | 61 | +{document.getElementById("guia1obj").style.display="block";}; |
62 | document.getElementById("guia2").onclick = function() | 62 | document.getElementById("guia2").onclick = function() |
63 | -{document.getElementById("guia2obj").style.display="block";} | 63 | +{document.getElementById("guia2obj").style.display="block";}; |
64 | document.getElementById("guia3").onclick = function() | 64 | document.getElementById("guia3").onclick = function() |
65 | -{document.getElementById("guia3obj").style.display="block";} | 65 | +{document.getElementById("guia3obj").style.display="block";}; |
66 | document.getElementById("guia4").onclick = function() | 66 | document.getElementById("guia4").onclick = function() |
67 | -{document.getElementById("guia4obj").style.display="block";} | 67 | +{document.getElementById("guia4obj").style.display="block";}; |
68 | navm = false; // IE | 68 | navm = false; // IE |
69 | navn = false; // netscape | 69 | navn = false; // netscape |
70 | -var app = navigator.appName.substring(0,1); | 70 | +var i, j, app = navigator.appName.substring(0,1); |
71 | if (app=='N') navn=true; else navm=true; | 71 | if (app=='N') navn=true; else navm=true; |
72 | //verifica se existem guias | 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 | if (document.getElementById("guia"+i)) | 75 | if (document.getElementById("guia"+i)) |
77 | - {reduzAltura = 50} | 76 | + {reduzAltura = 50;} |
78 | } | 77 | } |
79 | h = 500; //altura do corpo geral da guia | 78 | h = 500; //altura do corpo geral da guia |
80 | if (navn) | 79 | if (navn) |
@@ -111,11 +110,11 @@ for (i=0;i<7;i++) | @@ -111,11 +110,11 @@ for (i=0;i<7;i++) | ||
111 | this.style.color="orange"; | 110 | this.style.color="orange"; |
112 | this.style.backgroundColor="rgb(255,255,255)"; | 111 | this.style.backgroundColor="rgb(255,255,255)"; |
113 | //this.style.textDecoration="underline" | 112 | //this.style.textDecoration="underline" |
114 | - } | 113 | + }; |
115 | document.getElementById("guia"+i).onmouseover = function() | 114 | document.getElementById("guia"+i).onmouseover = function() |
116 | - {this.style.borderTop="2px solid orange";} | 115 | + {this.style.borderTop="2px solid orange";}; |
117 | document.getElementById("guia"+i).onmouseout = function() | 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,7 +162,7 @@ i3GEOF.busca = { | ||
162 | {alert($trad('erroTema',i3GEOF.busca.dicionario));} | 162 | {alert($trad('erroTema',i3GEOF.busca.dicionario));} |
163 | var i = $i("i3GEOF.busca_c").style; | 163 | var i = $i("i3GEOF.busca_c").style; |
164 | i3GEO.janela.ULTIMOZINDEX++; | 164 | i3GEO.janela.ULTIMOZINDEX++; |
165 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 165 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
166 | }, | 166 | }, |
167 | /* | 167 | /* |
168 | Function: montaListaItens | 168 | Function: montaListaItens |
ferramentas/buscafotos/funcoes.php
1 | <?php | 1 | <?php |
2 | error_reporting(0); | 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 | require_once(dirname(__FILE__)."/../../pacotes/cpaint/cpaint2.inc.php"); | 5 | require_once(dirname(__FILE__)."/../../pacotes/cpaint/cpaint2.inc.php"); |
5 | require_once(dirname(__FILE__)."/../../ms_configura.php"); | 6 | require_once(dirname(__FILE__)."/../../ms_configura.php"); |
6 | require_once(dirname(__FILE__)."/../../pacotes/phpflickr/phpFlickr.php"); | 7 | require_once(dirname(__FILE__)."/../../pacotes/phpflickr/phpFlickr.php"); |
7 | error_reporting(0); | 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 | $cp = new cpaint(); | 19 | $cp = new cpaint(); |
9 | if($funcao == "listafotosflickr") | 20 | if($funcao == "listafotosflickr") |
10 | {$cp->register('listafotosflickr');} | 21 | {$cp->register('listafotosflickr');} |
ferramentas/buscafotos/index.js
@@ -214,7 +214,7 @@ i3GEOF.buscaFotos = { | @@ -214,7 +214,7 @@ i3GEOF.buscaFotos = { | ||
214 | {return;} | 214 | {return;} |
215 | var i = $i("i3GEOF.buscaFotos_c").style; | 215 | var i = $i("i3GEOF.buscaFotos_c").style; |
216 | i3GEO.janela.ULTIMOZINDEX++; | 216 | i3GEO.janela.ULTIMOZINDEX++; |
217 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 217 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
218 | }, | 218 | }, |
219 | /* | 219 | /* |
220 | Function: mostraMenu | 220 | Function: mostraMenu |
ferramentas/buscarapida/gadget.php
1 | <?php | 1 | <?php |
2 | +return; | ||
2 | include_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | 3 | include_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); |
3 | include_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); | 4 | include_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
4 | $projecao = pegaProjecaoDefault("epsg"); | 5 | $projecao = pegaProjecaoDefault("epsg"); |
ferramentas/carregamapa/upload.php
@@ -4,8 +4,9 @@ require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | @@ -4,8 +4,9 @@ require_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | ||
4 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); | 4 | require_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
5 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); | 5 | include_once (dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
6 | session_name("i3GeoPHP"); | 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 | session_start(); | 10 | session_start(); |
10 | $map_file = $_SESSION["map_file"]; | 11 | $map_file = $_SESSION["map_file"]; |
11 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 12 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
@@ -71,9 +72,11 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) | @@ -71,9 +72,11 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) | ||
71 | $layertemp->setmetadata("download","nao"); | 72 | $layertemp->setmetadata("download","nao"); |
72 | $layertemp->setmetadata("permitekml","nao"); | 73 | $layertemp->setmetadata("permitekml","nao"); |
73 | $layertemp->setmetadata("permiteogc","nao"); | 74 | $layertemp->setmetadata("permiteogc","nao"); |
75 | + $layertemp->setmetadata("animagif",""); | ||
74 | $layertemp->setmetadata("editorsql","nao"); | 76 | $layertemp->setmetadata("editorsql","nao"); |
75 | $layertemp->setmetadata("EDITAVEL","nao"); | 77 | $layertemp->setmetadata("EDITAVEL","nao"); |
76 | $layertemp->setmetadata("PLUGINI3GEO",""); | 78 | $layertemp->setmetadata("PLUGINI3GEO",""); |
79 | + $layertemp->setmetadata("arquivodownload",""); | ||
77 | if ($testa == 1) | 80 | if ($testa == 1) |
78 | { | 81 | { |
79 | echo "<p class='paragrafo' >Problemas em ".($layer->name).". Removido.</p><br>"; | 82 | echo "<p class='paragrafo' >Problemas em ".($layer->name).". Removido.</p><br>"; |
@@ -81,6 +84,7 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) | @@ -81,6 +84,7 @@ if (isset($_FILES['i3GEOcarregamapafilemap']['name'])) | ||
81 | } | 84 | } |
82 | } | 85 | } |
83 | $map->save($map_file); | 86 | $map->save($map_file); |
87 | + restauraCon($map_file,$postgis_mapa); | ||
84 | $e = $mapt->extent; | 88 | $e = $mapt->extent; |
85 | $extatual = $e->minx." ".$e->miny." ".$e->maxx." ".$e->maxy; | 89 | $extatual = $e->minx." ".$e->miny." ".$e->maxx." ".$e->maxy; |
86 | echo "<p class='paragrafo' >Ok. redesenhando."; | 90 | echo "<p class='paragrafo' >Ok. redesenhando."; |
ferramentas/cesium/kml3d.php
1 | <?php | 1 | <?php |
2 | include("../../ms_configura.php"); | 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 | include("../../classesphp/funcoes_gerais.php"); | 5 | include("../../classesphp/funcoes_gerais.php"); |
6 | +$kmlurl = $_GET ["kmlurl"]; | ||
7 | +$legenda = $_GET ["legenda"]; | ||
5 | //define o centro, pegando as coordenadas do mapa de inicializacao | 8 | //define o centro, pegando as coordenadas do mapa de inicializacao |
6 | $versao = versao(); | 9 | $versao = versao(); |
7 | $versao = $versao["principal"]; | 10 | $versao = $versao["principal"]; |
8 | $centroX = -55; | 11 | $centroX = -55; |
9 | $centroY = -13; | 12 | $centroY = -13; |
10 | $extensao = "-180,-90,180,90"; | 13 | $extensao = "-180,-90,180,90"; |
11 | -if(!isset($mapext)){ | 14 | +if(!isset($_GET["mapext"])){ |
12 | if(isset($base) && $base != ""){ | 15 | if(isset($base) && $base != ""){ |
13 | if(file_exists($base)){ | 16 | if(file_exists($base)){ |
14 | $f = $base; | 17 | $f = $base; |
@@ -49,10 +52,10 @@ if(!isset($mapext)){ | @@ -49,10 +52,10 @@ if(!isset($mapext)){ | ||
49 | } | 52 | } |
50 | } | 53 | } |
51 | else{ | 54 | else{ |
52 | - $c = explode(" ",$mapext); | 55 | + $c = explode(" ",$_GET["mapext"]); |
53 | $centroX = $c[2] - ($c[2] - $c[0]) / 2; | 56 | $centroX = $c[2] - ($c[2] - $c[0]) / 2; |
54 | $centroY = $c[3] - ($c[3] - $c[1]) / 2; | 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 | <!DOCTYPE html> | 61 | <!DOCTYPE html> |
@@ -127,13 +130,7 @@ body { | @@ -127,13 +130,7 @@ body { | ||
127 | if('<?php echo $kmlurl;?>' != ''){ | 130 | if('<?php echo $kmlurl;?>' != ''){ |
128 | viewer.dataSources.add(Cesium.KmlDataSource.load('<?php echo strip_tags($kmlurl);?>')) | 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 | </script> | 134 | </script> |
138 | </body> | 135 | </body> |
139 | </html> | 136 | </html> |
ferramentas/colourramp/index.php
1 | <?php | 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 | include_once(dirname(__FILE__)."/../../classesphp/class.palette.php"); | 4 | include_once(dirname(__FILE__)."/../../classesphp/class.palette.php"); |
4 | $m = new palette(); | 5 | $m = new palette(); |
5 | $lista = implode(",",($m->listaColourRamps(dirname(__FILE__)."/../.."))); | 6 | $lista = implode(",",($m->listaColourRamps(dirname(__FILE__)."/../.."))); |
6 | if(!isset($ncores)) | 7 | if(!isset($ncores)) |
7 | {$ncores = 10;} | 8 | {$ncores = 10;} |
8 | - if(empty($locaplic)){ | 9 | + if(empty($_GET["locaplic"])){ |
9 | $locaplic = "../.."; | 10 | $locaplic = "../.."; |
10 | } | 11 | } |
11 | ?> | 12 | ?> |
@@ -106,7 +107,7 @@ p .boom { | @@ -106,7 +107,7 @@ p .boom { | ||
106 | </head> | 107 | </head> |
107 | <body class=" yui-skin-sam" style="margin:0px;width:253px;" > | 108 | <body class=" yui-skin-sam" style="margin:0px;width:253px;" > |
108 | <p class=paragrafo style="position:relative;left:6px;width:100%;" > | 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 | Clique para escolher o modelo de cores | 111 | Clique para escolher o modelo de cores |
111 | </p> | 112 | </p> |
112 | <div id="imagens" ></div> | 113 | <div id="imagens" ></div> |
@@ -129,7 +130,7 @@ new YAHOO.widget.Button( | @@ -129,7 +130,7 @@ new YAHOO.widget.Button( | ||
129 | {onclick:{fn: function(){aplicarCores();}}} | 130 | {onclick:{fn: function(){aplicarCores();}}} |
130 | ); | 131 | ); |
131 | $i("voltar-button").style.width = "250px" | 132 | $i("voltar-button").style.width = "250px" |
132 | -var lista = "<?php echo $lista;?>"; | 133 | +var lista = "<?php echo $_GET["lista"];?>"; |
133 | lista = lista.split(","); | 134 | lista = lista.split(","); |
134 | var n = lista.length; | 135 | var n = lista.length; |
135 | var ins = ""; | 136 | var ins = ""; |
ferramentas/conectargeorss/index.htm
@@ -91,15 +91,15 @@ function iniciaListaGEORSS(){ | @@ -91,15 +91,15 @@ function iniciaListaGEORSS(){ | ||
91 | } | 91 | } |
92 | function mostraRetornoRSS(retorno) | 92 | function mostraRetornoRSS(retorno) |
93 | { | 93 | { |
94 | - aguarde("none") | 94 | + aguarde("none"); |
95 | var reg = /Erro/gi; | 95 | var reg = /Erro/gi; |
96 | if (retorno.data.rss.search(reg) != -1) | 96 | if (retorno.data.rss.search(reg) != -1) |
97 | { | 97 | { |
98 | i3GEO.janela.tempoMsg("OOps! Ocorreu um erro\n"+retorno.data); | 98 | i3GEO.janela.tempoMsg("OOps! Ocorreu um erro\n"+retorno.data); |
99 | return; | 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 | $i("RSS").innerHTML = retorno.data.rss; | 104 | $i("RSS").innerHTML = retorno.data.rss; |
105 | var i, ins = ""; | 105 | var i, ins = ""; |
ferramentas/confluence/index.js
@@ -158,7 +158,7 @@ i3GEOF.confluence = { | @@ -158,7 +158,7 @@ i3GEOF.confluence = { | ||
158 | ativaFoco: function(){ | 158 | ativaFoco: function(){ |
159 | var i = $i("i3GEOF.confluence_c").style; | 159 | var i = $i("i3GEOF.confluence_c").style; |
160 | i3GEO.janela.ULTIMOZINDEX++; | 160 | i3GEO.janela.ULTIMOZINDEX++; |
161 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 161 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
162 | }, | 162 | }, |
163 | /* | 163 | /* |
164 | Function: escondexy | 164 | Function: escondexy |
ferramentas/cores.htm
@@ -44,11 +44,11 @@ navn = false; // netscape | @@ -44,11 +44,11 @@ navn = false; // netscape | ||
44 | var app = navigator.appName.substring(0,1); | 44 | var app = navigator.appName.substring(0,1); |
45 | if (app=='N') navn=true; else navm=true; | 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 | function inicia(esquema) | 52 | function inicia(esquema) |
53 | { | 53 | { |
54 | intnl = Math.ceil(nco / numl); | 54 | intnl = Math.ceil(nco / numl); |
@@ -56,7 +56,7 @@ function inicia(esquema) | @@ -56,7 +56,7 @@ function inicia(esquema) | ||
56 | r = 0; | 56 | r = 0; |
57 | g = 0; | 57 | g = 0; |
58 | b = 0; | 58 | b = 0; |
59 | - ins = "" | 59 | + ins = ""; |
60 | for (linhas = 1; linhas < numl; linhas++) | 60 | for (linhas = 1; linhas < numl; linhas++) |
61 | { | 61 | { |
62 | ins += "<tbody><tr>\n"; | 62 | ins += "<tbody><tr>\n"; |
@@ -79,29 +79,29 @@ function inicia(esquema) | @@ -79,29 +79,29 @@ function inicia(esquema) | ||
79 | if (esquema == "ciano"){b = 255; g = linhas; r = 0;} | 79 | if (esquema == "ciano"){b = 255; g = linhas; r = 0;} |
80 | if (esquema == "amarelo"){b = 0; g = linhas; r = 255;} | 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 | function muda (e) | 84 | function muda (e) |
85 | { | 85 | { |
86 | - inicia(e.value) | 86 | + inicia(e.value); |
87 | } | 87 | } |
88 | function mais() | 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 | function menos() | 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 | function aplicacor(c) | 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 | var elemento = unescape(((((window.location.href).split("elemento="))[1]).split("&"))[0] ); | 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 | </script> | 106 | </script> |
107 | </body> | 107 | </body> |
ferramentas/editorol/editorol.js
@@ -343,7 +343,7 @@ i3GEO.editorOL = | @@ -343,7 +343,7 @@ i3GEO.editorOL = | ||
343 | } | 343 | } |
344 | if (i3GEO.editorOL.fundo != "") { | 344 | if (i3GEO.editorOL.fundo != "") { |
345 | for (i = nfundo - 1; i >= 0; i--) { | 345 | for (i = nfundo - 1; i >= 0; i--) { |
346 | - if (fundo[i] != "") { | 346 | + if (fundo[i] != "" && i3GEO.editorOL[fundo[i]]) { |
347 | alayers.push(i3GEO.editorOL[fundo[i]]); | 347 | alayers.push(i3GEO.editorOL[fundo[i]]); |
348 | i3GEO.editorOL[fundo[i]].setVisibility(true); | 348 | i3GEO.editorOL[fundo[i]].setVisibility(true); |
349 | } | 349 | } |
@@ -705,7 +705,7 @@ i3GEO.editorOL = | @@ -705,7 +705,7 @@ i3GEO.editorOL = | ||
705 | i3GEO.editorOL.mapa.zoomToExtent(b); | 705 | i3GEO.editorOL.mapa.zoomToExtent(b); |
706 | }, | 706 | }, |
707 | mostraLegenda : function() { | 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 | for (i = 0; i < nlayers; i++) { | 709 | for (i = 0; i < nlayers; i++) { |
710 | layer = layers.item(i); | 710 | layer = layers.item(i); |
711 | prop = layer.getProperties(); | 711 | prop = layer.getProperties(); |
@@ -750,7 +750,13 @@ i3GEO.editorOL = | @@ -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 | // necessario pq nao e sincrono | 760 | // necessario pq nao e sincrono |
755 | eval("var f = function(retorno){document.getElementById('legendaL_" + i | 761 | eval("var f = function(retorno){document.getElementById('legendaL_" + i |
756 | + "').innerHTML = retorno.responseText;};"); | 762 | + "').innerHTML = retorno.responseText;};"); |
@@ -760,7 +766,7 @@ i3GEO.editorOL = | @@ -760,7 +766,7 @@ i3GEO.editorOL = | ||
760 | url : url, | 766 | url : url, |
761 | callback : f | 767 | callback : f |
762 | }; | 768 | }; |
763 | - OpenLayers.Request.issue(config); | 769 | + //OpenLayers.Request.issue(config); |
764 | } else if (prop.isBaseLayer === false && prop.visible === true) { | 770 | } else if (prop.isBaseLayer === false && prop.visible === true) { |
765 | //caso a legenda seja aberta dentro do i3Geo | 771 | //caso a legenda seja aberta dentro do i3Geo |
766 | url = url.replace("LAYERS", "LAYER"); | 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 | \ No newline at end of file | 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 | \ No newline at end of file | 3 | \ No newline at end of file |
ferramentas/geolocal/index.js
@@ -43,14 +43,14 @@ i3GEOF.geolocal = | @@ -43,14 +43,14 @@ i3GEOF.geolocal = | ||
43 | { | 43 | { |
44 | /* | 44 | /* |
45 | * Variavel: posicoes | 45 | * Variavel: posicoes |
46 | - * | 46 | + * |
47 | * Objetos capturados | 47 | * Objetos capturados |
48 | */ | 48 | */ |
49 | posicoes : [], | 49 | posicoes : [], |
50 | tempo : null, | 50 | tempo : null, |
51 | /* | 51 | /* |
52 | * Variavel: aguarde | 52 | * Variavel: aguarde |
53 | - * | 53 | + * |
54 | * Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. | 54 | * Estilo do objeto DOM com a imagem de aguarde existente no cabeçalho da janela. |
55 | */ | 55 | */ |
56 | aguarde : "", | 56 | aguarde : "", |
@@ -68,11 +68,11 @@ i3GEOF.geolocal = | @@ -68,11 +68,11 @@ i3GEOF.geolocal = | ||
68 | }, | 68 | }, |
69 | /* | 69 | /* |
70 | * Function: inicia | 70 | * Function: inicia |
71 | - * | 71 | + * |
72 | * Inicia a ferramenta. É chamado por criaJanelaFlutuante | 72 | * Inicia a ferramenta. É chamado por criaJanelaFlutuante |
73 | - * | 73 | + * |
74 | * Parametro: | 74 | * Parametro: |
75 | - * | 75 | + * |
76 | * iddiv {String} - id do div que receberá o conteudo HTML da ferramenta | 76 | * iddiv {String} - id do div que receberá o conteudo HTML da ferramenta |
77 | */ | 77 | */ |
78 | inicia : function(iddiv) { | 78 | inicia : function(iddiv) { |
@@ -100,11 +100,11 @@ i3GEOF.geolocal = | @@ -100,11 +100,11 @@ i3GEOF.geolocal = | ||
100 | }, | 100 | }, |
101 | /* | 101 | /* |
102 | * Function: html | 102 | * Function: html |
103 | - * | 103 | + * |
104 | * Gera o código html para apresentação das opções da ferramenta | 104 | * Gera o código html para apresentação das opções da ferramenta |
105 | - * | 105 | + * |
106 | * Retorno: | 106 | * Retorno: |
107 | - * | 107 | + * |
108 | * String com o código html | 108 | * String com o código html |
109 | */ | 109 | */ |
110 | html : function() { | 110 | html : function() { |
@@ -113,7 +113,7 @@ i3GEOF.geolocal = | @@ -113,7 +113,7 @@ i3GEOF.geolocal = | ||
113 | }, | 113 | }, |
114 | /* | 114 | /* |
115 | * Function: iniciaJanelaFlutuante | 115 | * Function: iniciaJanelaFlutuante |
116 | - * | 116 | + * |
117 | * Cria a janela flutuante para controle da ferramenta. | 117 | * Cria a janela flutuante para controle da ferramenta. |
118 | */ | 118 | */ |
119 | iniciaJanelaFlutuante : function() { | 119 | iniciaJanelaFlutuante : function() { |
@@ -134,7 +134,7 @@ i3GEOF.geolocal = | @@ -134,7 +134,7 @@ i3GEOF.geolocal = | ||
134 | + "<a class=ajuda_usuario target=_blank href='" | 134 | + "<a class=ajuda_usuario target=_blank href='" |
135 | + i3GEO.configura.locaplic | 135 | + i3GEO.configura.locaplic |
136 | + "/ajuda_usuario.php?idcategoria=6&idajuda=118' ><b> </b></a></div>"; | 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 | divid = janela[2].id; | 138 | divid = janela[2].id; |
139 | $i("i3GEOF.geolocal_corpo").style.backgroundColor = "white"; | 139 | $i("i3GEOF.geolocal_corpo").style.backgroundColor = "white"; |
140 | $i("i3GEOF.geolocal_corpo").style.textAlign = "left"; | 140 | $i("i3GEOF.geolocal_corpo").style.textAlign = "left"; |
@@ -143,7 +143,7 @@ i3GEOF.geolocal = | @@ -143,7 +143,7 @@ i3GEOF.geolocal = | ||
143 | temp = function() { | 143 | temp = function() { |
144 | var api; | 144 | var api; |
145 | if (i3GEO.Interface["ATUAL"] === "openlayers") { | 145 | if (i3GEO.Interface["ATUAL"] === "openlayers") { |
146 | - if (typeof OpenLayers == "undefined") { | 146 | + if (typeof OpenLayers.Control == "undefined") { |
147 | api = "ol3"; | 147 | api = "ol3"; |
148 | } else { | 148 | } else { |
149 | api = "openlayers"; | 149 | api = "openlayers"; |
@@ -256,7 +256,7 @@ i3GEOF.geolocal = | @@ -256,7 +256,7 @@ i3GEOF.geolocal = | ||
256 | limpa : function() { | 256 | limpa : function() { |
257 | i3GEOF.geolocal.posicoes = []; | 257 | i3GEOF.geolocal.posicoes = []; |
258 | if (i3GEO.Interface["ATUAL"] === "openlayers") { | 258 | if (i3GEO.Interface["ATUAL"] === "openlayers") { |
259 | - if (typeof OpenLayers == "undefined") { | 259 | + if (typeof OpenLayers.Control == "undefined") { |
260 | api = "ol3"; | 260 | api = "ol3"; |
261 | } else { | 261 | } else { |
262 | api = "openlayers"; | 262 | api = "openlayers"; |
ferramentas/googlemaps1/endereco.php
1 | <?php | 1 | <?php |
2 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | ||
2 | include(dirname(__FILE__)."/../../ms_configura.php"); | 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 | <html> | 9 | <html> |
6 | <head> | 10 | <head> |
ferramentas/heatmap/funcoes.php
@@ -66,7 +66,7 @@ function heatmapMapfile(){ | @@ -66,7 +66,7 @@ function heatmapMapfile(){ | ||
66 | ms_newLayerObj($mapa, $layern); | 66 | ms_newLayerObj($mapa, $layern); |
67 | $mapa->save($map_file); | 67 | $mapa->save($map_file); |
68 | if(!empty($postgis_mapa)){ | 68 | if(!empty($postgis_mapa)){ |
69 | - substituiCon($map_file,$postgis_mapa); | 69 | + //substituiCon($map_file,$postgis_mapa); |
70 | } | 70 | } |
71 | } | 71 | } |
72 | return $map_file; | 72 | return $map_file; |
ferramentas/identifica/index.js
@@ -45,7 +45,7 @@ if (typeof (i3GEOF) === 'undefined') { | @@ -45,7 +45,7 @@ if (typeof (i3GEOF) === 'undefined') { | ||
45 | } | 45 | } |
46 | /* | 46 | /* |
47 | * Classe: i3GEOF.identifica | 47 | * Classe: i3GEOF.identifica |
48 | - * | 48 | + * |
49 | */ | 49 | */ |
50 | 50 | ||
51 | // TODO na listagem de atributos, incluir opcao para abrir os valores das variaveis associadas a uma regiao, quando codigo_tipo_regiao for | 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,63 +67,64 @@ i3GEOF.identifica = | ||
67 | mustacheHash : function(idjanela) { | 67 | mustacheHash : function(idjanela) { |
68 | var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.identifica.dicionario); | 68 | var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.identifica.dicionario); |
69 | dicionario["idjanelaA"] = idjanela; | 69 | dicionario["idjanelaA"] = idjanela; |
70 | + dicionario["locaplic"] = i3GEO.configura.locaplic; | ||
70 | return dicionario; | 71 | return dicionario; |
71 | }, | 72 | }, |
72 | /* | 73 | /* |
73 | * Propriedade: mostraLinkGeohack | 74 | * Propriedade: mostraLinkGeohack |
74 | - * | 75 | + * |
75 | * Mostra ou não o link para abrir o site GeoHack. | 76 | * Mostra ou não o link para abrir o site GeoHack. |
76 | - * | 77 | + * |
77 | * Este site permite o uso de vários buscadores disponíveis na internet. | 78 | * Este site permite o uso de vários buscadores disponíveis na internet. |
78 | - * | 79 | + * |
79 | * Type: {boolean} | 80 | * Type: {boolean} |
80 | */ | 81 | */ |
81 | mostraLinkGeohack : true, | 82 | mostraLinkGeohack : true, |
82 | /* | 83 | /* |
83 | * Propriedade: mostraSistemasAdicionais | 84 | * Propriedade: mostraSistemasAdicionais |
84 | - * | 85 | + * |
85 | * Mostra ou não a lista de sistemas adicionais de busca de dados. | 86 | * Mostra ou não a lista de sistemas adicionais de busca de dados. |
86 | - * | 87 | + * |
87 | * Type: {boolean} | 88 | * Type: {boolean} |
88 | */ | 89 | */ |
89 | mostraSistemasAdicionais : true, | 90 | mostraSistemasAdicionais : true, |
90 | /* | 91 | /* |
91 | * Variavel: tema | 92 | * Variavel: tema |
92 | - * | 93 | + * |
93 | * Código do tema que será pesquisado | 94 | * Código do tema que será pesquisado |
94 | - * | 95 | + * |
95 | * Type: {String} | 96 | * Type: {String} |
96 | */ | 97 | */ |
97 | tema : "", | 98 | tema : "", |
98 | /* | 99 | /* |
99 | * Variavel: x | 100 | * Variavel: x |
100 | - * | 101 | + * |
101 | * Coordenada x | 102 | * Coordenada x |
102 | - * | 103 | + * |
103 | * Type: {Numeric} | 104 | * Type: {Numeric} |
104 | */ | 105 | */ |
105 | x : 0, | 106 | x : 0, |
106 | /* | 107 | /* |
107 | * Variavel: y | 108 | * Variavel: y |
108 | - * | 109 | + * |
109 | * Coordenada y | 110 | * Coordenada y |
110 | - * | 111 | + * |
111 | * Type: {Numeric} | 112 | * Type: {Numeric} |
112 | */ | 113 | */ |
113 | y : 0, | 114 | y : 0, |
114 | /* | 115 | /* |
115 | * Variavel: sistemasAdicionais | 116 | * Variavel: sistemasAdicionais |
116 | - * | 117 | + * |
117 | * Guarda a lista de sistemas adicionais que são incluídos na seleção de temas | 118 | * Guarda a lista de sistemas adicionais que são incluídos na seleção de temas |
118 | - * | 119 | + * |
119 | * Type: {Array} | 120 | * Type: {Array} |
120 | */ | 121 | */ |
121 | sistemasAdicionais : [], | 122 | sistemasAdicionais : [], |
122 | /* | 123 | /* |
123 | * Variavel: dadosIdentifica | 124 | * Variavel: dadosIdentifica |
124 | - * | 125 | + * |
125 | * Guarda os dados obtidos com a chamada em AJAX de identificação | 126 | * Guarda os dados obtidos com a chamada em AJAX de identificação |
126 | - * | 127 | + * |
127 | * Type: {Array} | 128 | * Type: {Array} |
128 | */ | 129 | */ |
129 | dadosIdentifica : [], | 130 | dadosIdentifica : [], |
@@ -136,9 +137,9 @@ i3GEOF.identifica = | @@ -136,9 +137,9 @@ i3GEOF.identifica = | ||
136 | }, | 137 | }, |
137 | /* | 138 | /* |
138 | * Function: iniciaDicionario | 139 | * Function: iniciaDicionario |
139 | - * | 140 | + * |
140 | * Carrega o dicionário e chama a função que inicia a ferramenta | 141 | * Carrega o dicionário e chama a função que inicia a ferramenta |
141 | - * | 142 | + * |
142 | * O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | 143 | * O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script |
143 | */ | 144 | */ |
144 | iniciaDicionario : function(x, y, id) { | 145 | iniciaDicionario : function(x, y, id) { |
@@ -164,24 +165,24 @@ i3GEOF.identifica = | @@ -164,24 +165,24 @@ i3GEOF.identifica = | ||
164 | }, | 165 | }, |
165 | /* | 166 | /* |
166 | * Function: inicia | 167 | * Function: inicia |
167 | - * | 168 | + * |
168 | * Inicia a janela de informações | 169 | * Inicia a janela de informações |
169 | - * | 170 | + * |
170 | * Parameters: | 171 | * Parameters: |
171 | - * | 172 | + * |
172 | * tema {String} - código do tema, existente no mapfile armazenado na seção, que será consultado | 173 | * tema {String} - código do tema, existente no mapfile armazenado na seção, que será consultado |
173 | * já na inicialização | 174 | * já na inicialização |
174 | - * | 175 | + * |
175 | * x {Numeric} - coordenada x do ponto que será utilizado para busca dos atributos | 176 | * x {Numeric} - coordenada x do ponto que será utilizado para busca dos atributos |
176 | - * | 177 | + * |
177 | * y {Numeric} - coordenada y do ponto | 178 | * y {Numeric} - coordenada y do ponto |
178 | - * | 179 | + * |
179 | * iddiv {String} - id do elemento html onde o conteúdo da ferramenta será incluido | 180 | * iddiv {String} - id do elemento html onde o conteúdo da ferramenta será incluido |
180 | - * | 181 | + * |
181 | * mostraLinkGeohack {boolean} - mostra ou não o link para o site geohacks | 182 | * mostraLinkGeohack {boolean} - mostra ou não o link para o site geohacks |
182 | - * | 183 | + * |
183 | * mostraSistemasAdicionais {boolean} - mostra ou não os sistemas adicionais de busca de dados | 184 | * mostraSistemasAdicionais {boolean} - mostra ou não os sistemas adicionais de busca de dados |
184 | - * | 185 | + * |
185 | * idjanela {string} | 186 | * idjanela {string} |
186 | */ | 187 | */ |
187 | inicia : function(tema, x, y, iddiv, mostraLinkGeohack, mostraSistemasAdicionais, idjanela) { | 188 | inicia : function(tema, x, y, iddiv, mostraLinkGeohack, mostraSistemasAdicionais, idjanela) { |
@@ -325,7 +326,7 @@ i3GEOF.identifica = | @@ -325,7 +326,7 @@ i3GEOF.identifica = | ||
325 | }, | 326 | }, |
326 | /* | 327 | /* |
327 | * Function: iniciaJanelaFlutuante | 328 | * Function: iniciaJanelaFlutuante |
328 | - * | 329 | + * |
329 | * Cria a janela flutuante para controle da ferramenta. | 330 | * Cria a janela flutuante para controle da ferramenta. |
330 | */ | 331 | */ |
331 | iniciaJanelaFlutuante : function(x, y) { | 332 | iniciaJanelaFlutuante : function(x, y) { |
@@ -361,8 +362,8 @@ i3GEOF.identifica = | @@ -361,8 +362,8 @@ i3GEOF.identifica = | ||
361 | + "/ajuda_usuario.php?idcategoria=8&idajuda=70' ><b> </b></a></div>"; | 362 | + "/ajuda_usuario.php?idcategoria=8&idajuda=70' ><b> </b></a></div>"; |
362 | janela = | 363 | janela = |
363 | i3GEO.janela.cria( | 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,7 +430,7 @@ i3GEOF.identifica = | ||
429 | }, | 430 | }, |
430 | /* | 431 | /* |
431 | * Function: ativaFoco | 432 | * Function: ativaFoco |
432 | - * | 433 | + * |
433 | * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado | 434 | * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado |
434 | */ | 435 | */ |
435 | ativaFoco : function(id) { | 436 | ativaFoco : function(id) { |
@@ -453,11 +454,11 @@ i3GEOF.identifica = | @@ -453,11 +454,11 @@ i3GEOF.identifica = | ||
453 | }, | 454 | }, |
454 | /* | 455 | /* |
455 | * Function: html | 456 | * Function: html |
456 | - * | 457 | + * |
457 | * Gera o código html para apresentação das opções da ferramenta | 458 | * Gera o código html para apresentação das opções da ferramenta |
458 | - * | 459 | + * |
459 | * Retorno: | 460 | * Retorno: |
460 | - * | 461 | + * |
461 | * String com o código html | 462 | * String com o código html |
462 | */ | 463 | */ |
463 | html : function(idjanela) { | 464 | html : function(idjanela) { |
@@ -534,17 +535,17 @@ i3GEOF.identifica = | @@ -534,17 +535,17 @@ i3GEOF.identifica = | ||
534 | }, | 535 | }, |
535 | /* | 536 | /* |
536 | * Function: listaTemas | 537 | * Function: listaTemas |
537 | - * | 538 | + * |
538 | * Incluí a lista de temas para o usuário escolher | 539 | * Incluí a lista de temas para o usuário escolher |
539 | - * | 540 | + * |
540 | * Veja: | 541 | * Veja: |
541 | - * | 542 | + * |
542 | * <i3GEO.php.listaTemas> | 543 | * <i3GEO.php.listaTemas> |
543 | - * | 544 | + * |
544 | * Parametros: | 545 | * Parametros: |
545 | - * | 546 | + * |
546 | * tipo {String} - ligados|todos lista apenas os temas que estão visíveis no mapa ou todos os temas | 547 | * tipo {String} - ligados|todos lista apenas os temas que estão visíveis no mapa ou todos os temas |
547 | - * | 548 | + * |
548 | * id {string} id da janela em foco | 549 | * id {string} id da janela em foco |
549 | */ | 550 | */ |
550 | listaTemas : function(tipo) { | 551 | listaTemas : function(tipo) { |
@@ -562,13 +563,13 @@ i3GEOF.identifica = | @@ -562,13 +563,13 @@ i3GEOF.identifica = | ||
562 | }, | 563 | }, |
563 | /* | 564 | /* |
564 | * Function: montaListaTemas | 565 | * Function: montaListaTemas |
565 | - * | 566 | + * |
566 | * Monta a lista de temas na forma de botões 'radio' | 567 | * Monta a lista de temas na forma de botões 'radio' |
567 | - * | 568 | + * |
568 | * O resultado é inserido no div com id "listaTemas" | 569 | * O resultado é inserido no div com id "listaTemas" |
569 | - * | 570 | + * |
570 | * Parametros: | 571 | * Parametros: |
571 | - * | 572 | + * |
572 | * retorno {JSON} - objeto retornado por i3GEO.php.listaTemas ou por i3GEO.arvoreDeCamadas.filtraCamadas | 573 | * retorno {JSON} - objeto retornado por i3GEO.php.listaTemas ou por i3GEO.arvoreDeCamadas.filtraCamadas |
573 | */ | 574 | */ |
574 | montaListaTemas : function(retorno) { | 575 | montaListaTemas : function(retorno) { |
@@ -641,11 +642,11 @@ i3GEOF.identifica = | @@ -641,11 +642,11 @@ i3GEOF.identifica = | ||
641 | }, | 642 | }, |
642 | /* | 643 | /* |
643 | * Function: montaLinkGeohack | 644 | * Function: montaLinkGeohack |
644 | - * | 645 | + * |
645 | * Monta o link para o site geohack | 646 | * Monta o link para o site geohack |
646 | - * | 647 | + * |
647 | * Return: | 648 | * Return: |
648 | - * | 649 | + * |
649 | * {String} | 650 | * {String} |
650 | */ | 651 | */ |
651 | montaLinkGeohack : function() { | 652 | montaLinkGeohack : function() { |
@@ -675,13 +676,13 @@ i3GEOF.identifica = | @@ -675,13 +676,13 @@ i3GEOF.identifica = | ||
675 | }, | 676 | }, |
676 | /* | 677 | /* |
677 | * Function: montaListaSistemas | 678 | * Function: montaListaSistemas |
678 | - * | 679 | + * |
679 | * Obtém a lista de sistemas especiais de consulta. | 680 | * Obtém a lista de sistemas especiais de consulta. |
680 | - * | 681 | + * |
681 | * O resultado é inserido no div com id "listaSistemas". | 682 | * O resultado é inserido no div com id "listaSistemas". |
682 | - * | 683 | + * |
683 | * Cada sistema consiste em uma URL para a qual serão passados os parametros x e y. | 684 | * Cada sistema consiste em uma URL para a qual serão passados os parametros x e y. |
684 | - * | 685 | + * |
685 | */ | 686 | */ |
686 | montaListaSistemas : function(retorno) { | 687 | montaListaSistemas : function(retorno) { |
687 | var l, divins, ig, sistema, pub, exec, temp, t, linhas, ltema, i, idjanela, n = i3GEOF.identifica.janelas.length; | 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,11 +752,11 @@ i3GEOF.identifica = | ||
751 | }, | 752 | }, |
752 | /* | 753 | /* |
753 | * Function: buscaDadosTema | 754 | * Function: buscaDadosTema |
754 | - * | 755 | + * |
755 | * Obtém os dados de um tema para o ponto de coordenadas clicado no mapa | 756 | * Obtém os dados de um tema para o ponto de coordenadas clicado no mapa |
756 | - * | 757 | + * |
757 | * Veja: | 758 | * Veja: |
758 | - * | 759 | + * |
759 | * <i3GEO.php.identifica3> | 760 | * <i3GEO.php.identifica3> |
760 | */ | 761 | */ |
761 | buscaDadosTema : function(tema, x, y, idjanela) { | 762 | buscaDadosTema : function(tema, x, y, idjanela) { |
@@ -848,13 +849,13 @@ i3GEOF.identifica = | @@ -848,13 +849,13 @@ i3GEOF.identifica = | ||
848 | }, | 849 | }, |
849 | /* | 850 | /* |
850 | * Function: mostraDadosSistema | 851 | * Function: mostraDadosSistema |
851 | - * | 852 | + * |
852 | * Obtém os dados de um sistema para o ponto de coordenadas clicado no mapa | 853 | * Obtém os dados de um sistema para o ponto de coordenadas clicado no mapa |
853 | - * | 854 | + * |
854 | * Parametros: | 855 | * Parametros: |
855 | - * | 856 | + * |
856 | * exec {String} - url que será aberta | 857 | * exec {String} - url que será aberta |
857 | - * | 858 | + * |
858 | * target {String} (depreciado) - _self|self| onde a url será aberta. Se for "self", será aberta na mesma janela, caso | 859 | * target {String} (depreciado) - _self|self| onde a url será aberta. Se for "self", será aberta na mesma janela, caso |
859 | * contrário, em uma nova página do navegador | 860 | * contrário, em uma nova página do navegador |
860 | */ | 861 | */ |
@@ -873,15 +874,15 @@ i3GEOF.identifica = | @@ -873,15 +874,15 @@ i3GEOF.identifica = | ||
873 | }, | 874 | }, |
874 | /* | 875 | /* |
875 | * Function abrejanelaIframe | 876 | * Function abrejanelaIframe |
876 | - * | 877 | + * |
877 | * Abre uma janela flutuante contendo um iframe | 878 | * Abre uma janela flutuante contendo um iframe |
878 | - * | 879 | + * |
879 | * Parametros: | 880 | * Parametros: |
880 | - * | 881 | + * |
881 | * w {string} - largura | 882 | * w {string} - largura |
882 | - * | 883 | + * |
883 | * h {string} - altura | 884 | * h {string} - altura |
884 | - * | 885 | + * |
885 | * s {string} - src do iframe | 886 | * s {string} - src do iframe |
886 | */ | 887 | */ |
887 | abrejanelaIframe : function(w, h, s) { | 888 | abrejanelaIframe : function(w, h, s) { |
@@ -912,14 +913,14 @@ i3GEOF.identifica = | @@ -912,14 +913,14 @@ i3GEOF.identifica = | ||
912 | }, | 913 | }, |
913 | /* | 914 | /* |
914 | * Function: mostraDadosTema | 915 | * Function: mostraDadosTema |
915 | - * | 916 | + * |
916 | * Mostra os dados obtidos de um ou mais temas. | 917 | * Mostra os dados obtidos de um ou mais temas. |
917 | - * | 918 | + * |
918 | * Recebe o resultado em JSON da operação de consulta realizada pelo servidor e formata os dados para | 919 | * Recebe o resultado em JSON da operação de consulta realizada pelo servidor e formata os dados para |
919 | * apresentação na tela. | 920 | * apresentação na tela. |
920 | - * | 921 | + * |
921 | * Parametros: | 922 | * Parametros: |
922 | - * | 923 | + * |
923 | * retorno {JSON} - objeto JSON com os dados <i3GEO.php.identifica3> | 924 | * retorno {JSON} - objeto JSON com os dados <i3GEO.php.identifica3> |
924 | */ | 925 | */ |
925 | mostraDadosTema : function(retorno, idjanela) { | 926 | mostraDadosTema : function(retorno, idjanela) { |
@@ -1108,7 +1109,7 @@ i3GEOF.identifica = | @@ -1108,7 +1109,7 @@ i3GEOF.identifica = | ||
1108 | else{ | 1109 | else{ |
1109 | alvo = "_blank"; | 1110 | alvo = "_blank"; |
1110 | } | 1111 | } |
1111 | - res += | 1112 | + res += |
1112 | "<div style='width:100%;text-align:left;background-color:" + cor | 1113 | "<div style='width:100%;text-align:left;background-color:" + cor |
1113 | + "' >" | 1114 | + "' >" |
1114 | + tip | 1115 | + tip |
ferramentas/identifica/template_mst.html
1 | <div id='{{{idjanelaA}}}i3GEOidentificaguiasYUI' class='yui-navset' style='overflow: hidden;top: 0px; cursor: pointer; left: 0px;'> | 1 | <div id='{{{idjanelaA}}}i3GEOidentificaguiasYUI' class='yui-navset' style='overflow: hidden;top: 0px; cursor: pointer; left: 0px;'> |
2 | <ul class='yui-nav' style='border-width: 0pt 0pt 0px; border-color: rgb(240, 240, 240); border-bottom-color: white;'> | 2 | <ul class='yui-nav' style='border-width: 0pt 0pt 0px; border-color: rgb(240, 240, 240); border-bottom-color: white;'> |
3 | <li> | 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 | <div id='{{{idjanelaA}}}i3GEOidentificaguia1' style='text-align: center; left: 0px;'> | 11 | <div id='{{{idjanelaA}}}i3GEOidentificaguia1' style='text-align: center; left: 0px;'> |
5 | <a><em>{{{temasVisiveis}}}</em></a> | 12 | <a><em>{{{temasVisiveis}}}</em></a> |
6 | </div> | 13 | </div> |
@@ -20,11 +27,6 @@ | @@ -20,11 +27,6 @@ | ||
20 | <a><em>XY/buffer</em></a> | 27 | <a><em>XY/buffer</em></a> |
21 | </div> | 28 | </div> |
22 | </li> | 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 | </ul> | 30 | </ul> |
29 | </div> | 31 | </div> |
30 | <div class='guiaobj' id='{{{idjanelaA}}}i3GEOidentificaguia1obj' style='overflow:auto;width:97%;height:90%;left: 1px;'> | 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,11 +2,13 @@ | ||
2 | // | 2 | // |
3 | //escrito por Luis Henrique Weirich de Matos | 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 | error_reporting(0); | 8 | error_reporting(0); |
7 | session_name("i3GeoPHP"); | 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 | session_start(); | 12 | session_start(); |
11 | $map_file = $_SESSION["map_file"]; | 13 | $map_file = $_SESSION["map_file"]; |
12 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 14 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
@@ -37,9 +39,8 @@ $nomes = nomeRandomico(); | @@ -37,9 +39,8 @@ $nomes = nomeRandomico(); | ||
37 | $map = ms_newMapObj($map_file); | 39 | $map = ms_newMapObj($map_file); |
38 | $temp = str_replace(".map","xxx.map",$map_file); | 40 | $temp = str_replace(".map","xxx.map",$map_file); |
39 | $map->save($temp); | 41 | $map->save($temp); |
40 | -substituiCon($temp,$postgis_mapa); | ||
41 | $map = ms_newMapObj($temp); | 42 | $map = ms_newMapObj($temp); |
42 | - | 43 | +restauraCon($temp,$postgis_mapa); |
43 | if($map->getmetadata("interface") == "googlemaps"){ | 44 | if($map->getmetadata("interface") == "googlemaps"){ |
44 | $proj4 = pegaProjecaoDefault("proj4"); | 45 | $proj4 = pegaProjecaoDefault("proj4"); |
45 | $map->setProjection($proj4); | 46 | $map->setProjection($proj4); |
@@ -83,7 +84,7 @@ foreach ($temas as $tema) | @@ -83,7 +84,7 @@ foreach ($temas as $tema) | ||
83 | $map->save($temp); | 84 | $map->save($temp); |
84 | removeLinha("classeNula",$temp); | 85 | removeLinha("classeNula",$temp); |
85 | $map = ms_newMapObj($temp); | 86 | $map = ms_newMapObj($temp); |
86 | - | 87 | +substituiCon($temp,$postgis_mapa); |
87 | $o = $map->outputformat; | 88 | $o = $map->outputformat; |
88 | if($mapexten != ""){ | 89 | if($mapexten != ""){ |
89 | $ext = explode(" ",$mapexten); | 90 | $ext = explode(" ",$mapexten); |
@@ -126,7 +127,9 @@ $nomer = ($imgo->imagepath)."leg".$nomeImagem.".PNG"; | @@ -126,7 +127,9 @@ $nomer = ($imgo->imagepath)."leg".$nomeImagem.".PNG"; | ||
126 | $imgo->saveImage($nomer); | 127 | $imgo->saveImage($nomer); |
127 | $pathlegenda = $dir_tmp."/".basename($imgo->imageurl)."/".basename($nomer); | 128 | $pathlegenda = $dir_tmp."/".basename($imgo->imageurl)."/".basename($nomer); |
128 | $titulo = $_GET['titulo']; | 129 | $titulo = $_GET['titulo']; |
130 | + | ||
129 | substituiCon($map_file,$postgis_mapa); | 131 | substituiCon($map_file,$postgis_mapa); |
132 | + | ||
130 | require(dirname(__FILE__).'/../../pacotes/fpdf/fpdf.php'); | 133 | require(dirname(__FILE__).'/../../pacotes/fpdf/fpdf.php'); |
131 | $pdf = new FPDF("L","mm","A4"); | 134 | $pdf = new FPDF("L","mm","A4"); |
132 | $pdf->SetAutoPageBreak(false); | 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,11 +29,13 @@ GNU junto com este programa; se n&atilde;o, escreva para a | ||
29 | Free Software Foundation, Inc., no endereço | 29 | Free Software Foundation, Inc., no endereço |
30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | 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 | error_reporting(0); | 35 | error_reporting(0); |
34 | session_name("i3GeoPHP"); | 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 | session_start(); | 39 | session_start(); |
38 | $map_file = $_SESSION["map_file"]; | 40 | $map_file = $_SESSION["map_file"]; |
39 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 41 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
@@ -107,7 +109,7 @@ foreach ($temas as $tema) | @@ -107,7 +109,7 @@ foreach ($temas as $tema) | ||
107 | $map->save($temp); | 109 | $map->save($temp); |
108 | removeLinha("classeNula",$temp); | 110 | removeLinha("classeNula",$temp); |
109 | $map = ms_newMapObj($temp); | 111 | $map = ms_newMapObj($temp); |
110 | - | 112 | +substituiCon($temp,$postgis_mapa); |
111 | $o = $map->outputformat; | 113 | $o = $map->outputformat; |
112 | 114 | ||
113 | if($mapexten != ""){ | 115 | if($mapexten != ""){ |
ferramentas/imprimir/geotif.php
@@ -29,11 +29,14 @@ GNU junto com este programa; se n&atilde;o, escreva para a | @@ -29,11 +29,14 @@ GNU junto com este programa; se n&atilde;o, escreva para a | ||
29 | Free Software Foundation, Inc., no endereço | 29 | Free Software Foundation, Inc., no endereço |
30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | 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 | error_reporting(0); | 35 | error_reporting(0); |
34 | session_name("i3GeoPHP"); | 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 | session_start(); | 40 | session_start(); |
38 | $map_file = $_SESSION["map_file"]; | 41 | $map_file = $_SESSION["map_file"]; |
39 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 42 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
@@ -60,7 +63,7 @@ require(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); | @@ -60,7 +63,7 @@ require(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); | ||
60 | error_reporting(0); | 63 | error_reporting(0); |
61 | $nomes = nomeRandomico(); | 64 | $nomes = nomeRandomico(); |
62 | $map = ms_newMapObj($map_file); | 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 | $map->save($temp); | 67 | $map->save($temp); |
65 | substituiCon($temp,$postgis_mapa); | 68 | substituiCon($temp,$postgis_mapa); |
66 | $of = $map->outputformat; | 69 | $of = $map->outputformat; |
@@ -107,6 +110,7 @@ foreach ($temas as $tema) | @@ -107,6 +110,7 @@ foreach ($temas as $tema) | ||
107 | $map->save($temp); | 110 | $map->save($temp); |
108 | removeLinha("classeNula",$temp); | 111 | removeLinha("classeNula",$temp); |
109 | $map = ms_newMapObj($temp); | 112 | $map = ms_newMapObj($temp); |
113 | +substituiCon($temp,$postgis_mapa); | ||
110 | $o = $map->outputformat; | 114 | $o = $map->outputformat; |
111 | if($mapexten != ""){ | 115 | if($mapexten != ""){ |
112 | $ext = explode(" ",$mapexten); | 116 | $ext = explode(" ",$mapexten); |
ferramentas/imprimir/geraimagens.php
1 | <?php | 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 | error_reporting(0); | 5 | error_reporting(0); |
4 | session_name("i3GeoPHP"); | 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 | session_start(); | 10 | session_start(); |
8 | $map_file = $_SESSION["map_file"]; | 11 | $map_file = $_SESSION["map_file"]; |
9 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 12 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
@@ -34,7 +37,7 @@ $map = ms_newMapObj($map_file); | @@ -34,7 +37,7 @@ $map = ms_newMapObj($map_file); | ||
34 | $map->save($temp); | 37 | $map->save($temp); |
35 | substituiCon($temp,$postgis_mapa); | 38 | substituiCon($temp,$postgis_mapa); |
36 | $map = ms_newMapObj($temp); | 39 | $map = ms_newMapObj($temp); |
37 | - | 40 | +substituiCon($temp,$postgis_mapa); |
38 | $w = $map->width; | 41 | $w = $map->width; |
39 | $h = $map->height; | 42 | $h = $map->height; |
40 | $legenda =$map->legend; | 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,11 +29,13 @@ GNU junto com este programa; se n&atilde;o, escreva para a | ||
29 | Free Software Foundation, Inc., no endereço | 29 | Free Software Foundation, Inc., no endereço |
30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | 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 | error_reporting(0); | 35 | error_reporting(0); |
34 | session_name("i3GeoPHP"); | 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 | session_start(); | 39 | session_start(); |
38 | $map_file = $_SESSION["map_file"]; | 40 | $map_file = $_SESSION["map_file"]; |
39 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 41 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
@@ -109,7 +111,7 @@ foreach ($temas as $tema) | @@ -109,7 +111,7 @@ foreach ($temas as $tema) | ||
109 | $map->save($temp); | 111 | $map->save($temp); |
110 | removeLinha("classeNula",$temp); | 112 | removeLinha("classeNula",$temp); |
111 | $map = ms_newMapObj($temp); | 113 | $map = ms_newMapObj($temp); |
112 | - | 114 | +substituiCon($temp,$postgis_mapa); |
113 | $o = $map->outputformat; | 115 | $o = $map->outputformat; |
114 | 116 | ||
115 | if($mapexten != ""){ | 117 | if($mapexten != ""){ |
ferramentas/imprimir/svg.php
@@ -29,11 +29,13 @@ GNU junto com este programa; se n&atilde;o, escreva para a | @@ -29,11 +29,13 @@ GNU junto com este programa; se n&atilde;o, escreva para a | ||
29 | Free Software Foundation, Inc., no endereço | 29 | Free Software Foundation, Inc., no endereço |
30 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | 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 | error_reporting(0); | 35 | error_reporting(0); |
34 | session_name("i3GeoPHP"); | 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 | session_start(); | 39 | session_start(); |
38 | $map_file = $_SESSION["map_file"]; | 40 | $map_file = $_SESSION["map_file"]; |
39 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 41 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
@@ -131,7 +133,7 @@ for ($i=0;$i < $numlayers;$i++) | @@ -131,7 +133,7 @@ for ($i=0;$i < $numlayers;$i++) | ||
131 | $map->save($temp); | 133 | $map->save($temp); |
132 | removeLinha("classeNula",$temp); | 134 | removeLinha("classeNula",$temp); |
133 | $map = ms_newMapObj($temp); | 135 | $map = ms_newMapObj($temp); |
134 | - | 136 | +substituiCon($temp,$postgis_mapa); |
135 | $o = $map->outputformat; | 137 | $o = $map->outputformat; |
136 | if($mapexten != ""){ | 138 | if($mapexten != ""){ |
137 | $ext = explode(" ",$mapexten); | 139 | $ext = explode(" ",$mapexten); |
ferramentas/imprimir/swf.php
1 | <?php | 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 | error_reporting(0); | 4 | error_reporting(0); |
4 | session_name("i3GeoPHP"); | 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 | session_start(); | 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 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 11 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
13 | // | 12 | // |
14 | //se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido | 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,11 +31,20 @@ if(!empty($g_sid)){ | ||
31 | session_name("i3GeoPHP"); | 31 | session_name("i3GeoPHP"); |
32 | session_id($g_sid); | 32 | session_id($g_sid); |
33 | session_start(); | 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 | include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); | 49 | include_once(dirname(__FILE__)."/../classesphp/funcoes_gerais.php"); |
41 | if(isset($fingerprint) && !empty($g_sid)) { | 50 | if(isset($fingerprint) && !empty($g_sid)) { |
@@ -55,9 +64,11 @@ if(!substituiCon($map_file,$postgis_mapa)){ | @@ -55,9 +64,11 @@ if(!substituiCon($map_file,$postgis_mapa)){ | ||
55 | cpjson("erro",$cp); | 64 | cpjson("erro",$cp); |
56 | return; | 65 | return; |
57 | } | 66 | } |
67 | +// | ||
58 | function redesenhaMapa() | 68 | function redesenhaMapa() |
59 | { | 69 | { |
60 | global $map_file,$tipoimagem,$cp,$postgis_mapa,$utilizacgi,$locmapserv,$interface,$mapexten; | 70 | global $map_file,$tipoimagem,$cp,$postgis_mapa,$utilizacgi,$locmapserv,$interface,$mapexten; |
71 | + substituiCon($map_file,$postgis_mapa); | ||
61 | if($tipoimagem != "nenhum" && $tipoimagem != "") | 72 | if($tipoimagem != "nenhum" && $tipoimagem != "") |
62 | {$utilizacgi = "nao";} | 73 | {$utilizacgi = "nao";} |
63 | if (connection_aborted()){exit();} | 74 | if (connection_aborted()){exit();} |
ferramentas/inseregrafico/index.js
@@ -155,7 +155,7 @@ i3GEOF.insereGrafico = { | @@ -155,7 +155,7 @@ i3GEOF.insereGrafico = { | ||
155 | g_nomepin = "pin"+temp[1]; | 155 | g_nomepin = "pin"+temp[1]; |
156 | var i = $i("i3GEOF.insereGrafico_c").style; | 156 | var i = $i("i3GEOF.insereGrafico_c").style; |
157 | i3GEO.janela.ULTIMOZINDEX++; | 157 | i3GEO.janela.ULTIMOZINDEX++; |
158 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 158 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
159 | }, | 159 | }, |
160 | /* | 160 | /* |
161 | Function: insere | 161 | Function: insere |
ferramentas/inserexy2/index.js
@@ -191,7 +191,7 @@ i3GEOF.inserexy = { | @@ -191,7 +191,7 @@ i3GEOF.inserexy = { | ||
191 | }; | 191 | }; |
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>"; | 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 | janela = i3GEO.janela.cria( | 193 | janela = i3GEO.janela.cria( |
194 | - "500px", | 194 | + "520px", |
195 | "310px", | 195 | "310px", |
196 | "", | 196 | "", |
197 | "", | 197 | "", |
@@ -231,7 +231,7 @@ i3GEOF.inserexy = { | @@ -231,7 +231,7 @@ i3GEOF.inserexy = { | ||
231 | i3GEO.barraDeBotoes.ativaIcone("inserexy"); | 231 | i3GEO.barraDeBotoes.ativaIcone("inserexy"); |
232 | var i = $i("i3GEOF.inserexy_c").style; | 232 | var i = $i("i3GEOF.inserexy_c").style; |
233 | i3GEO.janela.ULTIMOZINDEX++; | 233 | i3GEO.janela.ULTIMOZINDEX++; |
234 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 234 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
235 | }, | 235 | }, |
236 | /* | 236 | /* |
237 | Function: montaComboLocal | 237 | Function: montaComboLocal |
ferramentas/loginusuario/template_mst_bt.html
1 | <li> | 1 | <li> |
2 | - <div id="i3GEOF_loginusuario_imagemCabecalho" style="visibility:hidden;"> | 2 | + <div id="i3GEOF_loginusuario_imagemCabecalho" style="visibility: hidden;"> |
3 | <i class="fa fa-spinner fa-spin" aria-hidden="true"></i> | 3 | <i class="fa fa-spinner fa-spin" aria-hidden="true"></i> |
4 | </div> | 4 | </div> |
5 | <div class="row"> | 5 | <div class="row"> |
6 | <div class="col-md-12"> | 6 | <div class="col-md-12"> |
7 | <form class="form" role="form" method="post" action="#"> | 7 | <form class="form" role="form" method="post" action="#"> |
8 | <div class="form-group"> | 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 | </div> | 11 | </div> |
11 | <div class="form-group"> | 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 | </div> | 15 | </div> |
14 | </form> | 16 | </form> |
15 | </div> | 17 | </div> |
@@ -24,13 +26,14 @@ | @@ -24,13 +26,14 @@ | ||
24 | </div> | 26 | </div> |
25 | <div class="row"> | 27 | <div class="row"> |
26 | <div class="col-md-12"> | 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 | <a href="#" onclick="i3GEOF.loginusuario.alterarSenha()">{{{alterar}}}</a> | 31 | <a href="#" onclick="i3GEOF.loginusuario.alterarSenha()">{{{alterar}}}</a> |
29 | </div> | 32 | </div> |
30 | </div> | 33 | </div> |
31 | <div class="row"> | 34 | <div class="row"> |
32 | <div class="col-md-12"> | 35 | <div class="col-md-12"> |
33 | - <ph6 class="text-muted">{{{ativo}}}: {{{usuarioLogado}}}</h6> | 36 | + <h6 class="text-muted">{{{ativo}}}: {{{usuarioLogado}}}</h6> |
34 | </div> | 37 | </div> |
35 | </div> | 38 | </div> |
36 | </li> | 39 | </li> |
37 | \ No newline at end of file | 40 | \ No newline at end of file |
ferramentas/markercluster/funcoes.php
@@ -63,7 +63,7 @@ function markerclusterMapfile(){ | @@ -63,7 +63,7 @@ function markerclusterMapfile(){ | ||
63 | ms_newLayerObj($mapa, $layern); | 63 | ms_newLayerObj($mapa, $layern); |
64 | $mapa->save($map_file); | 64 | $mapa->save($map_file); |
65 | if(!empty($postgis_mapa)){ | 65 | if(!empty($postgis_mapa)){ |
66 | - substituiCon($map_file,$postgis_mapa); | 66 | + //substituiCon($map_file,$postgis_mapa); |
67 | } | 67 | } |
68 | } | 68 | } |
69 | return $map_file; | 69 | return $map_file; |
ferramentas/metar/index.js
@@ -159,7 +159,7 @@ i3GEOF.metar = | @@ -159,7 +159,7 @@ i3GEOF.metar = | ||
159 | ativaFoco : function() { | 159 | ativaFoco : function() { |
160 | var i = $i("i3GEOF.metar_c").style; | 160 | var i = $i("i3GEOF.metar_c").style; |
161 | i3GEO.janela.ULTIMOZINDEX++; | 161 | i3GEO.janela.ULTIMOZINDEX++; |
162 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 162 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
163 | }, | 163 | }, |
164 | /* | 164 | /* |
165 | * Function: lista | 165 | * Function: lista |
ferramentas/metar/metarextensao.php
@@ -36,10 +36,11 @@ Return: | @@ -36,10 +36,11 @@ Return: | ||
36 | */ | 36 | */ |
37 | //set_time_limit(600); | 37 | //set_time_limit(600); |
38 | require_once(dirname(__FILE__)."/../../pacotes/cpaint/cpaint2.inc.php"); | 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 | require_once(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); | 41 | require_once(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
41 | error_reporting(0); | 42 | error_reporting(0); |
42 | -$e = explode(" ",$ret); | 43 | +$e = explode(" ",$_GET["ret"]); |
43 | $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 | $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 | $s = file($url); | 45 | $s = file($url); |
45 | header("Content-type: text/ascii; charset=UTF-8"); | 46 | header("Content-type: text/ascii; charset=UTF-8"); |
ferramentas/metar/metarproxima.php
@@ -45,7 +45,10 @@ echo "<html><style> | @@ -45,7 +45,10 @@ echo "<html><style> | ||
45 | P | 45 | P |
46 | {padding-top:1px;COLOR: #2F4632;text-align: justify;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif;} | 46 | {padding-top:1px;COLOR: #2F4632;text-align: justify;font-size: 12px;font-family: Verdana, Arial, Helvetica, sans-serif;} |
47 | </style>"; | 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 | error_reporting(0); | 52 | error_reporting(0); |
50 | $url = "http://ws.geonames.org/findNearByWeatherXML?username=i3geo&lat=$y&lng=$x&lang=pt"; | 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,20 +9,20 @@ Minha ferramenta! | ||
9 | <script> | 9 | <script> |
10 | //TODO remover i3geo_tudo_compacto.js.php | 10 | //TODO remover i3geo_tudo_compacto.js.php |
11 | //essa funcao pega valores passados pela URL | 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 | //$i é um alias para pegar um objeto | 15 | //$i é um alias para pegar um objeto |
16 | -$i("exemplos").innerHTML = secao+aplic | 16 | +$i("exemplos").innerHTML = secao+aplic; |
17 | function mudaext() | 17 | function mudaext() |
18 | { | 18 | { |
19 | - aguarde("block") | 19 | + aguarde("block"); |
20 | //essa função só é executada quando ocorrer o retorno da chamada do objeto "cp" | 20 | //essa função só é executada quando ocorrer o retorno da chamada do objeto "cp" |
21 | var fim = function() | 21 | var fim = function() |
22 | { | 22 | { |
23 | - aguarde("none") | ||
24 | - window.parent.ajaxredesenha("") | ||
25 | - } | 23 | + aguarde("none"); |
24 | + window.parent.ajaxredesenha(""); | ||
25 | + }; | ||
26 | var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&ext="+$i("valor").value+"&g_sid="+g_sid; | 26 | var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&ext="+$i("valor").value+"&g_sid="+g_sid; |
27 | var cp = new cpaint(); | 27 | var cp = new cpaint(); |
28 | cp.set_response_type("JSON"); | 28 | cp.set_response_type("JSON"); |
ferramentas/mostraexten/index.js
@@ -145,7 +145,7 @@ i3GEOF.mostraExten = { | @@ -145,7 +145,7 @@ i3GEOF.mostraExten = { | ||
145 | $i("i3GEOmostraExtenatual").innerHTML = i3GEO.parametros.mapexten; | 145 | $i("i3GEOmostraExtenatual").innerHTML = i3GEO.parametros.mapexten; |
146 | var i = $i("i3GEOF.mostraExten_c").style; | 146 | var i = $i("i3GEOF.mostraExten_c").style; |
147 | i3GEO.janela.ULTIMOZINDEX++; | 147 | i3GEO.janela.ULTIMOZINDEX++; |
148 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 148 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
149 | }, | 149 | }, |
150 | /* | 150 | /* |
151 | Function: executa | 151 | Function: executa |
ferramentas/nuvemtags/index.js
@@ -202,7 +202,7 @@ i3GEOF.nuvemtags = { | @@ -202,7 +202,7 @@ i3GEOF.nuvemtags = { | ||
202 | i3GEO.barraDeBotoes.ativaIcone("nuvemtags"); | 202 | i3GEO.barraDeBotoes.ativaIcone("nuvemtags"); |
203 | var i = $i("i3GEOF.nuvemtags_c").style; | 203 | var i = $i("i3GEOF.nuvemtags_c").style; |
204 | i3GEO.janela.ULTIMOZINDEX++; | 204 | i3GEO.janela.ULTIMOZINDEX++; |
205 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 205 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
206 | }, | 206 | }, |
207 | /* | 207 | /* |
208 | Function: montaNuvem | 208 | Function: montaNuvem |
ferramentas/nuvemtagsflash/index.htm
@@ -47,7 +47,7 @@ | @@ -47,7 +47,7 @@ | ||
47 | <script type="text/javascript" src="../../pacotes/wpcumulus/swfobject.js"></script> | 47 | <script type="text/javascript" src="../../pacotes/wpcumulus/swfobject.js"></script> |
48 | <script> | 48 | <script> |
49 | //TODO remover i3geo_tudo_compacto.js.php | 49 | //TODO remover i3geo_tudo_compacto.js.php |
50 | -iniciaNuvem() | 50 | +iniciaNuvem(); |
51 | </script> | 51 | </script> |
52 | </body> | 52 | </body> |
53 | </html> | 53 | </html> |
54 | \ No newline at end of file | 54 | \ No newline at end of file |
ferramentas/parametrossql/exec.php
1 | <?php | 1 | <?php |
2 | +exit; | ||
2 | include_once(dirname(__FILE__)."/../inicia.php"); | 3 | include_once(dirname(__FILE__)."/../inicia.php"); |
3 | // | 4 | // |
4 | //faz a busca da função que deve ser executada | 5 | //faz a busca da função que deve ser executada |
@@ -130,8 +131,8 @@ switch (strtoupper($funcao)) | @@ -130,8 +131,8 @@ switch (strtoupper($funcao)) | ||
130 | */ | 131 | */ |
131 | case "INCLUDEPROG": | 132 | case "INCLUDEPROG": |
132 | //evita redirecoina o programa para algum lugar indevido | 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 | if(file_exists($locaplic."/".$prog)){ | 136 | if(file_exists($locaplic."/".$prog)){ |
136 | include($locaplic."/".$prog); | 137 | include($locaplic."/".$prog); |
137 | } | 138 | } |
@@ -144,4 +145,4 @@ else{ | @@ -144,4 +145,4 @@ else{ | ||
144 | exit(); | 145 | exit(); |
145 | } | 146 | } |
146 | 147 | ||
147 | -?> | ||
148 | \ No newline at end of file | 148 | \ No newline at end of file |
149 | +?> |
ferramentas/preferencias/index.js
@@ -194,10 +194,6 @@ i3GEOF.preferencias = { | @@ -194,10 +194,6 @@ i3GEOF.preferencias = { | ||
194 | tipo: "boolean", | 194 | tipo: "boolean", |
195 | elemento: "i3GEO.arvoreDeCamadas.OPCOESLEGENDA" | 195 | elemento: "i3GEO.arvoreDeCamadas.OPCOESLEGENDA" |
196 | },{ | 196 | },{ |
197 | - titulo: $trad('ativaAguardeLegenda',i3GEOF.preferencias.dicionario), | ||
198 | - tipo: "boolean", | ||
199 | - elemento: "i3GEO.arvoreDeCamadas.AGUARDALEGENDA" | ||
200 | - },{ | ||
201 | titulo: $trad('mostraIconeTema',i3GEOF.preferencias.dicionario), | 197 | titulo: $trad('mostraIconeTema',i3GEOF.preferencias.dicionario), |
202 | tipo: "boolean", | 198 | tipo: "boolean", |
203 | elemento: "i3GEO.arvoreDeCamadas.ICONETEMA" | 199 | elemento: "i3GEO.arvoreDeCamadas.ICONETEMA" |
ferramentas/recline/default.php
1 | <?php | 1 | <?php |
2 | //pega a extensao geografica da camada | 2 | //pega a extensao geografica da camada |
3 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | ||
4 | +$_GET = array_merge($_GET,$_POST); | ||
3 | include("../../ms_configura.php"); | 5 | include("../../ms_configura.php"); |
4 | -include("../../classesphp/pega_variaveis.php"); | ||
5 | include("../../classesphp/funcoes_gerais.php"); | 6 | include("../../classesphp/funcoes_gerais.php"); |
6 | $versao = versao(); | 7 | $versao = versao(); |
7 | $versao = $versao["principal"]; | 8 | $versao = $versao["principal"]; |
ferramentas/recline/tabela.php
@@ -5,8 +5,9 @@ | @@ -5,8 +5,9 @@ | ||
5 | // | 5 | // |
6 | 6 | ||
7 | //pega a extensao geografica da camada | 7 | //pega a extensao geografica da camada |
8 | +include_once (dirname(__FILE__)."/../../classesphp/sani_request.php"); | ||
9 | +$_GET = array_merge($_GET,$_POST); | ||
8 | include("../../ms_configura.php"); | 10 | include("../../ms_configura.php"); |
9 | -include("../../classesphp/pega_variaveis.php"); | ||
10 | ?> | 11 | ?> |
11 | <!DOCTYPE html> | 12 | <!DOCTYPE html> |
12 | <html lang="en"> | 13 | <html lang="en"> |
ferramentas/scielo/funcoes.php
1 | <?php | 1 | <?php |
2 | error_reporting(0); | 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 | require_once("../../pacotes/cpaint/cpaint2.inc.php"); | 7 | require_once("../../pacotes/cpaint/cpaint2.inc.php"); |
5 | require_once("../../ms_configura.php"); | 8 | require_once("../../ms_configura.php"); |
6 | require_once("../../pacotes/phpxbase/api_conversion.php"); | 9 | require_once("../../pacotes/phpxbase/api_conversion.php"); |
ferramentas/selecao/index.js
@@ -368,7 +368,7 @@ i3GEOF.selecao = | @@ -368,7 +368,7 @@ i3GEOF.selecao = | ||
368 | ]); | 368 | ]); |
369 | i3GEO.barraDeBotoes.ativaPadrao(); | 369 | i3GEO.barraDeBotoes.ativaPadrao(); |
370 | if(i3GEO.Interface["ATUAL"] === "openlayers"){ | 370 | if(i3GEO.Interface["ATUAL"] === "openlayers"){ |
371 | - if (typeof OpenLayers == "undefined") { | 371 | + if (typeof OpenLayers.Control == "undefined") { |
372 | api = "ol3"; | 372 | api = "ol3"; |
373 | i3GEO.Interface.openlayers.interacoes[0].setActive(true);//duplo clique | 373 | i3GEO.Interface.openlayers.interacoes[0].setActive(true);//duplo clique |
374 | } else { | 374 | } else { |
@@ -396,7 +396,7 @@ i3GEOF.selecao = | @@ -396,7 +396,7 @@ i3GEOF.selecao = | ||
396 | i3GEOF.selecao.mudaicone(); | 396 | i3GEOF.selecao.mudaicone(); |
397 | var i = $i("i3GEOF.selecao_c").style; | 397 | var i = $i("i3GEOF.selecao_c").style; |
398 | i3GEO.janela.ULTIMOZINDEX++; | 398 | i3GEO.janela.ULTIMOZINDEX++; |
399 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 399 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
400 | if (i3GEO.Interface.ATUAL != "openlayers") { | 400 | if (i3GEO.Interface.ATUAL != "openlayers") { |
401 | i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar(); | 401 | i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar(); |
402 | } | 402 | } |
@@ -542,7 +542,7 @@ i3GEOF.selecao = | @@ -542,7 +542,7 @@ i3GEOF.selecao = | ||
542 | i3GEOF.selecao.fimSelecao(retorno); | 542 | i3GEOF.selecao.fimSelecao(retorno); |
543 | }, tema = i3GEOF.selecao.pegaTemasSel(); | 543 | }, tema = i3GEOF.selecao.pegaTemasSel(); |
544 | if (i3GEO.Interface["ATUAL"] === "openlayers") { | 544 | if (i3GEO.Interface["ATUAL"] === "openlayers") { |
545 | - if (typeof OpenLayers == "undefined") { | 545 | + if (typeof OpenLayers.Control == "undefined") { |
546 | api = "ol3"; | 546 | api = "ol3"; |
547 | } else { | 547 | } else { |
548 | api = "openlayers"; | 548 | api = "openlayers"; |
ferramentas/tabela/index.js
@@ -527,7 +527,7 @@ i3GEOF.tabela = | @@ -527,7 +527,7 @@ i3GEOF.tabela = | ||
527 | } | 527 | } |
528 | var i = $i(id + "_c").style; | 528 | var i = $i(id + "_c").style; |
529 | i3GEO.janela.ULTIMOZINDEX++; | 529 | i3GEO.janela.ULTIMOZINDEX++; |
530 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 530 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
531 | }, | 531 | }, |
532 | vinculos : { | 532 | vinculos : { |
533 | ligacoes : [], | 533 | ligacoes : [], |
ferramentas/tabela/relatorio.php
@@ -7,18 +7,28 @@ | @@ -7,18 +7,28 @@ | ||
7 | </head> | 7 | </head> |
8 | <?php | 8 | <?php |
9 | session_name("i3GeoPHP"); | 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 | session_start(); | 21 | session_start(); |
13 | -include(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | 22 | + |
14 | $map_file = $_SESSION["map_file"]; | 23 | $map_file = $_SESSION["map_file"]; |
15 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 24 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
25 | + | ||
16 | include (dirname(__FILE__)."/../../ms_configura.php"); | 26 | include (dirname(__FILE__)."/../../ms_configura.php"); |
17 | include(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); | 27 | include(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
18 | include(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); | 28 | include(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
19 | $versao = versao(); | 29 | $versao = versao(); |
20 | $versao = $versao["principal"]; | 30 | $versao = $versao["principal"]; |
21 | -substituiCon($map_file,$postgis_mapa); | 31 | + |
22 | $temp = explode(",",$nomesrel); | 32 | $temp = explode(",",$nomesrel); |
23 | $colunasTemp = array(); | 33 | $colunasTemp = array(); |
24 | foreach($temp as $t){ | 34 | foreach($temp as $t){ |
@@ -61,7 +71,9 @@ foreach($temp as $t) | @@ -61,7 +71,9 @@ foreach($temp as $t) | ||
61 | } | 71 | } |
62 | if($itemagruparel != "" && !in_array($itemagruparel,$itensrel)) | 72 | if($itemagruparel != "" && !in_array($itemagruparel,$itensrel)) |
63 | {$itensrel[] = $itemagruparel;} | 73 | {$itensrel[] = $itemagruparel;} |
74 | + | ||
64 | $mapa = ms_newMapObj($map_file); | 75 | $mapa = ms_newMapObj($map_file); |
76 | +substituiConObj($temp,$postgis_mapa); | ||
65 | if($ext && $ext != ""){ | 77 | if($ext && $ext != ""){ |
66 | $e = explode(" ",$ext); | 78 | $e = explode(" ",$ext); |
67 | $extatual = $mapa->extent; | 79 | $extatual = $mapa->extent; |
ferramentas/wiki/funcoes.php
@@ -2,7 +2,9 @@ | @@ -2,7 +2,9 @@ | ||
2 | $usuarioGeonames = "i3geo"; | 2 | $usuarioGeonames = "i3geo"; |
3 | //set_time_limit(600); | 3 | //set_time_limit(600); |
4 | require_once(dirname(__FILE__)."/../../pacotes/cpaint/cpaint2.inc.php"); | 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 | require_once(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); | 8 | require_once(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); |
7 | error_reporting(0); | 9 | error_reporting(0); |
8 | $cp = new cpaint(); | 10 | $cp = new cpaint(); |
ferramentas/wiki/index.js
@@ -159,7 +159,7 @@ i3GEOF.wiki = { | @@ -159,7 +159,7 @@ i3GEOF.wiki = { | ||
159 | ativaFoco: function(){ | 159 | ativaFoco: function(){ |
160 | var i = $i("i3GEOF.wiki_c").style; | 160 | var i = $i("i3GEOF.wiki_c").style; |
161 | i3GEO.janela.ULTIMOZINDEX++; | 161 | i3GEO.janela.ULTIMOZINDEX++; |
162 | - i.zIndex = 21000 + i3GEO.janela.ULTIMOZINDEX; | 162 | + i.zIndex = 51000 + i3GEO.janela.ULTIMOZINDEX; |
163 | }, | 163 | }, |
164 | /* | 164 | /* |
165 | Function: lista | 165 | Function: lista |