From 50cca08e2ed3a5ed126ba5e70c71eb92d9830192 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 13 Mar 2012 00:49:25 +0000 Subject: [PATCH] Correção na geração de miniaturas no sistema de administração --- .buildpath | 5 +++++ .project | 39 +++++++++++++++++++++++++++++++++++++++ .settings/.jsdtscope | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .settings/org.eclipse.wst.jsdt.ui.superType.container | 1 + .settings/org.eclipse.wst.jsdt.ui.superType.name | 1 + .settings/org.eclipse.wst.xsl.core.prefs | 11 +++++++++++ admin/index.html | 6 ++++-- admin/php/menutemas.php | 3 ++- aplicmap/geral1debianv6.map | 15 ++++++++------- aplicmap/geral1fedorav6.map | 15 ++++++++------- geraminiatura.php | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------- temas/miniaturas/locali.map.grande.png | Bin 0 -> 20330 bytes temas/miniaturas/locali.map.mini.png | Bin 0 -> 2158 bytes testainstal.php | 3 ++- 14 files changed, 291 insertions(+), 39 deletions(-) create mode 100644 .buildpath create mode 100644 .project create mode 100644 .settings/.jsdtscope create mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.container create mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.name create mode 100644 .settings/org.eclipse.wst.xsl.core.prefs create mode 100644 temas/miniaturas/locali.map.grande.png create mode 100644 temas/miniaturas/locali.map.mini.png diff --git a/.buildpath b/.buildpath new file mode 100644 index 0000000..606f236 --- /dev/null +++ b/.buildpath @@ -0,0 +1,5 @@ + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..c4a1311 --- /dev/null +++ b/.project @@ -0,0 +1,39 @@ + + + i3geo + + + + + + org.eclipse.wst.jsdt.core.javascriptValidator + + + + + org.eclipse.wst.validation.validationbuilder + + + + + org.eclipse.dltk.core.scriptbuilder + + + + + + org.eclipse.wst.jsdt.core.jsNature + org.eclipse.php.core.PHPNature + + + + 1331581444157 + + 30 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-*compacto* + + + + diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope new file mode 100644 index 0000000..8dc460d --- /dev/null +++ b/.settings/.jsdtscope @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..49c8cd4 --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.JRE_CONTAINER \ No newline at end of file diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..11006e2 --- /dev/null +++ b/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Global \ No newline at end of file diff --git a/.settings/org.eclipse.wst.xsl.core.prefs b/.settings/org.eclipse.wst.xsl.core.prefs new file mode 100644 index 0000000..437d548 --- /dev/null +++ b/.settings/org.eclipse.wst.xsl.core.prefs @@ -0,0 +1,11 @@ +CHECK_CALL_TEMPLATES=2 +CHECK_XPATHS=2 +CIRCULAR_REF=2 +DUPLICATE_PARAMETER=2 +EMPTY_PARAM=1 +MISSING_INCLUDE=2 +MISSING_PARAM=1 +NAME_ATTRIBUTE_EMPTY=2 +NAME_ATTRIBUTE_MISSING=2 +TEMPLATE_CONFLICT=2 +eclipse.preferences.version=1 diff --git a/admin/index.html b/admin/index.html index 6560db8..9a480db 100644 --- a/admin/index.html +++ b/admin/index.html @@ -1,7 +1,9 @@ - - + + + + diff --git a/admin/php/menutemas.php b/admin/php/menutemas.php index 3eabd2a..35f427e 100644 --- a/admin/php/menutemas.php +++ b/admin/php/menutemas.php @@ -1243,9 +1243,10 @@ function removeCabecalho($arq,$symbolset=true) } function atualizaMiniatura(){ global $tema,$locaplic; + $tipo = "foo"; include_once("../../classesphp/funcoes_gerais.php"); require("../../geraminiatura.php"); verificaMiniatura($tema,"todos",true); - exit; + return "ok"; } ?> \ No newline at end of file diff --git a/aplicmap/geral1debianv6.map b/aplicmap/geral1debianv6.map index 6652828..98c7f51 100644 --- a/aplicmap/geral1debianv6.map +++ b/aplicmap/geral1debianv6.map @@ -47,13 +47,14 @@ MAP FORMATOPTION "INTERLACE=OFF" END - OUTPUTFORMAT - NAME svg - MIMETYPE "image/svg+xml" - DRIVER cairo/svg - #FORMATOPTION "COMPRESSED_OUTPUT=TRUE" - #FORMATOPTION "FULL_RESOLUTION=TRUE" - END + #OUTPUTFORMAT + # NAME svg + # MIMETYPE "image/svg+xml" + # DRIVER cairo/svg + ##FORMATOPTION "COMPRESSED_OUTPUT=TRUE" + ##FORMATOPTION "FULL_RESOLUTION=TRUE" + #END + OUTPUTFORMAT NAME jpeg DRIVER "AGG/JPEG" diff --git a/aplicmap/geral1fedorav6.map b/aplicmap/geral1fedorav6.map index 98a2cfa..c10e1e7 100644 --- a/aplicmap/geral1fedorav6.map +++ b/aplicmap/geral1fedorav6.map @@ -47,13 +47,14 @@ MAP FORMATOPTION "INTERLACE=OFF" END - OUTPUTFORMAT - NAME svg - MIMETYPE "image/svg+xml" - DRIVER cairo/svg - #FORMATOPTION "COMPRESSED_OUTPUT=TRUE" - #FORMATOPTION "FULL_RESOLUTION=TRUE" - END + #OUTPUTFORMAT + # NAME svg + # MIMETYPE "image/svg+xml" + # DRIVER cairo/svg + # #FORMATOPTION "COMPRESSED_OUTPUT=TRUE" + # #FORMATOPTION "FULL_RESOLUTION=TRUE" + #END + OUTPUTFORMAT NAME jpeg DRIVER "AGG/JPEG" diff --git a/geraminiatura.php b/geraminiatura.php index 42b0764..43138ac 100644 --- a/geraminiatura.php +++ b/geraminiatura.php @@ -79,10 +79,14 @@ if (!function_exists('ms_GetVersion')) else {dl('php_mapscript.so');} } -include("ms_configura.php"); -include("classesphp/funcoes_gerais.php"); -require_once("classesphp/pega_variaveis.php"); -include_once ("classesphp/carrega_ext.php"); +//para o caso de ser feito um include desse programa +if(!isset($locaplic)) +{$locaplic = "";} +include($locaplic."/ms_configura.php"); +if(!function_exists("versao")) +{include($locaplic."/classesphp/funcoes_gerais.php");} +require_once($locaplic."/classesphp/pega_variaveis.php"); +include_once ($locaplic."/classesphp/carrega_ext.php"); $versao = versao(); $versao = $versao["principal"]; // @@ -130,7 +134,11 @@ if($tipo == "mini" || $tipo == "todos" || $tipo == "grande" || $tipo == "") // function verificaMiniatura($map,$tipo,$admin=false) { - global $locaplic,$versao; + global $locaplic,$versao,$base; + if($versao == ""){ + $versao = versao(); + $versao = $versao["principal"]; + } //echo $map."
";return; ms_ResetErrorList(); $tema = ""; @@ -142,15 +150,42 @@ function verificaMiniatura($map,$tipo,$admin=false) {$tema = $locaplic.'/temas/'.$map.".map";} if ($tema != "") { - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) - {$mapa = ms_newMapObj("$locaplic/aplicmap/geral1windowsv".$versao.".map");} + if(isset($base) && $base != ""){ + if(file_exists($base)) + {$f = $base;} + else + {$f = $locaplic."/aplicmap/".$base.".map";} + if(!file_exists($base)){ + echo "ARQUIVO $base NÂO FOI ENCONTRADO. CORRIJA ISSO EM ms_configura.php"; + exit; + } + } else - {$mapa = ms_newMapObj("$locaplic/aplicmap/geral1v".$versao.".map");} + { + $f = ""; + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) + {$f = $locaplic."/aplicmap/geral1windowsv".$versao.".map";} + else + { + if($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){ + $f = "/var/www/i3geo/aplicmap/geral1debianv".$versao.".map"; + } + if($f == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ + $f = "/var/www/html/i3geo/aplicmap/geral1fedorav".$versao.".map"; + } + if($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ + $f = "/opt/www/html/i3geo/aplicmap/geral1v".$versao.".map"; + } + if($f == "") + {$f = $locaplic."/aplicmap/geral1v".$versao.".map";} + } + } + $mapa = ms_newMapObj($f); if(@ms_newMapObj($tema)) {$nmapa = ms_newMapObj($tema);} else { - echo "erro no arquivo $map
"; + echo "erro no arquivo $tema
"; return; } $temasn = $nmapa->getAllLayerNames(); @@ -162,9 +197,9 @@ function verificaMiniatura($map,$tipo,$admin=false) ms_newLayerObj($mapa, $layern); autoClasses($layern,$mapa,$locaplic); if ($layern->data == "") - $dados = $layern->connection; + {$dados = $layern->connection;} else - $dados = $layern->data; + {$dados = $layern->data;} $pegarext = $teman; } if (isset($postgis_mapa)) @@ -184,20 +219,16 @@ function verificaMiniatura($map,$tipo,$admin=false) } } } - } - + } zoomTemaMiniatura($pegarext,$mapa); if ($tipo == "mini" || $tipo == "todos") - { - + { $mapa->setsize(50,50); $sca = $mapa->scalebar; $sca->set("status",MS_OFF); $objImagemM = @$mapa->draw(); - - if ($objImagemM == "" || $objImagemM == MS_FAILURE) - {echo "Problemas ao gerar o mapa
";return;} - + //if ($objImagemM == "" || $objImagemM == MS_FAILURE) + //{echo "Problemas ao gerar o mapa
";return;} $weboM = $mapa->web; $urlM = $weboM->imageurl."/".$map; } @@ -207,8 +238,8 @@ function verificaMiniatura($map,$tipo,$admin=false) $sca = $mapa->scalebar; $sca->set("status",MS_OFF); $objImagemG = @$mapa->draw(); - if ($objImagemG == "" || $objImagemG == MS_FAILURE) - {echo "Problemas ao gerar o mapa
";return;} + //if ($objImagemG == "" || $objImagemG == MS_FAILURE) + //{echo "Problemas ao gerar o mapa
";return;} $weboG = $mapa->web; $urlG = $weboG->imageurl."/".$map; } diff --git a/temas/miniaturas/locali.map.grande.png b/temas/miniaturas/locali.map.grande.png new file mode 100644 index 0000000..bbdce40 Binary files /dev/null and b/temas/miniaturas/locali.map.grande.png differ diff --git a/temas/miniaturas/locali.map.mini.png b/temas/miniaturas/locali.map.mini.png new file mode 100644 index 0000000..6c0e274 Binary files /dev/null and b/temas/miniaturas/locali.map.mini.png differ diff --git a/testainstal.php b/testainstal.php index 7f65671..a3ba09e 100644 --- a/testainstal.php +++ b/testainstal.php @@ -59,7 +59,8 @@ i3geo/testainstal.php error_reporting(E_ALL); //echo "
\n";
-echo "TESTE DE INSTALACAO DO i3Geo
\n"; +echo "Observação: se você estiver usando Linux e a biblioteca CAIRO estiver instalada corretamente no Mapserver, edite os arquivos i3geo/aplicmap/geral1fedorav6.map e geral1debianv6.map para remover os comentários do OUTPUTFORMAT que utiliza SVG com o drive Cairo
\n"; +echo "
TESTE DE INSTALACAO DO i3Geo
\n"; //ip $ip = "UNKNOWN"; if (getenv("HTTP_CLIENT_IP")) $ip = getenv("HTTP_CLIENT_IP"); -- libgit2 0.21.2