Commit 0781c09426d7f0eb7b3b62972c74f7209b2a9afc

Authored by Edmar Moretti
1 parent ae3e056f

Atualização da API do Google Maps para 3.0

aplicmap/geral.htm
@@ -215,7 +215,7 @@ i3GEO.barraDeBotoes.AUTO = true //as barras de botões serão construídas automati @@ -215,7 +215,7 @@ i3GEO.barraDeBotoes.AUTO = true //as barras de botões serão construídas automati
215 215
216 i3GEO.idioma.IDSELETOR = "seletorIdiomas" 216 i3GEO.idioma.IDSELETOR = "seletorIdiomas"
217 i3GEO.interface.ATIVAMENUCONTEXTO = true; 217 i3GEO.interface.ATIVAMENUCONTEXTO = true;
218 - 218 +i3GEO.guias.CONFIGURA.temas.titulo = "teste"
219 i3GEO.inicia(); 219 i3GEO.inicia();
220 // 220 //
221 //inclui um tema via javascript 221 //inclui um tema via javascript
aplicmap/googlemaps.phtml
@@ -15,7 +15,10 @@ include_once("../ms_configura.php"); @@ -15,7 +15,10 @@ include_once("../ms_configura.php");
15 } 15 }
16 </style> 16 </style>
17 <title>MMA - Mapa interativo</title> 17 <title>MMA - Mapa interativo</title>
  18 +<!---
18 <script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=3&amp;sensor=false&amp;key=<?php echo $googleApiKey; ?>"></script> 19 <script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=3&amp;sensor=false&amp;key=<?php echo $googleApiKey; ?>"></script>
  20 +--->
  21 +<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
19 <script type="text/javascript" src="../classesjs/i3geonaocompacto.js"></script> 22 <script type="text/javascript" src="../classesjs/i3geonaocompacto.js"></script>
20 23
21 </head> 24 </head>
@@ -74,13 +77,15 @@ include_once(&quot;../ms_configura.php&quot;); @@ -74,13 +77,15 @@ include_once(&quot;../ms_configura.php&quot;);
74 <td class=tdbranca ></td> 77 <td class=tdbranca ></td>
75 <td class=tdbranca style=text-align:center > 78 <td class=tdbranca style=text-align:center >
76 <div id=localizarxy > 79 <div id=localizarxy >
77 - Aguarde...  
78 </div> 80 </div>
79 </td> 81 </td>
80 <td class=tdbranca > 82 <td class=tdbranca >
81 <div id=inserirKml ></div> 83 <div id=inserirKml ></div>
82 </td> 84 </td>
83 - <td class=tdbranca ><div id=ondeestou ></div></td> 85 + <td class=tdbranca >
  86 + <!-- aqui será incluída a escala numérica -->
  87 + <div id=escala ></div>
  88 + </td>
84 </tr> 89 </tr>
85 <tr><td></td><td class="tdbranca"><div style="text-align:left;font-size:10px;background-color:white;display:none;" id=mostraUTM ></div></td><td></td></tr> 90 <tr><td></td><td class="tdbranca"><div style="text-align:left;font-size:10px;background-color:white;display:none;" id=mostraUTM ></div></td><td></td></tr>
86 </table> 91 </table>
@@ -89,148 +94,44 @@ include_once(&quot;../ms_configura.php&quot;); @@ -89,148 +94,44 @@ include_once(&quot;../ms_configura.php&quot;);
89 <tr style="border:0px"><td colspan=3 id="barraInferior" style="background-image:url('../imagens/visual/default/rodape.png');height:10px"></td></tr> 94 <tr style="border:0px"><td colspan=3 id="barraInferior" style="background-image:url('../imagens/visual/default/rodape.png');height:10px"></td></tr>
90 <tr style="border:0px"><td colspan=3 style=background-color:black ><input style="border:0px none; background-color:black;color:white;font-size:12pt;" type="text" size="1" id="i3geo_letreiro" ></td></tr> 95 <tr style="border:0px"><td colspan=3 style=background-color:black ><input style="border:0px none; background-color:black;color:white;font-size:12pt;" type="text" size="1" id="i3geo_letreiro" ></td></tr>
91 <tr style="border:0px"><td colspan=3 style=background-color:black;color:white >geoprocessamento@mma.gov.br</td></tr> 96 <tr style="border:0px"><td colspan=3 style=background-color:black;color:white >geoprocessamento@mma.gov.br</td></tr>
92 -  
93 </table> 97 </table>
94 </center> 98 </center>
95 -<div id=barraDeBotoes2 style='display:none'>  
96 - <table style="width:100%"><caption style="text-align:center">&nbsp;</caption>  
97 - <tr><td style='background-color:rgb(250,250,250);'><img title="" alt="" src="../imagens/branco.gif" id='sobeferramentas'/></td></tr>  
98 - </table>  
99 - <div style='display:inline;background-color:rgb(250,250,250);'>  
100 - <p style='font-size:6px;'>&nbsp;</p>  
101 - <img title="identifica" alt="" src="../imagens/branco.gif" id='identifica'/>  
102 - </div>  
103 - <div style='display:inline;background-color:rgb(250,250,250);'>  
104 - <p style='font-size:4px;'>&nbsp;</p>  
105 - <img title="info" alt="" src="../imagens/branco.gif" id='identificaBalao'/>  
106 - </div>  
107 - <div style='display:inline;background-color:rgb(250,250,250);'>  
108 - <p style='font-size:6px;'>&nbsp;</p>  
109 - <img title="extensao" alt="" src="../imagens/branco.gif" id='exten'/>  
110 - </div>  
111 - <div style='display:inline;background-color:rgb(250,250,250);'>  
112 - <p style='font-size:6px;'>&nbsp;</p>  
113 - <img title="insere xy" alt="" src="../imagens/branco.gif" id='inserexy'/>  
114 - </div>  
115 - <div style='display:inline;background-color:rgb(250,250,250);'>  
116 - <p style='font-size:6px;'>&nbsp;</p>  
117 - <img title="texto" alt="" src="../imagens/branco.gif" id='textofid'/>  
118 - </div>  
119 - <div style='display:inline;background-color:rgb(250,250,250);'>  
120 - <p style='font-size:6px;'>&nbsp;</p>  
121 - <img title="selecao" alt="" src="../imagens/branco.gif" id='selecao'/>  
122 - </div>  
123 - <div style='display:inline;background-color:rgb(250,250,250);'>  
124 - <p style='font-size:6px;'>&nbsp;</p>  
125 - <img title="rota" alt="" src="../imagens/branco.gif" id='rota'/>  
126 - </div>  
127 -  
128 - <div style='display:inline;background-color:rgb(250,250,250);'>  
129 - <p style='font-size:6px;'>&nbsp;</p>  
130 - <img title="insere grafico" alt="" src="../imagens/branco.gif" id='inseregrafico'/>  
131 - </div>  
132 - <div style='display:none;background-color:rgb(250,250,250);'>  
133 - <p style='font-size:6px;'>&nbsp;</p>  
134 - <img title="scielo" alt="" src="../imagens/branco.gif" id='scielo'/>  
135 - </div>  
136 - <div style='display:none;background-color:rgb(250,250,250);'>  
137 - <p style='font-size:6px;'>&nbsp;</p>  
138 - <img title="confluencias" alt="" src="../imagens/branco.gif" id='confluence'/>  
139 - </div>  
140 - <div style='display:none;background-color:rgb(250,250,250);'>  
141 - <p style='font-size:6px;'>&nbsp;</p>  
142 - <img title="busca na wikipedia" alt="" src="../imagens/branco.gif" id='wiki'/>  
143 - </div>  
144 - <div style='display:none;background-color:rgb(250,250,250);'>  
145 - <p style='font-size:6px;'>&nbsp;</p>  
146 - <img title="fotos" alt="" src="../imagens/branco.gif" id='buscafotos'/>  
147 - </div>  
148 - <table style="width:100%;"><tr><td style='background-color:rgb(250,250,250);'><p style='font-size:6px;'>&nbsp;</p><img title="" alt="" src="../imagens/branco.gif" id='desceferramentas'/></td></tr></table>  
149 -</div>  
150 <script type="text/javascript"> 99 <script type="text/javascript">
151 /* 100 /*
152 -Title: Google Maps (experimental) 101 +Title: Google Maps
153 102
154 Abre o i3geo com a navegação controlada pelo Google Maps. 103 Abre o i3geo com a navegação controlada pelo Google Maps.
155 104
156 -File: i3geo/aplicmap/googlemaps.htm 105 +Arquivo: i3geo/aplicmap/googlemaps.phtml
157 106
158 Exemplo: 107 Exemplo:
159 108
160 -http://localhost/i3geo/ms_criamapa.php?interface=googlemaps.phtml 109 +http://localhost/i3geo/aplicmap/googlemaps.phtml
161 110
162 */ 111 */
163 -g_locaplic = i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo";  
164 -g_barraFerramentas1 = "nao"  
165 -g_barraFerramentas2 = "sim"  
166 -g_mapaRefDisplay = "none"  
167 -g_janelaMen = "nao";  
168 -g_mostraRosa = "nao"  
169 -g_opcoesTemas = "sim";  
170 -;  
171 -i3GEO.interface.ATUAL = "googlemaps";  
172 -i3GEO.interface.IDCORPO = "contemImg";  
173 -i3GEO.Interface.OUTPUTFORMAT = "png2";  
174 -i3GEO.barraDeBotoes.BOTAOPADRAO = "identifica";  
175 -i3GEO.configura.diminuixN = 20 112 +i3GEO.configura.locaplic = i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo";
176 113
177 -i3GEO.configura.listaDePropriedadesDoMapa = {  
178 - "propriedades": [  
179 - { text: "p10", url: "javascript:i3GEO.mapa.dialogo.gradeCoord()"},  
180 - { text: "p12", url: "javascript:i3GEO.mapa.dialogo.autoredesenha()"}  
181 - ]  
182 -} 114 +i3GEO.Interface.ATUAL = "googlemaps";
  115 +i3GEO.Interface.IDCORPO = "contemImg";
  116 +i3GEO.configura.diminuixN = 20;
183 117
184 -i3GEO.configura.oMenuData = {  
185 - menu:[  
186 - {nome:$trad("s1"),id:"ajudaMenu"},  
187 - {nome:$trad("s2"),id:"analise"},  
188 - {nome:$trad("s4"),id:"arquivos"},  
189 - {nome:$trad("d27"),id:"interface"}  
190 - ],  
191 - submenus:{  
192 - "ajudaMenu": [  
193 - { text: $trad("u1"), url: "http://www.softwarepublico.gov.br/spb/ver-comunidade?community_id=1444332", target:"_blank" },  
194 - { text: $trad("u2"), url: "javascript:i3GEO.ajuda.abreDoc()" },  
195 - { text: $trad("u3"), url: "http://pt.wikibooks.org/wiki/I3geo", target:"_blank" },  
196 - { text: $trad("u4"), url: "http://mapas.mma.gov.br/wikibooki3geo", target:"_blank" },  
197 - { text: $trad("u5a"), url: "http://www.softwarepublico.gov.br", target:"_blank" },  
198 - { text: "i3Geo Blog", url: "http://sistemas.mma.gov.br/blogs/index.php?blog=6", target:"_blank" },  
199 - { text: "Lista de funções", url:"http://mapas.mma.gov.br/i3geo/ajuda_usuario.php", target:"_blank" }  
200 - ],  
201 - "analise": [  
202 - { text: '<span style=color:gray;text-decoration:underline; ><b>'+$trad("u22")+'</b></span>',url: "#"},  
203 - { text: $trad("u7"), url: "javascript:i3GEO.analise.dialogo.gradePol()"},  
204 - { text: $trad("u8"), url: "javascript:i3GEO.analise.dialogo.gradePontos()" },  
205 - { text: $trad("u9"), url: "javascript:i3GEO.analise.dialogo.gradeHex()" },  
206 - { text: '<span style=color:gray;text-decoration:underline; ><b>'+$trad("u23")+'</b></span>',url: "#"},  
207 - { text: $trad("u11a"), url: "javascript:i3GEO.analise.dialogo.distanciaptpt()" },  
208 - { text: $trad("u12"), url: "javascript:i3GEO.analise.dialogo.nptPol()" },  
209 - { text: $trad("u13"), url: "javascript:i3GEO.analise.dialogo.pontoempoligono()" },  
210 - { text: $trad("u14"), url: "javascript:i3GEO.analise.dialogo.pontosdistri()" },  
211 - { text: '<span style=color:gray;text-decoration:underline; ><b>'+$trad("u24")+'</b></span>',url: "#"},  
212 - { text: $trad("u11"), url: "javascript:i3GEO.analise.dialogo.centroide()" },  
213 - { text: $trad("u25"), url: "javascript:i3GEO.analise.dialogo.dissolve()" },  
214 - { text: '<span style=color:gray;text-decoration:underline; ><b>'+$trad("u27")+'</b></span>',url: "#"},  
215 - { text: $trad("u6"), url: "javascript:i3GEO.analise.dialogo.analisaGeometrias()" },  
216 - { text: $trad("u10"), url: "javascript:i3GEO.analise.dialogo.buffer()" },  
217 - { text: $trad("u26"), url: "javascript:i3GEO.analise.dialogo.agrupaElementos()" }  
218 - ],  
219 - "arquivos": [  
220 - { text: $trad("u17"), url: "javascript:i3GEO.mapa.dialogo.salvaMapa()" },  
221 - { text: $trad("u18"), url: "javascript:i3GEO.mapa.dialogo.carregaMapa()" },  
222 - { text: $trad("u20"), url: "javascript:i3GEO.mapa.dialogo.convertews()" },  
223 - { text: $trad("u20a"), url: "javascript:i3GEO.mapa.dialogo.convertekml()" },  
224 - { text: $trad("u21"), url: "../geradordelinks.htm" }  
225 - ],  
226 - "interface": [  
227 - { text: "Normal", url: "javascript:window.location = i3GEO.configura.locaplic+'/aplicmap/geral.htm?'+i3GEO.configura.sid" },  
228 - { text: "Google Earth", url: "javascript:window.location = i3GEO.configura.locaplic+'/aplicmap/googleearth.phtml?'+i3GEO.configura.sid" }  
229 - ]  
230 - }  
231 -}  
232 -i3GEO.barraDeBotoes.COMPORTAMENTO = "laranja"  
233 i3GEO.cria(); 118 i3GEO.cria();
  119 +
  120 +i3GEO.barraDeBotoes.AUTOALTURA = false;
  121 +i3GEO.barraDeBotoes.ATIVAMENUCONTEXTO = false;
  122 +i3GEO.barraDeBotoes.PERMITEFECHAR = true;
  123 +i3GEO.barraDeBotoes.PERMITEDESLOCAR = true;
  124 +i3GEO.barraDeBotoes.AUTO = true;
  125 +i3GEO.barraDeBotoes.COMPORTAMENTO = "laranja";
  126 +
  127 +i3GEO.Interface.BARRABOTOESLEFT = 80;
  128 +i3GEO.Interface.BARRABOTOESTOP = 20;
  129 +
  130 +i3GEO.idioma.IDSELETOR = "seletorIdiomas";
  131 +i3GEO.Interface.ATIVAMENUCONTEXTO = true;
  132 +i3GEO.arvoreDeTemas.TIPOBOTAO = "radio";
  133 +i3GEO.arvoreDeTemas.ATIVATEMAIMEDIATO = true;
  134 +
234 i3GEO.inicia(); 135 i3GEO.inicia();
235 </script> 136 </script>
236 </body> 137 </body>
aplicmap/openlayers.htm
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 <meta http-equiv="Category" content="I3Geo Mapa interativo MMA geoprocessamento sig mobile"> 4 <meta http-equiv="Category" content="I3Geo Mapa interativo MMA geoprocessamento sig mobile">
5 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> 5 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
6 <title>i3Geo - Mapa interativo</title> 6 <title>i3Geo - Mapa interativo</title>
7 -<script type="text/javascript" src="../classesjs/i3geo.js"></script> 7 +<script type="text/javascript" src="../classesjs/i3geonaocompacto.js"></script>
8 <script type="text/javascript" src="../pacotes/openlayers/OpenLayers29.js.php"></script> 8 <script type="text/javascript" src="../pacotes/openlayers/OpenLayers29.js.php"></script>
9 </head> 9 </head>
10 <body id="i3geo"> 10 <body id="i3geo">
@@ -163,7 +163,6 @@ Para definir quais botões das barras de ferramentas serão incluídos no mapa, vej @@ -163,7 +163,6 @@ Para definir quais botões das barras de ferramentas serão incluídos no mapa, vej
163 É utilizada para identificar o local correto onde estão os programas em php que são utilizados. 163 É utilizada para identificar o local correto onde estão os programas em php que são utilizados.
164 */ 164 */
165 i3GEO.configura.locaplic = i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo"; 165 i3GEO.configura.locaplic = i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo";
166 -var g_localimg = i3GEO.util.protocolo()+"://"+window.location.host+"/i3geo/imagens";  
167 166
168 i3GEO.Interface.ATUAL = "openlayers"; 167 i3GEO.Interface.ATUAL = "openlayers";
169 i3GEO.Interface.IDCORPO = "contemImg"; 168 i3GEO.Interface.IDCORPO = "contemImg";
@@ -176,7 +175,7 @@ i3GEO.Interface.openlayers.GADGETS = { @@ -176,7 +175,7 @@ i3GEO.Interface.openlayers.GADGETS = {
176 ScaleLine:true, 175 ScaleLine:true,
177 OverviewMap:false 176 OverviewMap:false
178 }; 177 };
179 -i3GEO.Interface.openlayers.TILES = false; 178 +i3GEO.Interface.openlayers.TILES = true;
180 /* 179 /*
181 Após a criação, é criado o objeto i3geoOL que corresponde ao objeto map da API do OpenLayers. 180 Após a criação, é criado o objeto i3geoOL que corresponde ao objeto map da API do OpenLayers.
182 Vc pode usar i3geoOL para aplicar os métodos e verificar as propriedades da API do OpenLayers 181 Vc pode usar i3geoOL para aplicar os métodos e verificar as propriedades da API do OpenLayers
@@ -184,7 +183,6 @@ Vc pode usar i3geoOL para aplicar os métodos e verificar as propriedades da API @@ -184,7 +183,6 @@ Vc pode usar i3geoOL para aplicar os métodos e verificar as propriedades da API
184 i3GEO.cria(); 183 i3GEO.cria();
185 /* 184 /*
186 Inicializa o mapa 185 Inicializa o mapa
187 -  
188 */ 186 */
189 i3GEO.barraDeBotoes.AUTOALTURA = false; 187 i3GEO.barraDeBotoes.AUTOALTURA = false;
190 i3GEO.barraDeBotoes.ATIVAMENUCONTEXTO = false; 188 i3GEO.barraDeBotoes.ATIVAMENUCONTEXTO = false;
classesjs/classe_analise.js
@@ -333,7 +333,7 @@ i3GEO.analise = { @@ -333,7 +333,7 @@ i3GEO.analise = {
333 pontosdistobj.yimg[n] = objposicaocursor.imgy; 333 pontosdistobj.yimg[n] = objposicaocursor.imgy;
334 pontosdistobj.dist[n] = 0; 334 pontosdistobj.dist[n] = 0;
335 //cria a linha que será utilizada para seguir a posição do mouse e o último ponto 335 //cria a linha que será utilizada para seguir a posição do mouse e o último ponto
336 - if(i3GEO.Interface.ATUAL === "padrao" || i3GEO.Interface.ATUAL === "openlayers"){ 336 + if(i3GEO.Interface.ATUAL === "padrao" || i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps"){
337 try{ 337 try{
338 if (navn) 338 if (navn)
339 {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1),(pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1));} 339 {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1),(pontosdistobj.ximg[n]-1),(pontosdistobj.yimg[n]-1));}
@@ -355,7 +355,7 @@ i3GEO.analise = { @@ -355,7 +355,7 @@ i3GEO.analise = {
355 pontosdistobj.dist[n] = d + pontosdistobj.dist[n-1]; 355 pontosdistobj.dist[n] = d + pontosdistobj.dist[n-1];
356 356
357 if($i("pararraios") && $i("pararraios").checked === true ){ 357 if($i("pararraios") && $i("pararraios").checked === true ){
358 - if(i3GEO.Interface.ATUAL === "padrao" || i3GEO.Interface.ATUAL === "openlayers"){ 358 + if(i3GEO.Interface.ATUAL === "padrao" || i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps"){
359 i3GEO.desenho.aplica("insereCirculo","",n); 359 i3GEO.desenho.aplica("insereCirculo","",n);
360 if(navm) 360 if(navm)
361 {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n-1])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n-1],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n]);} 361 {pontosdistobj.linhas[n] = i3GEO.desenho.richdraw.renderer.create(i3GEO.desenho.richdraw.mode, i3GEO.desenho.richdraw.fillColor, i3GEO.desenho.richdraw.lineColor, i3GEO.desenho.richdraw.lineWidth, (pontosdistobj.ximg[n-1])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n-1],(pontosdistobj.ximg[n])-(i3GEO.parametros.w/2),pontosdistobj.yimg[n]);}
@@ -366,7 +366,7 @@ i3GEO.analise = { @@ -366,7 +366,7 @@ i3GEO.analise = {
366 } 366 }
367 } 367 }
368 if($i("parartextos") && $i("parartextos").checked === true ){ 368 if($i("parartextos") && $i("parartextos").checked === true ){
369 - if(i3GEO.Interface.ATUAL === "padrao" || i3GEO.Interface.ATUAL === "openlayers"){ 369 + if(i3GEO.Interface.ATUAL === "padrao" || i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps"){
370 i3GEO.desenho.aplica("insereTexto","",n,d+" km"); 370 i3GEO.desenho.aplica("insereTexto","",n,d+" km");
371 } 371 }
372 } 372 }
@@ -375,7 +375,7 @@ i3GEO.analise = { @@ -375,7 +375,7 @@ i3GEO.analise = {
375 i3GEO.Interface.googleearth.insereLinha(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],pontosdistobj.xpt[n],pontosdistobj.ypt[n],"divGeometriasTemp"); 375 i3GEO.Interface.googleearth.insereLinha(pontosdistobj.xpt[n-1],pontosdistobj.ypt[n-1],pontosdistobj.xpt[n],pontosdistobj.ypt[n],"divGeometriasTemp");
376 } 376 }
377 } 377 }
378 - if(i3GEO.Interface.ATUAL === "padrao" || i3GEO.Interface.ATUAL === "openlayers") 378 + if(i3GEO.Interface.ATUAL === "padrao" || i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps")
379 {i3GEO.util.insereMarca.cria(objposicaocursor.imgx,objposicaocursor.imgy,i3GEO.analise.medeDistancia.fechaJanela,"divGeometriasTemp");} 379 {i3GEO.util.insereMarca.cria(objposicaocursor.imgx,objposicaocursor.imgy,i3GEO.analise.medeDistancia.fechaJanela,"divGeometriasTemp");}
380 if(i3GEO.Interface.ATUAL === "googleearth") 380 if(i3GEO.Interface.ATUAL === "googleearth")
381 {i3GEO.util.insereMarca.cria(objposicaocursor.ddx,objposicaocursor.ddy,i3GEO.analise.medeDistancia.fechaJanela,"divGeometriasTemp","");} 381 {i3GEO.util.insereMarca.cria(objposicaocursor.ddx,objposicaocursor.ddy,i3GEO.analise.medeDistancia.fechaJanela,"divGeometriasTemp","");}
classesjs/classe_arvoredecamadas.js
@@ -1046,11 +1046,13 @@ i3GEO.arvoreDeCamadas = { @@ -1046,11 +1046,13 @@ i3GEO.arvoreDeCamadas = {
1046 {t = i3GEO.arvoreDeCamadas.listaLigadosDesligados("mantem");} 1046 {t = i3GEO.arvoreDeCamadas.listaLigadosDesligados("mantem");}
1047 if(tipo === "ligartodos"){ 1047 if(tipo === "ligartodos"){
1048 t = i3GEO.arvoreDeCamadas.listaLigadosDesligados("marca"); 1048 t = i3GEO.arvoreDeCamadas.listaLigadosDesligados("marca");
1049 - if(i3GEO.Interface.ATUAL === "openlayers"){return;} 1049 + if(i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps")
  1050 + {return;}
1050 } 1051 }
1051 if(tipo === "desligartodos"){ 1052 if(tipo === "desligartodos"){
1052 t = i3GEO.arvoreDeCamadas.listaLigadosDesligados("desmarca"); 1053 t = i3GEO.arvoreDeCamadas.listaLigadosDesligados("desmarca");
1053 - if(i3GEO.Interface.ATUAL === "openlayers"){return;} 1054 + if(i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps")
  1055 + {return;}
1054 } 1056 }
1055 // 1057 //
1056 //zera o contador de tempo 1058 //zera o contador de tempo
@@ -1123,13 +1125,18 @@ i3GEO.arvoreDeCamadas = { @@ -1123,13 +1125,18 @@ i3GEO.arvoreDeCamadas = {
1123 if(tipo === "marca"){ 1125 if(tipo === "marca"){
1124 c.checked = true; 1126 c.checked = true;
1125 if(i3GEO.Interface.ATUAL === "openlayers"){ 1127 if(i3GEO.Interface.ATUAL === "openlayers"){
1126 - i3geoOL.getLayersByName(c.value)[0].setVisibility(true); 1128 + i3GEO.Interface.openlayers.ligaDesliga(c);
  1129 + }
  1130 + if(i3GEO.Interface.ATUAL === "googlemaps"){
  1131 + i3GEO.Interface.googlemaps.ligaDesliga(c);
1127 } 1132 }
1128 } 1133 }
1129 if(tipo === "desmarca"){ 1134 if(tipo === "desmarca"){
1130 c.checked = false; 1135 c.checked = false;
1131 if(i3GEO.Interface.ATUAL === "openlayers") 1136 if(i3GEO.Interface.ATUAL === "openlayers")
1132 - {i3geoOL.getLayersByName(c.value)[0].setVisibility(false);} 1137 + {i3GEO.Interface.openlayers.ligaDesliga(c);}
  1138 + if(i3GEO.Interface.ATUAL === "googlemaps")
  1139 + {i3GEO.Interface.googlemaps.ligaDesliga(c);}
1133 } 1140 }
1134 } 1141 }
1135 } 1142 }
classesjs/classe_configura.js
@@ -572,6 +572,10 @@ i3GEO.configura = { @@ -572,6 +572,10 @@ i3GEO.configura = {
572 i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.extentTotal); 572 i3GEO.Interface.openlayers.zoom2ext(i3GEO.parametros.extentTotal);
573 return; 573 return;
574 } 574 }
  575 + if(i3GEO.Interface.ATUAL === "googlemaps"){
  576 + i3GEO.Interface.googlemaps.zoom2extent(i3GEO.parametros.extentTotal);
  577 + return;
  578 + }
575 i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,i3GEO.configura.tipoimagem,i3GEO.parametros.extentTotal); 579 i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,i3GEO.configura.tipoimagem,i3GEO.parametros.extentTotal);
576 marcadorZoom = ""; 580 marcadorZoom = "";
577 } 581 }
classesjs/classe_guias.js
@@ -61,6 +61,10 @@ i3GEO.guias = { @@ -61,6 +61,10 @@ i3GEO.guias = {
61 61
62 Define os parâmetros de cada guia que será mostrada no mapa, como título, conteúdo, etc. 62 Define os parâmetros de cada guia que será mostrada no mapa, como título, conteúdo, etc.
63 63
  64 + Você pode modificar o nome de uma guia como no exemplo
  65 +
  66 + i3GEO.guias.CONFIGURA.legenda.titulo = "nome diferente";
  67 +
64 Exemplo 68 Exemplo
65 69
66 i3GEO.guias.CONFIGURA.legenda = { 70 i3GEO.guias.CONFIGURA.legenda = {
classesjs/classe_interface.js
@@ -982,8 +982,6 @@ i3GEO.Interface = { @@ -982,8 +982,6 @@ i3GEO.Interface = {
982 } 982 }
983 if ($i("barraDeBotoes2") || i3GEO.barraDeBotoes.AUTO === true) 983 if ($i("barraDeBotoes2") || i3GEO.barraDeBotoes.AUTO === true)
984 {i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2);} 984 {i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2);}
985 - //if(i3GEO.Interface.ATIVAMENUCONTEXTO)  
986 - //{i3GEO.Interface.padrao.ativaMenuContexto();}  
987 if(i3GEO.configura.visual !== "default") 985 if(i3GEO.configura.visual !== "default")
988 {i3GEO.gadgets.visual.troca(i3GEO.configura.visual);} 986 {i3GEO.gadgets.visual.troca(i3GEO.configura.visual);}
989 i3GEO.barraDeBotoes.ativaBotoes(); 987 i3GEO.barraDeBotoes.ativaBotoes();
@@ -1042,12 +1040,12 @@ i3GEO.Interface = { @@ -1042,12 +1040,12 @@ i3GEO.Interface = {
1042 Tipo de mapa que será usado como default, conforme constantes definidas na API do Google Maps. 1040 Tipo de mapa que será usado como default, conforme constantes definidas na API do Google Maps.
1043 1041
1044 Default: 1042 Default:
1045 - "G_PHYSICAL_MAP" 1043 + "roadmap"
1046 1044
1047 Tipo: 1045 Tipo:
1048 - {string - Google API constante GMapType "G_SATELLITE_MAP"|"G_PHYSICAL_MAP"|"G_HYBRID_MAP"} 1046 + {string - Google API constante "satellite"|"roadmap"|"hybrid"|"terrain"}
1049 */ 1047 */
1050 - TIPOMAPA: "G_PHYSICAL_MAP", 1048 + TIPOMAPA: "terrain",
1051 /* 1049 /*
1052 Variable 1050 Variable
1053 1051
@@ -1066,20 +1064,19 @@ i3GEO.Interface = { @@ -1066,20 +1064,19 @@ i3GEO.Interface = {
1066 i3GEO.atualiza(retorno); 1064 i3GEO.atualiza(retorno);
1067 }, 1065 },
1068 redesenha: function(){ 1066 redesenha: function(){
1069 - try{  
1070 - if(i3GeoMap !== ""){  
1071 - posfixo = posfixo + "&";  
1072 - i3GeoMap.removeOverlay(i3GEOTileO);  
1073 - var i3GEOTile = new GTileLayer(null,0,18,{  
1074 - tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile()+posfixo,  
1075 - isPng:true,  
1076 - opacity:i3GEO.Interface.googlemaps.OPACIDADE });  
1077 - i3GEOTileO = new GTileLayerOverlay(i3GEOTile);  
1078 - i3GeoMap.addOverlay(i3GEOTileO); 1067 + //
  1068 + //remove todos os layers
  1069 + //
  1070 + var nlayers = i3GEO.arvoreDeCamadas.CAMADAS.length,
  1071 + i,
  1072 + camada;
  1073 + for (i=0;i<nlayers;i++){
  1074 + camada = i3GEO.arvoreDeCamadas.CAMADAS[i];
  1075 + if(i3GEO.Interface.googlemaps.retornaIndiceLayer(camada.name)){
  1076 + i3GeoMap.overlayMapTypes.removeAt(i);
1079 } 1077 }
1080 - }catch(e){  
1081 - if(typeof(console) !== 'undefined'){console.error(e);}  
1082 } 1078 }
  1079 + i3GEO.Interface.googlemaps.criaLayers();
1083 }, 1080 },
1084 cria: function(w,h){ 1081 cria: function(w,h){
1085 var i,f,ins; 1082 var i,f,ins;
@@ -1097,67 +1094,99 @@ i3GEO.Interface = { @@ -1097,67 +1094,99 @@ i3GEO.Interface = {
1097 } 1094 }
1098 i3GeoMap = ""; 1095 i3GeoMap = "";
1099 i3GEO.Interface.IDMAPA = "googlemapsdiv"; 1096 i3GEO.Interface.IDMAPA = "googlemapsdiv";
  1097 + i3GEO.barraDeBotoes.INCLUIBOTAO.zoomli = true;
  1098 + i3GEO.barraDeBotoes.INCLUIBOTAO.pan = true;
  1099 + i3GEO.barraDeBotoes.INCLUIBOTAO.zoomtot = true;
1100 }, 1100 },
1101 inicia: function(){ 1101 inicia: function(){
1102 - var pos,myMapType,pol,ret,pt1,pt2,bottomLeft,bottomRight,sw,ne,z,i3GEOTile; 1102 + var pol,ret,pt1,pt2,bottomLeft,bottomRight,i3GEOTile;
1103 pol = i3GEO.parametros.mapexten; 1103 pol = i3GEO.parametros.mapexten;
1104 ret = pol.split(" "); 1104 ret = pol.split(" ");
1105 - pt1 = (( (ret[0] * -1) - (ret[2] * -1) ) / 2) + ret[0] *1;  
1106 - pt2 = (((ret[1] - ret[3]) / 2)* -1) + ret[1] *1;  
1107 -  
1108 - i3GeoMap = new GMap2($i(i3GEO.Interface.IDMAPA));  
1109 - i3GeoMap.addMapType(G_PHYSICAL_MAP);  
1110 - if(i3GEO.Interface.googlemaps.TIPOMAPA === "G_SATELLITE_MAP")  
1111 - {i3GeoMap.setMapType(G_SATELLITE_MAP);}  
1112 - if(i3GEO.Interface.googlemaps.TIPOMAPA === "G_PHYSICAL_MAP")  
1113 - {i3GeoMap.setMapType(G_PHYSICAL_MAP);}  
1114 - if(i3GEO.Interface.googlemaps.TIPOMAPA === "G_HYBRID_MAP")  
1115 - {i3GeoMap.setMapType(G_HYBRID_MAP);}  
1116 - i3GeoMap.addControl(new GLargeMapControl());  
1117 - i3GeoMap.addControl(new GMapTypeControl());  
1118 - bottomLeft = new GControlPosition(G_ANCHOR_BOTTOM_LEFT,new GSize(0,40));  
1119 - i3GeoMap.addControl(new GScaleControl(),bottomLeft);  
1120 - bottomRight = new GControlPosition(G_ANCHOR_BOTTOM_RIGHT);  
1121 - i3GeoMap.addControl(new GOverviewMapControl(),bottomRight);  
1122 -  
1123 - sw = new GLatLng(ret[1],ret[0]);  
1124 - ne = new GLatLng(ret[3],ret[2]);  
1125 - z = i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));  
1126 -  
1127 - i3GeoMap.setCenter(new GLatLng(pt2,pt1), z); 1105 + function montaMapa(retorno){
  1106 + var pos, sw,ne,z,myMapType;
  1107 + i3GeoMap = new google.maps.Map($i(i3GEO.Interface.IDMAPA),{scaleControl:true});
  1108 + i3GeoMap.setMapTypeId(i3GEO.Interface.googlemaps.TIPOMAPA);
  1109 + sw = new google.maps.LatLng(ret[1],ret[0]);
  1110 + ne = new google.maps.LatLng(ret[3],ret[2]);
  1111 + i3GEO.Interface.googlemaps.registraEventos();
  1112 + i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne));
  1113 + i3GEO.Interface.googlemaps.criaLayers();
  1114 +
  1115 + i3GEO.gadgets.mostraInserirKml();
  1116 + i3GEO.Interface.googlemaps.ativaBotoes();
  1117 + i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));
  1118 + i3GEO.gadgets.mostraCoordenadasGEO();
  1119 + i3GEO.gadgets.mostraCoordenadasUTM();
  1120 + i3GEO.gadgets.mostraEscalaNumerica();
  1121 + i3GEO.gadgets.mostraMenuSuspenso();
  1122 + g_operacao = "";
  1123 + g_tipoacao = "";
  1124 + if(i3GEO.parametros.kmlurl !== "")
  1125 + {i3GEO.mapa.insereKml(true,i3GEO.parametros.kmlurl);}
  1126 + //i3GEO.parametros.mapscale = i3GEO.Interface.googlemaps.calcescala();
  1127 + //atualizaEscalaNumerica(parseInt(i3GEO.parametros.mapscale,10));
  1128 + //
  1129 + //i3GEO.arvoreDeCamadas.CAMADAS é definido na inicialização (classe_i3geo)
  1130 + //
  1131 + i3GEO.arvoreDeCamadas.ATIVATEMA = "i3GEO.Interface.googlemaps.ligaDesliga(this)";
1128 1132
1129 - i3GEOTile = new GTileLayer(null,0,18,{  
1130 - tileUrlTemplate:i3GEO.Interface.googlemaps.criaTile(),  
1131 - isPng:true,  
1132 - opacity:i3GEO.Interface.googlemaps.OPACIDADE });  
1133 -  
1134 - i3GEOTileO = new GTileLayerOverlay(i3GEOTile);  
1135 - i3GeoMap.addOverlay(i3GEOTileO);  
1136 - myMapType = new GMapType([i3GEOTile], new GMercatorProjection(18), 'i3Geo');  
1137 - i3GeoMap.addMapType(myMapType);  
1138 - GEvent.addListener(i3GeoMap, "dragstart", function() {  
1139 - g_operacao = "";  
1140 - g_tipoacao = "";  
1141 - });  
1142 - GEvent.addListener(i3GeoMap, "dragend", function() {  
1143 - i3GEO.Interface.googlemaps.recalcPar();  
1144 - });  
1145 - GEvent.addListener(i3GeoMap, "zoomend", function() {  
1146 - i3GEO.Interface.googlemaps.recalcPar();  
1147 - g_operacao = "";  
1148 - g_tipoacao = "";  
1149 - });  
1150 - i3GEO.Interface.googlemaps.ativaBotoes();  
1151 - i3GEO.eventos.ativa($i(i3GEO.Interface.IDMAPA));  
1152 - i3GEO.gadgets.mostraCoordenadasGEO();  
1153 - i3GEO.gadgets.mostraMenuSuspenso();  
1154 - i3GEO.gadgets.mostraInserirKml(); 1133 + i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,i3GEO.configura.sid,i3GEO.configura.locaplic);
  1134 + i3GEO.Interface.googlemaps.adicionaListaKml();
  1135 + };
  1136 + i3GEO.php.googlemaps(montaMapa);
  1137 + },
  1138 + criaLayers: function(){
  1139 + var nlayers = i3GEO.arvoreDeCamadas.CAMADAS.length,
  1140 + i,
  1141 + camada;
  1142 + for (i=0;i<nlayers;i++){
  1143 + camada = i3GEO.arvoreDeCamadas.CAMADAS[i];
  1144 + if(!i3GEO.Interface.googlemaps.retornaIndiceLayer(camada.name)){
  1145 + if(camada.status !== 0){
  1146 + i3GEO.Interface.googlemaps.insereLayer(camada.name,i);
  1147 + }
  1148 + }
  1149 + }
  1150 + },
  1151 + insereLayer: function(nomeLayer,indice){
  1152 + var i3GEOTileO,s;
  1153 + s = "i3GEOTileO = new google.maps.ImageMapType({ "+
  1154 + "getTileUrl: function(coord, zoom) {" +
  1155 + " var url = '" + i3GEO.configura.locaplic +"/classesphp/mapa_googlemaps.php?map=" + i3GEO.parametros.mapfile +
  1156 + " &Z=' + zoom + '&X=' + coord.x + '&Y=' + coord.y + '&layer=" + nomeLayer + "';" +
  1157 + " return url; " +
  1158 + "}, "+
  1159 + "tileSize: new google.maps.Size(256, 256)," +
  1160 + "isPng: true," +
  1161 + "name: '" + nomeLayer + "'" +
  1162 + "});";
  1163 + eval(s);
  1164 + i3GeoMap.overlayMapTypes.insertAt(indice, i3GEOTileO);
  1165 + },
  1166 + registraEventos: function(){
  1167 + var pos;
  1168 + google.maps.event.addListener(i3GeoMap, "dragstart", function() {
  1169 + g_operacao = "";
  1170 + g_tipoacao = "";
  1171 + });
  1172 + google.maps.event.addListener(i3GeoMap, "dragend", function() {
  1173 + i3GEO.Interface.googlemaps.recalcPar();
  1174 + i3GEO.eventos.navegaMapa();
  1175 + });
  1176 + google.maps.event.addListener(i3GeoMap, "zoom_changed", function() {
  1177 + i3GEO.Interface.googlemaps.recalcPar();
  1178 + g_operacao = "";
  1179 + g_tipoacao = "";
  1180 + i3GEO.eventos.navegaMapa();
  1181 + });
1155 pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA)); 1182 pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA));
1156 - GEvent.addListener(i3GeoMap, "mousemove", function(ponto) {  
1157 - var teladms,tela;  
1158 - teladms = i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat());  
1159 - tela = i3GeoMap.fromLatLngToContainerPixel(ponto);  
1160 - objposicaocursor = { 1183 + google.maps.event.addListener(i3GeoMap, "mousemove", function(ponto) {
  1184 + var teladms,tela,mapType;
  1185 + ponto = ponto.latLng;
  1186 + teladms = i3GEO.calculo.dd2dms(ponto.lng(),ponto.lat());
  1187 + mapType = i3GeoMap.mapTypes[i3GeoMap.getMapTypeId()];
  1188 + tela = mapType.projection.fromLatLngToPoint(ponto);
  1189 + objposicaocursor = {
1161 ddx: ponto.lng(), 1190 ddx: ponto.lng(),
1162 ddy: ponto.lat(), 1191 ddy: ponto.lat(),
1163 dmsx: teladms[0], 1192 dmsx: teladms[0],
@@ -1167,17 +1196,32 @@ i3GEO.Interface = { @@ -1167,17 +1196,32 @@ i3GEO.Interface = {
1167 telax: tela.x + pos[0], 1196 telax: tela.x + pos[0],
1168 telay: tela.y + pos[1] 1197 telay: tela.y + pos[1]
1169 }; 1198 };
1170 - });  
1171 - g_operacao = "";  
1172 - g_tipoacao = "";  
1173 - if(i3GEO.parametros.kmlurl !== "")  
1174 - {i3GEO.mapa.insereKml(true,i3GEO.parametros.kmlurl);}  
1175 - i3GEO.parametros.mapscale = i3GEO.Interface.googlemaps.calcescala();  
1176 - //  
1177 - //i3GEO.arvoreDeCamadas.CAMADAS é definido na inicialização (classe_i3geo)  
1178 - //  
1179 - i3GEO.arvoreDeCamadas.cria("",i3GEO.arvoreDeCamadas.CAMADAS,i3GEO.configura.sid,i3GEO.configura.locaplic);  
1180 - i3GEO.Interface.googlemaps.adicionaListaKml(); 1199 + });
  1200 + },
  1201 + retornaIndiceLayer: function(nomeLayer){
  1202 + var i = null;
  1203 + i3GeoMap.overlayMapTypes.forEach(
  1204 + function(elemento, number){
  1205 + if(elemento.name == nomeLayer)
  1206 + {i = number;}
  1207 + }
  1208 + )
  1209 + return i;
  1210 + },
  1211 + ligaDesliga:function(obj){
  1212 + var indice = i3GEO.Interface.googlemaps.retornaIndiceLayer(obj.value),
  1213 + temp = function(){},
  1214 + desligar = "",
  1215 + ligar = "";
  1216 + if(obj.checked && !indice){
  1217 + ligar = obj.value;
  1218 + i3GEO.Interface.googlemaps.insereLayer(obj.value,0);
  1219 + }
  1220 + else{
  1221 + desligar = obj.value;
  1222 + i3GeoMap.overlayMapTypes.removeAt(indice);
  1223 + }
  1224 + i3GEO.php.ligatemas(temp,desligar,ligar);
1181 }, 1225 },
1182 bbox: function(){ 1226 bbox: function(){
1183 var bd,so,ne,bbox; 1227 var bd,so,ne,bbox;
@@ -1187,46 +1231,21 @@ i3GEO.Interface = { @@ -1187,46 +1231,21 @@ i3GEO.Interface = {
1187 bbox = so.lng()+" "+so.lat()+" "+ne.lng()+" "+ne.lat(); 1231 bbox = so.lng()+" "+so.lat()+" "+ne.lng()+" "+ne.lat();
1188 return (bbox); 1232 return (bbox);
1189 }, 1233 },
1190 - criaWMS: function(){  
1191 - var cgi,parametros;  
1192 - cgi = i3GEO.configura.locaplic+"/classesphp/parse_cgi.php?g_sid="+i3GEO.configura.sid;  
1193 - parametros = "&map_size="+parseInt($i(i3GEO.Interface.IDMAPA).style.width,10);  
1194 - parametros += ","+parseInt($i(i3GEO.Interface.IDMAPA).style.height,10);  
1195 - parametros += "&mapext="+i3GEO.Interface.googlemaps.bbox();  
1196 - parametros += "&map_imagecolor=-1 -1 -1&map_transparent=on";  
1197 - return(cgi+parametros);  
1198 - },  
1199 - criaTile: function(){  
1200 - var cgi,parametros;  
1201 - /*  
1202 - cgi = i3GEO.util.protocolo()+"://"+window.location.host+i3GEO.parametros.cgi+"?";  
1203 - parametros = "map="+i3GEO.parametros.mapfile;  
1204 - parametros += '&mode=tile';  
1205 - parametros += '&tilemode=gmap';  
1206 - parametros += '&tile={X}+{Y}+{Z}';  
1207 - parametros += '&map_imagetype='+i3GEO.Interface.OUTPUTFORMAT;  
1208 - return(cgi+parametros);  
1209 - */  
1210 - parametros = i3GEO.configura.locaplic+"/classesphp/mapa_googlemaps.php?";  
1211 - parametros += "map="+i3GEO.parametros.mapfile;  
1212 - parametros += '&X={X}&Y={Y}&Z={Z}';  
1213 - //window.open(parametros)  
1214 - return(parametros);  
1215 - },  
1216 ativaBotoes: function(){ 1234 ativaBotoes: function(){
1217 - var imagemxy,x2,y2; 1235 + if(typeof(console) !== 'undefined'){console.info("i3GEO.Interface.padrao.ativaBotoes()");}
  1236 + var imagemxy,x1,y1,x2,y2;
1218 imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO)); 1237 imagemxy = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDCORPO));
1219 - if ($i("barraDeBotoes2")){  
1220 - x2 = imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT+70; 1238 + if ($i("barraDeBotoes2") || i3GEO.barraDeBotoes.AUTO === true){
  1239 + x2 = imagemxy[0]+i3GEO.Interface.BARRABOTOESLEFT;
1221 y2 = imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP; 1240 y2 = imagemxy[1]+i3GEO.Interface.BARRABOTOESTOP;
1222 } 1241 }
1223 - if ($i("barraDeBotoes2")) 1242 + if ($i("barraDeBotoes2") || i3GEO.barraDeBotoes.AUTO === true)
1224 {i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2);} 1243 {i3GEO.barraDeBotoes.inicializaBarra("barraDeBotoes2","i3geo_barra2",false,x2,y2);}
1225 - //ativa as funções dos botões 1244 + if(i3GEO.configura.visual !== "default")
  1245 + {i3GEO.gadgets.visual.troca(i3GEO.configura.visual);}
1226 i3GEO.barraDeBotoes.ativaBotoes(); 1246 i3GEO.barraDeBotoes.ativaBotoes();
1227 }, 1247 },
1228 mudaOpacidade: function(valor){ 1248 mudaOpacidade: function(valor){
1229 - //$i("xg").value = valor / 200;  
1230 i3GEO.Interface.googlemaps.OPACIDADE = valor / 200; 1249 i3GEO.Interface.googlemaps.OPACIDADE = valor / 200;
1231 i3GEO.Interface.googlemaps.redesenha(); 1250 i3GEO.Interface.googlemaps.redesenha();
1232 }, 1251 },
@@ -1235,10 +1254,12 @@ i3GEO.Interface = { @@ -1235,10 +1254,12 @@ i3GEO.Interface = {
1235 g_operacao = ""; 1254 g_operacao = "";
1236 g_tipoacao = ""; 1255 g_tipoacao = "";
1237 bounds = i3GeoMap.getBounds(); 1256 bounds = i3GeoMap.getBounds();
1238 - sw = bounds.getSouthWest();  
1239 - ne = bounds.getNorthEast();  
1240 - i3GEO.parametros.mapexten = sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();  
1241 - i3GEO.parametros.mapscale = i3GEO.Interface.googlemaps.calcescala(); 1257 + if(bounds){
  1258 + sw = bounds.getSouthWest();
  1259 + ne = bounds.getNorthEast();
  1260 + i3GEO.parametros.mapexten = sw.lng()+" "+sw.lat()+" "+ne.lng()+" "+ne.lat();
  1261 + i3GEO.parametros.mapscale = i3GEO.Interface.googlemaps.calcescala();
  1262 + }
1242 }, 1263 },
1243 calcescala:function(){ 1264 calcescala:function(){
1244 var zoom = i3GeoMap.getZoom(); 1265 var zoom = i3GeoMap.getZoom();
@@ -1259,10 +1280,12 @@ i3GEO.Interface = { @@ -1259,10 +1280,12 @@ i3GEO.Interface = {
1259 ret = pol.split(" "); 1280 ret = pol.split(" ");
1260 pt1 = (( (ret[0] * -1) - (ret[2] * -1) ) / 2) + ret[0] *1; 1281 pt1 = (( (ret[0] * -1) - (ret[2] * -1) ) / 2) + ret[0] *1;
1261 pt2 = (((ret[1] - ret[3]) / 2)* -1) + ret[1] *1; 1282 pt2 = (((ret[1] - ret[3]) / 2)* -1) + ret[1] *1;
1262 - sw = new GLatLng(ret[1],ret[0]);  
1263 - ne = new GLatLng(ret[3],ret[2]);  
1264 - z = i3GeoMap.getBoundsZoomLevel(new GLatLngBounds(sw,ne));  
1265 - i3GeoMap.setCenter(new GLatLng(pt2,pt1), z); 1283 + sw = new google.maps.Latlng(ret[1],ret[0]);
  1284 + ne = new google.maps.Latlng(ret[3],ret[2]);
  1285 + i3GeoMap.fitBounds(new google.maps.LatLngBounds(sw,ne));
  1286 + },
  1287 + pan2ponto: function(x,y){
  1288 + i3GeoMap.panTo(new google.maps.LatLng(x,y));
1266 }, 1289 },
1267 /* 1290 /*
1268 Function: adicionaKml 1291 Function: adicionaKml
@@ -1307,16 +1330,6 @@ i3GEO.Interface = { @@ -1307,16 +1330,6 @@ i3GEO.Interface = {
1307 {return;} 1330 {return;}
1308 //"http://api.flickr.com/services/feeds/geo/?g=322338@N20&lang=en-us&format=feed-georss" 1331 //"http://api.flickr.com/services/feeds/geo/?g=322338@N20&lang=en-us&format=feed-georss"
1309 i3GEO.mapa.GEOXML.push(ngeoxml); 1332 i3GEO.mapa.GEOXML.push(ngeoxml);
1310 - zoom = function(){  
1311 - if(pan){  
1312 - eval("var ll = "+ngeoxml+".getDefaultCenter()");  
1313 - eval(ngeoxml+".gotoDefaultViewport(i3GeoMap)");  
1314 - }  
1315 - };  
1316 - eval(ngeoxml+" = new GGeoXml(url,zoom)");  
1317 - if(ativo === true)  
1318 - {eval("i3GeoMap.addOverlay("+ngeoxml+")");}  
1319 -  
1320 i3GEO.Interface.googlemaps.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml); 1333 i3GEO.Interface.googlemaps.adicionaNoArvoreGoogle(url,titulo,ativo,ngeoxml);
1321 }, 1334 },
1322 adicionaListaKml: function(){ 1335 adicionaListaKml: function(){
@@ -1361,11 +1374,16 @@ i3GEO.Interface = { @@ -1361,11 +1374,16 @@ i3GEO.Interface = {
1361 {id = nomeOverlay;} 1374 {id = nomeOverlay;}
1362 root = i3GEO.Interface.googlemaps.ARVORE.getRoot(); 1375 root = i3GEO.Interface.googlemaps.ARVORE.getRoot();
1363 node = i3GEO.Interface.googlemaps.ARVORE.getNodeByProperty("idkml","raiz"); 1376 node = i3GEO.Interface.googlemaps.ARVORE.getNodeByProperty("idkml","raiz");
1364 - html = "<input onclick='i3GEO.Interface.googlemaps.ativaDesativaCamadaKml(this)' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'"; 1377 + html = "<input onclick='i3GEO.Interface.googlemaps.ativaDesativaCamadaKml(this,\""+url+"\")' class=inputsb style='cursor:pointer;' type='checkbox' value='"+id+"'";
1365 if(ativo === true) 1378 if(ativo === true)
1366 {html += " checked ";} 1379 {html += " checked ";}
1367 html += "/>"; 1380 html += "/>";
1368 - html += "&nbsp;<span style='cursor:move'>"+nomeOverlay+"</span>"; 1381 + if(navm)
  1382 + {estilo = "cursor:default;vertical-align:35%;padding-top:0px;";}
  1383 + else
  1384 + {estilo = "cursor:default;vertical-align:top;";}
  1385 +
  1386 + html += "&nbsp;<span style='"+estilo+"'>"+nomeOverlay+"</span>";
1369 d = {html:html}; 1387 d = {html:html};
1370 nodekml = new YAHOO.widget.HTMLNode(d, node, true,true); 1388 nodekml = new YAHOO.widget.HTMLNode(d, node, true,true);
1371 nodekml.enableHighlight = false; 1389 nodekml.enableHighlight = false;
@@ -1402,13 +1420,15 @@ i3GEO.Interface = { @@ -1402,13 +1420,15 @@ i3GEO.Interface = {
1402 Parametro: 1420 Parametro:
1403 1421
1404 obj {object} - objeto do tipo checkbox que foi ativado/desativado 1422 obj {object} - objeto do tipo checkbox que foi ativado/desativado
  1423 +
  1424 + url {string} - url do KML
1405 */ 1425 */
1406 - ativaDesativaCamadaKml: function(obj){  
1407 - if(!obj.checked){  
1408 - eval("i3GeoMap.removeOverlay("+obj.value+")"); 1426 + ativaDesativaCamadaKml: function(obj,url){
  1427 + if(!obj.checked)
  1428 + {eval(obj.value+".setMap(null);");}
  1429 + else{
  1430 + eval(obj.value+" = new google.maps.KmlLayer(url,{map:i3GeoMap,preserveViewport:true});");
1409 } 1431 }
1410 - else  
1411 - {eval("i3GeoMap.addOverlay("+obj.value+")");}  
1412 } 1432 }
1413 }, 1433 },
1414 /* 1434 /*
classesjs/classe_mapa.js
@@ -142,7 +142,7 @@ i3GEO.mapa = { @@ -142,7 +142,7 @@ i3GEO.mapa = {
142 i3GEO.mapa.recupera.TENTATIVA = 0; 142 i3GEO.mapa.recupera.TENTATIVA = 0;
143 } 143 }
144 catch(e){ 144 catch(e){
145 - if(i3GEO.Interface.ATUAL === "openlayers"){ 145 + if(i3GEO.Interface.ATUAL === "openlayers" || i3GEO.Interface.ATUAL === "googlemaps"){
146 i3GEO.janela.fechaAguarde(); 146 i3GEO.janela.fechaAguarde();
147 return; 147 return;
148 } 148 }
classesjs/classe_navega.js
@@ -599,6 +599,9 @@ i3GEO.navega = { @@ -599,6 +599,9 @@ i3GEO.navega = {
599 clearTimeout(i3GEO.navega.contaTempoRedesenho); 599 clearTimeout(i3GEO.navega.contaTempoRedesenho);
600 if(i3GEO.Interface.ATUAL === "openlayers") 600 if(i3GEO.Interface.ATUAL === "openlayers")
601 {i3GEO.Interface.openlayers.atualizaMapa();} 601 {i3GEO.Interface.openlayers.atualizaMapa();}
  602 + if(i3GEO.Interface.ATUAL === "googlemaps")
  603 + {i3GEO.Interface.googlemaps.redesenha();}
  604 +
602 else{ 605 else{
603 i3GEO.contadorAtualiza++; 606 i3GEO.contadorAtualiza++;
604 i3GEO.atualiza(""); 607 i3GEO.atualiza("");
@@ -798,6 +801,8 @@ i3GEO.navega = { @@ -798,6 +801,8 @@ i3GEO.navega = {
798 Ao ser chamada, essa função muda o modo atual, ativando ou desativando o entorno 801 Ao ser chamada, essa função muda o modo atual, ativando ou desativando o entorno
799 */ 802 */
800 ativaDesativa: function(){ 803 ativaDesativa: function(){
  804 + if(i3GEO.Interface.ATUAL === "googlemaps")
  805 + {alert("Essa operação não funciona nessa interface");return;}
801 if(i3GEO.Interface.ATUAL === "openlayers") 806 if(i3GEO.Interface.ATUAL === "openlayers")
802 {i3GEO.Interface.openlayers.inverteModoTile();return;} 807 {i3GEO.Interface.openlayers.inverteModoTile();return;}
803 var letras,l; 808 var letras,l;
classesjs/classe_php.js
@@ -481,6 +481,10 @@ i3GEO.php = { @@ -481,6 +481,10 @@ i3GEO.php = {
481 i3GEO.Interface.openlayers.pan2ponto(x,y); 481 i3GEO.Interface.openlayers.pan2ponto(x,y);
482 i3GEO.janela.fechaAguarde(); 482 i3GEO.janela.fechaAguarde();
483 } 483 }
  484 + if(i3GEO.Interface.ATUAL === "googlemaps"){
  485 + i3GEO.Interface.googlemaps.pan2ponto(x,y);
  486 + i3GEO.janela.fechaAguarde();
  487 + }
484 funcao.call(retorno); 488 funcao.call(retorno);
485 }; 489 };
486 var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=zoomponto&pin=pin&xy="+x+" "+y+"&g_sid="+i3GEO.configura.sid; 490 var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=zoomponto&pin=pin&xy="+x+" "+y+"&g_sid="+i3GEO.configura.sid;
@@ -848,6 +852,17 @@ i3GEO.php = { @@ -848,6 +852,17 @@ i3GEO.php = {
848 cpJSON.call(p,"montaFlamingo",funcao); 852 cpJSON.call(p,"montaFlamingo",funcao);
849 }, 853 },
850 /* 854 /*
  855 + Function: googlemaps
  856 +
  857 + <GOOGLEMAPS>
  858 + */
  859 + googlemaps: function(funcao){
  860 + i3GEO.php.verifica();
  861 + var p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=googlemaps&g_sid="+i3GEO.configura.sid;
  862 + cpJSON.call(p,"googlemaps",funcao);
  863 + },
  864 +
  865 + /*
851 Function: openlayers 866 Function: openlayers
852 867
853 <OPENLAYERS> 868 <OPENLAYERS>
classesphp/mapa_controle.php
@@ -253,6 +253,16 @@ Prepara o mapa atual para funcionar na interface openlayers. @@ -253,6 +253,16 @@ Prepara o mapa atual para funcionar na interface openlayers.
253 include_once("mapa_inicia.php"); 253 include_once("mapa_inicia.php");
254 iniciaMapa(); 254 iniciaMapa();
255 break; 255 break;
  256 +/*
  257 +Valor: GOOGLEMAPS
  258 +
  259 +Prepara o mapa atual para funcionar na interface googlemaps.
  260 +*/
  261 + case "GOOGLEMAPS":
  262 + $interface = "googlemaps";
  263 + include_once("mapa_inicia.php");
  264 + iniciaMapa();
  265 + break;
256 266
257 /* 267 /*
258 Section: Análise 268 Section: Análise
classesphp/mapa_googlemaps.php
@@ -67,10 +67,6 @@ $poPoint2-&gt;project($projInObj, $projOutObj); @@ -67,10 +67,6 @@ $poPoint2-&gt;project($projInObj, $projOutObj);
67 67
68 $_GET["BBOX"] = $poPoint1->x." ".$poPoint1->y." ".$poPoint2->x." ".$poPoint2->y; 68 $_GET["BBOX"] = $poPoint1->x." ".$poPoint1->y." ".$poPoint2->x." ".$poPoint2->y;
69 69
70 -  
71 -  
72 -  
73 -  
74 //echo $_GET["BBOX"]; 70 //echo $_GET["BBOX"];
75 $_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]); 71 $_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]);
76 $_GET["map_size"] = "256 256"; 72 $_GET["map_size"] = "256 256";
@@ -93,8 +89,8 @@ foreach ($layersNames as $layerName) @@ -93,8 +89,8 @@ foreach ($layersNames as $layerName)
93 include_once("funcoes_gerais.php"); 89 include_once("funcoes_gerais.php");
94 autoClasses(&$l,$mapa); 90 autoClasses(&$l,$mapa);
95 } 91 }
96 - //if($layerName != $_GET["layer"])  
97 - //{$l->set("status",MS_OFF);} 92 + if($layerName != $_GET["layer"])
  93 + {$l->set("status",MS_OFF);}
98 if($layerName == $_GET["layer"] || $l->group == $_GET["layer"] && $l->group != "") 94 if($layerName == $_GET["layer"] || $l->group == $_GET["layer"] && $l->group != "")
99 { 95 {
100 $l->set("status",MS_DEFAULT); 96 $l->set("status",MS_DEFAULT);
@@ -111,8 +107,9 @@ foreach ($layersNames as $layerName) @@ -111,8 +107,9 @@ foreach ($layersNames as $layerName)
111 {$l->set("connection",$postgis_mapa[$lcon]);} 107 {$l->set("connection",$postgis_mapa[$lcon]);}
112 } 108 }
113 } 109 }
114 -  
115 } 110 }
  111 + if($l->getProjection() == MS_FALSE)
  112 + {$l->setProjection("init=epsg:4291");}
116 } 113 }
117 if($layerName == $_GET["layer"]) 114 if($layerName == $_GET["layer"])
118 { 115 {
@@ -126,8 +123,8 @@ foreach ($layersNames as $layerName) @@ -126,8 +123,8 @@ foreach ($layersNames as $layerName)
126 } 123 }
127 $l->set("template","none.htm"); 124 $l->set("template","none.htm");
128 } 125 }
129 -//if($_GET["layer"] == "")  
130 -//{$cache = true;} 126 +if($_GET["layer"] == "")
  127 +{$cache = true;}
131 if($_GET == false) 128 if($_GET == false)
132 {$cache = false;} 129 {$cache = false;}
133 if($_GET["DESLIGACACHE"] == "sim") 130 if($_GET["DESLIGACACHE"] == "sim")
classesphp/mapa_inicia.php
@@ -137,7 +137,8 @@ function iniciaMapa() @@ -137,7 +137,8 @@ function iniciaMapa()
137 } 137 }
138 } 138 }
139 } 139 }
140 - $layer->setProjection("init=epsg:4291"); 140 + if($layer->getProjection() == MS_FALSE)
  141 + {$layer->setProjection("init=epsg:4291");}
141 } 142 }
142 $temp = $m->scalebar; 143 $temp = $m->scalebar;
143 $temp->set("status",MS_OFF); 144 $temp->set("status",MS_OFF);
menutemas/admin.db
No preview for this file type