Commit 9138c4bb7d07ce798c4bd02330d5f1a38ab05bba

Authored by Edmar Moretti
1 parent 1b65341b

--no commit message

ferramentas/googlemaps1/index.js
@@ -129,11 +129,6 @@ function inicializa(){ @@ -129,11 +129,6 @@ function inicializa(){
129 } 129 }
130 }); 130 });
131 if(i3GEO){ 131 if(i3GEO){
132 - /*  
133 - if(i3GEO.parametros.mapfile){  
134 - botaoI3geo();  
135 - }  
136 - */  
137 ondegoogle(map); 132 ondegoogle(map);
138 } 133 }
139 botaoRota(); 134 botaoRota();
ferramentas/graficointerativo1/index.js
@@ -969,7 +969,10 @@ i3GEOF.graficointerativo1 = @@ -969,7 +969,10 @@ i3GEOF.graficointerativo1 =
969 } 969 }
970 970
971 if (tema === "") { 971 if (tema === "") {
972 - i3GEO.janela.tempoMsg($trad('selecionaTema', i3GEOF.graficointerativo1.dicionario)); 972 + //pode ser que os dados tenham vindo de outra fonte
  973 + if($i(idjanela + "i3GEOgraficointerativo1Dados").innerHTML === ""){
  974 + i3GEO.janela.tempoMsg($trad('selecionaTema', i3GEOF.graficointerativo1.dicionario));
  975 + }
973 return; 976 return;
974 } 977 }
975 if (x === "") { 978 if (x === "") {
ferramentas/wkt2layer/index.js
@@ -89,16 +89,13 @@ i3GEOF.wkt2layer = @@ -89,16 +89,13 @@ i3GEOF.wkt2layer =
89 * Cria a janela flutuante para controle da ferramenta. 89 * Cria a janela flutuante para controle da ferramenta.
90 */ 90 */
91 iniciaJanelaFlutuante : function(wkt,texto) { 91 iniciaJanelaFlutuante : function(wkt,texto) {
92 - var minimiza, cabecalho, janela, divid, temp, titulo; 92 + var cabecalho, janela, divid, titulo;
93 93
94 if ($i("i3GEOF.wkt2layer")) { 94 if ($i("i3GEOF.wkt2layer")) {
95 return; 95 return;
96 } 96 }
97 cabecalho = function() { 97 cabecalho = function() {
98 }; 98 };
99 - minimiza = function() {  
100 - //i3GEO.janela.minimiza("i3GEOF.wkt2layer");  
101 - };  
102 // cria a janela flutuante 99 // cria a janela flutuante
103 titulo = "<div class='i3GeoTituloJanela'>" + $trad("wkt2layer",i3GEOF.wkt2layer.dicionario) + "</div>"; 100 titulo = "<div class='i3GeoTituloJanela'>" + $trad("wkt2layer",i3GEOF.wkt2layer.dicionario) + "</div>";
104 janela = 101 janela =
@@ -160,7 +157,7 @@ i3GEOF.wkt2layer = @@ -160,7 +157,7 @@ i3GEOF.wkt2layer =
160 if(i3GEOF.wkt2layer.aguarde.visibility === "visible") 157 if(i3GEOF.wkt2layer.aguarde.visibility === "visible")
161 {return;} 158 {return;}
162 i3GEOF.wkt2layer.aguarde.visibility = "visible"; 159 i3GEOF.wkt2layer.aguarde.visibility = "visible";
163 - var wkt,monta,par,p,nometema,temp,cp; 160 + var wkt,monta,par,p,cp;
164 monta = function(){ 161 monta = function(){
165 i3GEOF.wkt2layer.aguarde.visibility = "hidden"; 162 i3GEOF.wkt2layer.aguarde.visibility = "hidden";
166 i3GEO.atualiza(); 163 i3GEO.atualiza();
@@ -185,7 +182,7 @@ i3GEOF.wkt2layer = @@ -185,7 +182,7 @@ i3GEOF.wkt2layer =
185 if(i3GEOF.wkt2layer.aguarde.visibility === "visible") 182 if(i3GEOF.wkt2layer.aguarde.visibility === "visible")
186 {return;} 183 {return;}
187 i3GEOF.wkt2layer.aguarde.visibility = "visible"; 184 i3GEOF.wkt2layer.aguarde.visibility = "visible";
188 - var wkt,monta,par,p,nometema,temp,cp; 185 + var wkt,monta,par,p,cp;
189 monta = function(){ 186 monta = function(){
190 i3GEOF.wkt2layer.aguarde.visibility = "hidden"; 187 i3GEOF.wkt2layer.aguarde.visibility = "hidden";
191 i3GEO.atualiza(); 188 i3GEO.atualiza();
@@ -601,7 +601,7 @@ i3GEO.analise = @@ -601,7 +601,7 @@ i3GEO.analise =
601 } 601 }
602 }, 602 },
603 point : function(point) { 603 point : function(point) {
604 - var n, x1, y1, x2, y2, trecho, temp, circ, label, raio, pontoRaio, 604 + var n, x1, y1, x2, y2, trecho, temp, circ, label, raio,
605 estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao]; 605 estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao];
606 coord = point.getCoordinates(); 606 coord = point.getCoordinates();
607 total = 0; 607 total = 0;
@@ -629,6 +629,7 @@ i3GEO.analise = @@ -629,6 +629,7 @@ i3GEO.analise =
629 i3GEO.analise.medeDistancia.pontos.dist.push(trecho); 629 i3GEO.analise.medeDistancia.pontos.dist.push(trecho);
630 total = i3GEO.analise.medeDistancia.openlayers.somaDist(); 630 total = i3GEO.analise.medeDistancia.openlayers.somaDist();
631 i3GEO.analise.medeDistancia.openlayers.mostraTotal(trecho, total); 631 i3GEO.analise.medeDistancia.openlayers.mostraTotal(trecho, total);
  632 + i3GEO.analise.medeDistancia.ultimoWkt = i3GEO.analise.medeDistancia.pontos2wkt();
632 // raio 633 // raio
633 if ($i("pararraios") && $i("pararraios").checked === true) { 634 if ($i("pararraios") && $i("pararraios").checked === true) {
634 circ = new ol.Feature({ 635 circ = new ol.Feature({
@@ -682,25 +683,6 @@ i3GEO.analise = @@ -682,25 +683,6 @@ i3GEO.analise =
682 }) 683 })
683 ); 684 );
684 i3GEO.desenho.layergrafico.getSource().addFeature(label); 685 i3GEO.desenho.layergrafico.getSource().addFeature(label);
685 -  
686 - /*  
687 - label = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.Point(point.x, point.y), {  
688 - origem : "medeDistanciaExcluir"  
689 - }, {  
690 - graphicName : "square",  
691 - pointRadius : 3,  
692 - strokeColor : "black",  
693 - graphicOpacity : 1,  
694 - strokeWidth : 1,  
695 - fillColor : "white",  
696 - label : trecho.toFixed(3),  
697 - labelAlign : "rb",  
698 - fontColor : estilo.textcolor,  
699 - fontSize : 12,  
700 - fontWeight : "bold"  
701 - });  
702 - */  
703 -  
704 } 686 }
705 } 687 }
706 }, 688 },
js/barradebotoes.js
@@ -1010,6 +1010,7 @@ i3GEO.barraDeBotoes = @@ -1010,6 +1010,7 @@ i3GEO.barraDeBotoes =
1010 // a barra j&aacute; foi expandida 1010 // a barra j&aacute; foi expandida
1011 if (nb !== i3GEO.barraDeBotoes.MAXBOTOES) { 1011 if (nb !== i3GEO.barraDeBotoes.MAXBOTOES) {
1012 i3GEO.barraDeBotoes.recria(); 1012 i3GEO.barraDeBotoes.recria();
  1013 + return;
1013 } 1014 }
1014 if (i3GEO.barraDeBotoes.MAXBOTOES > 0 && n > nb) { 1015 if (i3GEO.barraDeBotoes.MAXBOTOES > 0 && n > nb) {
1015 for (i = nb; i < n; i += 1) { 1016 for (i = nb; i < n; i += 1) {
@@ -294,7 +294,7 @@ i3GEO.desenho = @@ -294,7 +294,7 @@ i3GEO.desenho =
294 } 294 }
295 }, 295 },
296 addBox : function(xmin, ymin, xmax, ymax, namespace, strokeColor, strokeWidth) { 296 addBox : function(xmin, ymin, xmax, ymax, namespace, strokeColor, strokeWidth) {
297 - var bounds, f; 297 + var pol, f;
298 if (!namespace) { 298 if (!namespace) {
299 namespace = "box"; 299 namespace = "box";
300 } 300 }
@@ -305,31 +305,34 @@ i3GEO.desenho = @@ -305,31 +305,34 @@ i3GEO.desenho =
305 strokeWidth = 2; 305 strokeWidth = 2;
306 } 306 }
307 i3GEO.desenho.openlayers.inicia(); 307 i3GEO.desenho.openlayers.inicia();
308 - bounds = OpenLayers.Bounds.fromArray([  
309 - xmin, ymin, xmax, ymax  
310 - ]);  
311 - bounds = bounds.toGeometry();  
312 - bounds = i3GEO.util.extGeo2OSM(bounds);  
313 - f = new OpenLayers.Feature.Vector(bounds, { 308 + xmin = xmin * 1;
  309 + ymin = ymin * 1;
  310 + xmax = xmax * 1;
  311 + ymax = ymax * 1;
  312 + pol = new ol.geom.Polygon([[[xmin,ymin],[xmin,ymax],[xmax,ymax],[xmax,ymin],[xmin,ymin]]]);
  313 + pol = i3GEO.util.extGeo2OSM(pol);
  314 + f = new ol.Feature({
  315 + geometry: pol
  316 + });
  317 + f.setStyle(
  318 + new ol.style.Style({
  319 + stroke: new ol.style.Stroke({
  320 + color: strokeColor,
  321 + width: strokeWidth
  322 + })
  323 + })
  324 + );
  325 + f.setProperties({
314 origem : namespace 326 origem : namespace
315 - }, {  
316 - fill : false,  
317 - strokeColor : strokeColor,  
318 - strokeWidth : strokeWidth  
319 }); 327 });
320 - i3GEO.desenho.layergrafico.addFeatures([  
321 - f  
322 - ]); 328 + i3GEO.desenho.layergrafico.getSource().addFeature(f);
323 return f; 329 return f;
324 }, 330 },
325 moveBox : function(box, xmin, ymin, xmax, ymax) { 331 moveBox : function(box, xmin, ymin, xmax, ymax) {
326 - i3GEO.desenho.layergrafico.removeFeatures(box);  
327 - var namespace = box["attributes"].origem, strokeWidth = box["style"].strokeWidth, strokeColor = box["style"].strokeColor;  
328 - box = i3GEO.desenho.addBox(xmin, ymin, xmax, ymax, namespace, strokeColor, strokeWidth); 332 + box.getGeometry().setCoordinates([[[xmin,ymin],[xmin,ymax],[xmax,ymax],[xmax,ymin],[xmin,ymin]]]);
329 return box; 333 return box;
330 }, 334 },
331 addPin : function(x, y, w, h, imagem, namespace, centro, funcaoclick) { 335 addPin : function(x, y, w, h, imagem, namespace, centro, funcaoclick) {
332 - return;  
333 if (!imagem || imagem === "") { 336 if (!imagem || imagem === "") {
334 imagem = i3GEO.configura.locaplic + "/imagens/google/confluence.png"; 337 imagem = i3GEO.configura.locaplic + "/imagens/google/confluence.png";
335 } 338 }
@@ -353,46 +356,53 @@ i3GEO.desenho = @@ -353,46 +356,53 @@ i3GEO.desenho =
353 i3GEO.desenho.openlayers.inicia(); 356 i3GEO.desenho.openlayers.inicia();
354 var point, f, ox, oy; 357 var point, f, ox, oy;
355 if (centro === true) { 358 if (centro === true) {
356 - ox = parseInt(w / 2, 10) * -1;  
357 - oy = parseInt(h / 2, 10) * -1; 359 + ox = 0.5;
  360 + oy = 0.5;
358 } else { 361 } else {
359 - ox = parseInt(w / 2, 10) * -1;  
360 - oy = h * -1; 362 + ox = 0.5;
  363 + oy = 1;
361 } 364 }
362 - point = new OpenLayers.Geometry.Point(x, y); 365 + point = new ol.geom.Point([x, y]);
363 point = i3GEO.util.extGeo2OSM(point); 366 point = i3GEO.util.extGeo2OSM(point);
364 - f = new OpenLayers.Feature.Vector(point, {  
365 - origem : namespace,  
366 - click : funcaoclick  
367 - }, {  
368 - graphicWidth : w,  
369 - graphicHeight : h,  
370 - graphicXOffset : ox,  
371 - graphicYOffset : oy,  
372 - externalGraphic : imagem 367 +
  368 + f = new ol.Feature({
  369 + geometry: point
  370 + });
  371 + f.setProperties({
  372 + origem : namespace
373 }); 373 });
374 - i3GEO.desenho.layergrafico.addFeatures([  
375 - f  
376 - ]); 374 + f.setStyle(
  375 + new ol.style.Style({
  376 + image: new ol.style.Icon({
  377 + src : imagem,
  378 + size: [w,h],
  379 + anchor: [ox,oy]
  380 + })
  381 + })
  382 + );
  383 + //FIXME como incluir o evento click?
  384 + //f.on('click',funcaoclick);
  385 + i3GEO.desenho.layergrafico.getSource().addFeature(f);
377 return f; 386 return f;
378 }, 387 },
379 removePins : function(namespace) { 388 removePins : function(namespace) {
380 - return;  
381 if (!namespace) { 389 if (!namespace) {
382 namespace = "pin"; 390 namespace = "pin";
383 } 391 }
384 if (i3GEO.desenho.layergrafico) { 392 if (i3GEO.desenho.layergrafico) {
385 - var f = i3GEO.desenho.layergrafico.getFeaturesByAttribute("origem", namespace);  
386 - if (f && f.length > 0) {  
387 - i3GEO.desenho.layergrafico.destroyFeatures(f); 393 + var features, n, f, i;
  394 + features = i3GEO.desenho.layergrafico.getSource().getFeatures();
  395 + n = features.length;
  396 + for (i = 0; i < n; i++) {
  397 + f = features[i];
  398 + if (f && f.getProperties().origem === namespace) {
  399 + i3GEO.desenho.layergrafico.getSource().removeFeature(f);
  400 + }
388 } 401 }
389 } 402 }
390 }, 403 },
391 movePin : function(pin, x, y) { 404 movePin : function(pin, x, y) {
392 - return;  
393 - var point = new OpenLayers.LonLat(x, y);  
394 - point = i3GEO.util.extGeo2OSM(point);  
395 - pin.move(point); 405 + pin.getGeometry().setCoordinates([x,y]);
396 }, 406 },
397 criaLayerGrafico : function() { 407 criaLayerGrafico : function() {
398 if (!i3GEO.desenho.layergrafico) { 408 if (!i3GEO.desenho.layergrafico) {
js/interface.js
@@ -924,6 +924,10 @@ i3GEO.Interface = @@ -924,6 +924,10 @@ i3GEO.Interface =
924 "lat" : c[1] 924 "lat" : c[1]
925 }; 925 };
926 }; 926 };
  927 + i3geoOL.getZoom = function() {
  928 + var c = this.getView().getZoom();
  929 + return c;
  930 + };
927 i3geoOL.getExtent = function() { 931 i3geoOL.getExtent = function() {
928 var e = this.getView().calculateExtent(this.getSize()); 932 var e = this.getView().calculateExtent(this.getSize());
929 return { 933 return {
@@ -1002,12 +1002,17 @@ i3GEO.navega = @@ -1002,12 +1002,17 @@ i3GEO.navega =
1002 if (typeof (console) !== 'undefined') 1002 if (typeof (console) !== 'undefined')
1003 console.info("i3GEO.navega.dialogo.google()"); 1003 console.info("i3GEO.navega.dialogo.google()");
1004 1004
1005 - //i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle()"]);  
1006 - var idgoogle = "googlemaps" + Math.random();  
1007 - i3GEO.janela.cria((i3GEO.parametros.w / 2.5) + 25 + "px", (i3GEO.parametros.h / 2.5) + 18 + "px", i3GEO.configura.locaplic 1005 + var temp, janela, idgoogle = "googlemaps" + Math.random();
  1006 + janela = i3GEO.janela.cria((i3GEO.parametros.w / 2.5) + 25 + "px", (i3GEO.parametros.h / 2.5) + 18 + "px", i3GEO.configura.locaplic
1008 + "/ferramentas/googlemaps1/index.php", "", "", "<div class='i3GeoTituloJanela'>Google maps<a class=ajuda_usuario target=_blank href='" 1007 + "/ferramentas/googlemaps1/index.php", "", "", "<div class='i3GeoTituloJanela'>Google maps<a class=ajuda_usuario target=_blank href='"
1009 + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=7&idajuda=68' ><b> </b></a></div>", idgoogle); 1008 + i3GEO.configura.locaplic + "/ajuda_usuario.php?idcategoria=7&idajuda=68' ><b> </b></a></div>", idgoogle);
1010 - i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle('"+idgoogle+"')"]); 1009 +
  1010 + temp = function() {
  1011 + i3GEO.desenho.removePins("boxOndeGoogle");
  1012 + i3GEO.desenho.removePins("googlemaps");
  1013 + };
  1014 + YAHOO.util.Event.addListener(janela[0].close, "click", temp);
  1015 + //i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle('"+idgoogle+"')"]);
1011 }, 1016 },
1012 /** 1017 /**
1013 * Function: confluence 1018 * Function: confluence