diff --git a/ferramentas/animagif/manutencao.php b/ferramentas/animagif/manutencao.php index 92a091f..4ff4cda 100755 --- a/ferramentas/animagif/manutencao.php +++ b/ferramentas/animagif/manutencao.php @@ -20,109 +20,25 @@ $retorno = ""; //string que será retornada ao browser via JSON switch (strtoupper($funcao)) { case "REMOVE": - restauraCon($map_file,$postgis_mapa); $mapa = ms_newMapObj($map_file); $l = $mapa->getlayerbyname($tema); if($l != ""){ $l->setmetadata("tme",""); $mapa->save($map_file); } - $arq = $locaplic."/temas/".$tema.".map"; - if(file_exists($arq)){ - $mapa = ms_newMapObj($arq); - $l = $mapa->getlayerbyname($tema); - if($l != ""){ - $l->setmetadata("animagif",""); - $mapa->save($arq); - removeCabecalho($arq); - } - } $retorno = "ok"; break; case "INCLUI": - restauraCon($map_file,$postgis_mapa); - $mapa = ms_newMapObj($map_file); - $l = $mapa->getlayerbyname($tema); - if($l != ""){ - $l->setmetadata("animagif",$animagif); - $mapa->save($map_file); - } - $arq = $locaplic."/temas/".$tema.".map"; - if(file_exists($arq)){ - $mapa = ms_newMapObj($arq); - $l = $mapa->getlayerbyname($tema); - if($l != ""){ - $l->setmetadata("animagif",str_replace("\\","'",$_POST["animagif"])); - $mapa->save($arq); - removeCabecalho($arq); - } - } - $retorno = "ok"; + $mapa = ms_newMapObj($map_file); + $l = $mapa->getlayerbyname($tema); + if($l != ""){ + $l->setmetadata("animagif",str_replace("\\","'",$_POST["animagif"])); + $mapa->save($map_file); + } + $retorno = "ok"; break; } cpjson($retorno); -//TODO colocar essa funcao em algum lugar que permita reaproveitamento -function removeCabecalho($arq,$symbolset=true) -{ - $handle = fopen($arq, "r"); - if ($handle) - { - $cabeca = array(); - if($symbolset) - { - $cabeca[] = "MAP\n"; - } - $grava = false; - while (!feof($handle)) - { - $linha = fgets($handle); - if($symbolset) - { - if(strpos(strtoupper($linha),"SYMBOLSET") !== false) - { - $cabeca[] = $linha; - } - if(strpos(strtoupper($linha),"FONTSET") !== false) - { - $cabeca[] = $linha; - } - } - if(strtoupper(trim($linha)) == "LAYER") - { - $grava = true; - } - if($grava) - { - $final[] = rtrim($linha, "\r\n") . PHP_EOL; - } - } - fclose($handle); - } - $final = array_merge($cabeca,$final); - $handle = fopen($arq, "w+"); - foreach ($final as $f) - { - // - //remove resultados em branco - //e grava a linha - // - $teste = strtoupper($f); - $teste = trim($teste); - $teste = str_replace(" ","",$teste); - $teste = str_replace("'","",$teste); - $teste = str_replace('"',"",$teste); - $teste = preg_replace('/[\n\r\t ]*/', '', $teste); - $testar = array("KEYIMAGE","TILEINDEX","TILEITEM","SYMBOL","LABELITEM","FILTERITEM","GROUP","ENCODING","TIP","CLASSE","ITENSDESC","CLASSESNOME","ITENSLINK","ESCALA","CLASSESSIMBOLO","MENSAGEM","EXTENSAO","CLASSESITEM","ESCONDIDO","CLASSESCOR","DOWNLOAD","CLASSESTAMANHO","ITENS","TEMA","APLICAEXTENSAO","IDENTIFICA"); - $passou = true; - foreach ($testar as $t) - { - if($teste == $t){ - $passou = false; - } - } - if($passou) - fwrite($handle,$f); - } - fclose($handle); -} + + ?> \ No newline at end of file diff --git a/ferramentas/markercluster/funcoes.php b/ferramentas/markercluster/funcoes.php index db5f927..a802bf7 100755 --- a/ferramentas/markercluster/funcoes.php +++ b/ferramentas/markercluster/funcoes.php @@ -8,8 +8,7 @@ function markerclusterDados($map_file){ include_once($dir."/../../classesphp/classe_atributos.php"); $m = new Atributos($map_file,$layer); $registros = $m->listaRegistrosXY($coluna, "brasil", "tudo"); - //TODO remover - $registros = array_slice($registros,0,50); + //$registros = array_slice($registros,0,50); $n = count($registros); $resultado = array(); if(empty($coluna)){ diff --git a/ferramentas/storymap/default.php b/ferramentas/storymap/default.php index 89f48a2..d83113a 100755 --- a/ferramentas/storymap/default.php +++ b/ferramentas/storymap/default.php @@ -69,7 +69,7 @@ html, body {
- +