Commit ff5a8b98f27bd7fecb47855e66d5464037a16c61
1 parent
ad438f88
Exists in
master
and in
7 other branches
--no commit message
Showing
2 changed files
with
42 additions
and
29 deletions
Show diff stats
ferramentas/parametrossql/ogc.php
| @@ -174,7 +174,8 @@ else{ | @@ -174,7 +174,8 @@ else{ | ||
| 174 | if($c["chave"] != ""){ | 174 | if($c["chave"] != ""){ |
| 175 | //valores definidos no plugin como uma string | 175 | //valores definidos no plugin como uma string |
| 176 | if($c["valores"] != ""){ | 176 | if($c["valores"] != ""){ |
| 177 | - $plugin[] = explode(",",$c["valores"])[0]; | 177 | + $temp = explode(",",$c["valores"]); |
| 178 | + $plugin[] = $temp[0]; | ||
| 178 | } | 179 | } |
| 179 | elseif ($c["prog"] != ""){ | 180 | elseif ($c["prog"] != ""){ |
| 180 | $plugin[] = execProg($locaplic."/".$c["prog"]); | 181 | $plugin[] = execProg($locaplic."/".$c["prog"]); |
| @@ -182,7 +183,8 @@ else{ | @@ -182,7 +183,8 @@ else{ | ||
| 182 | } | 183 | } |
| 183 | } | 184 | } |
| 184 | $plugin = implode(",",$plugin); | 185 | $plugin = implode(",",$plugin); |
| 185 | - } | 186 | + } |
| 187 | + $l->setmetadata("TEMA",$l->getmetadata("TEMA")." - ".$plugin); | ||
| 186 | $valores = str_ireplace(array(" and ", " or ", "select","from","where","update","delete","insert","--"),"",$plugin); | 188 | $valores = str_ireplace(array(" and ", " or ", "select","from","where","update","delete","insert","--"),"",$plugin); |
| 187 | $valores = explode(",",strip_tags($valores)); | 189 | $valores = explode(",",strip_tags($valores)); |
| 188 | for($i = 0; $i < $n; $i++){ | 190 | for($i = 0; $i < $n; $i++){ |
| @@ -196,7 +198,8 @@ else{ | @@ -196,7 +198,8 @@ else{ | ||
| 196 | } | 198 | } |
| 197 | if($filtro != ""){ | 199 | if($filtro != ""){ |
| 198 | $l->setfilter($filtro); | 200 | $l->setfilter($filtro); |
| 199 | - } | 201 | + } |
| 202 | + | ||
| 200 | $l->set("data",$data); | 203 | $l->set("data",$data); |
| 201 | //acrecenta-se um md5 apos o nome caso seja necessario gerar cache | 204 | //acrecenta-se um md5 apos o nome caso seja necessario gerar cache |
| 202 | if($cache == true){ | 205 | if($cache == true){ |
mashups/osm.php
| @@ -25,6 +25,7 @@ if($nocache == "sim"){ | @@ -25,6 +25,7 @@ if($nocache == "sim"){ | ||
| 25 | else{ | 25 | else{ |
| 26 | $nocache = ""; | 26 | $nocache = ""; |
| 27 | } | 27 | } |
| 28 | +//guarda os parametros das camadas que possuem plugins configurados | ||
| 28 | $temasPluginI3Geo = array(); | 29 | $temasPluginI3Geo = array(); |
| 29 | // | 30 | // |
| 30 | // recupera um mapa salvo no banco de administracao | 31 | // recupera um mapa salvo no banco de administracao |
| @@ -241,6 +242,8 @@ if(isset($fundo) && $fundo != ""){ | @@ -241,6 +242,8 @@ if(isset($fundo) && $fundo != ""){ | ||
| 241 | // | 242 | // |
| 242 | // define quais os layers que comporão o mapa | 243 | // define quais os layers que comporão o mapa |
| 243 | // | 244 | // |
| 245 | +//$objOpenLayers guarda a string javascript que sera usada para criar os objetos | ||
| 246 | +//layer do OpenLayers | ||
| 244 | if(isset($temas)){ | 247 | if(isset($temas)){ |
| 245 | $objOpenLayers = array(); | 248 | $objOpenLayers = array(); |
| 246 | } | 249 | } |
| @@ -266,9 +269,9 @@ if($temas != ""){ | @@ -266,9 +269,9 @@ if($temas != ""){ | ||
| 266 | // | 269 | // |
| 267 | $listaFerramentas = array("tme","storymap"); | 270 | $listaFerramentas = array("tme","storymap"); |
| 268 | foreach($temas as $tema){ | 271 | foreach($temas as $tema){ |
| 269 | - // | ||
| 270 | - //utilzado para obter os parametros de ferramentas especificas indicadas nos metadados do LAYER | ||
| 271 | - // | 272 | + // |
| 273 | + //utilzado para obter os parametros de ferramentas especificas indicadas nos metadados do LAYER | ||
| 274 | + // | ||
| 272 | $ferramentas = array(); | 275 | $ferramentas = array(); |
| 273 | if(file_exists($locaplic."/temas/".$tema.".gvp")){ | 276 | if(file_exists($locaplic."/temas/".$tema.".gvp")){ |
| 274 | include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php"); | 277 | include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php"); |
| @@ -303,14 +306,18 @@ if($temas != ""){ | @@ -303,14 +306,18 @@ if($temas != ""){ | ||
| 303 | $layern = $maptemp->getLayer($i); | 306 | $layern = $maptemp->getLayer($i); |
| 304 | if($layern->getmetadata("PLUGINI3GEO") != ""){ | 307 | if($layern->getmetadata("PLUGINI3GEO") != ""){ |
| 305 | //obtem os dados necessarios para iniciar o plugin | 308 | //obtem os dados necessarios para iniciar o plugin |
| 309 | + //os objetos layer (openLayers) sao criados apenas no final | ||
| 310 | + //do processo, pois necessitam usar javascript e nao apenas PHP | ||
| 306 | $temasPluginI3Geo[] = array( | 311 | $temasPluginI3Geo[] = array( |
| 307 | "name"=>$layern->name, | 312 | "name"=>$layern->name, |
| 308 | "tema"=>$layern->getmetadata("tema"), | 313 | "tema"=>$layern->getmetadata("tema"), |
| 309 | "plugin"=>$layern->getmetadata("PLUGINI3GEO"), | 314 | "plugin"=>$layern->getmetadata("PLUGINI3GEO"), |
| 310 | "cache"=>strtoupper($layern->getmetadata("cache")), | 315 | "cache"=>strtoupper($layern->getmetadata("cache")), |
| 311 | "transitioneffect"=>strtoupper($layern->getmetadata("transitioneffect")), | 316 | "transitioneffect"=>strtoupper($layern->getmetadata("transitioneffect")), |
| 312 | - "tiles"=>strtoupper($layern->getmetadata("tiles")) | 317 | + "tiles"=>strtoupper($layern->getmetadata("tiles")), |
| 318 | + "posicaoLayer"=>count($objOpenLayers) | ||
| 313 | ); | 319 | ); |
| 320 | + $objOpenLayers[] = ""; | ||
| 314 | } | 321 | } |
| 315 | else{ | 322 | else{ |
| 316 | $layersNomes[] = $layern->name; | 323 | $layersNomes[] = $layern->name; |
| @@ -712,9 +719,30 @@ i3GEO.editorOL.mapa = new OpenLayers.Map( | @@ -712,9 +719,30 @@ i3GEO.editorOL.mapa = new OpenLayers.Map( | ||
| 712 | if(i3GEO.configura.locaplic === ""){ | 719 | if(i3GEO.configura.locaplic === ""){ |
| 713 | i3GEO.configura.locaplic = "../"; | 720 | i3GEO.configura.locaplic = "../"; |
| 714 | } | 721 | } |
| 715 | - | 722 | +//faz a inclusao das camadas que possuem plugins |
| 723 | +//veja o codigo PHP abaixo da funcao | ||
| 724 | +//a variavel i3GEO.editorOL.layersIniciais ja contem a entrada para o layer | ||
| 725 | +//mas vazia. Isso e necessario para incluir a camada na ordem correta | ||
| 726 | +function adicionaPluginI3geo(camada,visivel,indice){ | ||
| 727 | + if(!camada.cache){ | ||
| 728 | + camada["cache"] = "NAO"; | ||
| 729 | + } | ||
| 730 | + var n, i, l = i3GEO.pluginI3geo.layerMashup("openlayers",camada,"4326"); | ||
| 731 | + n = l.length; | ||
| 732 | + for(i = 0; i < n; i++){ | ||
| 733 | + if(l[i].displayInLayerSwitcher === true){ | ||
| 734 | + l[i].setVisibility(visivel); | ||
| 735 | + } | ||
| 736 | + if(l[i] != true){ | ||
| 737 | + i3GEO.editorOL.layersIniciais[indice] = l[i]; | ||
| 738 | + } | ||
| 739 | + } | ||
| 740 | +} | ||
| 716 | <?php | 741 | <?php |
| 717 | //camadas plugin | 742 | //camadas plugin |
| 743 | + //cria o javascript que faz a inclusao das camadas | ||
| 744 | + //configuradas com plugins do i3geo | ||
| 745 | + //a variavel $temasPluginI3Geo e definida no inicio do PHP | ||
| 718 | foreach ($temasPluginI3Geo as $t){ | 746 | foreach ($temasPluginI3Geo as $t){ |
| 719 | //var_dump($temasPluginI3Geo);exit; | 747 | //var_dump($temasPluginI3Geo);exit; |
| 720 | //cria um objeto javascript para iniciar o plugin | 748 | //cria um objeto javascript para iniciar o plugin |
| @@ -725,28 +753,10 @@ if(i3GEO.configura.locaplic === ""){ | @@ -725,28 +753,10 @@ if(i3GEO.configura.locaplic === ""){ | ||
| 725 | if(in_array($t["name"],$visiveis)){ | 753 | if(in_array($t["name"],$visiveis)){ |
| 726 | $visivel = "true"; | 754 | $visivel = "true"; |
| 727 | } | 755 | } |
| 728 | - echo "adicionaPluginI3geo(camada,$visivel);\n"; | ||
| 729 | - } | ||
| 730 | - ?> | ||
| 731 | - i3GEO.editorOL.inicia(); | ||
| 732 | - | ||
| 733 | - function adicionaPluginI3geo(camada,visivel){ | ||
| 734 | - if(!camada.cache){ | ||
| 735 | - camada["cache"] = "NAO"; | ||
| 736 | - } | ||
| 737 | - var l = i3GEO.pluginI3geo.layerMashup("openlayers",camada,"4326"), | ||
| 738 | - n, | ||
| 739 | - i; | ||
| 740 | - n = l.length; | ||
| 741 | - for(i = 0; i < n; i++){ | ||
| 742 | - if(l[i].displayInLayerSwitcher === true){ | ||
| 743 | - l[i].setVisibility(visivel); | ||
| 744 | - } | ||
| 745 | - if(l[i] != true){ | ||
| 746 | - i3GEO.editorOL.layersIniciais.push(l[i]); | ||
| 747 | - } | ||
| 748 | - } | 756 | + echo "adicionaPluginI3geo(camada,".$visivel.",".$t["posicaoLayer"].");\n"; |
| 749 | } | 757 | } |
| 758 | +?> | ||
| 759 | +i3GEO.editorOL.inicia(); | ||
| 750 | </script> | 760 | </script> |
| 751 | </body> | 761 | </body> |
| 752 | </html> | 762 | </html> |