From 48b5f5b9d8a2bde3646f1fd7fb61fff53a20ddc5 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Thu, 10 Nov 2011 14:32:19 +0000 Subject: [PATCH] --- classesphp/mapa_openlayers.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/classesphp/mapa_openlayers.php b/classesphp/mapa_openlayers.php index 95901d8..85f902f 100644 --- a/classesphp/mapa_openlayers.php +++ b/classesphp/mapa_openlayers.php @@ -107,15 +107,30 @@ $qy = file_exists($qyfile); if($qy) { $l = $mapa->getLayerByname($_GET["layer"]); + if (($postgis_mapa != "") && ($postgis_mapa != " ")) + { + if ($l->connectiontype == MS_POSTGIS) + { + $lcon = $l->connection; + if (($lcon == " ") || ($lcon == "") || (in_array($lcon,array_keys($postgis_mapa)))) + { + if(($lcon == " ") || ($lcon == "")) + {$l->set("connection",$postgis_mapa);} + else + {$l->set("connection",$postgis_mapa[$lcon]);} + } + } + } $indxlayer = $l->index; $handle = fopen ($qyfile, "r"); $conteudo = fread ($handle, filesize ($qyfile)); fclose ($handle); $shp = unserialize($conteudo); + //$l->set("tileitem",""); foreach ($shp as $indx) {$mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} - - //$mapa->loadquery(str_replace(".map",".qy",$map_fileX); + //$mapa->loadquery(str_replace(".map",".qy",$map_fileX)); + //echo str_replace(".map",".qy",$map_fileX);exit; } if(!isset($_GET["telaR"])){//no caso de projecoes remotas, o mapfile nao e alterado $numlayers = $mapa->numlayers; -- libgit2 0.21.2