Commit 10c70465734ec767fa5c093d75d463262b60a48a
1 parent
0215f570
Exists in
master
and in
7 other branches
--no commit message
Showing
5 changed files
with
80 additions
and
116 deletions
Show diff stats
classesphp/classe_alteraclasse.php
@@ -709,7 +709,7 @@ class Alteraclasse | @@ -709,7 +709,7 @@ class Alteraclasse | ||
709 | { | 709 | { |
710 | $classe = $this->layer->getclass($i); | 710 | $classe = $this->layer->getclass($i); |
711 | $numestilos = $classe->numstyles; | 711 | $numestilos = $classe->numstyles; |
712 | - $o = $i * $n; | 712 | + $o = ($i * $n) + 5; |
713 | for($j=0;$j<$numestilos;++$j) | 713 | for($j=0;$j<$numestilos;++$j) |
714 | { | 714 | { |
715 | $estilo = $classe->getstyle($j); | 715 | $estilo = $classe->getstyle($j); |
classesphp/classe_atributos.php
@@ -661,25 +661,22 @@ class Atributos | @@ -661,25 +661,22 @@ class Atributos | ||
661 | { | 661 | { |
662 | //error_reporting(0); | 662 | //error_reporting(0); |
663 | $resultado = array(); | 663 | $resultado = array(); |
664 | - if ($onde == "mapa") | ||
665 | - { | 664 | + if ($onde == "mapa"){ |
666 | $this->mapa = extPadrao($this->mapa); | 665 | $this->mapa = extPadrao($this->mapa); |
667 | } | 666 | } |
668 | - $ptvs = explode(",",$lista); | 667 | + $ptvs = explode("|",$lista); |
669 | //monta a lista de temas que serao utilizados | 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 | $temas[] = $pp[1]; | 671 | $temas[] = $pp[1]; |
674 | } | 672 | } |
675 | $temas = array_unique($temas); | 673 | $temas = array_unique($temas); |
676 | //monta a lista de itens por tema | 674 | //monta a lista de itens por tema |
677 | - foreach ($temas as $tema) | ||
678 | - { | 675 | + foreach ($temas as $tema){ |
679 | $temp = array(); | 676 | $temp = array(); |
680 | foreach ($ptvs as $p) | 677 | foreach ($ptvs as $p) |
681 | { | 678 | { |
682 | - $pp = explode(";",$p); | 679 | + $pp = explode(",",$p); |
683 | if ($pp[1] == $tema) | 680 | if ($pp[1] == $tema) |
684 | { | 681 | { |
685 | $temp[] = $pp[0]; | 682 | $temp[] = $pp[0]; |
@@ -689,30 +686,26 @@ class Atributos | @@ -689,30 +686,26 @@ class Atributos | ||
689 | } | 686 | } |
690 | $encontrado = "nao"; | 687 | $encontrado = "nao"; |
691 | $palavra = trim($palavra); | 688 | $palavra = trim($palavra); |
692 | - foreach ($temas as $tema) | ||
693 | - { | 689 | + foreach ($temas as $tema){ |
694 | $registros = array(); | 690 | $registros = array(); |
695 | $items = $temasi[$tema]; | 691 | $items = $temasi[$tema]; |
696 | $l = $this->mapa->getlayerbyname($tema); | 692 | $l = $this->mapa->getlayerbyname($tema); |
697 | $this->layer = $l; | 693 | $this->layer = $l; |
698 | $l->set("template","none.htm"); | 694 | $l->set("template","none.htm"); |
699 | - if ($l->data == "") | ||
700 | - { | 695 | + if ($l->data == ""){ |
701 | return "Erro. O tema não tem tabela"; | 696 | return "Erro. O tema não tem tabela"; |
702 | } | 697 | } |
703 | - if(strtoupper($l->getmetadata("convcaracter")) == "NAO") | ||
704 | - { | 698 | + if(strtoupper($l->getmetadata("convcaracter")) == "NAO"){ |
705 | $convC = false; | 699 | $convC = false; |
706 | } | 700 | } |
707 | - else | ||
708 | - {$convC = true; | 701 | + else{ |
702 | + $convC = true; | ||
709 | } | 703 | } |
710 | $filtro = $l->getfilterstring(); | 704 | $filtro = $l->getfilterstring(); |
711 | if ($filtro != ""){ | 705 | if ($filtro != ""){ |
712 | $l->setfilter(""); | 706 | $l->setfilter(""); |
713 | } | 707 | } |
714 | $b = "ÁÃÕÓÔáãâàóõôòúûíêéç"; | 708 | $b = "ÁÃÕÓÔáãâàóõôòúûíêéç"; |
715 | - | ||
716 | $trocas = "AAOOOaaaaoooouuieecAAOOOaaaaoooouuieecAAOOOaaaaoooouuieec"; | 709 | $trocas = "AAOOOaaaaoooouuieecAAOOOaaaaoooouuieecAAOOOaaaaoooouuieec"; |
717 | $buscas = b.(html_entity_decode($b,ENT_NOQUOTES,'UTF8')).(html_entity_decode($b,ENT_NOQUOTES,'ISO8859-1')); | 710 | $buscas = b.(html_entity_decode($b,ENT_NOQUOTES,'UTF8')).(html_entity_decode($b,ENT_NOQUOTES,'ISO8859-1')); |
718 | $sopen = $l->open(); | 711 | $sopen = $l->open(); |
@@ -722,8 +715,7 @@ class Atributos | @@ -722,8 +715,7 @@ class Atributos | ||
722 | $prjMapa = $this->mapa->getProjection(); | 715 | $prjMapa = $this->mapa->getProjection(); |
723 | $prjTema = $l->getProjection(); | 716 | $prjTema = $l->getProjection(); |
724 | $ret = $this->mapa->extent; | 717 | $ret = $this->mapa->extent; |
725 | - if (($prjTema != "") && ($prjMapa != $prjTema)) | ||
726 | - { | 718 | + if (($prjTema != "") && ($prjMapa != $prjTema)) { |
727 | $projInObj = ms_newprojectionobj($prjTema); | 719 | $projInObj = ms_newprojectionobj($prjTema); |
728 | $projOutObj = ms_newprojectionobj($prjMapa); | 720 | $projOutObj = ms_newprojectionobj($prjMapa); |
729 | $status = $ret->project($projInObj, $projOutObj); | 721 | $status = $ret->project($projInObj, $projOutObj); |
@@ -731,12 +723,11 @@ class Atributos | @@ -731,12 +723,11 @@ class Atributos | ||
731 | $ret = $this->mapa->extent; | 723 | $ret = $this->mapa->extent; |
732 | } | 724 | } |
733 | } | 725 | } |
726 | + | ||
734 | $fr = array(); | 727 | $fr = array(); |
735 | - if (@$l->queryByrect($ret) == MS_SUCCESS) | ||
736 | - { | 728 | + if (@$l->queryByrect($ret) == MS_SUCCESS){ |
737 | $res_count = $l->getNumresults(); | 729 | $res_count = $l->getNumresults(); |
738 | - for ($i = 0; $i < $res_count; ++$i) | ||
739 | - { | 730 | + for ($i = 0; $i < $res_count; ++$i) { |
740 | $valitem = array(); | 731 | $valitem = array(); |
741 | if($this->v == 6){ | 732 | if($this->v == 6){ |
742 | $shape = $l->getShape($l->getResult($i)); | 733 | $shape = $l->getShape($l->getResult($i)); |
@@ -749,11 +740,9 @@ class Atributos | @@ -749,11 +740,9 @@ class Atributos | ||
749 | } | 740 | } |
750 | $novoreg = array(); | 741 | $novoreg = array(); |
751 | $r = array(); | 742 | $r = array(); |
752 | - foreach ($items as $item) | ||
753 | - { | 743 | + foreach ($items as $item){ |
754 | $v = trim($shape->values[$item]); | 744 | $v = trim($shape->values[$item]); |
755 | - if ($tipo == "exata") | ||
756 | - { | 745 | + if ($tipo == "exata"){ |
757 | if ($v == $palavra || (strtr($v,$buscas,$trocas) == strtr($palavra,$buscas,$trocas))) | 746 | if ($v == $palavra || (strtr($v,$buscas,$trocas) == strtr($palavra,$buscas,$trocas))) |
758 | { | 747 | { |
759 | if($convC == true) | 748 | if($convC == true) |
@@ -764,11 +753,8 @@ class Atributos | @@ -764,11 +753,8 @@ class Atributos | ||
764 | $encontrado = "sim"; | 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 | if($convC == true){ | 758 | if($convC == true){ |
773 | $v = $this->converte($v); | 759 | $v = $this->converte($v); |
774 | } | 760 | } |
@@ -777,11 +763,9 @@ class Atributos | @@ -777,11 +763,9 @@ class Atributos | ||
777 | } | 763 | } |
778 | } | 764 | } |
779 | } | 765 | } |
780 | - if ($encontrado == "sim") | ||
781 | - { | 766 | + if ($encontrado == "sim"){ |
782 | $ret = $this->extensaoShape($shape,$l); | 767 | $ret = $this->extensaoShape($shape,$l); |
783 | - if (($prjTema != "") && ($prjMapa != $prjTema)) | ||
784 | - { | 768 | + if (($prjTema != "") && ($prjMapa != $prjTema)){ |
785 | $ret->project($projInObj, $projOutObj); | 769 | $ret->project($projInObj, $projOutObj); |
786 | } | 770 | } |
787 | $novoreg["box"] = $ret; | 771 | $novoreg["box"] = $ret; |
classesphp/classe_mapa.php
@@ -145,10 +145,10 @@ class Mapa | @@ -145,10 +145,10 @@ class Mapa | ||
145 | { | 145 | { |
146 | $metadata = $l->getmetadata("itembuscarapida"); | 146 | $metadata = $l->getmetadata("itembuscarapida"); |
147 | if($metadata != ""){ | 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 | Method: mudaoutputformat | 154 | Method: mudaoutputformat |
ferramentas/busca/index.js
@@ -179,7 +179,7 @@ i3GEOF.busca = { | @@ -179,7 +179,7 @@ i3GEOF.busca = { | ||
179 | ins += ("<table class=lista >"); | 179 | ins += ("<table class=lista >"); |
180 | n = retorno.data.valores.length; | 180 | n = retorno.data.valores.length; |
181 | for (i=0;i<n; i++){ | 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 | ins += "<td> "+retorno.data.valores[i].item+" - "+retorno.data.valores[i].tema+"</td></tr>"; | 183 | ins += "<td> "+retorno.data.valores[i].item+" - "+retorno.data.valores[i].tema+"</td></tr>"; |
184 | } | 184 | } |
185 | ins += "</table>"; | 185 | ins += "</table>"; |
@@ -229,10 +229,11 @@ i3GEOF.busca = { | @@ -229,10 +229,11 @@ i3GEOF.busca = { | ||
229 | if ($i("i3GEObuscaregiao").checked === true) | 229 | if ($i("i3GEObuscaregiao").checked === true) |
230 | {onde = "regiao";} | 230 | {onde = "regiao";} |
231 | palavra = i3GEO.util.removeAcentos(palavra); | 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 | cp = new cpaint(); | 233 | cp = new cpaint(); |
234 | cp.set_response_type("json"); | 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,7 +834,7 @@ i3GEO.Interface = | ||
834 | res.push(layers.item(i)); | 834 | res.push(layers.item(i)); |
835 | } | 835 | } |
836 | } | 836 | } |
837 | - return res | 837 | + return res; |
838 | }; | 838 | }; |
839 | i3geoOL.addLayers = function(lista) { | 839 | i3geoOL.addLayers = function(lista) { |
840 | var n = lista.length, i; | 840 | var n = lista.length, i; |
@@ -842,6 +842,15 @@ i3GEO.Interface = | @@ -842,6 +842,15 @@ i3GEO.Interface = | ||
842 | this.addLayer(lista[i]); | 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 | * Monta o corpo do mapa e os componentes marginais | 856 | * Monta o corpo do mapa e os componentes marginais |
@@ -867,11 +876,11 @@ i3GEO.Interface = | @@ -867,11 +876,11 @@ i3GEO.Interface = | ||
867 | pz = new ol.control.Zoom(openlayers.ZOOM); | 876 | pz = new ol.control.Zoom(openlayers.ZOOM); |
868 | pz.setMap(i3geoOL); | 877 | pz.setMap(i3geoOL); |
869 | } | 878 | } |
870 | - if (openlayers.GADGETS.ZoomSlider === true) { | 879 | + if (openlayers.GADGETS.ZoomSlider === true && i3GEO.parametros.h > 600) { |
871 | pz = new ol.control.ZoomSlider(openlayers.ZOOMSLIDER); | 880 | pz = new ol.control.ZoomSlider(openlayers.ZOOMSLIDER); |
872 | pz.setMap(i3geoOL); | 881 | pz.setMap(i3geoOL); |
873 | } | 882 | } |
874 | - if (openlayers.GADGETS.ScaleLine === true) { | 883 | + if (openlayers.GADGETS.ScaleLine === true && i3GEO.parametros.h > 600) { |
875 | pz = new ol.control.ScaleLine(openlayers.SCALELINE); | 884 | pz = new ol.control.ScaleLine(openlayers.SCALELINE); |
876 | pz.setMap(i3geoOL); | 885 | pz.setMap(i3geoOL); |
877 | } | 886 | } |
@@ -880,6 +889,7 @@ i3GEO.Interface = | @@ -880,6 +889,7 @@ i3GEO.Interface = | ||
880 | // insere a lista de layers de fundo | 889 | // insere a lista de layers de fundo |
881 | // | 890 | // |
882 | temp = $i("listaLayersBase"); | 891 | temp = $i("listaLayersBase"); |
892 | + // FIXME testar isso | ||
883 | if (temp && i3GEO.arvoreDeCamadas.INCLUILFUNDO === false) { | 893 | if (temp && i3GEO.arvoreDeCamadas.INCLUILFUNDO === false) { |
884 | // | 894 | // |
885 | // torna false a variavel que pode permitir que as camadas de fundo | 895 | // torna false a variavel que pode permitir que as camadas de fundo |
@@ -910,34 +920,11 @@ i3GEO.Interface = | @@ -910,34 +920,11 @@ i3GEO.Interface = | ||
910 | i3GEO.util.arvore("<b>" + $trad("p16") + "</b>", "listaLayersBase", temp); | 920 | i3GEO.util.arvore("<b>" + $trad("p16") + "</b>", "listaLayersBase", temp); |
911 | } else { | 921 | } else { |
912 | if (openlayers.GADGETS.LayerSwitcher === true && i3GEO.arvoreDeCamadas.INCLUILFUNDO === false) { | 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 | if (i3GEO.configura.mapaRefDisplay !== "none") { | 928 | if (i3GEO.configura.mapaRefDisplay !== "none") { |
942 | if (i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")) { | 929 | if (i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay")) { |
943 | i3GEO.configura.mapaRefDisplay = i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay"); | 930 | i3GEO.configura.mapaRefDisplay = i3GEO.util.pegaCookie("i3GEO.configura.mapaRefDisplay"); |
@@ -946,40 +933,18 @@ i3GEO.Interface = | @@ -946,40 +933,18 @@ i3GEO.Interface = | ||
946 | i3GEO.maparef.inicia(); | 933 | i3GEO.maparef.inicia(); |
947 | } | 934 | } |
948 | } | 935 | } |
949 | - // é necessário ativar nesse momento pois a barra | ||
950 | - // de botoes já 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 | if (i3GEO.Interface.openlayers.googleLike === true) { | 937 | if (i3GEO.Interface.openlayers.googleLike === true) { |
958 | i3GEO.barraDeBotoes.INCLUIBOTAO.lentei = false; | 938 | i3GEO.barraDeBotoes.INCLUIBOTAO.lentei = false; |
959 | } | 939 | } |
960 | i3GEO.Interface.ativaBotoes(); | 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 | if (i3GEO.arvoreDeCamadas.ATIVATEMA === "") { | 942 | if (i3GEO.arvoreDeCamadas.ATIVATEMA === "") { |
978 | i3GEO.arvoreDeCamadas.ATIVATEMA = | 943 | i3GEO.arvoreDeCamadas.ATIVATEMA = |
979 | "i3GEO.Interface.ligaDesliga(this);i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS);"; | 944 | "i3GEO.Interface.ligaDesliga(this);i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS);"; |
980 | } | 945 | } |
981 | montaMapa(); | 946 | montaMapa(); |
982 | - return; | 947 | + |
983 | i3GEO.coordenadas.mostraCoordenadas(); | 948 | i3GEO.coordenadas.mostraCoordenadas(); |
984 | i3GEO.gadgets.mostraMenuSuspenso(); | 949 | i3GEO.gadgets.mostraMenuSuspenso(); |
985 | i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens); | 950 | i3GEO.ajuda.ativaLetreiro(i3GEO.parametros.mensagens); |
@@ -1010,7 +975,9 @@ i3GEO.Interface = | @@ -1010,7 +975,9 @@ i3GEO.Interface = | ||
1010 | // verifica se nas preferencias existem ferramentas que devem ser | 975 | // verifica se nas preferencias existem ferramentas que devem ser |
1011 | // abertas | 976 | // abertas |
1012 | i3GEO.configura.iniciaFerramentas.executa(); | 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 | * Aplica um valor de opacidade aos layers do mapa | 983 | * Aplica um valor de opacidade aos layers do mapa |
@@ -1275,7 +1242,7 @@ i3GEO.Interface = | @@ -1275,7 +1242,7 @@ i3GEO.Interface = | ||
1275 | matrixIds[z] = z; | 1242 | matrixIds[z] = z; |
1276 | } | 1243 | } |
1277 | // define a cor do fundo do mapa | 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 | $i("openlayers").style.backgroundColor = "rgb(" + i3GEO.parametros.cordefundo + ")"; | 1246 | $i("openlayers").style.backgroundColor = "rgb(" + i3GEO.parametros.cordefundo + ")"; |
1280 | 1247 | ||
1281 | // adiciona as camadas definidas em LAYERSADICIONAIS | 1248 | // adiciona as camadas definidas em LAYERSADICIONAIS |
@@ -1292,13 +1259,6 @@ i3GEO.Interface = | @@ -1292,13 +1259,6 @@ i3GEO.Interface = | ||
1292 | preload : Infinity | 1259 | preload : Infinity |
1293 | // pode ser 0 | 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 | for (i = nlayers - 1; i >= 0; i--) { | 1262 | for (i = nlayers - 1; i >= 0; i--) { |
1303 | layer = ""; | 1263 | layer = ""; |
1304 | camada = i3GEO.arvoreDeCamadas.CAMADAS[i]; | 1264 | camada = i3GEO.arvoreDeCamadas.CAMADAS[i]; |
@@ -1405,15 +1365,34 @@ i3GEO.Interface = | @@ -1405,15 +1365,34 @@ i3GEO.Interface = | ||
1405 | matrixIds : matrixIds | 1365 | matrixIds : matrixIds |
1406 | }), | 1366 | }), |
1407 | wrapX : true | 1367 | wrapX : true |
1408 | - }) | 1368 | + }); |
1369 | + source.set("name",camada.name); | ||
1409 | opcoes.source = source; | 1370 | opcoes.source = source; |
1410 | opcoes.title = camada.tema; | 1371 | opcoes.title = camada.tema; |
1411 | opcoes.name = camada.name; | 1372 | opcoes.name = camada.name; |
1412 | opcoes.isBaseLayer = false; | 1373 | opcoes.isBaseLayer = false; |
1413 | opcoes.visible = true; | 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 | layer = new ol.layer.Tile(opcoes); | 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,7 +1427,7 @@ i3GEO.Interface = | ||
1448 | $i(i3GEO.Interface.IDMAPA).appendChild(temp); | 1427 | $i(i3GEO.Interface.IDMAPA).appendChild(temp); |
1449 | } | 1428 | } |
1450 | } | 1429 | } |
1451 | - //FIXME testar isso | 1430 | + // FIXME testar isso |
1452 | if (i3GEO.Interface.openlayers.LAYERFUNDO != "") { | 1431 | if (i3GEO.Interface.openlayers.LAYERFUNDO != "") { |
1453 | i3GEO.Interface.openlayers.ativaFundo(i3GEO.Interface.openlayers.LAYERFUNDO); | 1432 | i3GEO.Interface.openlayers.ativaFundo(i3GEO.Interface.openlayers.LAYERFUNDO); |
1454 | } | 1433 | } |
@@ -1510,11 +1489,11 @@ i3GEO.Interface = | @@ -1510,11 +1489,11 @@ i3GEO.Interface = | ||
1510 | /** | 1489 | /** |
1511 | * Funcoes executadas quando um layer inicia o desenho | 1490 | * Funcoes executadas quando um layer inicia o desenho |
1512 | */ | 1491 | */ |
1513 | - loadStartLayer : function(event) { | 1492 | + loadStartLayer : function(name) { |
1514 | var p = $i("i3GEOprogressoDiv"); | 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 | if (p) { | 1497 | if (p) { |
1519 | p.style.display = "block"; | 1498 | p.style.display = "block"; |
1520 | i3GEO.arvoreDeCamadas.progressBar.set('maxValue', i3GEO.Interface.STATUS.atualizando.length); | 1499 | i3GEO.arvoreDeCamadas.progressBar.set('maxValue', i3GEO.Interface.STATUS.atualizando.length); |
@@ -1525,11 +1504,11 @@ i3GEO.Interface = | @@ -1525,11 +1504,11 @@ i3GEO.Interface = | ||
1525 | /** | 1504 | /** |
1526 | * Funcoes executadas quando um layer e concluido | 1505 | * Funcoes executadas quando um layer e concluido |
1527 | */ | 1506 | */ |
1528 | - loadStopLayer : function(event) { | 1507 | + loadStopLayer : function(name) { |
1529 | var p = $i("i3GEOprogressoDiv"); | 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 | if (p) { | 1512 | if (p) { |
1534 | p.style.display = "block"; | 1513 | p.style.display = "block"; |
1535 | if (i3GEO.Interface.STATUS.atualizando.length > 0) { | 1514 | if (i3GEO.Interface.STATUS.atualizando.length > 0) { |