Commit 9138c4bb7d07ce798c4bd02330d5f1a38ab05bba
1 parent
1b65341b
Exists in
master
and in
7 other branches
--no commit message
Showing
8 changed files
with
76 additions
and
79 deletions
Show diff stats
ferramentas/googlemaps1/index.js
ferramentas/graficointerativo1/index.js
| ... | ... | @@ -969,7 +969,10 @@ i3GEOF.graficointerativo1 = |
| 969 | 969 | } |
| 970 | 970 | |
| 971 | 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 | 976 | return; |
| 974 | 977 | } |
| 975 | 978 | if (x === "") { | ... | ... |
ferramentas/wkt2layer/index.js
| ... | ... | @@ -89,16 +89,13 @@ i3GEOF.wkt2layer = |
| 89 | 89 | * Cria a janela flutuante para controle da ferramenta. |
| 90 | 90 | */ |
| 91 | 91 | iniciaJanelaFlutuante : function(wkt,texto) { |
| 92 | - var minimiza, cabecalho, janela, divid, temp, titulo; | |
| 92 | + var cabecalho, janela, divid, titulo; | |
| 93 | 93 | |
| 94 | 94 | if ($i("i3GEOF.wkt2layer")) { |
| 95 | 95 | return; |
| 96 | 96 | } |
| 97 | 97 | cabecalho = function() { |
| 98 | 98 | }; |
| 99 | - minimiza = function() { | |
| 100 | - //i3GEO.janela.minimiza("i3GEOF.wkt2layer"); | |
| 101 | - }; | |
| 102 | 99 | // cria a janela flutuante |
| 103 | 100 | titulo = "<div class='i3GeoTituloJanela'>" + $trad("wkt2layer",i3GEOF.wkt2layer.dicionario) + "</div>"; |
| 104 | 101 | janela = |
| ... | ... | @@ -160,7 +157,7 @@ i3GEOF.wkt2layer = |
| 160 | 157 | if(i3GEOF.wkt2layer.aguarde.visibility === "visible") |
| 161 | 158 | {return;} |
| 162 | 159 | i3GEOF.wkt2layer.aguarde.visibility = "visible"; |
| 163 | - var wkt,monta,par,p,nometema,temp,cp; | |
| 160 | + var wkt,monta,par,p,cp; | |
| 164 | 161 | monta = function(){ |
| 165 | 162 | i3GEOF.wkt2layer.aguarde.visibility = "hidden"; |
| 166 | 163 | i3GEO.atualiza(); |
| ... | ... | @@ -185,7 +182,7 @@ i3GEOF.wkt2layer = |
| 185 | 182 | if(i3GEOF.wkt2layer.aguarde.visibility === "visible") |
| 186 | 183 | {return;} |
| 187 | 184 | i3GEOF.wkt2layer.aguarde.visibility = "visible"; |
| 188 | - var wkt,monta,par,p,nometema,temp,cp; | |
| 185 | + var wkt,monta,par,p,cp; | |
| 189 | 186 | monta = function(){ |
| 190 | 187 | i3GEOF.wkt2layer.aguarde.visibility = "hidden"; |
| 191 | 188 | i3GEO.atualiza(); | ... | ... |
js/analise.js
| ... | ... | @@ -601,7 +601,7 @@ i3GEO.analise = |
| 601 | 601 | } |
| 602 | 602 | }, |
| 603 | 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 | 605 | estilo = i3GEO.desenho.estilos[i3GEO.desenho.estiloPadrao]; |
| 606 | 606 | coord = point.getCoordinates(); |
| 607 | 607 | total = 0; |
| ... | ... | @@ -629,6 +629,7 @@ i3GEO.analise = |
| 629 | 629 | i3GEO.analise.medeDistancia.pontos.dist.push(trecho); |
| 630 | 630 | total = i3GEO.analise.medeDistancia.openlayers.somaDist(); |
| 631 | 631 | i3GEO.analise.medeDistancia.openlayers.mostraTotal(trecho, total); |
| 632 | + i3GEO.analise.medeDistancia.ultimoWkt = i3GEO.analise.medeDistancia.pontos2wkt(); | |
| 632 | 633 | // raio |
| 633 | 634 | if ($i("pararraios") && $i("pararraios").checked === true) { |
| 634 | 635 | circ = new ol.Feature({ |
| ... | ... | @@ -682,25 +683,6 @@ i3GEO.analise = |
| 682 | 683 | }) |
| 683 | 684 | ); |
| 684 | 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 | 1010 | // a barra já foi expandida |
| 1011 | 1011 | if (nb !== i3GEO.barraDeBotoes.MAXBOTOES) { |
| 1012 | 1012 | i3GEO.barraDeBotoes.recria(); |
| 1013 | + return; | |
| 1013 | 1014 | } |
| 1014 | 1015 | if (i3GEO.barraDeBotoes.MAXBOTOES > 0 && n > nb) { |
| 1015 | 1016 | for (i = nb; i < n; i += 1) { | ... | ... |
js/desenho.js
| ... | ... | @@ -294,7 +294,7 @@ i3GEO.desenho = |
| 294 | 294 | } |
| 295 | 295 | }, |
| 296 | 296 | addBox : function(xmin, ymin, xmax, ymax, namespace, strokeColor, strokeWidth) { |
| 297 | - var bounds, f; | |
| 297 | + var pol, f; | |
| 298 | 298 | if (!namespace) { |
| 299 | 299 | namespace = "box"; |
| 300 | 300 | } |
| ... | ... | @@ -305,31 +305,34 @@ i3GEO.desenho = |
| 305 | 305 | strokeWidth = 2; |
| 306 | 306 | } |
| 307 | 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 | 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 | 329 | return f; |
| 324 | 330 | }, |
| 325 | 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 | 333 | return box; |
| 330 | 334 | }, |
| 331 | 335 | addPin : function(x, y, w, h, imagem, namespace, centro, funcaoclick) { |
| 332 | - return; | |
| 333 | 336 | if (!imagem || imagem === "") { |
| 334 | 337 | imagem = i3GEO.configura.locaplic + "/imagens/google/confluence.png"; |
| 335 | 338 | } |
| ... | ... | @@ -353,46 +356,53 @@ i3GEO.desenho = |
| 353 | 356 | i3GEO.desenho.openlayers.inicia(); |
| 354 | 357 | var point, f, ox, oy; |
| 355 | 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 | 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 | 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 | 386 | return f; |
| 378 | 387 | }, |
| 379 | 388 | removePins : function(namespace) { |
| 380 | - return; | |
| 381 | 389 | if (!namespace) { |
| 382 | 390 | namespace = "pin"; |
| 383 | 391 | } |
| 384 | 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 | 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 | 407 | criaLayerGrafico : function() { |
| 398 | 408 | if (!i3GEO.desenho.layergrafico) { | ... | ... |
js/interface.js
| ... | ... | @@ -924,6 +924,10 @@ i3GEO.Interface = |
| 924 | 924 | "lat" : c[1] |
| 925 | 925 | }; |
| 926 | 926 | }; |
| 927 | + i3geoOL.getZoom = function() { | |
| 928 | + var c = this.getView().getZoom(); | |
| 929 | + return c; | |
| 930 | + }; | |
| 927 | 931 | i3geoOL.getExtent = function() { |
| 928 | 932 | var e = this.getView().calculateExtent(this.getSize()); |
| 929 | 933 | return { | ... | ... |
js/navega.js
| ... | ... | @@ -1002,12 +1002,17 @@ i3GEO.navega = |
| 1002 | 1002 | if (typeof (console) !== 'undefined') |
| 1003 | 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 | 1007 | + "/ferramentas/googlemaps1/index.php", "", "", "<div class='i3GeoTituloJanela'>Google maps<a class=ajuda_usuario target=_blank href='" |
| 1009 | 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 | 1018 | * Function: confluence | ... | ... |