Commit 10c70465734ec767fa5c093d75d463262b60a48a

Authored by Edmar Moretti
1 parent 0215f570

--no commit message

classesphp/classe_alteraclasse.php
... ... @@ -709,7 +709,7 @@ class Alteraclasse
709 709 {
710 710 $classe = $this->layer->getclass($i);
711 711 $numestilos = $classe->numstyles;
712   - $o = $i * $n;
  712 + $o = ($i * $n) + 5;
713 713 for($j=0;$j<$numestilos;++$j)
714 714 {
715 715 $estilo = $classe->getstyle($j);
... ...
classesphp/classe_atributos.php
... ... @@ -661,25 +661,22 @@ class Atributos
661 661 {
662 662 //error_reporting(0);
663 663 $resultado = array();
664   - if ($onde == "mapa")
665   - {
  664 + if ($onde == "mapa"){
666 665 $this->mapa = extPadrao($this->mapa);
667 666 }
668   - $ptvs = explode(",",$lista);
  667 + $ptvs = explode("|",$lista);
669 668 //monta a lista de temas que serao utilizados
670   - foreach ($ptvs as $p)
671   - {
672   - $pp = explode(";",$p);
  669 + foreach ($ptvs as $p){
  670 + $pp = explode(",",$p);
673 671 $temas[] = $pp[1];
674 672 }
675 673 $temas = array_unique($temas);
676 674 //monta a lista de itens por tema
677   - foreach ($temas as $tema)
678   - {
  675 + foreach ($temas as $tema){
679 676 $temp = array();
680 677 foreach ($ptvs as $p)
681 678 {
682   - $pp = explode(";",$p);
  679 + $pp = explode(",",$p);
683 680 if ($pp[1] == $tema)
684 681 {
685 682 $temp[] = $pp[0];
... ... @@ -689,30 +686,26 @@ class Atributos
689 686 }
690 687 $encontrado = "nao";
691 688 $palavra = trim($palavra);
692   - foreach ($temas as $tema)
693   - {
  689 + foreach ($temas as $tema){
694 690 $registros = array();
695 691 $items = $temasi[$tema];
696 692 $l = $this->mapa->getlayerbyname($tema);
697 693 $this->layer = $l;
698 694 $l->set("template","none.htm");
699   - if ($l->data == "")
700   - {
  695 + if ($l->data == ""){
701 696 return "Erro. O tema n&atilde;o tem tabela";
702 697 }
703   - if(strtoupper($l->getmetadata("convcaracter")) == "NAO")
704   - {
  698 + if(strtoupper($l->getmetadata("convcaracter")) == "NAO"){
705 699 $convC = false;
706 700 }
707   - else
708   - {$convC = true;
  701 + else{
  702 + $convC = true;
709 703 }
710 704 $filtro = $l->getfilterstring();
711 705 if ($filtro != ""){
712 706 $l->setfilter("");
713 707 }
714 708 $b = "&Aacute;&Atilde;&Otilde;&Oacute;&Ocirc;&aacute;&atilde;&acirc;&agrave;&oacute;&otilde;&ocirc;&ograve;&uacute;&ucirc;&iacute;&ecirc;&eacute;&ccedil;";
715   -
716 709 $trocas = "AAOOOaaaaoooouuieecAAOOOaaaaoooouuieecAAOOOaaaaoooouuieec";
717 710 $buscas = b.(html_entity_decode($b,ENT_NOQUOTES,'UTF8')).(html_entity_decode($b,ENT_NOQUOTES,'ISO8859-1'));
718 711 $sopen = $l->open();
... ... @@ -722,8 +715,7 @@ class Atributos
722 715 $prjMapa = $this->mapa->getProjection();
723 716 $prjTema = $l->getProjection();
724 717 $ret = $this->mapa->extent;
725   - if (($prjTema != "") && ($prjMapa != $prjTema))
726   - {
  718 + if (($prjTema != "") && ($prjMapa != $prjTema)) {
727 719 $projInObj = ms_newprojectionobj($prjTema);
728 720 $projOutObj = ms_newprojectionobj($prjMapa);
729 721 $status = $ret->project($projInObj, $projOutObj);
... ... @@ -731,12 +723,11 @@ class Atributos
731 723 $ret = $this->mapa->extent;
732 724 }
733 725 }
  726 +
734 727 $fr = array();
735   - if (@$l->queryByrect($ret) == MS_SUCCESS)
736   - {
  728 + if (@$l->queryByrect($ret) == MS_SUCCESS){
737 729 $res_count = $l->getNumresults();
738   - for ($i = 0; $i < $res_count; ++$i)
739   - {
  730 + for ($i = 0; $i < $res_count; ++$i) {
740 731 $valitem = array();
741 732 if($this->v == 6){
742 733 $shape = $l->getShape($l->getResult($i));
... ... @@ -749,11 +740,9 @@ class Atributos
749 740 }
750 741 $novoreg = array();
751 742 $r = array();
752   - foreach ($items as $item)
753   - {
  743 + foreach ($items as $item){
754 744 $v = trim($shape->values[$item]);
755   - if ($tipo == "exata")
756   - {
  745 + if ($tipo == "exata"){
757 746 if ($v == $palavra || (strtr($v,$buscas,$trocas) == strtr($palavra,$buscas,$trocas)))
758 747 {
759 748 if($convC == true)
... ... @@ -764,11 +753,8 @@ class Atributos
764 753 $encontrado = "sim";
765 754 }
766 755 }
767   - else
768   - {
769   -
770   - if (strtolower($v) == strtolower($palavra) || (stristr(strtr(strtolower($v),$buscas,$trocas),strtr(strtolower($palavra),$buscas,$trocas))))
771   - {
  756 + else{
  757 + if (strtolower($v) == strtolower($palavra) || (stristr(strtr(strtolower($v),$buscas,$trocas),strtr(strtolower($palavra),$buscas,$trocas)))){
772 758 if($convC == true){
773 759 $v = $this->converte($v);
774 760 }
... ... @@ -777,11 +763,9 @@ class Atributos
777 763 }
778 764 }
779 765 }
780   - if ($encontrado == "sim")
781   - {
  766 + if ($encontrado == "sim"){
782 767 $ret = $this->extensaoShape($shape,$l);
783   - if (($prjTema != "") && ($prjMapa != $prjTema))
784   - {
  768 + if (($prjTema != "") && ($prjMapa != $prjTema)){
785 769 $ret->project($projInObj, $projOutObj);
786 770 }
787 771 $novoreg["box"] = $ret;
... ...
classesphp/classe_mapa.php
... ... @@ -145,10 +145,10 @@ class Mapa
145 145 {
146 146 $metadata = $l->getmetadata("itembuscarapida");
147 147 if($metadata != ""){
148   - $lista[] = $metadata.";".$l->name;
  148 + $lista[] = $metadata.",".$l->name;
149 149 }
150 150 }
151   - return implode(",",$lista);
  151 + return implode("|",$lista);
152 152 }
153 153 /*
154 154 Method: mudaoutputformat
... ...
ferramentas/busca/index.js
... ... @@ -179,7 +179,7 @@ i3GEOF.busca = {
179 179 ins += ("<table class=lista >");
180 180 n = retorno.data.valores.length;
181 181 for (i=0;i<n; i++){
182   - ins += "<tr><td><input size=2 style='cursor:pointer;border:0px solid white;' name='"+retorno.data.valores[i].item+";"+retorno.data.valores[i].tema+"' type=checkbox /></td>";
  182 + ins += "<tr><td><input size=2 style='cursor:pointer;border:0px solid white;' name='"+retorno.data.valores[i].item+","+retorno.data.valores[i].tema+"' type=checkbox /></td>";
183 183 ins += "<td>&nbsp;"+retorno.data.valores[i].item+" - "+retorno.data.valores[i].tema+"</td></tr>";
184 184 }
185 185 ins += "</table>";
... ... @@ -229,10 +229,11 @@ i3GEOF.busca = {
229 229 if ($i("i3GEObuscaregiao").checked === true)
230 230 {onde = "regiao";}
231 231 palavra = i3GEO.util.removeAcentos(palavra);
232   - p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid+"&funcao=listavaloresitens&palavra="+palavra+"&lista="+listai.toString()+"&tipo="+tipo+"&onde="+onde+"&ext="+i3GEO.parametros.mapexten;
  232 + p = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?g_sid="+i3GEO.configura.sid;
233 233 cp = new cpaint();
234 234 cp.set_response_type("json");
235   - cp.call(p,"listavaloresitens",i3GEOF.busca.mostraBusca);
  235 + cp.set_transfer_mode('POST');
  236 + cp.call(p,"listavaloresitens",i3GEOF.busca.mostraBusca,"funcao=listavaloresitens","palavra="+palavra,"lista="+listai.toString(),"tipo="+tipo,"onde="+onde,"ext="+i3GEO.parametros.mapexten);
236 237 }
237 238 }
238 239 },
... ...
js/interface.js
... ... @@ -834,7 +834,7 @@ i3GEO.Interface =
834 834 res.push(layers.item(i));
835 835 }
836 836 }
837   - return res
  837 + return res;
838 838 };
839 839 i3geoOL.addLayers = function(lista) {
840 840 var n = lista.length, i;
... ... @@ -842,6 +842,15 @@ i3GEO.Interface =
842 842 this.addLayer(lista[i]);
843 843 }
844 844 };
  845 + i3geoOL.getLayersBy = function (chave, valor){
  846 + var res = [], layers = this.getLayers(), n = layers.getLength(), i;
  847 + for (i = 0; i < n; i++) {
  848 + if (layers.item(i)[chave] && layers.item(i)[chave] === valor) {
  849 + res.push(layers.item(i));
  850 + }
  851 + }
  852 + return res;
  853 + };
845 854 },
846 855 /**
847 856 * Monta o corpo do mapa e os componentes marginais
... ... @@ -867,11 +876,11 @@ i3GEO.Interface =
867 876 pz = new ol.control.Zoom(openlayers.ZOOM);
868 877 pz.setMap(i3geoOL);
869 878 }
870   - if (openlayers.GADGETS.ZoomSlider === true) {
  879 + if (openlayers.GADGETS.ZoomSlider === true && i3GEO.parametros.h > 600) {
871 880 pz = new ol.control.ZoomSlider(openlayers.ZOOMSLIDER);
872 881 pz.setMap(i3geoOL);
873 882 }
874   - if (openlayers.GADGETS.ScaleLine === true) {
  883 + if (openlayers.GADGETS.ScaleLine === true && i3GEO.parametros.h > 600) {
875 884 pz = new ol.control.ScaleLine(openlayers.SCALELINE);
876 885 pz.setMap(i3geoOL);
877 886 }
... ... @@ -880,6 +889,7 @@ i3GEO.Interface =
880 889 // insere a lista de layers de fundo
881 890 //
882 891 temp = $i("listaLayersBase");
  892 + // FIXME testar isso
883 893 if (temp && i3GEO.arvoreDeCamadas.INCLUILFUNDO === false) {
884 894 //
885 895 // torna false a variavel que pode permitir que as camadas de fundo
... ... @@ -910,34 +920,11 @@ i3GEO.Interface =
910 920 i3GEO.util.arvore("<b>" + $trad("p16") + "</b>", "listaLayersBase", temp);
911 921 } else {
912 922 if (openlayers.GADGETS.LayerSwitcher === true && i3GEO.arvoreDeCamadas.INCLUILFUNDO === false) {
913   - i3geoOL.addControl(new OpenLayers.Control.LayerSwitcher());
  923 + // nao existe no OL3
  924 + // i3geoOL.addControl(new OpenLayers.Control.LayerSwitcher());
914 925 }
915 926 }
916   - if (i3GEO.parametros.h < 600) {
917   - openlayers.GADGETS.PanZoomBar = false;
918   - openlayers.GADGETS.ScaleLine = false;
919   - }
920   - if (openlayers.GADGETS.ScaleLine === true) {
921   - pz = new OpenLayers.Control.ScaleLine();
922   - i3geoOL.addControl(pz);
923   - pz.div.style.left = i3GEO.Interface.BARRADEZOOMLEFT + 5 + "px";
924   - }
925   - if (openlayers.GADGETS.OverviewMap === true) {
926   - i3geoOL.addControl(new OpenLayers.Control.OverviewMap());
927   - }
928   -
929   - if (i3GEO.Interface.TABLET === false) {
930   - i3GEO.Interface.openlayers.OLpan = new OpenLayers.Control.Navigation();
931   -
932   - i3GEO.Interface.openlayers.OLzoom = new OpenLayers.Control.ZoomBox();
933   -
934   - i3GEO.Interface.openlayers.OLpanel = new OpenLayers.Control.Panel();
935   - i3GEO.Interface.openlayers.OLpanel.addControls([
936   - i3GEO.Interface.openlayers.OLpan, i3GEO.Interface.openlayers.OLzoom
937   - ]);
938   - i3geoOL.addControl(i3GEO.Interface.openlayers.OLpanel);
939 927  
940   - }
941 928 if (i3GEO.configura.mapaRefDisplay !== "none") {
942 929 if (i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")) {
943 930 i3GEO.configura.mapaRefDisplay = i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay");
... ... @@ -946,40 +933,18 @@ i3GEO.Interface =
946 933 i3GEO.maparef.inicia();
947 934 }
948 935 }
949   - // &eacute; necess&aacute;rio ativar nesse momento pois a barra
950   - // de botoes j&aacute; foi criada
951   - if (i3GEO.Interface.TABLET === false && i3GEO.Interface.openlayers.OLpanel) {
952   - i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan);
953   - }
954   - /**
955   - * @TODO lente nao funciona no OSM
956   - */
  936 + // FIXME lente nao funciona no OSM
957 937 if (i3GEO.Interface.openlayers.googleLike === true) {
958 938 i3GEO.barraDeBotoes.INCLUIBOTAO.lentei = false;
959 939 }
960 940 i3GEO.Interface.ativaBotoes();
961   - if (openlayers.GADGETS.PanZoomBar === true) {
962   - i3GEO.Interface.openlayers.OLpanzoombar = new OpenLayers.Control.PanZoomBar();
963   - i3geoOL.addControl(i3GEO.Interface.openlayers.OLpanzoombar);
964   - i3GEO.Interface.openlayers.OLpanzoombar.div.style.zIndex = 5000;
965   - i3GEO.Interface.openlayers.OLpanzoombar.div.style.top = i3GEO.Interface.BARRADEZOOMTOP + "px";
966   -
967   - i3GEO.Interface.openlayers.OLpanzoombar.div.style.left = i3GEO.Interface.BARRADEZOOMLEFT + "px";
968   - i3GEO.Interface.openlayers.OLpanzoombar.div.style.right = i3GEO.Interface.BARRADEZOOMRIGHT + "px";
969   - if (i3GEO.Interface.BARRADEZOOMLEFT === 0) {
970   - i3GEO.Interface.openlayers.OLpanzoombar.div.style.left = null;
971   - }
972   - if (i3GEO.Interface.BARRADEZOOMRIGHT === 0) {
973   - i3GEO.Interface.openlayers.OLpanzoombar.div.style.right = null;
974   - }
975   - }
976 941 };
977 942 if (i3GEO.arvoreDeCamadas.ATIVATEMA === "") {
978 943 i3GEO.arvoreDeCamadas.ATIVATEMA =
979 944 "i3GEO.Interface.ligaDesliga(this);i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS);";
980 945 }
981 946 montaMapa();
982   - return;
  947 +
983 948 i3GEO.coordenadas.mostraCoordenadas();
984 949 i3GEO.gadgets.mostraMenuSuspenso();
985 950 i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens);
... ... @@ -1010,7 +975,9 @@ i3GEO.Interface =
1010 975 // verifica se nas preferencias existem ferramentas que devem ser
1011 976 // abertas
1012 977 i3GEO.configura.iniciaFerramentas.executa();
1013   - i3GEO.Interface.openlayers.sobeLayersGraficos();
  978 +
  979 + // FIXME nao esta funcionando
  980 + // i3GEO.Interface.openlayers.sobeLayersGraficos();
1014 981 },
1015 982 /**
1016 983 * Aplica um valor de opacidade aos layers do mapa
... ... @@ -1275,7 +1242,7 @@ i3GEO.Interface =
1275 1242 matrixIds[z] = z;
1276 1243 }
1277 1244 // define a cor do fundo do mapa
1278   - //FIXME mudar a ferramenta que define o fundo
  1245 + // FIXME mudar a ferramenta que define o fundo
1279 1246 $i("openlayers").style.backgroundColor = "rgb(" + i3GEO.parametros.cordefundo + ")";
1280 1247  
1281 1248 // adiciona as camadas definidas em LAYERSADICIONAIS
... ... @@ -1292,13 +1259,6 @@ i3GEO.Interface =
1292 1259 preload : Infinity
1293 1260 // pode ser 0
1294 1261 };
1295   - // eventListeners : {
1296   - // "loadstart" : i3GEO.Interface.openlayers.loadStartLayer,
1297   - // "loadend" : i3GEO.Interface.openlayers.loadStopLayer
1298   - // }
1299   - /*
1300   - * var key = source.on('change', function() { if (source.getState() == 'ready') { source.unByKey(key); } });
1301   - */
1302 1262 for (i = nlayers - 1; i >= 0; i--) {
1303 1263 layer = "";
1304 1264 camada = i3GEO.arvoreDeCamadas.CAMADAS[i];
... ... @@ -1405,15 +1365,34 @@ i3GEO.Interface =
1405 1365 matrixIds : matrixIds
1406 1366 }),
1407 1367 wrapX : true
1408   - })
  1368 + });
  1369 + source.set("name",camada.name);
1409 1370 opcoes.source = source;
1410 1371 opcoes.title = camada.tema;
1411 1372 opcoes.name = camada.name;
1412 1373 opcoes.isBaseLayer = false;
1413 1374 opcoes.visible = true;
1414   - // opcoes.extent = ol.proj.get('EPSG:4326').getExtent();
  1375 + if(i3GEO.arvoreDeCamadas.BARRAPROGRESSO === true){
  1376 + source.on(
  1377 + 'tileloadstart',
  1378 + function(event) {
  1379 + i3GEO.Interface.openlayers.loadStartLayer(source.get("name"));
  1380 + }
  1381 + );
  1382 + source.on(
  1383 + 'tileloadend',
  1384 + function(event) {
  1385 + i3GEO.Interface.openlayers.loadStopLayer(source.get("name"));
  1386 + }
  1387 + );
  1388 + source.on(
  1389 + 'tileloaderror',
  1390 + function(event) {
  1391 + i3GEO.Interface.openlayers.loadStopLayer(source.get("name"));
  1392 + }
  1393 + );
  1394 + }
1415 1395 layer = new ol.layer.Tile(opcoes);
1416   - // console.warn(source.getTileGrid().getOrigin())
1417 1396 }
1418 1397 }
1419 1398 }
... ... @@ -1448,7 +1427,7 @@ i3GEO.Interface =
1448 1427 $i(i3GEO.Interface.IDMAPA).appendChild(temp);
1449 1428 }
1450 1429 }
1451   - //FIXME testar isso
  1430 + // FIXME testar isso
1452 1431 if (i3GEO.Interface.openlayers.LAYERFUNDO != "") {
1453 1432 i3GEO.Interface.openlayers.ativaFundo(i3GEO.Interface.openlayers.LAYERFUNDO);
1454 1433 }
... ... @@ -1510,11 +1489,11 @@ i3GEO.Interface =
1510 1489 /**
1511 1490 * Funcoes executadas quando um layer inicia o desenho
1512 1491 */
1513   - loadStartLayer : function(event) {
  1492 + loadStartLayer : function(name) {
1514 1493 var p = $i("i3GEOprogressoDiv");
1515   - if ($i("ArvoreTituloTema" + event.object.name)) {
1516   - i3GEO.Interface.STATUS.atualizando.push(event.object.name);
1517   - YAHOO.util.Dom.setStyle("ArvoreTituloTema" + event.object.name, "background", i3GEO.Interface.openlayers.FUNDOTEMA);
  1494 + if ($i("ArvoreTituloTema" + name)) {
  1495 + i3GEO.Interface.STATUS.atualizando.push(name);
  1496 + YAHOO.util.Dom.setStyle("ArvoreTituloTema" + name, "background", i3GEO.Interface.openlayers.FUNDOTEMA);
1518 1497 if (p) {
1519 1498 p.style.display = "block";
1520 1499 i3GEO.arvoreDeCamadas.progressBar.set('maxValue', i3GEO.Interface.STATUS.atualizando.length);
... ... @@ -1525,11 +1504,11 @@ i3GEO.Interface =
1525 1504 /**
1526 1505 * Funcoes executadas quando um layer e concluido
1527 1506 */
1528   - loadStopLayer : function(event) {
  1507 + loadStopLayer : function(name) {
1529 1508 var p = $i("i3GEOprogressoDiv");
1530   - i3GEO.Interface.STATUS.atualizando.remove(event.object.name);
1531   - if ($i("ArvoreTituloTema" + event.object.name)) {
1532   - YAHOO.util.Dom.setStyle("ArvoreTituloTema" + event.object.name, "background", "");
  1509 + i3GEO.Interface.STATUS.atualizando.remove(name);
  1510 + if ($i("ArvoreTituloTema" + name)) {
  1511 + YAHOO.util.Dom.setStyle("ArvoreTituloTema" + name, "background", "");
1533 1512 if (p) {
1534 1513 p.style.display = "block";
1535 1514 if (i3GEO.Interface.STATUS.atualizando.length > 0) {
... ...