From 8bcce97ed9ea62f27360ac53b4dd60532b10a553 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Wed, 23 Apr 2014 15:35:16 +0000 Subject: [PATCH] i3geosaude - inclusão de templates para escolha na lista de mapas salvos no banco e geração automática de miniatura do mapa --- ferramentas/salvamapa/geraminiatura.php | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+), 0 deletions(-) create mode 100644 ferramentas/salvamapa/geraminiatura.php diff --git a/ferramentas/salvamapa/geraminiatura.php b/ferramentas/salvamapa/geraminiatura.php new file mode 100644 index 0000000..f3fcb29 --- /dev/null +++ b/ferramentas/salvamapa/geraminiatura.php @@ -0,0 +1,51 @@ +numlayers; + for ($i=0;$i < $numlayers;$i++){ + $layern = $mapa->getlayer($i); + if (!empty($postgis_mapa)){ + if ($layern->connectiontype == MS_POSTGIS){ + $lcon = $layern->connection; + if (($lcon == " ") || ($lcon == "") || (in_array($lcon,array_keys($postgis_mapa)))){ + if(($lcon == " ") || ($lcon == "")) //para efeitos de compatibilidade + {$layern->set("connection",$postgis_mapa); + } + else{ + $layern->set("connection",$postgis_mapa[$lcon]); + } + } + } + } + } + } + } + $mapa->setsize($_GET["w"],$_GET["h"]); + $sca = $mapa->scalebar; + $sca->set("status",MS_OFF); + $objImagemM = @$mapa->draw(); + $objImagemM->saveImage($nomeImagem); + +} +header('Content-Length: '.filesize($nomeImagem)); +header('Content-Type: image/png'); +header('Cache-Control: public, max-age=22222222'); +header('Expires: ' . gmdate('D, d M Y H:i:s', time()+48*60*60) . ' GMT'); +fpassthru(fopen($nomeImagem, 'rb')); +?> \ No newline at end of file -- libgit2 0.21.2