Commit ec317260720ca7f7f27115512da9ba367965d914

Authored by Edmar Moretti
1 parent 8d34bef2

Correções para versão OL3

admin/admin.db
No preview for this file type
admin/php/editormapfile.php
@@ -83,6 +83,7 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){ @@ -83,6 +83,7 @@ if(in_array(strtoupper($funcao),$funcoesEdicao)){
83 if(verificaOperacaoSessao("admin/html/editormapfile") == false){ 83 if(verificaOperacaoSessao("admin/html/editormapfile") == false){
84 retornaJSON("Vc nao pode realizar essa operacao.");exit; 84 retornaJSON("Vc nao pode realizar essa operacao.");exit;
85 } 85 }
  86 + unlink("$locaplic/temas/teste.txt");
86 } 87 }
87 error_reporting(0); 88 error_reporting(0);
88 //define o parametro de output do resultado da funcao 89 //define o parametro de output do resultado da funcao
classesjs/compactajs.php
@@ -59,24 +59,28 @@ $f = @fopen("../classesjs/teste.txt",w); @@ -59,24 +59,28 @@ $f = @fopen("../classesjs/teste.txt",w);
59 if (!file_exists("../classesjs/teste.txt")){ 59 if (!file_exists("../classesjs/teste.txt")){
60 echo "<span style='color:red'>N&atilde;o foi possivel escrever em classesjs";exit; 60 echo "<span style='color:red'>N&atilde;o foi possivel escrever em classesjs";exit;
61 } 61 }
  62 +unlink("../classesjs/teste.txt");
62 unlink("../css/teste.txt"); 63 unlink("../css/teste.txt");
63 $f = @fopen("../css/teste.txt",w); 64 $f = @fopen("../css/teste.txt",w);
64 @fclose($f); 65 @fclose($f);
65 if (!file_exists("../css/teste.txt")){ 66 if (!file_exists("../css/teste.txt")){
66 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em css";exit; 67 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em css";exit;
67 } 68 }
  69 +unlink("../css/teste.txt");
68 unlink("../pacotes/teste.txt"); 70 unlink("../pacotes/teste.txt");
69 $f = @fopen("../pacotes/teste.txt",w); 71 $f = @fopen("../pacotes/teste.txt",w);
70 @fclose($f); 72 @fclose($f);
71 if (!file_exists("../pacotes/teste.txt")){ 73 if (!file_exists("../pacotes/teste.txt")){
72 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em pacotes";exit; 74 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em pacotes";exit;
73 } 75 }
  76 +unlink("../pacotes/teste.txt");
74 unlink("../mashups/teste.txt"); 77 unlink("../mashups/teste.txt");
75 $f = @fopen("../mashups/teste.txt",w); 78 $f = @fopen("../mashups/teste.txt",w);
76 @fclose($f); 79 @fclose($f);
77 if (!file_exists("../mashups/teste.txt")){ 80 if (!file_exists("../mashups/teste.txt")){
78 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em mashups";exit; 81 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em mashups";exit;
79 } 82 }
  83 +unlink("../mashups/teste.txt");
80 echo "<pre>"; 84 echo "<pre>";
81 // 85 //
82 //compacta os arquivos do i3geo 86 //compacta os arquivos do i3geo
classesjs/teste.txt 0 → 100755
ferramentas/congelamapa/openlayers3.php 0 → 100644
@@ -0,0 +1,97 @@ @@ -0,0 +1,97 @@
  1 +<?php
  2 +$g_sid = strip_tags($_GET["g_sid"]);
  3 +session_name("i3GeoPHP");
  4 +session_id($g_sid);
  5 +session_start();
  6 +$fingerprint = $_SESSION["fingerprint"];
  7 +$f = explode(",",$fingerprint);
  8 +if($f[0] != md5('I3GEOSEC' . $_SERVER['HTTP_USER_AGENT'] . session_id())){
  9 + echo "erro";
  10 + return;
  11 +}
  12 +include(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php");
  13 +$map_file = $_SESSION["map_file"];
  14 +$base = basename($map_file);
  15 +$dir = dirname($map_file);
  16 +$novo_mapfile = $dir."/".nomeRandomico(5).$base;
  17 +copy($map_file,$novo_mapfile);
  18 +chmod($novo_mapfile,0777);
  19 +$mapa = ms_newMapObj($novo_mapfile);
  20 +$mapa->setProjection("+proj=longlat +ellps=GRS67 +no_defs");
  21 +$numlayers = $mapa->numlayers;
  22 +$layers = array();
  23 +for($i = 0;$i < $numlayers;++$i){
  24 + $l = $mapa->getLayer($i);
  25 + $l->setmetadata("permiteogc","sim");
  26 + if($l->status != MS_DEFAULT){
  27 + $l->set("status",MS_DELETE);
  28 + }
  29 + else{
  30 + $layers[] = $l->name;
  31 + }
  32 +}
  33 +//$legenda = $mapa->legend;
  34 +//$legenda->set("status",MS_EMBED);
  35 +$mapa->save($novo_mapfile);
  36 +$layers = implode(",",$layers);
  37 +$mapext = str_replace(" ",",",strip_tags($_GET["ext"]));
  38 +$urllayer = "../../ogc.php?tema=".$novo_mapfile;
  39 +?>
  40 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd">
  41 +<html>
  42 +<head>
  43 +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
  44 +<script src="../../pacotes/ol3/ol.js"></script>
  45 +<link rel="stylesheet" type="text/css" href="../../pacotes/ol3/ol.css">
  46 +<style>
  47 +.ol-zoom {
  48 + padding-left: 4px;
  49 + padding-right: 4px;
  50 + top: 2em;
  51 +}
  52 +
  53 +.ol-zoomslider {
  54 + top: 6em;
  55 +}
  56 +</style>
  57 +</head>
  58 +<body style="background-color: white">
  59 + <div id=mapa style="width: 470px; height: 330px"></div>
  60 + <script>
  61 +var source = new ol.source.ImageWMS({
  62 + url : '<?php echo $urllayer; ?>',
  63 + params : {
  64 + 'LAYERS' : '<?php echo $layers;?>',
  65 + 'VERSION' : '1.1.0'
  66 + },
  67 + projection : "EPSG:4326",
  68 + visible : true
  69 +});
  70 +
  71 +var layer = new ol.layer.Image({source : source});
  72 +
  73 +var parametrosMap = {
  74 + target : "mapa",
  75 + layers : [layer],
  76 + controls : [new ol.control.Zoom()],
  77 + loadTilesWhileAnimating : true,
  78 + loadTilesWhileInteracting : true,
  79 + visibility:true,
  80 + maxExtent: [-180,-90,180,90],
  81 + displayOutsideMaxExtent:true,
  82 + view : new ol.View({
  83 + projection : "EPSG:4326"
  84 + }),
  85 + interactions : [
  86 + new ol.interaction.DoubleClickZoom(),
  87 + new ol.interaction.MouseWheelZoom(),
  88 + new ol.interaction.DragPan()
  89 + ]
  90 +};
  91 +mapa = new ol.Map(parametrosMap);
  92 +
  93 +var v = mapa.getView();
  94 +v.fitExtent([<?php echo $mapext; ?>], mapa.getSize());
  95 +
  96 +</script>
  97 +</body>
0 \ No newline at end of file 98 \ No newline at end of file
ferramentas/geolocal/dicionario.js
@@ -20,8 +20,8 @@ i3GEOF.geolocal.dicionario = { @@ -20,8 +20,8 @@ i3GEOF.geolocal.dicionario = {
20 en : "", 20 en : "",
21 es : "" 21 es : ""
22 } ], 22 } ],
23 - 'exclui' : [ {  
24 - pt : "Exclui", 23 + 'shp' : [ {
  24 + pt : "Cria camada com os pontos",
25 en : "", 25 en : "",
26 es : "" 26 es : ""
27 } ], 27 } ],
ferramentas/geolocal/index.js
@@ -33,26 +33,27 @@ GNU junto com este programa; se n&amp;atilde;o, escreva para a @@ -33,26 +33,27 @@ GNU junto com este programa; se n&amp;atilde;o, escreva para a
33 Free Software Foundation, Inc., no endere&ccedil;o 33 Free Software Foundation, Inc., no endere&ccedil;o
34 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. 34 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
35 */ 35 */
36 -if(typeof(i3GEOF) === 'undefined'){ 36 +if (typeof (i3GEOF) === 'undefined') {
37 var i3GEOF = {}; 37 var i3GEOF = {};
38 } 38 }
39 /* 39 /*
40 -Classe: i3GEOF.geolocal 40 + * Classe: i3GEOF.geolocal
41 */ 41 */
42 -i3GEOF.geolocal = { 42 +i3GEOF.geolocal =
  43 + {
43 /* 44 /*
44 - Variavel: posicoes  
45 -  
46 - Objetos capturados 45 + * Variavel: posicoes
  46 + *
  47 + * Objetos capturados
47 */ 48 */
48 - posicoes: [],  
49 - tempo: null, 49 + posicoes : [],
  50 + tempo : null,
50 /* 51 /*
51 - Variavel: aguarde  
52 -  
53 - Estilo do objeto DOM com a imagem de aguarde existente no cabe&ccedil;alho da janela. 52 + * Variavel: aguarde
  53 + *
  54 + * Estilo do objeto DOM com a imagem de aguarde existente no cabe&ccedil;alho da janela.
54 */ 55 */
55 - aguarde: "", 56 + aguarde : "",
56 /** 57 /**
57 * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php 58 * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php
58 */ 59 */
@@ -66,124 +67,121 @@ i3GEOF.geolocal = { @@ -66,124 +67,121 @@ i3GEOF.geolocal = {
66 return dicionario; 67 return dicionario;
67 }, 68 },
68 /* 69 /*
69 - Function: inicia  
70 -  
71 - Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante  
72 -  
73 - Parametro:  
74 -  
75 - iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta 70 + * Function: inicia
  71 + *
  72 + * Inicia a ferramenta. &Eacute; chamado por criaJanelaFlutuante
  73 + *
  74 + * Parametro:
  75 + *
  76 + * iddiv {String} - id do div que receber&aacute; o conteudo HTML da ferramenta
76 */ 77 */
77 - inicia: function(iddiv){  
78 - var ics,n,i;  
79 - //se nao permitir a localizacao, retorna uma mensagem  
80 - if(navigator.geolocation){ 78 + inicia : function(iddiv) {
  79 + var ics, n, i;
  80 + // se nao permitir a localizacao, retorna uma mensagem
  81 + if (navigator.geolocation) {
81 $i(iddiv).innerHTML = i3GEOF.geolocal.html(); 82 $i(iddiv).innerHTML = i3GEOF.geolocal.html();
82 $i("i3GEOFgeolocalFormTempo").onsubmit = i3GEOF.geolocal.capturaTempo; 83 $i("i3GEOFgeolocalFormTempo").onsubmit = i3GEOF.geolocal.capturaTempo;
83 ics = $i(iddiv).getElementsByTagName("button"); 84 ics = $i(iddiv).getElementsByTagName("button");
84 n = ics.length; 85 n = ics.length;
85 - for(i=0;i<n;i++){ 86 + for (i = 0; i < n; i++) {
86 ics[i].style.backgroundColor = "white"; 87 ics[i].style.backgroundColor = "white";
87 ics[i].className = "iconeGuiaMovel iconeGuiaMovelMouseOut"; 88 ics[i].className = "iconeGuiaMovel iconeGuiaMovelMouseOut";
88 - ics[i].onmouseout = function(){this.className = "iconeGuiaMovel iconeGuiaMovelMouseOut";};  
89 - ics[i].onmouseover = function(){this.className = "iconeGuiaMovel iconeGuiaMovelMouseOver";}; 89 + ics[i].onmouseout = function() {
  90 + this.className = "iconeGuiaMovel iconeGuiaMovelMouseOut";
  91 + };
  92 + ics[i].onmouseover = function() {
  93 + this.className = "iconeGuiaMovel iconeGuiaMovelMouseOver";
  94 + };
90 } 95 }
91 i3GEOF.geolocal.capturaCoordenada(); 96 i3GEOF.geolocal.capturaCoordenada();
92 - }  
93 - else{  
94 - $i(iddiv).innerHTML = $trad('msgNavegador',i3GEOF.geolocal.dicionario); 97 + } else {
  98 + $i(iddiv).innerHTML = $trad('msgNavegador', i3GEOF.geolocal.dicionario);
95 } 99 }
96 }, 100 },
97 /* 101 /*
98 - Function: html  
99 -  
100 - Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta  
101 -  
102 - Retorno:  
103 -  
104 - String com o c&oacute;digo html 102 + * Function: html
  103 + *
  104 + * Gera o c&oacute;digo html para apresenta&ccedil;&atilde;o das op&ccedil;&otilde;es da ferramenta
  105 + *
  106 + * Retorno:
  107 + *
  108 + * String com o c&oacute;digo html
105 */ 109 */
106 - html:function() { 110 + html : function() {
107 var ins = Mustache.render(i3GEOF.geolocal.MUSTACHE, i3GEOF.geolocal.mustacheHash()); 111 var ins = Mustache.render(i3GEOF.geolocal.MUSTACHE, i3GEOF.geolocal.mustacheHash());
108 return ins; 112 return ins;
109 }, 113 },
110 /* 114 /*
111 - Function: iniciaJanelaFlutuante  
112 -  
113 - Cria a janela flutuante para controle da ferramenta. 115 + * Function: iniciaJanelaFlutuante
  116 + *
  117 + * Cria a janela flutuante para controle da ferramenta.
114 */ 118 */
115 - iniciaJanelaFlutuante: function(){  
116 - var janela,divid,temp,titulo,cabecalho,minimiza;  
117 - if($i("i3GEOF.geolocal")){ 119 + iniciaJanelaFlutuante : function() {
  120 + var janela, divid, temp, titulo, cabecalho, minimiza;
  121 + if ($i("i3GEOF.geolocal")) {
118 return; 122 return;
119 } 123 }
120 - cabecalho = function(){};  
121 - minimiza = function(){ 124 + cabecalho = function() {
  125 + };
  126 + minimiza = function() {
122 i3GEO.janela.minimiza("i3GEOF.geolocal"); 127 i3GEO.janela.minimiza("i3GEOF.geolocal");
123 }; 128 };
124 - //cria a janela flutuante  
125 - titulo = "<span class='i3GEOiconeFerramenta i3GEOiconeGeoLocal'></span><div class='i3GeoTituloJanela'>" + $trad('localizaUsuario',i3GEOF.geolocal.dicionario)+"<a class=ajuda_usuario target=_blank href='" + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=6&idajuda=118' ><b> </b></a></div>";  
126 - janela = i3GEO.janela.cria(  
127 - "290",  
128 - "220",  
129 - "",  
130 - "",  
131 - "",  
132 - titulo,  
133 - "i3GEOF.geolocal",  
134 - false,  
135 - "hd",  
136 - cabecalho,  
137 - minimiza  
138 - ); 129 + // cria a janela flutuante
  130 + titulo =
  131 + "<span class='i3GEOiconeFerramenta i3GEOiconeGeoLocal'></span><div class='i3GeoTituloJanela'>" + $trad(
  132 + 'localizaUsuario',
  133 + i3GEOF.geolocal.dicionario)
  134 + + "<a class=ajuda_usuario target=_blank href='"
  135 + + i3GEO.configura.locaplic
  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);
139 divid = janela[2].id; 138 divid = janela[2].id;
140 $i("i3GEOF.geolocal_corpo").style.backgroundColor = "white"; 139 $i("i3GEOF.geolocal_corpo").style.backgroundColor = "white";
141 $i("i3GEOF.geolocal_corpo").style.textAlign = "left"; 140 $i("i3GEOF.geolocal_corpo").style.textAlign = "left";
142 i3GEOF.geolocal.aguarde = $i("i3GEOF.geolocal_imagemCabecalho").style; 141 i3GEOF.geolocal.aguarde = $i("i3GEOF.geolocal_imagemCabecalho").style;
143 i3GEOF.geolocal.inicia(divid); 142 i3GEOF.geolocal.inicia(divid);
144 - temp = function(){ 143 + temp = function() {
145 i3GEOF.geolocal[i3GEO.Interface.ATUAL].removeLayer(); 144 i3GEOF.geolocal[i3GEO.Interface.ATUAL].removeLayer();
146 i3GEOF.geolocal.paraTempo(); 145 i3GEOF.geolocal.paraTempo();
147 }; 146 };
148 YAHOO.util.Event.addListener(janela[0].close, "click", temp); 147 YAHOO.util.Event.addListener(janela[0].close, "click", temp);
149 }, 148 },
150 - capturaCoordenada: function(){  
151 - if(i3GEOF.geolocal.aguarde.visibility == "visible"){ 149 + capturaCoordenada : function() {
  150 + if (i3GEOF.geolocal.aguarde.visibility == "visible") {
152 return; 151 return;
153 } 152 }
154 i3GEOF.geolocal.aguarde.visibility = "visible"; 153 i3GEOF.geolocal.aguarde.visibility = "visible";
155 - var retorno = function(position){ 154 + var retorno = function(position) {
156 i3GEOF.geolocal.posicoes.push(position); 155 i3GEOF.geolocal.posicoes.push(position);
157 - var n = parseInt($i("i3GEOFgeolocalMaximo").value,10);  
158 - if(n > 0 && i3GEOF.geolocal.posicoes.length > n){  
159 - i3GEOF.geolocal.posicoes.splice(0,(i3GEOF.geolocal.posicoes.length - n)); 156 + var n = parseInt($i("i3GEOFgeolocalMaximo").value, 10);
  157 + if (n > 0 && i3GEOF.geolocal.posicoes.length > n) {
  158 + i3GEOF.geolocal.posicoes.splice(0, (i3GEOF.geolocal.posicoes.length - n));
160 } 159 }
161 i3GEOF.geolocal.listaCoord(); 160 i3GEOF.geolocal.listaCoord();
162 }; 161 };
163 - navigator.geolocation.getCurrentPosition(retorno,i3GEOF.geolocal.erro); 162 + navigator.geolocation.getCurrentPosition(retorno, i3GEOF.geolocal.erro);
164 }, 163 },
165 - capturaTempo: function(){  
166 - var tempo = parseInt($i("i3GEOFgeolocalTempo").value,10);  
167 - if(tempo){  
168 - if(tempo > 0){  
169 - i3GEOF.geolocal.tempo = setInterval("i3GEOF.geolocal.capturaCoordenada()",tempo*1000);  
170 - }  
171 - else{ 164 + capturaTempo : function() {
  165 + var tempo = parseInt($i("i3GEOFgeolocalTempo").value, 10);
  166 + if (tempo) {
  167 + if (tempo > 0) {
  168 + i3GEOF.geolocal.tempo = setInterval("i3GEOF.geolocal.capturaCoordenada()", tempo * 1000);
  169 + } else {
172 clearInterval(i3GEOF.geolocal.tempo); 170 clearInterval(i3GEOF.geolocal.tempo);
173 } 171 }
174 } 172 }
175 return false; 173 return false;
176 }, 174 },
177 - paraTempo: function(){  
178 - if($i("i3GEOFgeolocalTempo")){ 175 + paraTempo : function() {
  176 + if ($i("i3GEOFgeolocalTempo")) {
179 $i("i3GEOFgeolocalTempo").value = 0; 177 $i("i3GEOFgeolocalTempo").value = 0;
180 } 178 }
181 clearInterval(i3GEOF.geolocal.tempo); 179 clearInterval(i3GEOF.geolocal.tempo);
182 }, 180 },
183 - erro: function(error){ 181 + erro : function(error) {
184 i3GEOF.geolocal.paraTempo(); 182 i3GEOF.geolocal.paraTempo();
185 var erro = ""; 183 var erro = "";
186 - switch(error.code){ 184 + switch (error.code) {
187 case error.PERMISSION_DENIED: 185 case error.PERMISSION_DENIED:
188 erro = "User denied the request for Geolocation."; 186 erro = "User denied the request for Geolocation.";
189 break; 187 break;
@@ -200,100 +198,193 @@ i3GEOF.geolocal = { @@ -200,100 +198,193 @@ i3GEOF.geolocal = {
200 i3GEO.janela.tempoMsg(erro); 198 i3GEO.janela.tempoMsg(erro);
201 i3GEOF.geolocal.aguarde.visibility = "hidden"; 199 i3GEOF.geolocal.aguarde.visibility = "hidden";
202 }, 200 },
203 - listaCoord: function(position){  
204 - var ps = i3GEOF.geolocal.posicoes,  
205 - n = ps.length,  
206 - i,  
207 - ins = "",  
208 - res = ["<tr><td></td><td></td><td></td><td><b>Latitude</b></td><td><b>Longitude</b></td></tr>"];  
209 - for(i=(n-1);i>=0;i--){  
210 - ins = "<tr>" +  
211 - '<td><img title="' + $trad('limpa',i3GEOF.geolocal.dicionario) + '" src="'+i3GEO.configura.locaplic+'/imagens/x.gif" onclick="i3GEOF.geolocal.excluiLinha('+i+')" style="cursor:pointer"></td>' +  
212 - '<td><img onmouseout="i3GEOF.geolocal.escondexy()" onmouseover="i3GEOF.geolocal.mostraxy('+i+')" title="pan" src="'+i3GEO.configura.locaplic+'/imagens/o.gif" onclick="i3GEOF.geolocal.panLinha('+i+')" style="cursor:pointer"></td>' +  
213 - '<td><img title="info" src="'+i3GEO.configura.locaplic+'/imagens/oxygen/16x16/help-about.png" onclick="i3GEOF.geolocal.info('+i+')" style="cursor:pointer"></td>' +  
214 - "<td>" + ps[i].coords.latitude + "</td><td>" + ps[i].coords.longitude + "</td></tr>"; 201 + listaCoord : function(position) {
  202 + var ps = i3GEOF.geolocal.posicoes, n = ps.length, i, ins = "", res = [
  203 + "<tr><td></td><td></td><td></td><td><b>Latitude</b></td><td><b>Longitude</b></td></tr>"
  204 + ];
  205 + for (i = (n - 1); i >= 0; i--) {
  206 + ins =
  207 + "<tr>" + '<td><img title="' + $trad('limpa', i3GEOF.geolocal.dicionario)
  208 + + '" src="'
  209 + + i3GEO.configura.locaplic
  210 + + '/imagens/x.gif" onclick="i3GEOF.geolocal.excluiLinha('
  211 + + i
  212 + + ')" style="cursor:pointer"></td>'
  213 + + '<td><img onmouseout="i3GEOF.geolocal.escondexy()" onmouseover="i3GEOF.geolocal.mostraxy('
  214 + + i
  215 + + ')" title="pan" src="'
  216 + + i3GEO.configura.locaplic
  217 + + '/imagens/o.gif" onclick="i3GEOF.geolocal.panLinha('
  218 + + i
  219 + + ')" style="cursor:pointer"></td>'
  220 + + '<td><img title="info" src="'
  221 + + i3GEO.configura.locaplic
  222 + + '/imagens/oxygen/16x16/help-about.png" onclick="i3GEOF.geolocal.info('
  223 + + i
  224 + + ')" style="cursor:pointer"></td>'
  225 + + "<td>"
  226 + + ps[i].coords.latitude
  227 + + "</td><td>"
  228 + + ps[i].coords.longitude
  229 + + "</td></tr>";
215 res.push(ins); 230 res.push(ins);
216 } 231 }
217 $i("i3GEOFgeolocalListaDePontos").innerHTML = "<table class='lista8' >" + res.join("") + "</table>"; 232 $i("i3GEOFgeolocalListaDePontos").innerHTML = "<table class='lista8' >" + res.join("") + "</table>";
218 $i("i3GEOFgeolocalNcoord").innerHTML = n; 233 $i("i3GEOFgeolocalNcoord").innerHTML = n;
219 - i3GEOF.geolocal[i3GEO.Interface.ATUAL].desenha(); 234 + if (i3GEO.Interface["ATUAL"] === "openlayers") {
  235 + if (typeof OpenLayers == "undefined") {
  236 + api = "ol3";
  237 + } else {
  238 + api = "openlayers";
  239 + }
  240 + } else {
  241 + api = i3GEO.Interface["ATUAL"];
  242 + }
  243 + i3GEOF.geolocal[api].desenha();
220 i3GEOF.geolocal.aguarde.visibility = "hidden"; 244 i3GEOF.geolocal.aguarde.visibility = "hidden";
221 }, 245 },
222 - limpa: function(){ 246 + limpa : function() {
223 i3GEOF.geolocal.posicoes = []; 247 i3GEOF.geolocal.posicoes = [];
224 - i3GEOF.geolocal[i3GEO.Interface.ATUAL].removeLayer(); 248 + if (i3GEO.Interface["ATUAL"] === "openlayers") {
  249 + if (typeof OpenLayers == "undefined") {
  250 + api = "ol3";
  251 + } else {
  252 + api = "openlayers";
  253 + }
  254 + } else {
  255 + api = i3GEO.Interface["ATUAL"];
  256 + }
  257 + i3GEOF.geolocal[api].removeLayer();
225 i3GEOF.geolocal.listaCoord(); 258 i3GEOF.geolocal.listaCoord();
226 }, 259 },
227 - excluiLinha: function(i){  
228 - i3GEOF.geolocal.posicoes.splice(i,1); 260 + excluiLinha : function(i) {
  261 + i3GEOF.geolocal.posicoes.splice(i, 1);
229 i3GEOF.geolocal.listaCoord(); 262 i3GEOF.geolocal.listaCoord();
230 }, 263 },
231 - panLinha: function(i){ 264 + panLinha : function(i) {
232 var posicao = i3GEOF.geolocal.posicoes[i]; 265 var posicao = i3GEOF.geolocal.posicoes[i];
233 - //@FIXME o pan nao funciona no OSM  
234 - if(posicao != undefined && i3GEO.Interface.openlayers.googleLike != true){  
235 - i3GEO.navega.pan2ponto((posicao.coords.longitude),(posicao.coords.latitude)); 266 + // @FIXME o pan nao funciona no OSM
  267 + if (posicao != undefined && i3GEO.Interface.openlayers.googleLike != true) {
  268 + i3GEO.navega.pan2ponto((posicao.coords.longitude), (posicao.coords.latitude));
236 } 269 }
237 }, 270 },
238 - info: function(i){  
239 - i3GEO.mapa.dialogo.cliqueIdentificaDefault(i3GEOF.geolocal.posicoes[i].coords.longitude,i3GEOF.geolocal.posicoes[i].coords.latitude); 271 + info : function(i) {
  272 + i3GEO.mapa.dialogo.cliqueIdentificaDefault(
  273 + i3GEOF.geolocal.posicoes[i].coords.longitude,
  274 + i3GEOF.geolocal.posicoes[i].coords.latitude);
240 }, 275 },
241 - mostraxy: function(i){  
242 - if(i3GEO.Interface.ATUAL === "googleearth")  
243 - {return;} 276 + mostraxy : function(i) {
  277 + if (i3GEO.Interface.ATUAL === "googleearth") {
  278 + return;
  279 + }
244 var posicao = i3GEOF.geolocal.posicoes[i]; 280 var posicao = i3GEOF.geolocal.posicoes[i];
245 - i3GEO.desenho.addPin(posicao.coords.longitude,posicao.coords.latitude,"","",i3GEO.configura.locaplic+'/imagens/google/confluence.png',"pingeolocal"); 281 + i3GEO.desenho.addPin(
  282 + posicao.coords.longitude,
  283 + posicao.coords.latitude,
  284 + "",
  285 + "",
  286 + i3GEO.configura.locaplic + '/imagens/google/confluence.png',
  287 + "pingeolocal");
246 }, 288 },
247 - escondexy: function(){ 289 + escondexy : function() {
248 i3GEO.desenho.removePins("pingeolocal"); 290 i3GEO.desenho.removePins("pingeolocal");
249 }, 291 },
250 - posicoes2pontos: function(){  
251 - var ps = i3GEOF.geolocal.posicoes,  
252 - n = ps.length,  
253 - i,  
254 - pontos = [];  
255 - for(i=0;i < n;i++){ 292 + posicoes2pontos : function() {
  293 + var ps = i3GEOF.geolocal.posicoes, n = ps.length, i, pontos = [];
  294 + for (i = 0; i < n; i++) {
256 pontos.push((ps[i].coords.longitude) + " " + ps[i].coords.latitude); 295 pontos.push((ps[i].coords.longitude) + " " + ps[i].coords.latitude);
257 } 296 }
258 return pontos; 297 return pontos;
259 }, 298 },
260 - criaShp: function(){  
261 - function ativanovotema(retorno){  
262 - var pontos = i3GEOF.geolocal.posicoes2pontos(),  
263 - temaNovo = retorno.data,  
264 - converteParaLinha = function(){  
265 - var cp = new cpaint();  
266 - cp.set_response_type("JSON");  
267 - var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=sphPT2shp&para=linha&tema="+temaNovo;  
268 - cp.call(p,"sphPT2shp",i3GEO.atualiza);  
269 - };  
270 - var p = window.parent.i3GEO.configura.locaplic+"/ferramentas/inserexy2/exec.php?g_sid="+i3GEO.configura.sid+"&funcao=insereSHP&tema="+retorno.data; 299 + criaShp : function() {
  300 + function ativanovotema(retorno) {
  301 + var pontos = i3GEOF.geolocal.posicoes2pontos(), temaNovo = retorno.data, converteParaLinha =
  302 + function() {
  303 + var cp = new cpaint();
  304 + cp.set_response_type("JSON");
  305 + var p =
  306 + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid="
  307 + + i3GEO.configura.sid
  308 + + "&funcao=sphPT2shp&para=linha&tema="
  309 + + temaNovo;
  310 + cp.call(p, "sphPT2shp", i3GEO.atualiza);
  311 + };
  312 + var p =
  313 + window.parent.i3GEO.configura.locaplic + "/ferramentas/inserexy2/exec.php?g_sid="
  314 + + i3GEO.configura.sid
  315 + + "&funcao=insereSHP&tema="
  316 + + retorno.data;
271 var cp = new cpaint(); 317 var cp = new cpaint();
272 cp.set_response_type("JSON"); 318 cp.set_response_type("JSON");
273 cp.set_transfer_mode('POST'); 319 cp.set_transfer_mode('POST');
274 - cp.call(p,"insereSHP",converteParaLinha,"&xy="+pontos.join(" ")); 320 + cp.call(p, "insereSHP", converteParaLinha, "&xy=" + pontos.join(" "));
275 } 321 }
276 var cp = new cpaint(); 322 var cp = new cpaint();
277 cp.set_response_type("JSON"); 323 cp.set_response_type("JSON");
278 cp.set_transfer_mode("POST"); 324 cp.set_transfer_mode("POST");
279 - var p = window.parent.i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid;  
280 - cp.call(p,"criaSHPvazio",ativanovotema,"&funcao=criashpvazio"); 325 + var p = window.parent.i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid;
  326 + cp.call(p, "criaSHPvazio", ativanovotema, "&funcao=criashpvazio");
281 }, 327 },
282 - openlayers: {  
283 - desenha: function(){ 328 + ol3 : {
  329 + desenha : function() {
  330 + if (!i3GEO.desenho.layergrafico) {
  331 + i3GEO.desenho.openlayers.criaLayerGrafico();
  332 + }
  333 + i3GEOF.geolocal.ol3.removeFiguras();
  334 + var ps = i3GEOF.geolocal.posicoes, n = ps.length, i, feature;
  335 + for (i = 0; i < n; i++) {
  336 + feature = new ol.Feature({
  337 + geometry : new ol.geom.Point([
  338 + ps[i].coords.longitude, ps[i].coords.latitude
  339 + ]),
  340 + origem : 'i3GEOFgeolocal'
  341 + });
  342 + i3GEO.desenho.layergrafico.addFeature(feature);
  343 + // linha
  344 + if (ps[i + 1]) {
  345 + feature = new ol.Feature({
  346 + geometry : new ol.geom.LineString([
  347 + [
  348 + ps[i].coords.longitude, ps[i].coords.latitude
  349 + ], [
  350 + ps[i + 1].coords.longitude, ps[i + 1].coords.latitude
  351 + ]
  352 + ]),
  353 + origem : 'i3GEOFgeolocal'
  354 + });
  355 + i3GEO.desenho.layergrafico.addFeature(feature);
  356 + }
  357 + }
  358 + },
  359 + removeFiguras : function() {
  360 + var features, n, f, i, remover = [];
  361 + features = i3GEO.desenho.layergrafico.getFeatures();
  362 + n = features.getLength();
  363 + for (i = 0; i < n; i++) {
  364 + f = features.item(i);
  365 + if (f.getProperties().origem === "i3GEOFgeolocal") {
  366 + remover.push(f);
  367 + }
  368 + }
  369 + for (r in remover) {
  370 + i3GEO.desenho.layergrafico.removeFeature(remover[r]);
  371 + }
  372 + },
  373 + removeLayer : function() {
  374 +
  375 + }
  376 + },
  377 + openlayers : {
  378 + desenha : function() {
284 // allow testing of specific renderers via "?renderer=Canvas", etc 379 // allow testing of specific renderers via "?renderer=Canvas", etc
285 - var renderer = OpenLayers.Util.getParameters(window.location.href).renderer,  
286 - layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']),  
287 - style_blue = OpenLayers.Util.extend({}, layer_style),  
288 - vectorLayer,  
289 - ps = i3GEOF.geolocal.posicoes,  
290 - n = ps.length,  
291 - i,  
292 - point,  
293 - pointFeature = [],  
294 - pointList = []; 380 + var renderer = OpenLayers.Util.getParameters(window.location.href).renderer, layer_style =
  381 + OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']), style_blue =
  382 + OpenLayers.Util.extend({}, layer_style), vectorLayer, ps = i3GEOF.geolocal.posicoes, n = ps.length, i, point, pointFeature =
  383 + [], pointList = [];
295 384
296 - renderer = (renderer) ? [renderer] : OpenLayers.Layer.Vector.prototype.renderers; 385 + renderer = (renderer) ? [
  386 + renderer
  387 + ] : OpenLayers.Layer.Vector.prototype.renderers;
297 388
298 style_blue.strokeColor = "blue"; 389 style_blue.strokeColor = "blue";
299 style_blue.fillColor = "yellow"; 390 style_blue.fillColor = "yellow";
@@ -302,91 +393,83 @@ i3GEOF.geolocal = { @@ -302,91 +393,83 @@ i3GEOF.geolocal = {
302 style_blue.strokeWidth = 2; 393 style_blue.strokeWidth = 2;
303 style_blue.rotation = 0; 394 style_blue.rotation = 0;
304 style_blue.strokeLinecap = "butt"; 395 style_blue.strokeLinecap = "butt";
305 - if(i3geoOL.getLayersByName("Coordenadas").length === 0){ 396 + if (i3geoOL.getLayersByName("Coordenadas").length === 0) {
306 vectorLayer = new OpenLayers.Layer.Vector("Coordenadas", { 397 vectorLayer = new OpenLayers.Layer.Vector("Coordenadas", {
307 - style: layer_style,  
308 - renderers: renderer 398 + style : layer_style,
  399 + renderers : renderer
309 }); 400 });
310 - }  
311 - else{ 401 + } else {
312 vectorLayer = i3geoOL.getLayersByName("Coordenadas")[0]; 402 vectorLayer = i3geoOL.getLayersByName("Coordenadas")[0];
313 vectorLayer.removeFeatures(vectorLayer.features); 403 vectorLayer.removeFeatures(vectorLayer.features);
314 } 404 }
315 405
316 - for(i=0;i<n;i++){  
317 - point = new OpenLayers.Geometry.Point((ps[i].coords.longitude),(ps[i].coords.latitude)); 406 + for (i = 0; i < n; i++) {
  407 + point = new OpenLayers.Geometry.Point((ps[i].coords.longitude), (ps[i].coords.latitude));
318 i3GEOF.geolocal.wgs2google(point); 408 i3GEOF.geolocal.wgs2google(point);
319 pointList.push(point); 409 pointList.push(point);
320 - pointFeature.push(new OpenLayers.Feature.Vector(point,null,style_blue)); 410 + pointFeature.push(new OpenLayers.Feature.Vector(point, null, style_blue));
321 } 411 }
322 412
323 - var lineFeature = new OpenLayers.Feature.Vector(  
324 - new OpenLayers.Geometry.LineString(pointList),null,style_blue); 413 + var lineFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(pointList), null, style_blue);
325 414
326 i3geoOL.addLayer(vectorLayer); 415 i3geoOL.addLayer(vectorLayer);
327 - vectorLayer.addFeatures([lineFeature]); 416 + vectorLayer.addFeatures([
  417 + lineFeature
  418 + ]);
328 vectorLayer.addFeatures(pointFeature); 419 vectorLayer.addFeatures(pointFeature);
329 - i3GEOF.geolocal.panLinha(n-1); 420 + i3GEOF.geolocal.panLinha(n - 1);
330 }, 421 },
331 - removeLayer: function(){  
332 - i3geoOL.removeLayer(i3geoOL.getLayersByName("Coordenadas")[0],false); 422 + removeLayer : function() {
  423 + i3geoOL.removeLayer(i3geoOL.getLayersByName("Coordenadas")[0], false);
333 } 424 }
334 }, 425 },
335 - googlemaps: {  
336 - linhas: null,  
337 - marca: null,  
338 - desenha: function(){  
339 - var ps = i3GEOF.geolocal.posicoes,  
340 - n = ps.length,  
341 - i,  
342 - l,  
343 - pointFeature = [];  
344 - for(i=0;i<n;i++){  
345 - l = new google.maps.LatLng(ps[i].coords.latitude,ps[i].coords.longitude);  
346 - pointFeature.push(  
347 - l  
348 - ); 426 + googlemaps : {
  427 + linhas : null,
  428 + marca : null,
  429 + desenha : function() {
  430 + var ps = i3GEOF.geolocal.posicoes, n = ps.length, i, l, pointFeature = [];
  431 + for (i = 0; i < n; i++) {
  432 + l = new google.maps.LatLng(ps[i].coords.latitude, ps[i].coords.longitude);
  433 + pointFeature.push(l);
349 } 434 }
350 i3GEOF.geolocal.googlemaps.removeLayer(); 435 i3GEOF.geolocal.googlemaps.removeLayer();
351 i3GEOF.geolocal.googlemaps.marca = new google.maps.Marker({ 436 i3GEOF.geolocal.googlemaps.marca = new google.maps.Marker({
352 - position: new google.maps.LatLng(ps[0].coords.latitude,ps[0].coords.longitude),  
353 - map: i3GeoMap 437 + position : new google.maps.LatLng(ps[0].coords.latitude, ps[0].coords.longitude),
  438 + map : i3GeoMap
354 }); 439 });
355 i3GEOF.geolocal.googlemaps.linhas = new google.maps.Polyline({ 440 i3GEOF.geolocal.googlemaps.linhas = new google.maps.Polyline({
356 - path: pointFeature,  
357 - geodesic: true,  
358 - strokeColor: 'blue',  
359 - strokeOpacity: 1.0,  
360 - strokeWeight: 2,  
361 - name: "Coordenadas" 441 + path : pointFeature,
  442 + geodesic : true,
  443 + strokeColor : 'blue',
  444 + strokeOpacity : 1.0,
  445 + strokeWeight : 2,
  446 + name : "Coordenadas"
362 }); 447 });
363 i3GEOF.geolocal.googlemaps.linhas.setMap(i3GeoMap); 448 i3GEOF.geolocal.googlemaps.linhas.setMap(i3GeoMap);
364 - i3GEOF.geolocal.panLinha(n-1); 449 + i3GEOF.geolocal.panLinha(n - 1);
365 }, 450 },
366 - removeLayer: function(){  
367 - if(i3GEOF.geolocal.googlemaps.linhas){ 451 + removeLayer : function() {
  452 + if (i3GEOF.geolocal.googlemaps.linhas) {
368 i3GEOF.geolocal.googlemaps.linhas.setMap(null); 453 i3GEOF.geolocal.googlemaps.linhas.setMap(null);
369 } 454 }
370 - if(i3GEOF.geolocal.googlemaps.marca){ 455 + if (i3GEOF.geolocal.googlemaps.marca) {
371 i3GEOF.geolocal.googlemaps.marca.setMap(null); 456 i3GEOF.geolocal.googlemaps.marca.setMap(null);
372 } 457 }
373 } 458 }
374 }, 459 },
375 - //@TODO implementar desenho dos pontos e linhas  
376 - googleearth: {  
377 - desenha: function(){ 460 + // @TODO implementar desenho dos pontos e linhas
  461 + googleearth : {
  462 + desenha : function() {
378 }, 463 },
379 - removeLayer: function(){ 464 + removeLayer : function() {
380 } 465 }
381 }, 466 },
382 - wgs2google: function(obj){  
383 - if(i3GEO.Interface.openlayers.googleLike === true || i3GEO.Interface.ATUAL === "googlemaps"){  
384 - var projWGS84 = new OpenLayers.Projection("EPSG:4326"),  
385 - proj900913 = new OpenLayers.Projection("EPSG:900913");  
386 - return obj.transform(projWGS84,proj900913);  
387 - }  
388 - else{ 467 + wgs2google : function(obj) {
  468 + if (i3GEO.Interface.openlayers.googleLike === true || i3GEO.Interface.ATUAL === "googlemaps") {
  469 + var projWGS84 = new OpenLayers.Projection("EPSG:4326"), proj900913 = new OpenLayers.Projection("EPSG:900913");
  470 + return obj.transform(projWGS84, proj900913);
  471 + } else {
389 return obj; 472 return obj;
390 } 473 }
391 } 474 }
392 -}; 475 + };
ferramentas/geolocal/template_mst.html
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <button title='{{{limpa}}}' onclick='i3GEOF.geolocal.limpa()'> 4 <button title='{{{limpa}}}' onclick='i3GEOF.geolocal.limpa()'>
5 <img src='{{{locaplic}}}/imagens/gisicons/erase.png' /> 5 <img src='{{{locaplic}}}/imagens/gisicons/erase.png' />
6 </button> 6 </button>
7 -<button title='{{{exclui}}}' onclick='i3GEOF.geolocal.criaShp()'> 7 +<button title='{{{shp}}}' onclick='i3GEOF.geolocal.criaShp()'>
8 <img src='{{{locaplic}}}/imagens/gisicons/layer-gps-create.png' /> 8 <img src='{{{locaplic}}}/imagens/gisicons/layer-gps-create.png' />
9 </button> 9 </button>
10 <img title='{{{paraCaptura}}}' onclick='i3GEOF.geolocal.paraTempo()' style='top: -3px; left: 10px; position: relative;' src='{{{locaplic}}}/imagens/oxygen/16x16/clock.png'> 10 <img title='{{{paraCaptura}}}' onclick='i3GEOF.geolocal.paraTempo()' style='top: -3px; left: 10px; position: relative;' src='{{{locaplic}}}/imagens/oxygen/16x16/clock.png'>
ferramentas/selecao/index.js
@@ -595,15 +595,18 @@ i3GEOF.selecao = @@ -595,15 +595,18 @@ i3GEOF.selecao =
595 */ 595 */
596 removeFiguras : { 596 removeFiguras : {
597 ol3 : function(){ 597 ol3 : function(){
598 - var features, n, f, i; 598 + var features, n, f, i, remover = [];
599 features = i3GEO.desenho.layergrafico.getFeatures(); 599 features = i3GEO.desenho.layergrafico.getFeatures();
600 n = features.getLength(); 600 n = features.getLength();
601 - for(i=0; i< n; i++){ 601 + for(i = 0; i < n; i++){
602 f = features.item(i); 602 f = features.item(i);
603 - if(f.getGeometryName() === "i3GEOFselecao"){  
604 - i3GEO.desenho.layergrafico.getFeatures().removeAt(i); 603 + if(f.getProperties().origem === "i3GEOFselecao"){
  604 + remover.push(f);
605 } 605 }
606 } 606 }
  607 + for(r in remover){
  608 + i3GEO.desenho.layergrafico.removeFeature(remover[r]);
  609 + }
607 }, 610 },
608 openlayers : function() { 611 openlayers : function() {
609 if (i3GEO.desenho.layergrafico) { 612 if (i3GEO.desenho.layergrafico) {
interface/openlayersdebug.htm
@@ -94,28 +94,20 @@ @@ -94,28 +94,20 @@
94 </table> 94 </table>
95 95
96 <div id="i3GEOguiaMovel" style="visibility: hidden; position: absolute; display: block; border: 0px solid white; text-align: left; z-index: 2000; background-color: none"> 96 <div id="i3GEOguiaMovel" style="visibility: hidden; position: absolute; display: block; border: 0px solid white; text-align: left; z-index: 2000; background-color: none">
97 - <div style="cursor: pointer; position: absolute; top: 50%; margin-top: -65px; width: 30px; z-index: 5000; left: 18px; background-color: lightgray; border: 1px solid lightgray; border-radius: 5px; opacity: 0.8; box-shadow: -1px 0px 1px 1px rgba(200, 200, 200, 0.81)">  
98 - <!-- <img src='../imagens/openbars1.png' style="width: 48px; position: absolute; left: -16px; height: 418px; top: -160px;">--> 97 + <div style="cursor: pointer; position: absolute; top: 50%; margin-top: -65px; width: 30px; z-index: 5000; left: 18px;">
99 <div id="iconeGuia_temas"></div> 98 <div id="iconeGuia_temas"></div>
100 <div id="iconeGuia_adiciona" style="margin-top: 3px;"></div> 99 <div id="iconeGuia_adiciona" style="margin-top: 3px;"></div>
101 <div id="iconeGuia_legenda" style="margin-top: 3px;"></div> 100 <div id="iconeGuia_legenda" style="margin-top: 3px;"></div>
102 </div> 101 </div>
103 -  
104 - <!--  
105 - <img id="i3GEOguiaMovelPuxador" onclick='i3GEO.guias.guiaMovel.abreFecha()' style='z-index:2;border:solid 0px white;left:0px;position:absolute;top:0px' width='0px' src='../imagens/openbars.png' >  
106 - -->  
107 <div id="i3GEOguiaMovelMolde" style="top: 0px; box-shadow: 0 2px 10px 0 #888888; position: absolute; display: none; border: 0px solid white; text-align: left; z-index: 1000; background-color: gray"> 102 <div id="i3GEOguiaMovelMolde" style="top: 0px; box-shadow: 0 2px 10px 0 #888888; position: absolute; display: none; border: 0px solid white; text-align: left; z-index: 1000; background-color: gray">
108 - <!--  
109 - <div id="i3GEOguiaMovelIcones" style='overflow:none;left:0px;display:none;position:absolute;top:0px;text-align:center;height:0px;width:0px;border:solid 0px white;background-color:white' ></div>  
110 - -->  
111 <div id="i3GEOguiaMovelConteudo" style='top: 10px; overflow: auto; display: none; position: absolute; border-color: gray; border-width: 0px 0 0px 0px; left: 0px; height: 0px; background-color: white'> 103 <div id="i3GEOguiaMovelConteudo" style='top: 10px; overflow: auto; display: none; position: absolute; border-color: gray; border-width: 0px 0 0px 0px; left: 0px; height: 0px; background-color: white'>
112 <div id='guia1obj' style='display: none;'> 104 <div id='guia1obj' style='display: none;'>
113 <!-- Esta div acrescenta a op&ccedil;&atilde;o de busca r&aacute;pida, caso vc queira coloc&aacute;-la em um lugar espec&iacute;fico --> 105 <!-- Esta div acrescenta a op&ccedil;&atilde;o de busca r&aacute;pida, caso vc queira coloc&aacute;-la em um lugar espec&iacute;fico -->
114 <div style='left: 5px; top: 10px; width: 150px;' id=buscaRapida></div> 106 <div style='left: 5px; top: 10px; width: 150px;' id=buscaRapida></div>
115 - <!-- Esta div acrescenta a lista de propriedades do mapa  
116 - <div id=listaPropriedades style='top: 15px;'></div>--> 107 + <!-- Esta div acrescenta a lista de propriedades do mapa -->
  108 + <!--<div id=listaPropriedades style='top:15px;' ></div>-->
117 <!-- Esta div acrescenta a lista de de camadas do tipo 'baselayers' espec&iacute;ficas da interface Openlayers. Veja tamb&eacute;m a op&ccedil;&atilde;o i3GEO.Interface.openlayers.GADGETS.LayerSwitcher --> 109 <!-- Esta div acrescenta a lista de de camadas do tipo 'baselayers' espec&iacute;ficas da interface Openlayers. Veja tamb&eacute;m a op&ccedil;&atilde;o i3GEO.Interface.openlayers.GADGETS.LayerSwitcher -->
118 - <!--<div id=listaLayersBase style='top: 15px;'></div>--> 110 + <div id=listaLayersBase style='top: 15px;'></div>
119 <!-- Esta div acrescenta a lista de de camadas dispon&iacute;veis no mapa atual --> 111 <!-- Esta div acrescenta a lista de de camadas dispon&iacute;veis no mapa atual -->
120 <div id=listaTemas style='top: 15px;'></div> 112 <div id=listaTemas style='top: 15px;'></div>
121 </div> 113 </div>
@@ -132,6 +124,7 @@ @@ -132,6 +124,7 @@
132 </div> 124 </div>
133 </div> 125 </div>
134 </div> 126 </div>
  127 +
135 <script> 128 <script>
136 i3GEO.configura.locaplic = i3GEO.util.protocolo() + "://" + window.location.host + "/i3geo"; 129 i3GEO.configura.locaplic = i3GEO.util.protocolo() + "://" + window.location.host + "/i3geo";
137 i3GEO.configura.autotamanho = false; 130 i3GEO.configura.autotamanho = false;
js/compactajs.php
@@ -59,24 +59,28 @@ $f = @fopen(&quot;../js/teste.txt&quot;,w); @@ -59,24 +59,28 @@ $f = @fopen(&quot;../js/teste.txt&quot;,w);
59 if (!file_exists("../js/teste.txt")){ 59 if (!file_exists("../js/teste.txt")){
60 echo "<span style='color:red'>N&atilde;o foi possivel escrever em js";exit; 60 echo "<span style='color:red'>N&atilde;o foi possivel escrever em js";exit;
61 } 61 }
  62 +unlink("../js/teste.txt");
62 unlink("../css/teste.txt"); 63 unlink("../css/teste.txt");
63 $f = @fopen("../css/teste.txt",w); 64 $f = @fopen("../css/teste.txt",w);
64 @fclose($f); 65 @fclose($f);
65 if (!file_exists("../css/teste.txt")){ 66 if (!file_exists("../css/teste.txt")){
66 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em css";exit; 67 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em css";exit;
67 } 68 }
  69 +unlink("../css/teste.txt");
68 unlink("../pacotes/teste.txt"); 70 unlink("../pacotes/teste.txt");
69 $f = @fopen("../pacotes/teste.txt",w); 71 $f = @fopen("../pacotes/teste.txt",w);
70 @fclose($f); 72 @fclose($f);
71 if (!file_exists("../pacotes/teste.txt")){ 73 if (!file_exists("../pacotes/teste.txt")){
72 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em pacotes";exit; 74 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em pacotes";exit;
73 } 75 }
  76 +unlink("../pacotes/teste.txt");
74 unlink("../mashups/teste.txt"); 77 unlink("../mashups/teste.txt");
75 $f = @fopen("../mashups/teste.txt",w); 78 $f = @fopen("../mashups/teste.txt",w);
76 @fclose($f); 79 @fclose($f);
77 if (!file_exists("../mashups/teste.txt")){ 80 if (!file_exists("../mashups/teste.txt")){
78 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em mashups";exit; 81 echo "<br><span style='color:red'>N&atilde;o foi possivel escrever em mashups";exit;
79 } 82 }
  83 +unlink("../mashups/teste.txt");
80 echo "<pre>"; 84 echo "<pre>";
81 // 85 //
82 //compacta os arquivos do i3geo 86 //compacta os arquivos do i3geo
js/interface.js
@@ -1374,25 +1374,42 @@ i3GEO.Interface = @@ -1374,25 +1374,42 @@ i3GEO.Interface =
1374 if (i3GEO.Interface.openlayers.googleLike === false && camada.connectiontype === 7 1374 if (i3GEO.Interface.openlayers.googleLike === false && camada.connectiontype === 7
1375 && camada.wmsurl !== "" 1375 && camada.wmsurl !== ""
1376 && camada.usasld.toLowerCase() != "sim") { 1376 && camada.usasld.toLowerCase() != "sim") {
1377 - urllayer = camada.wmsurl + "&r=" + Math.random();  
1378 - if (camada.wmstile == 1) { 1377 + urllayer = camada.wmsurl;
  1378 + if (camada.wmstile == 10) {
1379 // TODO testar isso 1379 // TODO testar isso
1380 - layer = new OpenLayers.Layer.TMS(camada.name, camada.wmsurl, {  
1381 - isBaseLayer : false,  
1382 - layername : camada.wmsname,  
1383 - type : 'png' 1380 + source = new ol.source.WMTS({
  1381 + url : urllayer,
  1382 + matrixSet : opcoes.projection,
  1383 + format : 'image/png',
  1384 + projection : opcoes.projection,
  1385 + tileGrid : new ol.tilegrid.WMTS({
  1386 + origin : ol.extent.getTopLeft(projectionExtent),
  1387 + resolutions : resolutions,
  1388 + matrixIds : matrixIds
  1389 + }),
  1390 + wrapX : true
1384 }); 1391 });
  1392 + source.set("tipoServico", "WMTS");
  1393 + opcoes.singleTile = false;
1385 } else { 1394 } else {
1386 - // TODO testar isso  
1387 - layer = new OpenLayers.Layer.WMS(camada.name, urllayer, {  
1388 - LAYERS : camada.name,  
1389 - format : camada.wmsformat,  
1390 - transparent : true  
1391 - }, opcoes);  
1392 - }  
1393 - if (camada.wmssrs != "" && layer.url) {  
1394 - layer.url = layer.url + "&SRS=" + camada.wmssrs + "&CRS=" + camada.wmssrs; 1395 + source = new ol.source.TileWMS({
  1396 + url : urllayer,
  1397 + params : {
  1398 + //'LAYERS' : camada.wmsname,
  1399 + 'VERSION' : '1.1.0'
  1400 + //'format' : camada.wmsformat
  1401 + },
  1402 + projection : camada.wmssrs
  1403 + });
  1404 + source.set("tipoServico", "ImageWMS");
  1405 + opcoes.singleTile = false;
1395 } 1406 }
  1407 + source.set("name", camada.name);
  1408 + opcoes.source = source;
  1409 + opcoes.title = camada.tema;
  1410 + opcoes.name = camada.name;
  1411 + opcoes.isBaseLayer = false;
  1412 + opcoes.visible = true;
1396 } else { 1413 } else {
1397 // verifica se havera apenas um tile 1414 // verifica se havera apenas um tile
1398 if (camada.tiles === "nao" || camada.escondido.toLowerCase() === "sim" 1415 if (camada.tiles === "nao" || camada.escondido.toLowerCase() === "sim"
@@ -1414,7 +1431,7 @@ i3GEO.Interface = @@ -1414,7 +1431,7 @@ i3GEO.Interface =
1414 if (camada.tiles === "sim" || camada.cache === "sim" || (camada.cortepixels && camada.cortepixels > 0)) { 1431 if (camada.tiles === "sim" || camada.cache === "sim" || (camada.cortepixels && camada.cortepixels > 0)) {
1415 opcoes.singleTile = false; 1432 opcoes.singleTile = false;
1416 } 1433 }
1417 - 1434 +
1418 if (camada.cache) { 1435 if (camada.cache) {
1419 urllayer = url + "&cache=" + camada.cache; 1436 urllayer = url + "&cache=" + camada.cache;
1420 } else { 1437 } else {
@@ -1450,24 +1467,24 @@ i3GEO.Interface = @@ -1450,24 +1467,24 @@ i3GEO.Interface =
1450 opcoes.source = source; 1467 opcoes.source = source;
1451 opcoes.title = camada.tema; 1468 opcoes.title = camada.tema;
1452 opcoes.name = camada.name; 1469 opcoes.name = camada.name;
1453 - opcoes.isBaseLayer = false;  
1454 - opcoes.visible = true;  
1455 - if (i3GEO.arvoreDeCamadas.BARRAPROGRESSO === true) {  
1456 - source.on('tileloadstart', function(event) {  
1457 - i3GEO.Interface.openlayers.loadStartLayer(source.get("name"));  
1458 - });  
1459 - source.on('tileloadend', function(event) {  
1460 - i3GEO.Interface.openlayers.loadStopLayer(source.get("name"));  
1461 - });  
1462 - source.on('tileloaderror', function(event) {  
1463 - i3GEO.Interface.openlayers.loadStopLayer(source.get("name"));  
1464 - });  
1465 - }  
1466 - if (opcoes.singleTile === true) {  
1467 - layer = new ol.layer.Image(opcoes);  
1468 - } else {  
1469 - layer = new ol.layer.Tile(opcoes);  
1470 - } 1470 + }
  1471 + opcoes.isBaseLayer = false;
  1472 + opcoes.visible = true;
  1473 + if (i3GEO.arvoreDeCamadas.BARRAPROGRESSO === true) {
  1474 + source.on('tileloadstart', function(event) {
  1475 + i3GEO.Interface.openlayers.loadStartLayer(source.get("name"));
  1476 + });
  1477 + source.on('tileloadend', function(event) {
  1478 + i3GEO.Interface.openlayers.loadStopLayer(source.get("name"));
  1479 + });
  1480 + source.on('tileloaderror', function(event) {
  1481 + i3GEO.Interface.openlayers.loadStopLayer(source.get("name"));
  1482 + });
  1483 + }
  1484 + if (opcoes.singleTile === true) {
  1485 + layer = new ol.layer.Image(opcoes);
  1486 + } else {
  1487 + layer = new ol.layer.Tile(opcoes);
1471 } 1488 }
1472 } catch (e) { 1489 } catch (e) {
1473 } 1490 }
@@ -1509,6 +1526,8 @@ i3GEO.Interface = @@ -1509,6 +1526,8 @@ i3GEO.Interface =
1509 * Altera a posicao do layer de desenho de figuras, posicionando-o sobre todos os demais 1526 * Altera a posicao do layer de desenho de figuras, posicionando-o sobre todos os demais
1510 */ 1527 */
1511 sobeLayersGraficos : function() { 1528 sobeLayersGraficos : function() {
  1529 + //TODO remover?
  1530 + return;
1512 var nlayers = i3geoOL.getNumLayers(), layers = i3geoOL.layers, i; 1531 var nlayers = i3geoOL.getNumLayers(), layers = i3geoOL.layers, i;
1513 for (i = 0; i < nlayers; i++) { 1532 for (i = 0; i < nlayers; i++) {
1514 if (layers[i].CLASS_NAME == "OpenLayers.Layer.Vector" && layers[i].name != "Nenhum") { 1533 if (layers[i].CLASS_NAME == "OpenLayers.Layer.Vector" && layers[i].name != "Nenhum") {
@@ -1679,36 +1698,10 @@ i3GEO.Interface = @@ -1679,36 +1698,10 @@ i3GEO.Interface =
1679 * Atualiza o mapa atual, forcando o redesenho dos layers 1698 * Atualiza o mapa atual, forcando o redesenho dos layers
1680 */ 1699 */
1681 atualizaMapa : function() { 1700 atualizaMapa : function() {
1682 - var layer, layers = i3geoOL.layers, nlayers = layers.length, i, servico, source;  
1683 - for (i = 0; i < nlayers; i++) {  
1684 - layer = layers[i];  
1685 - if (layer && layer != undefined) {  
1686 - source = layer.getSource();  
1687 - servico = source.getProperties().tipoServico;  
1688 - if(servico === "WMTS"){  
1689 - funcaoLoad = layer.getSource().getTileUrlFunction();  
1690 - if(funcaoLoad){  
1691 - layer.getSource().setTileUrlFunction(function() {  
1692 - var url = funcaoLoad.apply(this, arguments);  
1693 - url = url.replace("&cache=sim", "&cache=nao");  
1694 - //console.info(layer.getSource().getProperties().tipoServico)  
1695 - return url + '&r=' + Math.random();  
1696 - });  
1697 - }  
1698 - }  
1699 - if(servico === "ImageWMS"){  
1700 - funcaoLoad = layer.getSource().getImageLoadFunction();  
1701 - if(funcaoLoad){  
1702 - layer.getSource().setImageLoadFunction(function(image,src) {  
1703 - src = src.replace("&cache=sim", "&cache=nao");  
1704 - src += '&r=' + Math.random();  
1705 - image.getImage().src = src;  
1706 - });  
1707 - }  
1708 - }  
1709 - } 1701 + var camadas = i3GEO.arvoreDeCamadas.CAMADAS, n = camadas.lenght, i;
  1702 + for (i = 0; i < n; i++) {
  1703 + i3GEO.Interface.openlayers.atualizaTema("", camadas[i].name);
1710 } 1704 }
1711 - i3GEO.Interface.openlayers.sobeLayersGraficos();  
1712 }, 1705 },
1713 /** 1706 /**
1714 * Forca o redesenho de um layer especifico 1707 * Forca o redesenho de um layer especifico
@@ -937,7 +937,7 @@ i3GEO.mapa = @@ -937,7 +937,7 @@ i3GEO.mapa =
937 }; 937 };
938 if (i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps") { 938 if (i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps") {
939 url = 939 url =
940 - i3GEO.configura.locaplic + "/ferramentas/congelamapa/openlayers.php?g_sid=" 940 + i3GEO.configura.locaplic + "/ferramentas/congelamapa/openlayers3.php?g_sid="
941 + i3GEO.configura.sid 941 + i3GEO.configura.sid
942 + "&ext=" 942 + "&ext="
943 + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten); 943 + i3GEO.util.extOSM2Geo(i3GEO.parametros.mapexten);
mashups/teste.txt 0 → 100755
temas/_lbiomashp.map
@@ -6,12 +6,12 @@ MAP @@ -6,12 +6,12 @@ MAP
6 DATA "/var/www/i3geo/aplicmap/dados/biomas.shp" 6 DATA "/var/www/i3geo/aplicmap/dados/biomas.shp"
7 METADATA 7 METADATA
8 "METAESTAT_ID_MEDIDA_VARIAVEL" "" 8 "METAESTAT_ID_MEDIDA_VARIAVEL" ""
9 - "CACHE" "NAO" 9 + "CACHE" "SIM"
10 "TIP" "CD_LEGENDA" 10 "TIP" "CD_LEGENDA"
11 "CLASSE" "SIM" 11 "CLASSE" "SIM"
12 "permitekmz" "nao" 12 "permitekmz" "nao"
13 "ITENSDESC" "Bioma Teste de acentuação" 13 "ITENSDESC" "Bioma Teste de acentuação"
14 - "TILES" "NAO" 14 + #"TILES" "NAO"
15 "ESCALA" "1000000" 15 "ESCALA" "1000000"
16 "METAESTAT_CODIGO_TIPO_REGIAO" "" 16 "METAESTAT_CODIGO_TIPO_REGIAO" ""
17 "permitedownload" "sim" 17 "permitedownload" "sim"