Example #1
0
<?php

$lib = new Legenda();
$legenda = $lib->getLegenda();
<?php

$lib = new Legenda();
$MSG = '';
if (!empty($_POST['dodaj_legenda'])) {
    if ($lib->addLegenda($_POST['opis_legenda'], $_POST['symbol_legenda'])) {
        $message = 'Legenda została pomyślnie dodana';
        $MSG = Msg($message, 1);
    } else {
        $message = 'Błąd dodawania legendy';
        $MSG = Msg($message, 0);
    }
}
if (!empty($_POST['zapisz_legenda'])) {
    if ($lib->updateLegenda($_POST['id_legenda'], $_POST['opis_legenda'], $_POST['symbol_legenda'])) {
        $message = 'Legenda została pomyślnie zaktualizowana';
        $MSG = Msg($message, 1);
    } else {
        $message = 'Błąd aktualizacji legendy';
        $MSG = Msg($message, 0);
    }
}
if (!empty($_POST['usun_legenda'])) {
    if ($lib->deleteLegenda($_POST['id_legenda'])) {
        $message = 'Legenda została pomyślnie usunięta';
        $MSG = Msg($message, 1);
    } else {
        $message = 'Błąd usuwania legendy';
        $MSG = Msg($message, 0);
    }
}
Example #3
0
 }
 if (!isset($tipolista)) {
     $tipolista = "";
 }
 if (!isset($itemtema)) {
     $itemtema = "";
 }
 if (!isset($unico)) {
     $unico = "";
 }
 $legenda = "";
 if (!isset($dadosDaClasse)) {
     $dadosDaClasse = "nao";
 } else {
     include_once "classe_legenda.php";
     $mc = new Legenda($map_file, $locaplic, $tema);
     $linhas = $mc->tabelaLegenda();
     foreach ($linhas as $linha) {
         if ($linha["tema"] == $tema) {
             $legenda[$linha["idclasse"]] = $linha["imagem"];
         }
     }
 }
 $retorno = $m->listaRegistros($itemtema, $tipo, $unico, $inicio, $fim, $tipolista, $dadosDaClasse);
 $retorno["legenda"] = $legenda;
 break;
 /*
  Valor: LISTAUNICA
 
 Pega todos os valores dos itens de uma tabela de um tema.
 
Example #4
0
     }
     $retorno = $r;
     break;
     /*
      Valor: APLICATODASCLASSES
     
     Aplica um parametro a todas as classes
     */
 /*
  Valor: APLICATODASCLASSES
 
 Aplica um parametro a todas as classes
 */
 case "APLICATODASCLASSES":
     include_once dirname(__FILE__) . "/../../classesphp/classe_legenda.php";
     $m = new Legenda($map_file, $locaplic, $tema);
     $r = $m->aplicaTodasClasses($_GET["parametro"], $_GET["valor"]);
     $m->salva();
     if (!$r) {
         $r = "erro.Erro legenda nao disponivel";
     }
     $retorno = $r;
     break;
 case "APLICARCLUSTER":
     include_once dirname(__FILE__) . "/../../classesphp/classe_temas.php";
     $m = new Temas($map_file, $tema);
     $l = $m->mapa->getlayerbyname($tema);
     if ($filter != "") {
         //$filter = base64decode($filter);
     }
     $m->criaCluster($_GET["group"], $_GET["filter"], $_GET["maxdistance"], $_GET["region"], $_GET["buffer"]);
Example #5
0
             $base = "/var/www/html/i3geo/aplicmap/geral1fedorav" . $versao . ".map";
         }
         if ($base == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav' . $versao . '.map')) {
             $base = "/opt/www/html/i3geo/aplicmap/geral1v" . $versao . ".map";
         }
         if ($base == "") {
             $base = $locaplic . "/aplicmap/geral1v" . $versao . ".map";
         }
     }
 } else {
     if (!file_exists($base)) {
         $base = $locaplic . "/aplicmap/" . $base;
     }
 }
 $base = str_replace(".map", "", $base) . ".map";
 $m = new Legenda($base, $locaplic);
 retornaJSON($m->listaSimbolos($tipo, $dir_tmp, "", $_GET["onclick"], 8, 1, true));
 exit;
 break;
 /*
 Valor: PEGALAYERS
 
 Lista os layers existentes em um mapfile
 
 Parametros:
 
 codigoMap {string} - nome do mapfile (sem .map)
 
 Retorno:
 
 {JSON}
Example #6
0
        include_once dirname(__FILE__) . "/../../classesphp/classe_legenda.php";
        $m = new Legenda($map_file);
        $retorno = $m->pegaParametrosLegImg();
        break;
        /*
        Valor: TESTALEGENDA
        
        Testa os par&acirc;metros de defini&ccedil;&atilde;o da legenda inserida no mapa.
        
        <Legenda->aplicaParametrosLegImg>
        */
    /*
    Valor: TESTALEGENDA
    
    Testa os par&acirc;metros de defini&ccedil;&atilde;o da legenda inserida no mapa.
    
    <Legenda->aplicaParametrosLegImg>
    */
    case "TESTALEGENDA":
        include_once dirname(__FILE__) . "/../../classesphp/classe_legenda.php";
        $map_file = str_replace(".map", "", $map_file) . ".map";
        copy($map_file, str_replace(".map", "testeleg.map", $map_file));
        $m = new Legenda(str_replace(".map", "testeleg.map", $map_file));
        $m->aplicaParametrosLegImg($_GET["fonte"], $_GET["imagecolor"], $_GET["position"], $_GET["status"], $_GET["outlinecolor"], $_GET["keyspacingy"], $_GET["keyspacingx"], $_GET["keysizey"], $_GET["keysizex"], $_GET["height"], $_GET["width"], $_GET["labelsize"]);
        $retorno = $m->legendaGrafica();
        break;
}
if (isset($map_file) && isset($postgis_mapa) && $map_file != "") {
    restauraCon($map_file, $postgis_mapa);
}
cpjson($retorno);