Commit d03e7f7a99d47440a07bd2e9d9a597286df8a8d7
1 parent
6815acd2
Exists in
master
and in
7 other branches
Inclusão das opções de impressão em SVG e AGG
Showing
4 changed files
with
111 additions
and
1 deletions
Show diff stats
aplicmap/geral1.map
| ... | ... | @@ -50,7 +50,13 @@ MAP |
| 50 | 50 | # FORMATOPTION "QUANTIZE_DITHER=OFF" |
| 51 | 51 | # FORMATOPTION "QUANTIZE_COLORS=256" |
| 52 | 52 | #END |
| 53 | - | |
| 53 | + OUTPUTFORMAT | |
| 54 | + NAME svg | |
| 55 | + MIMETYPE "image/svg+xml" | |
| 56 | + DRIVER svg | |
| 57 | + #FORMATOPTION "COMPRESSED_OUTPUT=TRUE" | |
| 58 | + #FORMATOPTION "FULL_RESOLUTION=TRUE" | |
| 59 | + END | |
| 54 | 60 | OUTPUTFORMAT |
| 55 | 61 | NAME png1 |
| 56 | 62 | MIMETYPE image/png | ... | ... |
aplicmap/geral1windows.map
| ... | ... | @@ -50,6 +50,14 @@ SYMBOLSET "c:\ms4w\apache\htdocs\i3geo/symbols/simbolos.sym" |
| 50 | 50 | # FORMATOPTION "QUANTIZE_COLORS=256" |
| 51 | 51 | #END |
| 52 | 52 | OUTPUTFORMAT |
| 53 | + NAME svg | |
| 54 | + MIMETYPE "image/svg+xml" | |
| 55 | + DRIVER svg | |
| 56 | + #FORMATOPTION "COMPRESSED_OUTPUT=TRUE" | |
| 57 | + #FORMATOPTION "FULL_RESOLUTION=TRUE" | |
| 58 | + END | |
| 59 | + | |
| 60 | + OUTPUTFORMAT | |
| 53 | 61 | NAME png1 |
| 54 | 62 | MIMETYPE image/png |
| 55 | 63 | DRIVER GD/PNG | ... | ... |
ferramentas/imprimir/index.htm
| ... | ... | @@ -27,6 +27,11 @@ |
| 27 | 27 | <td><input style='cursor:pointer' onclick=abreI(this) type=radio value="aggpng.php" name=cmodelo /></td> |
| 28 | 28 | <td>Agg/Png alta qualidade</td> |
| 29 | 29 | </tr> |
| 30 | + <tr> | |
| 31 | + <td><input style='cursor:pointer' onclick=abreI(this) type=radio value="svg.php" name=cmodelo /></td> | |
| 32 | + <td>Svg - vetorial</td> | |
| 33 | + </tr> | |
| 34 | + | |
| 30 | 35 | </table> |
| 31 | 36 | </div> |
| 32 | 37 | </body> | ... | ... |
| ... | ... | @@ -0,0 +1,91 @@ |
| 1 | +<?php | |
| 2 | +/* | |
| 3 | +About: Licença | |
| 4 | + | |
| 5 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
| 6 | + | |
| 7 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
| 8 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
| 9 | + | |
| 10 | +Este programa é software livre; você pode redistribuí-lo | |
| 11 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
| 12 | +GNU conforme publicada pela Free Software Foundation; | |
| 13 | +tanto a versão 2 da Licença. | |
| 14 | +Este programa é distribuído na expectativa de que seja útil, | |
| 15 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
| 16 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
| 17 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
| 18 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
| 19 | +GNU junto com este programa; se não, escreva para a | |
| 20 | +Free Software Foundation, Inc., no endereço | |
| 21 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
| 22 | +*/ | |
| 23 | +require_once("../../classesphp/pega_variaveis.php"); | |
| 24 | +error_reporting(0); | |
| 25 | +session_name("i3GeoPHP"); | |
| 26 | +if (isset($g_sid)) | |
| 27 | +{session_id($g_sid);} | |
| 28 | +session_start(); | |
| 29 | +foreach(array_keys($_SESSION) as $k) | |
| 30 | +{ | |
| 31 | + eval("\$".$k."='".$_SESSION[$k]."';"); | |
| 32 | +} | |
| 33 | +$postgis_mapa = $_SESSION["postgis_mapa"]; | |
| 34 | +// | |
| 35 | +//se as extensões já estiverem carregadas no PHP, vc pode comentar essa linha para que o processamento fique mais rápido | |
| 36 | +// | |
| 37 | +include_once ("../../classesphp/carrega_ext.php"); | |
| 38 | +// | |
| 39 | +//carrega o phpmapscript | |
| 40 | +// | |
| 41 | +$exts = get_loaded_extensions(); | |
| 42 | +if (array_search( "MapScript", $exts) != TRUE) | |
| 43 | +{ | |
| 44 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) | |
| 45 | + { | |
| 46 | + if(!@dl('php_mapscript_48.dll')) | |
| 47 | + dl('php_mapscript.dll'); | |
| 48 | + } | |
| 49 | + else | |
| 50 | + {dl('php_mapscript.so');} | |
| 51 | +} | |
| 52 | +require("../../classesphp/funcoes_gerais.php"); | |
| 53 | +error_reporting(0); | |
| 54 | +$nomes = nomeRandomico(); | |
| 55 | +$map = ms_newMapObj($map_file); | |
| 56 | +$temp = str_replace(".map","xxx.map",$map_file); | |
| 57 | +$map->save($temp); | |
| 58 | +substituiCon($temp,$postgis_mapa); | |
| 59 | +$map = ms_newMapObj($temp); | |
| 60 | +//$legenda =$map->legend; | |
| 61 | +//$legenda->set("status",MS_EMBED); | |
| 62 | +//altera o nome das classes vazias | |
| 63 | +$temas = $map->getalllayernames(); | |
| 64 | +foreach ($temas as $tema) | |
| 65 | +{ | |
| 66 | + $layer = $map->getlayerbyname($tema); | |
| 67 | + if (($layer->data != "") && ($layer->getmetadata("escondido") != "SIM") && ($layer->getmetadata("tema") != "NAO")) | |
| 68 | + { | |
| 69 | + if ($layer->numclasses > 0) | |
| 70 | + { | |
| 71 | + $classe = $layer->getclass(0); | |
| 72 | + if (($classe->name == "") || ($classe->name == " ")) | |
| 73 | + {$classe->set("name",$layer->getmetadata("tema"));} | |
| 74 | + } | |
| 75 | + } | |
| 76 | +} | |
| 77 | +$map->selectOutputFormat("svg"); | |
| 78 | +//$of = $map->outputformat; | |
| 79 | +//$of->set("driver","svg"); | |
| 80 | +//$of->set("mimetype","image/svg+xml"); | |
| 81 | +//$of->set("formatoption","COMPRESSED_OUTPUT=TRUE"); | |
| 82 | +//$of->set("formatoption","FULL_RESOLUTION=TRUE"); | |
| 83 | +//$of->set("imagemode","RGB"); | |
| 84 | + | |
| 85 | +$imgo = $map->draw(); | |
| 86 | +$nomer = ($imgo->imagepath)."mapa".$nomes.".svg"; | |
| 87 | +$imgo->saveImage($nomer); | |
| 88 | +$protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | |
| 89 | +$nomemapa = strtolower($protocolo[0])."://".$_SERVER['HTTP_HOST'].($imgo->imageurl).basename($nomer); | |
| 90 | +echo "<a style=font-family:Verdana,Arial,Helvetica,sans-serif; href='$nomemapa' >Arquivo gerado! Clique para ver.</a>"; | |
| 91 | +?> | |
| 0 | 92 | \ No newline at end of file | ... | ... |