exec.php
1.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?php
include_once(dirname(__FILE__)."/../safe2.php");
verificaBlFerramentas(basename(dirname(__FILE__)),$_SESSION["i3geoBlFerramentas"],false);
$retorno = "";
include_once(dirname(__FILE__)."/../../classesphp/classe_legenda.php");
switch (strtoupper($_GET["funcao"]))
{
/*
Valor: APLICAPARAMETROSLEGIMG
Aplica um parâmetro em um estilo de uma classe.
<Legenda->aplicaParametrosLegImg>
*/
case "APLICAPARAMETROSLEGIMG":
$m = new Legenda($_SESSION["map_file"]);
$retorno = $m->aplicaParametrosLegImg($_GET);
$m->salva();
ob_clean();
header("Content-type: application/json");
echo json_encode(array(
"errorMsg" => ""
));
exit;
break;
/*
Valor: PEGAPARAMETROSLEGIMG
Pega os parâmetros da legenda embebida no mapa.
<Legenda->pegaParametrosLegImg>
*/
case "PEGAPARAMETROSLEGIMG":
$m = new Legenda($_SESSION["map_file"]);
$retorno = $m->pegaParametrosLegImg();
if($retorno["status"] == 0){
$retorno["status"] = 1;
}
ob_clean();
header("Content-type: application/json");
echo json_encode($retorno);
exit;
break;
/*
Valor: TESTALEGENDA
Testa os parâmetros de definição da legenda inserida no mapa.
<Legenda->aplicaParametrosLegImg>
*/
case "TESTALEGENDA":
$map_file = str_replace(".map","",$_SESSION["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);
$retorno = $m->legendaGrafica();
ob_clean();
header("Content-type: application/json");
echo json_encode($retorno["imagem"]);
exit;
break;
case "GETLEGENDA":
$m = new Legenda($_SESSION["map_file"]);
$retorno = $m->legendaGrafica();
ob_end_clean();
header('Content-type: image/png');
readfile($retorno["arq"]);
exit;
break;
}