Commit 7971535d3fe13ef4e17e46a35231223f9aa0703e

Authored by Edmar Moretti
1 parent 34552770

Reformulação Editor de mapfiles

admin/admin.db
No preview for this file type
admin1/catalogo/mapfile/editor/exec.php 0 → 100755
... ... @@ -0,0 +1,233 @@
  1 +<?php
  2 +include_once (dirname ( __FILE__ ) . "/../../../../admin/php/login.php");
  3 +include_once (dirname ( __FILE__ ) . "/../../../../admin/php/conexao.php");
  4 +error_reporting ( 0 );
  5 +if (isset ( $_POST ["texto"] )) {
  6 + $gravarTexto = $_POST ["texto"];
  7 + $_POST ["texto"] = "";
  8 +}
  9 +$versao = versao ();
  10 +$versao = $versao ["principal"];
  11 +
  12 +if (verificaOperacaoSessao ( "admin/html/editortexto" ) === false) {
  13 + header ( "HTTP/1.1 403 Vc nao pode realizar essa operacao" );
  14 + exit ();
  15 +}
  16 +
  17 +error_reporting ( 0 );
  18 +function textoMapfile($codigo) {
  19 + global $locaplic, $dbhw;
  20 + $mapfile = $locaplic . "/temas/" . $codigo . ".map";
  21 + if (! file_exists ( $mapfile )) {
  22 + return "Arquivo $codigo n&atilde;o existe.";
  23 + }
  24 + // testa
  25 + try {
  26 + ms_newMapObj ( $mapfile );
  27 + } catch ( Exception $e ) {
  28 + $texto = file_get_contents ( $mapfile );
  29 + if (mb_detect_encoding ( $texto, 'UTF-8, ISO-8859-1' ) == "ISO-8859-1") {
  30 + return utf8_encode ( $texto );
  31 + } else {
  32 + return $texto;
  33 + }
  34 + }
  35 + if (@ms_newMapObj ( $mapfile )) {
  36 + // verifica os metadata que sao armazenados tambem no banco de dados de administracao
  37 + // isso e necessario para manter a consistencia caso o usuario altere manualmente os valores
  38 + // cria o objeto map
  39 + $mapa = ms_newMapObj ( $mapfile );
  40 + $layer = $mapa->getlayerbyname ( $codigo );
  41 + if ($layer == "") {
  42 + return "<br><span style='color:red;'>Aten&ccedil;&atilde;o: n&atilde;o existe nenhum LAYER com NAME igual a " . $codigo . "</span><br>";
  43 + } else {
  44 + // pega o metadata
  45 + $meta = $layer->getmetadata ( "permitedownload" );
  46 + $meta = strtoupper ( $meta );
  47 + if ($meta != "" && ($meta == "SIM" || $meta == "NAO")) {
  48 + // grava no banco
  49 + $dbhw->query ( "UPDATE " . $esquemaadmin . "i3geoadmin_temas SET download_tema='$meta' WHERE codigo_tema = '$codigo'" );
  50 + }
  51 + $meta = $layer->getmetadata ( "permiteogc" );
  52 + $meta = strtoupper ( $meta );
  53 + if ($meta != "" && ($meta == "SIM" || $meta == "NAO")) {
  54 + $dbhw->query ( "UPDATE " . $esquemaadmin . "i3geoadmin_temas SET ogc_tema='$meta' WHERE codigo_tema = '$codigo'" );
  55 + }
  56 + $meta = $layer->getmetadata ( "permitekml" );
  57 + $meta = strtoupper ( $meta );
  58 + if ($meta != "" && ($meta == "SIM" || $meta == "NAO")) {
  59 + $dbhw->query ( "UPDATE " . $esquemaadmin . "i3geoadmin_temas SET kml_tema='$meta' WHERE codigo_tema = '$codigo'" );
  60 + }
  61 + $meta = $layer->getmetadata ( "permitekmz" );
  62 + $meta = strtoupper ( $meta );
  63 + if ($meta != "" && ($meta == "SIM" || $meta == "NAO")) {
  64 + $dbhw->query ( "UPDATE " . $esquemaadmin . "i3geoadmin_temas SET kmz_tema='$meta' WHERE codigo_tema = '$codigo'" );
  65 + }
  66 + }
  67 + }
  68 + $texto = file_get_contents ( $mapfile );
  69 + if (mb_detect_encoding ( $texto, 'UTF-8, ISO-8859-1' ) == "ISO-8859-1") {
  70 + return utf8_encode ( $texto );
  71 + } else {
  72 + return $texto;
  73 + }
  74 +}
  75 +function salvaMapfile() {
  76 + global $locaplic, $dbhw, $codigo, $gravarTexto;
  77 + if (empty ( $gravarTexto )) {
  78 + return;
  79 + }
  80 + $mapfile = $locaplic . "/temas/" . $codigo . ".map";
  81 + $original = file_get_contents ( $mapfile );
  82 + $fp = fopen ( $mapfile, "w" );
  83 + if ($fp == false) {
  84 + echo "<span style=color:red <b>N&atilde;o foi poss&iacute;vel salvar o arquivo. Verifique as permiss&otilde;es ou se h&aacute; algum erro no mapfile</b></span><br><br>";
  85 + exit ();
  86 + } else {
  87 + // remove itens vazios
  88 + $novoTexto = array ();
  89 + $testar = array (
  90 + "TEMPORIZADOR",
  91 + "PALLETESTEP",
  92 + "LTEMPOITEMIMAGEM",
  93 + "METAESTAT_ID_MEDIDA_VARIAVEL",
  94 + "GMOPACITY",
  95 + "GMSTATUS",
  96 + "ICONETEMA",
  97 + "LTEMPOITEMTITULO",
  98 + "DESCRIPTION_TEMPLATE",
  99 + "LTEMPOITEMLINK",
  100 + "TILES",
  101 + "METAESTAT_CODIGO_TIPO_REGIAO",
  102 + "ARQUIVOTEMAORIGINAL",
  103 + "PALLETEFILE",
  104 + "NOMEORIGINAL",
  105 + "OLSTATUS",
  106 + "PERMITEDOWNLOAD",
  107 + "LTEMPOFORMATODATA",
  108 + "FILTROORIGINAL",
  109 + "PERMITECOMENTARIO",
  110 + "LTEMPOITEMICONE",
  111 + "DATAORIGINAL",
  112 + "PLUGINI3GEO",
  113 + "METAESTAT",
  114 + "ITEMBUSCARAPIDA",
  115 + "ARQUIVODOWNLOAD",
  116 + "ARQUIVOKMZ",
  117 + "PERMITEKML",
  118 + "PERMITEOGC",
  119 + "CONVCARACTER",
  120 + "CORTEPIXELS",
  121 + "EDITORSQL",
  122 + "LTEMPOCONVENCODE",
  123 + "LTEMPOITEMFIM",
  124 + "OLOPACITY",
  125 + "LEGENDAWMS",
  126 + "LEGENDAIMG",
  127 + "KEYIMAGE",
  128 + "TILEINDEX",
  129 + "TILEITEM",
  130 + "SYMBOL",
  131 + "LABELITEM",
  132 + "FILTERITEM",
  133 + "GROUP",
  134 + "ENCODING",
  135 + "TIP",
  136 + "CLASSE",
  137 + "ITENSDESC",
  138 + "CLASSESNOME",
  139 + "ITENSLINK",
  140 + "ESCALA",
  141 + "CLASSESSIMBOLO",
  142 + "MENSAGEM",
  143 + "EXTENSAO",
  144 + "CLASSESITEM",
  145 + "ESCONDIDO",
  146 + "CLASSESCOR",
  147 + "DOWNLOAD",
  148 + "CLASSESTAMANHO",
  149 + "ITENS",
  150 + "TEMA",
  151 + "APLICAEXTENSAO",
  152 + "IDENTIFICA",
  153 + "TRANSITIONEFFECT"
  154 + );
  155 + foreach ( preg_split ( '~[\r\n]+~', $gravarTexto ) as $line ) {
  156 + $teste = strtoupper ( $line );
  157 + $teste = trim ( $teste );
  158 + $teste = str_replace ( array (
  159 + " ",
  160 + "'",
  161 + '"'
  162 + ), "", $teste );
  163 + $teste = preg_replace ( '/[\n\r\t ]*/', '', $teste );
  164 + $passou = true;
  165 + foreach ( $testar as $t ) {
  166 + if ($teste == $t) {
  167 + $passou = false;
  168 + }
  169 + }
  170 + if ($passou == true) {
  171 + if (mb_detect_encoding ( $line, 'UTF-8' ) == "UTF-8") {
  172 + $line = mb_convert_encoding($line,"ISO-8859-1","UTF-8");
  173 + }
  174 + $novoTexto [] = $line;
  175 + }
  176 + }
  177 + fwrite ( $fp, implode ( "\r\n", $novoTexto ) );
  178 + }
  179 + fclose ( $fp );
  180 + // testa o mapfile
  181 + ms_ResetErrorList ();
  182 + if (! @ms_newMapObj ( $mapfile )) {
  183 + echo "Erro no arquivo sera mantido o original<br>";
  184 + $error = ms_GetErrorObj ();
  185 + while ( $error && $error->code != MS_NOERR ) {
  186 + printf ( "<br>Error in %s: %s<br>\n", $error->routine, $error->message );
  187 + $error = $error->next ();
  188 + }
  189 + $fp = fopen ( $mapfile, "w" );
  190 + fwrite ( $fp, $original );
  191 + fclose ( $fp );
  192 + exit ();
  193 + }
  194 +
  195 + // verifica os metadata que sao armazenados tambem no banco de dados de administracao
  196 + // isso e necessario para manter a consistencia caso o usuario altere manualmente os valores
  197 +
  198 + // cria o objeto map
  199 + $mapa = ms_newMapObj ( $mapfile );
  200 + /*
  201 + * $layer = $mapa->getlayerbyname ( $codigo );
  202 + * if ($layer == "") {
  203 + * echo "<br><span style='color:red;'>Atenção: não existe nenhum LAYER com NAME igual a " . $codigo . "</span><br>";
  204 + * } else {
  205 + * include ("conexao.php");
  206 + * // pega o metadata
  207 + * $meta = $layer->getmetadata ( "permitedownload" );
  208 + * $meta = strtoupper ( $meta );
  209 + * if ($meta != "" && ($meta == "SIM" || $meta == "NAO")) {
  210 + * // grava no banco
  211 + * $dbhw->query ( "UPDATE " . $esquemaadmin . "i3geoadmin_temas SET download_tema='$meta' WHERE codigo_tema = '$codigo_tema'" );
  212 + * }
  213 + * $meta = $layer->getmetadata ( "permiteogc" );
  214 + * $meta = strtoupper ( $meta );
  215 + * if ($meta != "" && ($meta == "SIM" || $meta == "NAO")) {
  216 + * $dbhw->query ( "UPDATE " . $esquemaadmin . "i3geoadmin_temas SET ogc_tema='$meta' WHERE codigo_tema = '$codigo_tema'" );
  217 + * }
  218 + * $meta = $layer->getmetadata ( "permitekml" );
  219 + * $meta = strtoupper ( $meta );
  220 + * if ($meta != "" && ($meta == "SIM" || $meta == "NAO")) {
  221 + * $dbhw->query ( "UPDATE " . $esquemaadmin . "i3geoadmin_temas SET kml_tema='$meta' WHERE codigo_tema = '$codigo_tema'" );
  222 + * }
  223 + * $meta = $layer->getmetadata ( "permitekmz" );
  224 + * $meta = strtoupper ( $meta );
  225 + * if ($meta != "" && ($meta == "SIM" || $meta == "NAO")) {
  226 + * $dbhw->query ( "UPDATE " . $esquemaadmin . "i3geoadmin_temas SET kmz_tema='$meta' WHERE codigo_tema = '$codigo_tema'" );
  227 + * }
  228 + * $dbhw = null;
  229 + * $dbh = null;
  230 + * }
  231 + */
  232 +}
  233 +?>
0 234 \ No newline at end of file
... ...
admin1/catalogo/mapfile/editor/index.js 0 → 100755
... ... @@ -0,0 +1,36 @@
  1 +/*
  2 +Licenca:
  3 +
  4 +GPL2
  5 +
  6 +i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet
  7 +
  8 +Direitos Autorais Reservados (c) 2006 Minist&eacute;rio do Meio Ambiente Brasil
  9 +Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com
  10 +
  11 +Este programa &eacute; software livre; voc&ecirc; pode redistribu&iacute;-lo
  12 +e/ou modific&aacute;-lo sob os termos da Licen&ccedil;a P&uacute;blica Geral
  13 +GNU conforme publicada pela Free Software Foundation;
  14 +
  15 +Este programa &eacute; distribu&iacute;do na expectativa de que seja &uacute;til,
  16 +por&eacute;m, SEM NENHUMA GARANTIA; nem mesmo a garantia impl&iacute;cita
  17 +de COMERCIABILIDADE OU ADEQUA&Ccedil;&Atilde;O A UMA FINALIDADE ESPEC&Iacute;FICA.
  18 +Consulte a Licen&ccedil;a P&uacute;blica Geral do GNU para mais detalhes.
  19 +Voc&ecirc; deve ter recebido uma c&oacute;pia da Licen&ccedil;a P&uacute;blica Geral do
  20 +GNU junto com este programa; se n&atilde;o, escreva para a
  21 +Free Software Foundation, Inc., no endere&ccedil;o
  22 +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA.
  23 +
  24 + */
  25 +i3GEOadmin.mapfile = {};
  26 +i3GEOadmin.editor = {
  27 +
  28 + init: function(onde,codigo,id_tema){
  29 +
  30 + },
  31 + salvar: function(){
  32 + i3GEOadmin.core.iconeAguarde($("#titulo"));
  33 + $("form").submit();
  34 + }
  35 +
  36 +};
0 37 \ No newline at end of file
... ...
admin1/catalogo/mapfile/editor/index.php 0 → 100755
... ... @@ -0,0 +1,107 @@
  1 +<?php
  2 +define ( ONDEI3GEO, "../../../.." );
  3 +include (dirname ( __FILE__ ) . "/../../../../ms_configura.php");
  4 +error_reporting ( 0 );
  5 +include "../../../head.php";
  6 +$codigo = filter_var ( $_GET ["codigo"], FILTER_SANITIZE_STRING );
  7 +$id_tema = ( int ) $_GET ["id_tema"];
  8 +include ("exec.php");
  9 +salvaMapfile();
  10 +$textoMapfile = textoMapfile ( $codigo );
  11 +?>
  12 +<div class="container-fluid migalha">
  13 + <div class="row">
  14 + <div class="btn-group btn-breadcrumb">
  15 + <a class="btn btn-default" href="../../../../init/index.php">
  16 + <span>i3Geo</span>
  17 + </a>
  18 + <a class="btn btn-default" href="../../../index.php">
  19 + <span>Admin</span>
  20 + </a>
  21 + <a class="btn btn-default" style="pointer-events: none">
  22 + <span>Cat&aacute;logo</span>
  23 + </a>
  24 + <a class="btn btn-default" href="../index.php">
  25 + <span>Mapfiles</span>
  26 + </a>
  27 + <a class="btn btn-default" href="../opcoes/index.php?codigo=<?php echo $codigo; ?>&id_tema=<?php echo $id_tema; ?>">
  28 + <span>Op&ccedil;&otilde;es</span>
  29 + </a>
  30 + <a class="btn btn-default" style="pointer-events: none">
  31 + <span><?php echo $codigo; ?></span>
  32 + </a>
  33 + <a class="btn btn-default" style="pointer-events: none">
  34 + <span>Editor</span>
  35 + </a>
  36 + </div>
  37 + </div>
  38 +</div>
  39 +<div class="container-fluid">
  40 + <div class="row center-block">
  41 + <div class="col-md-12">
  42 + <div class="well" id="titulo">
  43 + <blockquote>
  44 + {{{ajudaEditor}}}
  45 + <a href="http://mapserver.org/mapfile/index.html#mapfile" target="_new">Mapserver</a>
  46 + </blockquote>
  47 + <a onclick="i3GEOadmin.editor.salvar()" class="btn btn-primary" style="color: #008579;" href="#" role="button"> {{{salva}}} </a>
  48 + <a onclick="preview()" class="btn btn-primary" style="color: #008579;" href="#" role="button"> Preview </a>
  49 + <a onclick="window.open('../../../../testamapfile.php?map=<?php echo $codigo;?>.map')" href="javascript:void(0)" class="btn btn-primary" style="color: #008579;" role="button"> {{{testaLayer}}} </a>
  50 + <a onclick="window.open('../../../../ms_criamapa.php?temasa=<?php echo $codigo;?>&layers=<?php echo $codigo;?>')" class="btn btn-primary" style="color: #008579;" href="javascript:void(0)" role="button"> {{{testarI3geo}}} </a>
  51 + <a onclick="window.open('../../../../ferramentas/recline/default.php?tema=<?php echo $codigo;?>')" class="btn btn-primary" style="color: #008579;" href="javascript:void(0)" role="button"> {{{tabela}}} </a>
  52 + </div>
  53 + <form action="index.php?codigo=<?php echo $codigo;?>&id_tema=<?php echo $id_tema;?>" method="post">
  54 + <TEXTAREA id=editor name=texto class="well form-control" style='font-size: 16px; width: 100%; float: left; border: 2px dotted lightgray;'>
  55 + <?php echo $textoMapfile; ?>
  56 + </TEXTAREA>
  57 + </form>
  58 + <!-- para calcular a altura do textarea -->
  59 + <pre id="editortemp" style="font-size: 16px; display: block; visibility: hidden;"><?php echo $textoMapfile; ?></pre>
  60 + </div>
  61 + </div>
  62 +</div>
  63 +<script type="text/javascript" src="index.js"></script>
  64 +<script type="text/javascript" src="../../../dicionario/editormapfile.js"></script>
  65 +<script>
  66 +
  67 +$(document).ready(function(){
  68 + //vem de admin1/index.js
  69 + iniciaMenuPrincipal();
  70 + $('ul.dropdown-menu [data-toggle=dropdown]').on('click', function(event) {
  71 + event.preventDefault();
  72 + event.stopPropagation();
  73 + $(this).parent().siblings().removeClass('open');
  74 + $(this).parent().toggleClass('open');
  75 + });
  76 + //traducao
  77 + var t = $("#titulo");
  78 + //complementa dicionario
  79 + i3GEOadmin.mapfile.dicionario = $.extend(
  80 + {},
  81 + i3GEOadmin.core.dicionario,
  82 + i3GEOadmin.mapfile.dicionario
  83 + );
  84 +
  85 + i3GEOadmin.core.dicionario = null;
  86 +
  87 + i3GEOadmin.editor.dicionario = i3GEO.idioma.objetoIdioma(i3GEOadmin.mapfile.dicionario);
  88 +
  89 + t.html(
  90 + Mustache.to_html(
  91 + t.html(),
  92 + i3GEOadmin.editor.dicionario
  93 + )
  94 + );
  95 +
  96 + var inicia = function() {
  97 + $(".hidden").removeClass('hidden');
  98 + };
  99 + i3GEO.login.verificaOperacao("admin/html/editortexto",i3GEO.configura.locaplic, inicia, "sessao");
  100 +
  101 + $.material.init();
  102 + $("#editor").height(parseInt($("#editortemp").height()) + 50 + "px");
  103 + $("#editortemp").html("").hide();
  104 + });
  105 +</script>
  106 +</body>
  107 +</html>
... ...
admin1/catalogo/mapfile/opcoes/templates/templateMaisOpcoes.php
... ... @@ -24,7 +24,7 @@
24 24 <div class="list-group-item">
25 25 <div class="row-content" >
26 26 <h4 class="list-group-item-heading">
27   - <a title="{{{editorTxt}}}" onclick="window.open('../../../../admin/php/editortexto.php?mapfile={{codigo}}')" href="javascript:void(0)" class="pull-right btn btn-danger btn-fab btn-fab-mini" role="button">
  27 + <a title="{{{editorTxt}}}" href="../editor/index.php?codigo={{codigo}}" class="pull-right btn btn-danger btn-fab btn-fab-mini" role="button">
28 28 <i class="material-icons">sending</i>
29 29 </a>
30 30 {{{editorTxt}}}
... ...
admin1/dicionario/core.js
1 1 //+$trad(1,i3GEOadmin.principal.dicionario)+
2 2 i3GEOadmin.core.dicionario = {
  3 + 'tabela' : [ {
  4 + pt : "Tabela",
  5 + en : "",
  6 + es : ""
  7 + } ],
3 8 'inicio' : [ {
4 9 pt : "In&iacute;cio",
5 10 en : "",
... ...
admin1/dicionario/editormapfile.js
1 1 //+$trad(1,i3GEOadmin.editormapfile.dicionario)+
2 2 i3GEOadmin.mapfile.dicionario = {
  3 + 'ajudaEditor' : [ {
  4 + pt : "Salve antes de testar. Mais detalhes sobre a edi&ccedil;&atilde;o de mapfiles veja em:",
  5 + en : "",
  6 + es : ""
  7 + } ],
3 8 'editarI3geo' : [ {
4 9 pt : "Editar usando o i3Geo",
5 10 en : "",
... ...
temas/_estadosbr.map
1   -MAP
2   - FONTSET "../symbols/fontes.txt"
3   - SYMBOLSET "../symbols/simbolosv6.sym"
4   - LAYER
5   - DATA "/var/www/i3geo/aplicmap/dados/estados.shp"
6   - METADATA
7   - "CLASSE" "SIM"
8   - "permitekmz" "SIM"
9   - "permitedownload" "SIM"
10   - "METAESTAT" ""
11   - "permitekml" "SIM"
12   - "permiteogc" "SIM"
13   - "TEMA" "Limite Estadualx"
14   - END # METADATA
15   - NAME "_estadosbr"
16   - STATUS DEFAULT
17   - TEMPLATE "none.htm"
18   - TILEITEM "location"
19   - TYPE LINE
20   - UNITS METERS
21   - CLASS
22   - NAME ""
23   - STYLE
24   - COLOR 0 0 0
25   - END # STYLE
26   - END # CLASS
27   - END # LAYER
28   -
29   -END # MAP
30   -
  1 +MAP
  2 + FONTSET "../symbols/fontes.txt"
  3 + SYMBOLSET "../symbols/simbolosv6.sym"
  4 + LAYER
  5 + DATA "/var/www/i3geo/aplicmap/dados/estados.shp"
  6 + METADATA
  7 + "CLASSE" "SIM"
  8 + "permitekmz" "SIM"
  9 + "permitedownload" "SIM"
  10 + "permitekml" "SIM"
  11 + "permiteogc" "SIM"
  12 + "TEMA" "Limite Estadualx"
  13 + END # METADATA
  14 + NAME "_estadosbr"
  15 + STATUS DEFAULT
  16 + TEMPLATE "none.htm"
  17 + TILEITEM "location"
  18 + TYPE LINE
  19 + UNITS METERS
  20 + CLASS
  21 + NAME ""
  22 + STYLE
  23 + COLOR 0 0 0
  24 + END # STYLE
  25 + END # CLASS
  26 + END # LAYER
  27 +END # MAP
31 28 \ No newline at end of file
... ...
temas/_lbiomashp.map
... ... @@ -6,21 +6,20 @@ MAP
6 6 DATA "/var/www/i3geo/aplicmap/dados/biomas.shp"
7 7 METADATA
8 8 "TIP" "CD_LEGENDA"
9   - "CACHE" "sim"
  9 + #"cache" "sim"
  10 + "transitioneffect" "SIM"
10 11 "CLASSE" "SIM"
11 12 "permitekmz" "nao"
12   - "ITENSDESC" "Bioma Teste de acentuação"
13   - "ESCALA" "1000000"
14   - "TILES" "NAO"
15   - "extensao" "-76 -39 -29 9"
  13 + "ITENSDESC" "Teste de acentuação"
16 14 "permitedownload" "sim"
17   - "download" "sim"
  15 + "download" "SIM"
18 16 "itembuscarapida" "CD_LEGENDA"
19 17 "ITENS" "CD_LEGENDA"
20   - "transitioneffect" "SIM"
21 18 "permiteogc" "sim"
22 19 "permitekml" "sim"
23   - "TEMA" "Biomas SHP (acentução) teste"
  20 + "TEMA" "Biomas shapefile (acentuação)"
  21 + "ESCALA" "1000000"
  22 + "TILES" "SIM"
24 23 END # METADATA
25 24 NAME "_lbiomashp"
26 25 PROCESSING "ITEMS=CD_LEGENDA"
... ... @@ -29,13 +28,14 @@ MAP
29 28 STATUS DEFAULT
30 29 TEMPLATE "none.htm"
31 30 TILEITEM "location"
  31 + OPACITY 90
32 32 TYPE POLYGON
33 33 UNITS METERS
34 34 CLASS
35 35 NAME "CAATINGA"
36 36 EXPRESSION ('[CD_LEGENDA]'eq'CAATINGA')
37 37 STYLE
38   - COLOR 247 166 4
  38 + COLOR 183 247 169
39 39 OUTLINECOLOR 255 255 255
40 40 END # STYLE
41 41 TITLE ""
... ... @@ -44,7 +44,7 @@ MAP
44 44 NAME "PAMPA area > 5"
45 45 EXPRESSION ('[CD_LEGENDA]'eq'PAMPA area > 5')
46 46 STYLE
47   - COLOR 116 220 127
  47 + COLOR 239 22 152
48 48 OUTLINECOLOR 255 255 255
49 49 END # STYLE
50 50 TITLE ""
... ... @@ -53,7 +53,7 @@ MAP
53 53 NAME "CERRADO"
54 54 EXPRESSION ('[CD_LEGENDA]'eq'CERRADO')
55 55 STYLE
56   - COLOR 202 199 25
  56 + COLOR 57 32 234
57 57 OUTLINECOLOR 255 255 255
58 58 END # STYLE
59 59 TITLE ""
... ... @@ -62,7 +62,7 @@ MAP
62 62 NAME "PANTANAL"
63 63 EXPRESSION ('[CD_LEGENDA]'eq'PANTANAL')
64 64 STYLE
65   - COLOR 68 130 30
  65 + COLOR 214 107 232
66 66 OUTLINECOLOR 255 255 255
67 67 END # STYLE
68 68 TITLE ""
... ... @@ -71,19 +71,19 @@ MAP
71 71 NAME "AMAZÔNIA"
72 72 EXPRESSION ('[CD_LEGENDA]'eq'AMAZÔNIA')
73 73 STYLE
74   - COLOR 23 2 150
  74 + COLOR 102 177 195
75 75 OUTLINECOLOR 255 255 255
76 76 END # STYLE
77 77 TITLE ""
78 78 END # CLASS
79 79 CLASS
80   - NAME "MATA ATLÂNTICA"
  80 + NAME "MATA ATLÂNTICA"
81 81 EXPRESSION ('[CD_LEGENDA]'eq'MATA ATLÂNTICA')
82 82 STYLE
83   - COLOR 187 96 164
  83 + COLOR 44 215 49
84 84 OUTLINECOLOR 255 255 255
85 85 END # STYLE
86 86 TITLE ""
87 87 END # CLASS
88 88 END # LAYER
89   -END # MAP
  89 +END # MAP
90 90 \ No newline at end of file
... ...
testamapfile.php
... ... @@ -274,10 +274,12 @@ function verifica($map,$solegenda,$tabela,$cache=&quot;sim&quot;){
274 274 }
275 275 if(!stristr($tema, '.map') === FALSE){
276 276 if(file_exists($mapUrl)){
  277 + ms_ResetErrorList();
277 278 if(@ms_newMapObj($mapUrl)){
278 279 $nmapa = ms_newMapObj($mapUrl);
279 280 }
280 281 else{
  282 +
281 283 echo "Erro no arquivo $mapUrl <br>";
282 284 $error = ms_GetErrorObj();
283 285 while($error && $error->code != MS_NOERR){
... ...