Commit e399b84eb0f28aa54df9123c74b85dbeee87eae4
1 parent
d3927994
Exists in
master
and in
7 other branches
--no commit message
Showing
24 changed files
with
1386 additions
and
1151 deletions
Show diff stats
admin/base.map
admin/html/arvore.html
... | ... | @@ -36,7 +36,7 @@ |
36 | 36 | <div class="ft"></div> |
37 | 37 | </div> |
38 | 38 | <br> |
39 | -<p>Menus existentes Para editar os menus clique <a href="menus.html" >aqui</a>):</p> | |
39 | +<p>Menus existentes Para editar os menus clique <a href="menus.html" >aqui</a>:</p> | |
40 | 40 | <div id="tabela" style="left:-5px;"></div> |
41 | 41 | </div> |
42 | 42 | <div id=logajax style="display:block" ></div> | ... | ... |
admin/html/mapfiles.html
1 | 1 | <html> |
2 | 2 | <head> |
3 | 3 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
4 | -<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
5 | -<link rel="stylesheet" type="text/css" href="admin.css"> | |
6 | -<script src="../js/admin.js" type="text/javascript"></script> | |
7 | -<script src="../js/mapfiles.js" type="text/javascript"></script> | |
4 | + <style type="text/css"> | |
5 | + /*margin and padding on body element | |
6 | + can introduce errors in determining | |
7 | + element position and are not recommended; | |
8 | + we turn them off as a foundation for YUI | |
9 | + CSS treatments. */ | |
10 | + body { | |
11 | + margin:0; | |
12 | + padding:0; | |
13 | + } | |
14 | + </style> | |
8 | 15 | |
16 | +<script type="text/javascript" src="../js/core.js"></script> | |
17 | +<script src="../js/mapfiles.js" type="text/javascript"></script> | |
9 | 18 | </head> |
10 | -<body> | |
11 | -<div style=width:80%;text-align:center;> | |
12 | -<h1>Administração do i3geo - mapfiles principais <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | |
13 | -<p><a href="../index.html">voltar</a></p> | |
14 | -<div id=ajuda style="display:none"> | |
15 | -<p>Este programa permite alterar as configurações básicas dos arquivos mapfile existentes em i3geo/aplicmap</p> | |
16 | -<p>Esses arquivos são os mapas básicos utilizados pelo i3geo na inicialização.</p> | |
17 | -<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
18 | -dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
19 | -alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
20 | -</div></div> | |
19 | +<body class=" yui-skin-sam"> | |
20 | +<div style=width:80%;> | |
21 | +<h1>Administração do i3geo - mapfiles de inicialização <img id=botaoAjuda src="../imagens/04.png" style="cursor:pointer" /></h1> | |
21 | 22 | |
22 | -<div id=aguarde style="color:red" ><img src="../../imagens/aguarde.gif" /></div> | |
23 | +<div id="ajuda"> | |
24 | + <div class="hd">Ajuda</div> | |
25 | + <div class="bd" style="height:144px;overflow:auto"> | |
26 | + Este programa permite alterar as configurações básicas dos arquivos mapfile existentes em i3geo/aplicmap<br> | |
27 | + Esses arquivos são os mapas básicos utilizados pelo i3geo na inicialização.<br> | |
28 | + A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
29 | + dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
30 | + alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php. | |
31 | + </div> | |
32 | + <div class="ft"></div> | |
33 | +</div> | |
34 | +</div> | |
23 | 35 | <br> |
24 | -<input onclick="restauraPadrao()" type=button value="Restaura os valores padrão" /><br><br> | |
25 | -<input onclick="javascript:window.open('../testainstal.php')" type=button value="Testar a instalação" /><br><br> | |
26 | - | |
36 | +<input id=botao2 type=button value="Testar a instalação" /><br><br> | |
37 | +<div id="tabela" style="left:-5px;"></div> | |
27 | 38 | </body> |
28 | -<script> | |
29 | -/* | |
30 | -Title: Administração dos mapfiles básicos | |
31 | - | |
32 | -File: i3geo/admin/mapfiles.htm | |
33 | -*/ | |
34 | -iniciaAdmin() | |
35 | -document.getElementById("aguarde").style.display="none" | |
36 | 39 | |
37 | -</script> | |
38 | 40 | </html> |
39 | 41 | \ No newline at end of file | ... | ... |
admin/html/ms_configura.html
1 | 1 | <html> |
2 | 2 | <head> |
3 | 3 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
4 | -<link rel="stylesheet" type="text/css" href="admin.css"> | |
5 | -<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
6 | -<script src="../js/admin.js" type="text/javascript"></script> | |
4 | + <style type="text/css"> | |
5 | + /*margin and padding on body element | |
6 | + can introduce errors in determining | |
7 | + element position and are not recommended; | |
8 | + we turn them off as a foundation for YUI | |
9 | + CSS treatments. */ | |
10 | + body { | |
11 | + margin:0; | |
12 | + padding:0; | |
13 | + } | |
14 | + </style> | |
15 | + | |
16 | +<script type="text/javascript" src="../js/core.js"></script> | |
7 | 17 | <script src="../js/ms_configura.js" type="text/javascript"></script> |
8 | 18 | </head> |
9 | -<body> | |
10 | -<div style=width:80%;text-align:center;> | |
11 | -<h1>Administração do i3geo - ms_configura.php <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | |
12 | -<p><a href="../index.html">voltar</a></p> | |
13 | -<div id=ajuda style="display:none"> | |
14 | -<p>Este programa permite alterar as variáveis de configuração existentes no programa ms_configura.php</p> | |
15 | -<p>O ms_configura.php é utilizado como um "include" nos programas do i3geo, definindo uma série de parâmetros necessários ao seu funcionamento.</p> | |
16 | -<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
17 | -dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
18 | -alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
19 | -<p>Da mesma forma, a variável $menutemas não pode ser modificada nesse formulário. Por padrão, essa variável é definida como vazia, forçando o i3geo a montar a árvore de camadas utilizando o banco de dados administrativo.</p> | |
20 | -<p>Se você quer utilizar um outro mecanismo de montagem do menu de temas, edite manualmente o arquivo ms_configura.php. | |
21 | -</div></div> | |
19 | +<body class=" yui-skin-sam"> | |
20 | +<div style=width:80%;> | |
21 | +<h1>Administração do i3geo - ms_configura.php <img id=botaoAjuda src="../imagens/04.png" style="cursor:pointer" /></h1> | |
22 | 22 | |
23 | -<div id=aguarde style="color:red" ><img src="../../imagens/aguarde.gif" /></div> | |
23 | +<div id="ajuda"> | |
24 | + <div class="hd">Ajuda</div> | |
25 | + <div class="bd" style="height:144px;overflow:auto"> | |
26 | + Este programa permite alterar as variáveis de configuração existentes no programa ms_configura.php<br> | |
27 | + O ms_configura.php é utilizado como um "include" nos programas do i3geo, definindo uma série de parâmetros necessários ao seu funcionamento.<br> | |
28 | + Da mesma forma, a variável $menutemas não pode ser modificada nesse formulário. Por padrão, essa variável é definida como vazia, forçando o i3geo a montar a árvore de camadas utilizando o banco de dados administrativo.<br> | |
29 | + Se você quer utilizar um outro mecanismo de montagem do menu de temas, edite manualmente o arquivo ms_configura.php.<br> | |
30 | + A lista de IPs dos usuários que podem administrar o i3geo é definida no | |
31 | + arquivo i3geo/ms_configura.php | |
32 | + </div> | |
33 | + <div class="ft"></div> | |
34 | +</div> | |
35 | +</div> | |
24 | 36 | <br> |
25 | -<input onclick="restauraPadrao()" type=button value="Restaura os valores padrão" /><br><br> | |
26 | -<input onclick="javascript:window.open('../testainstal.php')" type=button value="Testar a instalação" /><br><br> | |
27 | - | |
37 | +<input id=botao2 type=button value="Testar a instalação" /><br><br> | |
38 | +<div id="tabela" style="left:-5px;"></div> | |
28 | 39 | </body> |
29 | -<script> | |
30 | -/* | |
31 | -Title: Administração do ms_configura.php | |
32 | - | |
33 | -Administração das variáveis de configuração existentes no programa i3geo/ms_configura.php | |
34 | - | |
35 | -File: i3geo/admin/ms_configura.htm | |
36 | -*/ | |
37 | -iniciaAdmin() | |
38 | 40 | |
39 | -</script> | |
40 | 41 | </html> |
41 | 42 | \ No newline at end of file | ... | ... |
admin/html/temas.html
1 | +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> | |
1 | 2 | <html> |
2 | 3 | <head> |
3 | -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
4 | -<link rel="stylesheet" type="text/css" href="admin.css"> | |
5 | -<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
6 | -<script src="../js/admin.js" type="text/javascript"></script> | |
7 | -<script src="../js/temas.js" type="text/javascript"></script> | |
4 | + <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> | |
5 | + <title>Menus</title> | |
6 | + <style type="text/css"> | |
7 | + /*margin and padding on body element | |
8 | + can introduce errors in determining | |
9 | + element position and are not recommended; | |
10 | + we turn them off as a foundation for YUI | |
11 | + CSS treatments. */ | |
12 | + body { | |
13 | + margin:0; | |
14 | + padding:0; | |
15 | + } | |
16 | + </style> | |
17 | + <script type="text/javascript" src="../js/core.js"></script> | |
18 | + <script type="text/javascript" src="../js/temas.js"></script> | |
8 | 19 | </head> |
9 | -<body> | |
20 | +<body class=" yui-skin-sam"> | |
21 | +<div style="margin:20px"> | |
10 | 22 | <div style=width:80%;text-align:center;> |
11 | -<h1>Administração do i3geo - Temas <img src="../imagens/04.png" style="cursor:pointer" onclick="$i('ajuda').style.display='block'"/></h1> | |
12 | -<p><a href="../index.html">Voltar</a></p> | |
13 | -<div id=ajuda style="display:none"> | |
14 | -<p>Este programa permite criar ou editar os arquivos mapfile que compõem temas no i3geo.</p> | |
15 | -<p>O menu é baseado no banco admin.db.</p> | |
16 | -<p>A lista de IPs dos usuários que podem editar os arquivos de configuração do i3geo e | |
17 | -dos que podem navegar pelos diretórios do servidor, não são mostradas aqui. Para | |
18 | -alterar essas variáveis, vc deve editar diretamente o arquivo i3geo/ms_configura.php.</p> | |
19 | -<p>A lista de arquivos editáveis é baseada no banco de dados administrativo. Para que um arquivo apareça na | |
20 | -listagem, ele deve ter sido incluído no banco por meio da opção "Editar a lista de temas"</p> | |
21 | - | |
22 | -</div></div> | |
23 | -<fieldset> | |
24 | - <legend>Arquivo em edição</legend> | |
25 | - <p>Escolha o arquivo para editar (a lista de arquivos é baseada no banco de dados administrativo)</p> | |
26 | - <div id=arquivoAtivo ><p style=color:red >Aguarde...</p></div> | |
27 | - <p><input onclick=testarMap() type=button value="Testar" /></p> | |
28 | - | |
29 | - <p>Ou crie um novo (o código é uma palavra sem espaços que identifica o arquivo de forma única dentro do diretório i3geo/temas):</p> | |
30 | - <p>Código:</p> | |
31 | - <p><input type=text size=20 value="" id=codigoNovoMap /></p> | |
32 | - <p>Nome:</p> | |
33 | - <p><input type=text size=20 value="" id=nomeNovoMap /></p> | |
34 | - <p><input onclick=criarNovoMap() type=button value="Criar" id=nomeNovoMap /></p> | |
35 | -</fieldset> | |
36 | -<p><input onclick=adicionarLayer() type=button value="Adicionar um novo layer" /></p> | |
37 | -<div id=forms style=display:none ></div> | |
23 | +<h1>Administração do i3geo - mapfiles dos temas <img src="../imagens/04.png" style="cursor:pointer" id=botaoAjuda /></h1> | |
38 | 24 | |
25 | +</div> | |
26 | +<div id="ajuda"> | |
27 | + <div class="hd">Ajuda</div> | |
28 | + <div class="bd" style="height:144px;overflow:auto"> | |
29 | + Este programa permite criar ou editar os arquivos mapfile que compõem temas no i3geo.<br> | |
30 | + Os arquivo .map são armazenados no diretório i3geo/temas e podem também ser editados manualmente.<br> | |
31 | + Cada arquivo contém layers definidos conforme a sintaxe utilizada pelo Mapserver. Esses arquivos são as | |
32 | + estruturas básicas utilizadas pelo i3geo na apresentação de dados e montagem das camadas que são vistas no mapa.<br> | |
33 | + Após criados os mapfiles, deve-se ainda definir as características de cada tema.<br> | |
34 | + A lista de IPs dos usuários que podem administrar o i3geo é definida no | |
35 | + arquivo i3geo/ms_configura.php | |
36 | + </div> | |
37 | + <div class="ft"></div> | |
38 | +</div> | |
39 | +<input onclick="adicionaLinha()" type=button id=adiciona value="Criar um novo mapfile" /> | |
40 | +<br><br> | |
41 | +Além de criar os mapfiles, deve-se definir as características de cada tema antes de montar os menus. Para definir essas | |
42 | +características, clique <a href="listatemas.html" >aqui.</a><br> | |
43 | +<p>Mapfiles:</p> | |
44 | +<div id="tabela" style="left:-5px;"></div> | |
45 | +</div> | |
46 | +<div id=logajax style="display:block" ></div> | |
47 | +<div id=dialogoContinua style="display:block" ></div> | |
39 | 48 | |
40 | 49 | </body> |
41 | -<script> | |
42 | -iniciaAdmin() | |
43 | -</script> | |
44 | -</html> | |
45 | 50 | \ No newline at end of file | ... | ... |
admin/js/arvore.js
admin/js/mapfiles.js
... | ... | @@ -25,81 +25,53 @@ GNU junto com este programa; se não, escreva para a |
25 | 25 | Free Software Foundation, Inc., no endereço |
26 | 26 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
27 | 27 | */ |
28 | +YAHOO.namespace("example.container"); | |
28 | 29 | /* |
29 | 30 | Function: iniciaAdmin |
30 | 31 | |
31 | 32 | Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração |
32 | 33 | */ |
33 | -function iniciaAdmin() | |
34 | +function initMenu() | |
34 | 35 | { |
35 | -$parametros = { | |
36 | + core_ativaPainelAjuda("ajuda","botaoAjuda"); | |
37 | + new YAHOO.widget.Button("botao2",{ onclick: { fn: function(){window.open('../../testainstal.php') }} }); | |
38 | + $parametros = { | |
36 | 39 | "simples": [ |
37 | 40 | { mensagem: "Arquivo que define as fontes de texto utilizadas",cabeca: "FONTSET", variavel: "FONTSET"}, |
38 | 41 | { mensagem: "Arquivo que define a simbologia",cabeca: "SYMBOLSET", variavel: "SYMBOLSET"}, |
39 | 42 | { mensagem: "Diretório com o caminho padrão para arquivos shapefile",cabeca: "SHAPEPATH", variavel: "SHAPEPATH"}, |
40 | - { mensagem: "Extensão geográfica. Após alterar os valores, clique na imagem para atualizar.",cabeca: "EXTENT", variavel: "EXTENT"}, | |
43 | + { mensagem: "Extensão geográfica (xmin ymin xmax ymax). ",cabeca: "EXTENT", variavel: "EXTENT"}, | |
41 | 44 | { mensagem: "Endereço da imagem de referência",cabeca: "IMAGE", variavel: "IMAGE"}, |
42 | 45 | { mensagem: "Caminho para o armazenamento das imagens temporárias",cabeca: "IMAGEPATH", variavel: "IMAGEPATH"}, |
43 | 46 | { mensagem: "Complemento para a url das imagens",cabeca: "IMAGEURL", variavel: "IMAGEURL"} |
44 | 47 | ]}; |
45 | - verificaEditores() | |
48 | + core_carregando("ativa"); | |
49 | + core_pegaDados("buscando parâmetros...","../php/mapfiles.php?funcao=pegaParametrosConfigura","pegaParametros") | |
46 | 50 | } |
47 | 51 | /* |
48 | -Function: montaParametros | |
49 | - | |
50 | -Monta o html com os parametros | |
51 | -*/ | |
52 | -function montaParametros() | |
53 | -{ | |
54 | - montaCampos() | |
55 | - pegaParametros() | |
56 | -} | |
57 | -/* | |
58 | - | |
59 | -http://labs.metacarta.com/wms-c/Basic.py?LAYERS=basic&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-70,-40,-30,0&WIDTH=200&HEIGHT=200 | |
60 | - | |
61 | - | |
62 | 52 | Function: pegaParametros |
63 | 53 | |
64 | 54 | Pega os parâmetros do mapfiles.php |
65 | 55 | |
66 | 56 | */ |
67 | -function pegaParametros() | |
57 | +function pegaParametros(retorno) | |
68 | 58 | { |
69 | - var l = $i("EXTENT").parentNode.parentNode.parentNode | |
70 | - l.innerHTML += "<div id=mapaRef ></div>" | |
71 | - var retorna = function(retorno) | |
59 | + var ins = "" | |
60 | + for (i=0;i<$parametros.simples.length;i++) | |
72 | 61 | { |
73 | - for (i=0;i<$parametros.simples.length;i++) | |
74 | - { | |
75 | - if($i($parametros.simples[i].variavel)) | |
76 | - {$i($parametros.simples[i].variavel).value = eval("retorno.data."+$parametros.simples[i].variavel);} | |
77 | - } | |
78 | - maparef() | |
62 | + ins += "<fieldset><legend><b>"+$parametros.simples[i].cabeca+"</b></legend>" | |
63 | + ins += "<p class=mensagem >"+$parametros.simples[i].mensagem+"</p>" | |
64 | + ins += "<table><tr><td><img style=cursor:pointer src=../imagens/02.png title='aplicar' onclick='salva(\""+$parametros.simples[i].variavel+"\")' /></td>" | |
65 | + ins += "<td><input onchange=\"this.style.color='blue'\" type=text size=70 id='"+$parametros.simples[i].variavel+"' /></td></tr></table>" | |
66 | + ins += "</fieldset><br>" | |
79 | 67 | } |
80 | - var p = "../php/mapfiles.php?funcao=pegaParametrosConfigura"; | |
81 | - cPaint.call(p,"",retorna); | |
82 | -} | |
83 | -function maparef() | |
84 | -{ | |
85 | - var bb = $i("EXTENT").value.split(" ") | |
86 | - var bb = bb.toString() | |
87 | - $i("mapaRef").innerHTML = "<br><img onclick='maparef()' title='Clique para atualizar' src='http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&LAYERS=baseraster&STYLES=default&SRS=EPSG%3A4326&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&FORMAT=image%2Fjpeg&BBOX="+bb+"&WIDTH=200&HEIGHT=200' />" | |
88 | -} | |
89 | -/* | |
90 | -Function - restauraPadrao | |
91 | - | |
92 | -Copia o arquivo ms_configura.default para mapfiles.php | |
93 | -*/ | |
94 | -function restauraPadrao() | |
95 | -{ | |
96 | - if(confirm("Você realmente quer fazer isso?")) | |
68 | + $i("tabela").innerHTML += ins | |
69 | + for (i=0;i<$parametros.simples.length;i++) | |
97 | 70 | { |
98 | - var retorna = function(retorno) | |
99 | - {window.location.reload();} | |
100 | - var p = "../php/mapfiles.php?funcao=restauraConfigura"; | |
101 | - cPaint.call(p,"",retorna); | |
71 | + if($i($parametros.simples[i].variavel)) | |
72 | + {$i($parametros.simples[i].variavel).value = eval("retorno."+$parametros.simples[i].variavel);} | |
102 | 73 | } |
74 | + core_carregando("desativa"); | |
103 | 75 | } |
104 | 76 | /* |
105 | 77 | Function - salva |
... | ... | @@ -108,11 +80,7 @@ Salva o novo valor de uma variável |
108 | 80 | */ |
109 | 81 | function salva(variavel) |
110 | 82 | { |
111 | - if(confirm("Você realmente quer fazer isso?")) | |
112 | - { | |
113 | - var retorna = function(retorno) | |
114 | - {window.location.reload();} | |
115 | - var p = "../php/mapfiles.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value; | |
116 | - cPaint.call(p,"",retorna); | |
117 | - } | |
118 | -} | |
119 | 83 | \ No newline at end of file |
84 | + core_pegaDados("gravando...","../php/mapfiles.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value) | |
85 | + $i(variavel).style.color = "" | |
86 | +} | |
87 | +YAHOO.util.Event.addListener(window, "load", initMenu); | |
120 | 88 | \ No newline at end of file | ... | ... |
admin/js/ms_configura.js
... | ... | @@ -25,27 +25,30 @@ GNU junto com este programa; se não, escreva para a |
25 | 25 | Free Software Foundation, Inc., no endereço |
26 | 26 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
27 | 27 | */ |
28 | +YAHOO.namespace("example.container"); | |
28 | 29 | /* |
29 | 30 | Function: iniciaAdmin |
30 | 31 | |
31 | 32 | Inicializa as variáveis globais e checa o cadastro do editor do sistema de administração |
32 | 33 | */ |
33 | -function iniciaAdmin() | |
34 | +function initMenu() | |
34 | 35 | { |
35 | -$parametros = { | |
36 | + core_ativaPainelAjuda("ajuda","botaoAjuda"); | |
37 | + new YAHOO.widget.Button("botao2",{ onclick: { fn: function(){window.open('../../testainstal.php') }} }); | |
38 | + $parametros = { | |
36 | 39 | "simples": [ |
37 | - { mensagem: "Mensagem mostrada sempre que o i3geo é inicializado",cabeca: "Mensagem de inicialização", variavel: "$mensagemInicia"}, | |
38 | - { mensagem: "Texto mostrado na barra superior do navegador e em alguns aplicativos do i3geo, como a versão mobile",cabeca: "Título", variavel: "$tituloInstituicao"}, | |
39 | - { mensagem: "Diretório (caminho absoluto) utilizado para armazenar os mapfiles temporários e outros arquivos utilizados durante a operação do i3geo",cabeca: "Diretório temporário", variavel: "$dir_tmp"}, | |
40 | - { mensagem: "Local no servidor (caminho absoluto) onde o i3geo está armazenado",cabeca: "Localização do i3geo", variavel: "$locaplic"}, | |
41 | - { mensagem: "Diretório onde ficam os arquivos mapfiles dos temas disponíveis para uso na guia de adição de temas",cabeca: "Diretório com os temas", variavel: "$temasdir"}, | |
40 | + { mensagem: "Mensagem mostrada sempre que o i3geo é inicializado.",cabeca: "Mensagem de inicialização", variavel: "$mensagemInicia"}, | |
41 | + { mensagem: "Texto mostrado na barra superior do navegador e em alguns aplicativos do i3geo, como a versão mobile.",cabeca: "Título", variavel: "$tituloInstituicao"}, | |
42 | + { mensagem: "Diretório (caminho absoluto) utilizado para armazenar os mapfiles temporários e outros arquivos utilizados durante a operação do i3geo. Em sistemas Linux, você pode criar um link simbólico para esse diretório.",cabeca: "Diretório temporário", variavel: "$dir_tmp"}, | |
43 | + { mensagem: "Local no servidor (caminho absoluto) onde o i3geo está armazenado.",cabeca: "Localização do i3geo", variavel: "$locaplic"}, | |
44 | + { mensagem: "Diretório onde ficam os arquivos mapfiles dos temas disponíveis para uso na guia de adição de temas.",cabeca: "Diretório com os temas", variavel: "$temasdir"}, | |
42 | 45 | { mensagem: "Diretório onde ficam armazenados os arquivos de template HTML e mapfiles iniciais",cabeca: "Diretório aplicmap", variavel: "$temasaplic"}, |
43 | 46 | { mensagem: "Onde está armazenado o mapserv CGI no servidor",cabeca: "Mapserv CGI", variavel: "$locmapserv"}, |
44 | - { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de sistemas que são incluídos na guia de adição de temas",cabeca: "XML sistemas", variavel: "$locsistemas"}, | |
45 | - { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de programas especiais executados na ferramenta de identificação",cabeca: "XML identifica", variavel: "$locidentifica"}, | |
46 | - { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de mapas que são mostrados na versão mobile e na guia mapas",cabeca: "XML mapas", variavel: "$locmapas"}, | |
47 | - { mensagem: "(opcional) Endereço do arquivo XML ou programa PHP que gera o xml com a lista de atlas e pranchas utilizadas na interface Atlas do i3geo.",cabeca: "XML Atlas", variavel: "$atlasxml"}, | |
48 | - { mensagem: "Caminho onde fica o arquivo executável do software R",cabeca: "Caminho para o R", variavel: "$R_path"}, | |
47 | + { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de sistemas que são incluídos na guia de adição de temas. Se você deixar em branco, será utilizado o banco de dados administrativo ao invés do arquivo XML em disco.",cabeca: "XML sistemas", variavel: "$locsistemas"}, | |
48 | + { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de programas especiais executados na ferramenta de identificação. Se você deixar em branco, será utilizado o banco de dados administrativo ao invés do arquivo XML em disco.",cabeca: "XML identifica", variavel: "$locidentifica"}, | |
49 | + { mensagem: "Endereço do arquivo XML ou programa PHP que gera o xml com a lista de mapas que são mostrados na versão mobile e na guia mapas. Se você deixar em branco, será utilizado o banco de dados administrativo ao invés do arquivo XML em disco.",cabeca: "XML mapas", variavel: "$locmapas"}, | |
50 | + { mensagem: "(opcional) Endereço do arquivo XML ou programa PHP que gera o xml com a lista de atlas e pranchas utilizadas na interface Atlas do i3geo. Se você deixar em branco, será utilizado o banco de dados administrativo ao invés do arquivo XML em disco.",cabeca: "XML Atlas", variavel: "$atlasxml"}, | |
51 | + { mensagem: "Caminho onde fica o arquivo executável do software R. Se você incluiu o caminho do R como uma variável de ambiente, inclua a qui apenas o nome do executável.",cabeca: "Caminho para o R", variavel: "$R_path"}, | |
49 | 52 | { mensagem: "(depreciado) string de conexão com o banco de dados postgis para a realização de cálculos geométricos, como área. Na versão 5.x do mapserver não é mais necessário",cabeca: "Conexão postgis para cálculos", variavel: "$postgis_con"}, |
50 | 53 | { mensagem: "(depreciado) código da projeção definida no banco de dados postgis para cálculos de área",cabeca: "SRID postgis", variavel: "$srid_area"}, |
51 | 54 | { mensagem: "(opcional) string de conexão com o banco de dados para substituir o item CONECTION quando o mesmo estiver vazio",cabeca: "Substituição de conexão", variavel: "$postgis_mapa"}, |
... | ... | @@ -53,17 +56,8 @@ $parametros = { |
53 | 56 | { mensagem: "sim|nao Expõe ou não o endereço do arquivo mapfile utilizado no mapa que está sendo usado. Quando essa variável for definida como nao algumas das funcionalidades do i3geo poderão ficar prejudicadas, mas sem comprometimento das funções principais",cabeca: "Expõe o mapfile", variavel: "$expoeMapfile"}, |
54 | 57 | { mensagem: "Arquivo (PHP) que define a conexão com o banco de dados administrativo. Mantendo esse valor como vazio, o i3geo irá utilizar o banco de dados padrão em SQLITE. Veja i3geo/ms_configura.php e i3geo/admin/conexao.php para maiores informações sobre como utilizar outros bancos de dados.",cabeca: "Conexão com o banco de dados administrativo", variavel: "$conexaoadmin"} |
55 | 58 | ]}; |
56 | - verificaEditores() | |
57 | -} | |
58 | -/* | |
59 | -Function: montaParametros | |
60 | - | |
61 | -Monta o html com os parametros | |
62 | -*/ | |
63 | -function montaParametros() | |
64 | -{ | |
65 | - montaCampos() | |
66 | - pegaParametros() | |
59 | + core_carregando("ativa"); | |
60 | + core_pegaDados("buscando parâmetros...","../php/ms_configura.php?funcao=pegaParametrosConfigura","pegaParametros") | |
67 | 61 | } |
68 | 62 | /* |
69 | 63 | Function: pegaParametros |
... | ... | @@ -71,34 +65,25 @@ Function: pegaParametros |
71 | 65 | Pega os parâmetros do ms_configura.php |
72 | 66 | |
73 | 67 | */ |
74 | -function pegaParametros() | |
68 | +function pegaParametros(retorno) | |
75 | 69 | { |
76 | - var retorna = function(retorno) | |
70 | + var ins = "" | |
71 | + for (i=0;i<$parametros.simples.length;i++) | |
77 | 72 | { |
78 | - for (i=0;i<$parametros.simples.length;i++) | |
79 | - { | |
80 | - if($i($parametros.simples[i].variavel)) | |
81 | - {$i($parametros.simples[i].variavel).value = eval("retorno.data."+$parametros.simples[i].variavel);} | |
82 | - } | |
83 | - document.getElementById("aguarde").style.display="none" | |
73 | + ins += "<fieldset><legend><b>"+$parametros.simples[i].cabeca+"</b></legend>" | |
74 | + ins += "<p class=mensagem >"+$parametros.simples[i].mensagem+"</p>" | |
75 | + ins += "<table><tr><td><img style=cursor:pointer src=../imagens/02.png title='aplicar' onclick='salva(\""+$parametros.simples[i].variavel+"\")' /></td>" | |
76 | + ins += "<td><input onchange=\"this.style.color='blue'\" type=text size=70 id='"+$parametros.simples[i].variavel+"' /></td></tr></table>" | |
77 | + ins += "</fieldset><br>" | |
84 | 78 | } |
85 | - var p = "../php/ms_configura.php?funcao=pegaParametrosConfigura"; | |
86 | - cPaint.call(p,"",retorna); | |
87 | -} | |
88 | -/* | |
89 | -Function - restauraPadrao | |
90 | - | |
91 | -Copia o arquivo ms_configura.default para ms_configura.php | |
92 | -*/ | |
93 | -function restauraPadrao() | |
94 | -{ | |
95 | - if(confirm("Você realmente quer fazer isso?")) | |
79 | + $i("tabela").innerHTML += ins | |
80 | + retorno.$postgis_mapa = "Esta variável só pode ser definida editando-se diretamente o arquivo ms_configura.php" | |
81 | + for (i=0;i<$parametros.simples.length;i++) | |
96 | 82 | { |
97 | - var retorna = function(retorno) | |
98 | - {window.location.reload();} | |
99 | - var p = "../php/ms_configura.php?funcao=restauraConfigura"; | |
100 | - cPaint.call(p,"",retorna); | |
83 | + if($i($parametros.simples[i].variavel)) | |
84 | + {$i($parametros.simples[i].variavel).value = eval("retorno."+$parametros.simples[i].variavel);} | |
101 | 85 | } |
86 | + core_carregando("desativa"); | |
102 | 87 | } |
103 | 88 | /* |
104 | 89 | Function - salva |
... | ... | @@ -107,11 +92,12 @@ Salva o novo valor de uma variável |
107 | 92 | */ |
108 | 93 | function salva(variavel) |
109 | 94 | { |
110 | - if(confirm("Você realmente quer fazer isso?")) | |
95 | + if(variavel == "$postgis_mapa") | |
96 | + {alert("erro")} | |
97 | + else | |
111 | 98 | { |
112 | - var retorna = function(retorno) | |
113 | - {window.location.reload();} | |
114 | - var p = "../php/ms_configura.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value; | |
115 | - cPaint.call(p,"",retorna); | |
99 | + core_pegaDados("gravando...","../php/ms_configura.php?funcao=salvaConfigura&variavel="+variavel+"&valor="+$i(variavel).value,function(){core_carregando("desativa");}) | |
100 | + $i(variavel).style.color = "" | |
116 | 101 | } |
117 | -} | |
118 | 102 | \ No newline at end of file |
103 | +} | |
104 | +YAHOO.util.Event.addListener(window, "load", initMenu); | |
119 | 105 | \ No newline at end of file | ... | ... |
admin/js/temas.js
1 | -/* | |
2 | -Title: Arvore | |
3 | - | |
4 | -Funções javascript utilizadas no sistema de administração do menu de mapas | |
5 | - | |
6 | -File: i3geo/admin/mapas.js | |
7 | - | |
8 | -About: Licença | |
9 | - | |
10 | -I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
11 | - | |
12 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
13 | -Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
14 | - | |
15 | -Este programa é software livre; você pode redistribuí-lo | |
16 | -e/ou modificá-lo sob os termos da Licença Pública Geral | |
17 | -GNU conforme publicada pela Free Software Foundation; | |
18 | -tanto a versão 2 da Licença. | |
19 | -Este programa é distribuído na expectativa de que seja útil, | |
20 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
21 | -de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
22 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | |
23 | -Você deve ter recebido uma cópia da Licença Pública Geral do | |
24 | -GNU junto com este programa; se não, escreva para a | |
25 | -Free Software Foundation, Inc., no endereço | |
26 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
27 | -*/ | |
28 | 1 | contaN = 0; |
29 | 2 | objcontype = [ |
30 | 3 | {texto:"MS_INLINE",valor:"0"}, |
... | ... | @@ -123,669 +96,223 @@ objalignment = [ |
123 | 96 | {texto:"MS_ALIGN_RIGHT",valor:"2"} |
124 | 97 | ]; |
125 | 98 | |
126 | -$i = function(i) | |
127 | -{return document.getElementById(i);}; | |
128 | - | |
129 | -var retorna = function(retorno) | |
130 | -{ | |
131 | - fontes = retorno.data; | |
132 | -} | |
133 | -var p = "../php/temas.php?funcao=pegaFontes"; | |
134 | -cPaint.call(p,"",retorna); | |
99 | +YAHOO.namespace("example.container"); | |
135 | 100 | |
136 | -function iniciaAdmin() | |
101 | +function initMenu() | |
137 | 102 | { |
138 | - verificaEditores() | |
103 | + ativaBotaoAdicionaMapfile("adiciona") | |
104 | + core_carregando("ativa"); | |
105 | + core_carregando("buscando temas..."); | |
106 | + core_ativaPainelAjuda("ajuda","botaoAjuda"); | |
107 | + core_pegaMapfiles("montaArvore()") | |
139 | 108 | } |
140 | -function montaParametros() | |
109 | +function ativaBotaoAdicionaMapfile(idBotao) | |
141 | 110 | { |
142 | - var retorna = function(retorno) | |
111 | + var adiciona = function() | |
143 | 112 | { |
144 | - ins = "<select id=temaAtivo onchange='ativaTema(this.value)'>" | |
145 | - ins += comboObjeto(retorno.data,"codigo_tema","nome_tema","") | |
146 | - ins += "</select>" | |
147 | - $i("arquivoAtivo").innerHTML = ins | |
148 | - } | |
149 | - var p = "../php/menutemas.php?funcao=pegaTemas"; | |
150 | - cPaint.call(p,"",retorna); | |
113 | + core_montaEditor("adicionaNovoMapfile()") | |
114 | + ins = "<p>Título do novo tema: </p>" | |
115 | + ins += "<input size=50 type=text id='Etitulo' value='' /></p>" | |
116 | + ins += "<p>Nome do arquivo mapfile (sem .map): </p>" | |
117 | + ins += "<input size=50 type=text id='Ecodigo' value='' /></p>" | |
118 | + $i("editor_bd").innerHTML = ins | |
119 | + }; | |
120 | + //cria o botão de adição de um novo menu | |
121 | + var adiciona = new YAHOO.widget.Button(idBotao,{ onclick: { fn: adiciona } }); | |
151 | 122 | } |
152 | -function adicionarLayer() | |
123 | +function montaArvore() | |
153 | 124 | { |
154 | - var codigoMap = $i("temaAtivo").value | |
155 | - if(codigoMap != "") | |
125 | + YAHOO.example.treeExample = new function() | |
156 | 126 | { |
157 | - var retorna = function(retorno) | |
127 | + var currentIconMode; | |
128 | + tree = ""; | |
129 | + function changeIconMode() | |
158 | 130 | { |
159 | - ativaTema(codigoMap) | |
131 | + var newVal = parseInt(this.value); | |
132 | + if (newVal != currentIconMode) | |
133 | + {currentIconMode = newVal;} | |
134 | + buildTree(); | |
160 | 135 | } |
161 | - var p = "../php/temas.php?funcao=criarNovoLayer&codigoMap="+codigoMap; | |
162 | - cPaint.call(p,"",retorna); | |
163 | - } | |
136 | + function loadNodeData(node, fnLoadComplete) | |
137 | + { | |
138 | + var sUrl = "../php/temas.php?funcao=pegaLayers&codigoMap="+node.data.codigoMap; | |
139 | + var callback = | |
140 | + { | |
141 | + success: function(oResponse) | |
142 | + { | |
143 | + var dados = YAHOO.lang.JSON.parse(oResponse.responseText) | |
144 | + montaRaizTema(node,dados) | |
145 | + oResponse.argument.fnLoadComplete(); | |
146 | + }, | |
147 | + failure: function(oResponse) | |
148 | + { | |
149 | + oResponse.argument.fnLoadComplete(); | |
150 | + }, | |
151 | + argument: | |
152 | + { | |
153 | + "node": node, | |
154 | + "fnLoadComplete": fnLoadComplete | |
155 | + }, | |
156 | + timeout: 7000 | |
157 | + }; | |
158 | + YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); | |
159 | + } | |
160 | + function buildTree() | |
161 | + { | |
162 | + tree = new YAHOO.widget.TreeView("tabela"); | |
163 | + tree.setDynamicLoad(loadNodeData, currentIconMode); | |
164 | + var root = tree.getRoot(); | |
165 | + var tempNode = new YAHOO.widget.TextNode('', root, false); | |
166 | + tempNode.isLeaf = true; | |
167 | + core_carregando("desativa"); | |
168 | + } | |
169 | + buildTree(); | |
170 | + }(); | |
171 | + montaNosRaiz("nao") | |
172 | + tree.draw(); | |
164 | 173 | } |
165 | -function criarNovoMap() | |
174 | +function montaNosRaiz(redesenha) | |
166 | 175 | { |
167 | - var nome = $i("nomeNovoMap").value | |
168 | - var codigo = $i("codigoNovoMap").value | |
169 | - if(nome != "" && codigo != "") | |
176 | + var root = tree.getRoot(); | |
177 | + var nos = new Array() | |
178 | + for (var i=0, j=$mapfiles.length; i<j; i++) | |
170 | 179 | { |
171 | - var retorna = function(retorno) | |
172 | - { | |
173 | - $i("nomeNovoMap").value = "" | |
174 | - $i("codigoNovoMap").value = "" | |
175 | - $i("forms").style.display="none" | |
176 | - montaParametros() | |
177 | - } | |
178 | - var p = "../php/temas.php?funcao=criarNovoMap&nome="+nome+"&codigo="+codigo; | |
179 | - cPaint.call(p,"",retorna); | |
180 | + conteudo = " <img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"excluir('mapfile','"+$mapfiles[i]+"')\" title=excluir src=\"../imagens/01.png\" /><b> <span>"+$mapfiles[i]+"</span>" | |
181 | + var d = {html:conteudo,codigoMap:$mapfiles[i]}; | |
182 | + var tempNode = new YAHOO.widget.HTMLNode(d, root, false,true); | |
183 | + nos.push(tempNode) | |
180 | 184 | } |
185 | + if(redesenha=="sim") | |
186 | + tree.draw(); | |
187 | + return nos; | |
181 | 188 | } |
182 | -function ativaTema(codigoMap) | |
189 | +function montaRaizTema(no,dados) | |
183 | 190 | { |
184 | - var retorna = function(retorno) | |
191 | + function iconMode() | |
185 | 192 | { |
186 | - var cl = retorno.data.layers | |
187 | - var ins = "" | |
188 | - for(c=0;c<cl.length;c++) | |
189 | - { | |
190 | - ins += "<br><fieldset><legend>+- "+cl[c]+"</legend><div >" | |
191 | - ins += "<div id='geral_"+cl[c]+"_"+codigoMap+"' >" | |
192 | - ins += "</div>" | |
193 | - ins += "<div id='metadados_"+cl[c]+"_"+codigoMap+"' >" | |
194 | - ins += "</div>" | |
195 | - ins += "<div id='classes_"+cl[c]+"_"+codigoMap+"' >" | |
196 | - ins += "</div>" | |
197 | - | |
198 | - ins += "</div></fieldset>" | |
199 | - } | |
200 | - $i("forms").innerHTML = ins | |
201 | - var ins = "" | |
202 | - for(c=0;c<cl.length;c++) | |
193 | + var newVal = parseInt(this.value); | |
194 | + if (newVal != currentIconMode) | |
195 | + {currentIconMode = newVal;} | |
196 | + } | |
197 | + function loadLayerData(node, fnLoadComplete) | |
198 | + { | |
199 | + var sUrl = "../php/arvore.php?funcao=pegaTemas&id_n2="+node.data.id_n2; | |
200 | + var callback = | |
203 | 201 | { |
204 | - pegaCaracteristicasGerais(codigoMap,cl[c]) | |
205 | - pegaMetadados(codigoMap,cl[c]) | |
206 | - pegaClasses(codigoMap,cl[c]) | |
207 | - } | |
202 | + success: function(oResponse) | |
203 | + { | |
204 | + var dados = YAHOO.lang.JSON.parse(oResponse.responseText) | |
205 | + //montaTemas(idmenu,node,dados,false) | |
206 | + oResponse.argument.fnLoadComplete(); | |
207 | + }, | |
208 | + failure: function(oResponse) | |
209 | + { | |
210 | + oResponse.argument.fnLoadComplete(); | |
211 | + }, | |
212 | + argument: | |
213 | + { | |
214 | + "node": node, | |
215 | + "fnLoadComplete": fnLoadComplete | |
216 | + }, | |
217 | + timeout: 7000 | |
218 | + }; | |
219 | + YAHOO.util.Connect.asyncRequest('GET', sUrl, callback); | |
220 | + } | |
221 | + if(!tree.getNodeByProperty("etiquetaLayers",no.data.codigoMap)) | |
222 | + { | |
223 | + var conteudo = "<img style=\"position:relative;cursor:pointer;top:2px\" onclick=\"adicionaNovoLayer('"+no.data.codigoMap+"')\" title='adiciona layer' src=\"../imagens/05.png\" />" | |
224 | + var d = {tipo:"etiqueta",etiquetaLayers:no.data.codigoMap,html:conteudo+"<i>Layers:</i>"} | |
225 | + var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); | |
226 | + tempNode.isLeaf = true; | |
208 | 227 | } |
209 | - $i("forms").style.display="block" | |
210 | - var p = "../php/temas.php?funcao=pegaLayers&codigoMap="+codigoMap; | |
211 | - cPaint.call(p,"",retorna); | |
212 | -} | |
213 | -function pegaClasses(codigoMap,codigoLayer) | |
214 | -{ | |
215 | - var ins = "<br><fieldset style='background-color:beige'><legend>+- Classes</legend><div style=display:none >" | |
216 | - ins += "<p><input onclick=adicionarClasse('"+codigoLayer+"',this) type=button value='Adicionar classe' /></p>" | |
217 | - ins += "<br><fieldset><legend>+- Legenda (amostra)</legend><div style=display:none >" | |
218 | - ins += "<img id='legenda_"+codigoLayer+"' src='../ogc.php?tema=bioma&service=wms&request=getlegendgraphic&layer="+codigoLayer+"&format=image/png' />" | |
219 | - ins += "</div></fieldset>" | |
220 | - var retorna = function(retorna) | |
228 | + for (var i=0, j=dados.layers.length; i<j; i++) | |
221 | 229 | { |
222 | - var nc = retorna.data.length | |
223 | - for(c=0;c<nc;c++) | |
224 | - { | |
225 | - d = retorna.data[c] | |
226 | - var param = { | |
227 | - "linhas":[ | |
228 | - {texto:"Nome da classe para ser mostrada na legenda", | |
229 | - titulo:"name",prefixoid:"name_",id:codigoLayer+"_"+d.id,valor:"name"} | |
230 | - ] | |
231 | - } | |
232 | - | |
233 | - ins += "<br><fieldset><legend>+- "+d.id+"</legend><div style=display:none >" | |
234 | - ins += "<p><input onclick=excluirClasse('"+codigoLayer+"','"+d.id+"',this) type=button value='Excluir classe' /></p>" | |
235 | - ins += "<br><fieldset><legend>+- status</legend><div style=display:none >" | |
236 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Sets the current display status of the class. Default turns the class on.</p>" | |
237 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='status_"+codigoLayer+"_"+d.id+"' >" | |
238 | - ins += comboObjeto(objstatus,"valor","texto",d.dados.status) | |
239 | - ins += "</select>" | |
240 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasse(\""+codigoLayer+"_"+d.id+"\",\"status\",this)'/>" | |
241 | - ins += "</p></div></fieldset>" | |
242 | - | |
243 | - ins += "<br><fieldset><legend>+- expression</legend><div style=display:none >" | |
244 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Four types of expressions are now supported to define class membership. String comparisons, regular expressions, simple logical expressions, and string functions. If no expression is given, then all features are said to belong to this class.<br>String comparisons are case sensitive and are the fastest to evaluate. No special delimiters are necessary although string must be quoted if they contain special characters. (As a matter of good habit, it is recommended you quote all strings).<br>Regular expressions function just like previous versions of MapServer. However, you must now delimit a regular expression using /regex/. No quotes should be used.<br><br>Logical expressions allow you to build fairly complex tests based on one or more attributes and therefore are only available with shapefiles. Logical expressions are delimited by parentheses '(expression)'. Attribute names are delimited by square brackets '[ATTRIBUTE]'. These names are case sensitive and must match the items in the shapefile. For example: EXPRESSION ([POPULATION] > 50000 AND '[LANGUAGE]' eq 'FRENCH') ... The following logical operators are supported: =,>,<,<=,>=,=,or,and,lt,gt,ge,le,eq,ne. As you might expect this level of complexity is slower to process.<br>One string function exists: length(). This obviously computes the length of a string. An example follows:<br>EXPRESSION (length('[NAME_E]') < 8)<br>String comparisons and regular expressions work from the classitem defined at the layer level. You may mix expression types within the different classes of a layer.</p>" | |
245 | - ins += "<p><input type=text onchange='this.style.color=\"blue\"' id='expression_"+codigoLayer+"_"+d.id+"' value=\""+d.dados.expression+"\" />" | |
246 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasse(\""+codigoLayer+"_"+d.id+"\",\"expression\",this)'/>" | |
247 | - ins += "</p></div></fieldset>" | |
248 | - | |
249 | - ins += (geraLinhas2(d.dados,param,"salvarClasse")); | |
250 | - | |
251 | - var param = { | |
252 | - "linhas":[ | |
253 | - {texto:"Full filename of the legend image for the CLASS. This image is used when building a legend (or requesting a legend icon via MapScript or the CGI application).", | |
254 | - titulo:"keyimage",prefixoid:"keyimage_",id:codigoLayer+"_"+d.id,valor:"keyimage"}, | |
255 | - {texto:"Maximum scale at which this CLASS is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
256 | - titulo:"maxscale",prefixoid:"maxscale_",id:codigoLayer+"_"+d.id,valor:"maxscale"}, | |
257 | - {texto:"Minimum scale at which this CLASS is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
258 | - titulo:"minscale",prefixoid:"minscale_",id:codigoLayer+"_"+d.id,valor:"minscale"}, | |
259 | - {texto:"Maximum size in pixels to draw a symbol. Default is 50.", | |
260 | - titulo:"maxsize",prefixoid:"maxsize_",id:codigoLayer+"_"+d.id,valor:"maxsize"}, | |
261 | - {texto:"Minimum size in pixels to draw a symbol. Default is 0.", | |
262 | - titulo:"minsize",prefixoid:"minsize_",id:codigoLayer+"_"+d.id,valor:"minsize"}, | |
263 | - {texto:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. For vector (and ellipse) symbol types the default size is based on the range of Y values in the POINTS defining the symbol. For pixmaps, the default is the vertical size of the image. Default size is 1 for TTF symbols.", | |
264 | - titulo:"size",prefixoid:"size_",id:codigoLayer+"_"+d.id,valor:"size"}, | |
265 | - {texto:"Static text to label features in this class with. This overrides values obtained from the LABELTIEM. The string may be given as an expression delimited using the ()'s. This allows you to concatenate multiple attributes into a single label. For example: ([FIRSTNAME],[LASTNAME]).", | |
266 | - titulo:"text",prefixoid:"text_",id:codigoLayer+"_"+d.id,valor:"text"} | |
267 | - ] | |
268 | - } | |
269 | - | |
270 | - ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
271 | - ins += (geraLinhas2(d.dados,param,"salvarClasse")); | |
272 | - ins += "</fieldset>" | |
273 | - //labels | |
274 | - ins += "<br><fieldset><legend style=color:brown >+- Label (para ativar, defina LABELITEM em caract. gerais)</legend><div style=display:none >" | |
275 | - var param = { | |
276 | - "linhas":[ | |
277 | - {texto:"Color to draw text with.", | |
278 | - titulo:"color",prefixoid:"label_color_",id:codigoLayer+"_"+d.id,valor:"label.color"}, | |
279 | - {texto:"Text size. Use integer to give the size in pixels of your TrueType font based label, or any of theother 5 listed keywords to bitmap fonts.", | |
280 | - titulo:"size",prefixoid:"label_size_",id:codigoLayer+"_"+d.id,valor:"label.size"}, | |
281 | - {texto:"Position of the label relative to the labeling point (layers only). First letter is Y position, second letter is X position. Auto tells MapServer to calculate a label position that will not interfere with other labels. With points and polygons, MapServer selects from the 8 outer positions (i.e. excluding cc). With lines, it only uses lc or uc, until it finds a position that doesn't collide with labels that have already been drawn. If all positions cause a conflict, then the label is not drawn (Unless the label's FORCE a parameter is set to true). Auto placement is only available with cached labels.", | |
282 | - titulo:"position",prefixoid:"label_position_",id:codigoLayer+"_"+d.id,valor:"label.position"}, | |
283 | - {texto:"Padding, in pixels, around labels. Useful for maintaining spacing around text to enhance readability. Available only for cached labels. Default is 0.", | |
284 | - titulo:"buffer",prefixoid:"label_buffer_",id:codigoLayer+"_"+d.id,valor:"label.buffer"} | |
285 | - ] | |
286 | - } | |
287 | - | |
288 | - ins += "<br><fieldset><legend>+- font</legend><div style=display:none >" | |
289 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Font alias (as defined in the FONTSET) to use for labeling.</p>" | |
290 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='label_font_"+codigoLayer+"_"+d.id+"' >" | |
291 | - ins += combolista(fontes,d.dados.label.font) | |
292 | - ins += "</select>" | |
293 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".font\",this)'/>" | |
294 | - ins += "</p></div></fieldset>" | |
295 | - | |
296 | - ins += "<br><fieldset><legend>+- type</legend><div style=display:none >" | |
297 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Type of font to use. Generally bitmap fonts are faster to draw then TrueType fonts. However,TrueType fonts are scalable and available in a variety of faces. Be sure to set the FONT parameter ifyou select TrueType.</p>" | |
298 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='label_type_"+codigoLayer+"_"+d.id+"' >" | |
299 | - ins += comboObjeto(objfonttypes,"valor","texto",d.dados.label.type) | |
300 | - ins += "</select>" | |
301 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".type\",this)'/>" | |
302 | - ins += "</p></div></fieldset>" | |
303 | - | |
304 | - ins += "<br><fieldset><legend>+- partials</legend><div style=display:none >" | |
305 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Can text run off the edge of the map? Default is true.</p>" | |
306 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='label_type_"+codigoLayer+"_"+d.id+"' >" | |
307 | - ins += comboObjeto(objbool_tf,"valor","texto",d.dados.label.partials) | |
308 | - ins += "</select>" | |
309 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".partials\",this)'/>" | |
310 | - ins += "</p></div></fieldset>" | |
311 | - | |
312 | - ins += "<br><fieldset><legend>+- force</legend><div style=display:none >" | |
313 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Forces labels for a particular class on, regardless of collisions. Available only for cached labels. Default is false.</p>" | |
314 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='label_type_"+codigoLayer+"_"+d.id+"' >" | |
315 | - ins += comboObjeto(objbool_tf,"valor","texto",d.dados.label.force) | |
316 | - ins += "</select>" | |
317 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".force\",this)'/>" | |
318 | - ins += "</p></div></fieldset>" | |
319 | - | |
320 | - ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); | |
321 | - var param = { | |
322 | - "linhas":[ | |
323 | - {texto:"Color to draw a background rectangle (i.e. billboard). Off by default.", | |
324 | - titulo:"backgroundcolor",prefixoid:"label_backgroundcolor_",id:codigoLayer+"_"+d.id,valor:"label.backgroundcolor"}, | |
325 | - {texto:"Color to draw a background rectangle (i.e. billboard) shadow. Off by default.", | |
326 | - titulo:"backgroundshadowcolor",prefixoid:"label_backgroundshadowcolor_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowcolor"}, | |
327 | - {texto:"Color to draw a one pixel outline around the text.", | |
328 | - titulo:"outlinecolor",prefixoid:"label_outlinecolor_",id:codigoLayer+"_"+d.id,valor:"label.outlinecolor"}, | |
329 | - {texto:"Color of drop shadow.", | |
330 | - titulo:"shadowcolor",prefixoid:"label_shadowcolor_",id:codigoLayer+"_"+d.id,valor:"label.shadowcolor"}, | |
331 | - {texto:"Shadow offset in pixels.", | |
332 | - titulo:"shadowsizex",prefixoid:"label_shadowsizex_",id:codigoLayer+"_"+d.id,valor:"label.shadowsizex"}, | |
333 | - {texto:"Shadow offset in pixels.", | |
334 | - titulo:"shadowsizey",prefixoid:"label_shadowsizey_",id:codigoLayer+"_"+d.id,valor:"label.shadowsizey"}, | |
335 | - {texto:"How far should the background rectangle be offset? Default is 1.", | |
336 | - titulo:"backgroundshadowsizex",prefixoid:"label_backgroundshadowsizex_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowsizex"}, | |
337 | - {texto:"How far should the background rectangle be offset? Default is 1.", | |
338 | - titulo:"backgroundshadowsizey",prefixoid:"label_backgroundshadowsizey_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowsizey"}, | |
339 | - {texto:"Minimum font size to use when scaling text (pixels). Default is 4.", | |
340 | - titulo:"minsize",prefixoid:"label_minsize_",id:codigoLayer+"_"+d.id,valor:"label.minsize"}, | |
341 | - {texto:"Maximum font size to use when scaling text (pixels). Default is 256.", | |
342 | - titulo:"maxsize",prefixoid:"label_maxsize_",id:codigoLayer+"_"+d.id,valor:"label.maxsize"}, | |
343 | - {texto:"Offset values for labels, relative to the lower left hand corner of the label and the label point. Given in pixels. In the case of rotated text specify the values as if all labels are horizontal and any rotation will be compensated for.", | |
344 | - titulo:"offsetx",prefixoid:"label_offsetx_",id:codigoLayer+"_"+d.id,valor:"label.offsetx"}, | |
345 | - {texto:"Offset values for labels, relative to the lower left hand corner of the label and the label point. Given in pixels. In the case of rotated text specify the values as if all labels are horizontal and any rotation will be compensated for.", | |
346 | - titulo:"offsety",prefixoid:"label_offsety_",id:codigoLayer+"_"+d.id,valor:"label.offsety"}, | |
347 | - {texto:"Angle, given in degrees, to draw the label or AUTO to allow the software to compute the angle, AUTO is valid for LINE layers only. FOLLOW was introduced in version 4.10 and tells map server to compute a curved label for appropriate linear features", | |
348 | - titulo:"angle",prefixoid:"label_angle_",id:codigoLayer+"_"+d.id,valor:"label.angle"}, | |
349 | - {texto:"Should text be antialiased? Note that this requires more available colors, decreased drawing performance, and results in slightly larger output images.", | |
350 | - titulo:"antialias",prefixoid:"label_antialias_",id:codigoLayer+"_"+d.id,valor:"label.antialias"}, | |
351 | - {texto:"Character that represents an end-of-line condition in label text, thus resulting in a multi-line label.", | |
352 | - titulo:"wrap",prefixoid:"label_wrap_",id:codigoLayer+"_"+d.id,valor:"label.wrap"}, | |
353 | - {texto:"Minimum size a feature must be to be labeled. Given in pixels. For line data the overall length of the displayed line is used, for polygons features the smallest dimension of the bounding box is used. Auto keyword tells MapServer to only label features that are larger than their corresponding label. Available for cached labels only.", | |
354 | - titulo:"minfeaturesize",prefixoid:"label_minfeaturesize_",id:codigoLayer+"_"+d.id,valor:"label.minfeaturesize"}, | |
355 | - {texto:"Minimum distance between duplicate labels. Given in pixels.", | |
356 | - titulo:"mindistance",prefixoid:"label_mindistance_",id:codigoLayer+"_"+d.id,valor:"label.mindistance"}, | |
357 | - {texto:"Supported encoding format to be used for labels. If the format is not supported, the label will not be drawn. Requires the iconv library (present on most systems). The library is always detected if present on the system, but if not the label will not be drawn. Required for displaying international characters in MapServer. More information can be found at: http://www.foss4g.org/FOSS4G/MAPSERVER/mpsnf-i18n-en.html.", | |
358 | - titulo:"encoding",prefixoid:"label_encoding_",id:codigoLayer+"_"+d.id,valor:"label.encoding"} | |
359 | - ] | |
360 | - } | |
361 | - ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
362 | - ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); | |
363 | - ins += "</fieldset>" | |
364 | - | |
365 | - ins += "</div></fieldset>" | |
366 | - | |
367 | - ins += "<br><fieldset><legend style=color:brown >+- Estilos</legend><div style=display:none >" | |
368 | - ins += "<p><input onclick=adicionarEstilo('"+codigoLayer+"','"+d.id+"',this) type=button value='Adicionar estilo' /></p>" | |
369 | - ins += "<div id='estilos_"+codigoLayer+"_"+d.id+"' ></div>" | |
370 | - ins += "</div></fieldset>" | |
371 | - ins += "</div></fieldset>" | |
372 | - } | |
373 | - ins += "</div></fieldset>" | |
374 | - $i("classes_"+codigoLayer+"_"+codigoMap).innerHTML = ins | |
375 | - pegaEstilos(codigoMap,codigoLayer) | |
230 | + var conteudo = " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe')\" title=sobe src=\"../imagens/34.png\" />" | |
231 | + conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce')\" title=desce src=\"../imagens/33.png\" />" | |
232 | + conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluirLayer('"+no.data.codigoMap+"','"+dados.layers[i]+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" /> <span>"+dados.layers[i]+"</span>" | |
233 | + var d = {html:conteudo,id:no.data.codigoMap+"_"+dados.layers[i]} | |
234 | + var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); | |
235 | + tempNode.setDynamicLoad(loadLayerData, iconMode); | |
376 | 236 | } |
377 | - var p = "../php/temas.php?funcao=pegaClasses&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
378 | - cPaint.call(p,"",retorna); | |
379 | - | |
237 | + tree.draw(); | |
380 | 238 | } |
381 | -function pegaEstilos(codigoMap,codigoLayer) | |
239 | +function adicionaNovoMapfile() | |
382 | 240 | { |
383 | - var retorna = function(retorno) | |
241 | + core_carregando("ativa"); | |
242 | + core_carregando(" adicionando um novo mapfile"); | |
243 | + var nome = $i("Etitulo").value | |
244 | + var codigo = $i("Ecodigo").value | |
245 | + sUrl = "../php/temas.php?funcao=criarNovoMap&nome="+nome+"&codigo="+codigo | |
246 | + var callback = | |
384 | 247 | { |
385 | - var nc = retorno.data.length | |
386 | - for(c=0;c<nc;c++) | |
248 | + success:function(o) | |
387 | 249 | { |
388 | - var idclasse = retorno.data[c].classe | |
389 | - var estilos = retorno.data[c].estilos | |
390 | - var divestilos = "estilos_"+codigoLayer+"_"+idclasse; | |
391 | - var nes = retorno.data[c].estilos.length | |
392 | - for(est=0;est<nes;est++) | |
250 | + try | |
393 | 251 | { |
394 | - var ins = "" | |
395 | - var d = retorno.data[c].estilos[est].dados | |
396 | - var preid = codigoLayer+"_"+idclasse+"_"+est | |
397 | - var param = { | |
398 | - "linhas":[ | |
399 | - {texto:"The symbol name or number to use for all features if attribute tables are not used. The number is the index of the symbol in the symbol file, starting at 1, the 5th symbol in the file is therefore symbol number 5. You can also give your symbols names using the NAME keyword in the symbol definition file, and use those to refer to them. Default is 0, which results in a single pixel, single width line, or solid polygon fill, depending on layer type.You can also specify a gif or png filename. The path is relative to the location of the mapfile.", | |
400 | - titulo:"symbolname",prefixoid:"",id:"symbolname_"+preid,valor:"symbolname"}, | |
401 | - {texto:"Color to use for drawing features.", | |
402 | - titulo:"color",prefixoid:"",id:"color_"+preid,valor:"color"}, | |
403 | - {texto:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. Default is 1. For symbols of Type HATCH, the SIZE is the distance between hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
404 | - titulo:"size",prefixoid:"",id:"size_"+preid,valor:"size"}, | |
405 | - {texto:"Color to use for outlining polygons and certain marker symbols. Line symbols do not support outline colors.", | |
406 | - titulo:"outlinecolor",prefixoid:"",id:"outlinecolor_"+preid,valor:"outlinecolor"}, | |
407 | - {texto:"Width refers to the thickness of line work drawn, in pixels. Default is 1. For symbols of Type HATCH, the WIDTH is how thick the hatched lines are. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
408 | - titulo:"width",prefixoid:"",id:"width_"+preid,valor:"width"}, | |
409 | - ] | |
252 | + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") | |
253 | + { | |
254 | + core_carregando("<span style=color:red >Código já existe</span>"); | |
255 | + setTimeout("core_carregando('desativa')",3000) | |
410 | 256 | } |
411 | - ins += "<br><fieldset style='background-color:rgb(240,240,240)'><legend>+- "+est+"</legend>" | |
412 | - ins += (geraLinhas2(d,param,"salvarEstilo")); | |
413 | - | |
414 | - var param = { | |
415 | - "linhas":[ | |
416 | - {texto:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. Default is 1. For symbols of Type HATCH, the SIZE is the distance between hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
417 | - titulo:"minsize",prefixoid:"",id:"minsize_"+preid,valor:"minsize"}, | |
418 | - {texto:"Maximum size in pixels to draw a symbol. Default is 50.", | |
419 | - titulo:"maxsize",prefixoid:"",id:"maxsize_"+preid,valor:"maxsize"}, | |
420 | - {texto:"Offset values for shadows, hollow symbols, etc ...", | |
421 | - titulo:"offsetx",prefixoid:"",id:"offsetx_"+preid,valor:"offsetx"}, | |
422 | - {texto:"Offset values for shadows, hollow symbols, etc ...", | |
423 | - titulo:"offsety",prefixoid:"",id:"offsety_"+preid,valor:"offsety"}, | |
424 | - {texto:"Should TrueType fonts and Cartoline symbols be antialiased.", | |
425 | - titulo:"antialias",prefixoid:"",id:"antialias_"+preid,valor:"antialias"}, | |
426 | - {texto:"Minimum width in pixels to draw the line work.", | |
427 | - titulo:"minwidth",prefixoid:"",id:"minwidth_"+preid,valor:"minwidth"}, | |
428 | - {texto:"Angle, given in degrees, to draw the line work. Default is 0. For symbols of Type HATCH, this is the angle of the hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
429 | - titulo:"angle",prefixoid:"",id:"angle_"+preid,valor:"angle"}, | |
430 | - {texto:"For MapServer versions <5, this is the attribute/field that stores the angle to be used in rendering. Angle is given in degrees with 0 meaning no rotation.", | |
431 | - titulo:"angleitem",prefixoid:"",id:"angleitem_"+preid,valor:"angleitem"}, | |
432 | - {texto:"For MapServer versions <5, this is the attribute/field that stores the size to be used in rendering. Value is given in pixels.", | |
433 | - titulo:"sizeitem",prefixoid:"",id:"sizeitem_"+preid,valor:"sizeitem"} | |
434 | - ] | |
257 | + else | |
258 | + { | |
259 | + $mapfiles = [codigo]; | |
260 | + var nos = montaNosRaiz("nao"); | |
261 | + tree.popNode(nos[0]) | |
262 | + var noi = tree.getNodeByIndex(1); | |
263 | + nos[0].insertBefore(noi); | |
264 | + tree.draw(); | |
265 | + core_carregando("desativa"); | |
435 | 266 | } |
436 | - ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
437 | - ins += (geraLinhas2(d,param,"salvarEstilo")); | |
438 | - ins += "</fieldset>" | |
439 | - ins += "</fieldset>" | |
440 | - $i(divestilos).innerHTML = ins | |
267 | + YAHOO.example.container.panelEditor.destroy(); | |
268 | + YAHOO.example.container.panelEditor = null; | |
441 | 269 | } |
442 | - } | |
443 | - ativaLegenda() | |
444 | - } | |
445 | - var p = "../php/temas.php?funcao=pegaEstilos&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
446 | - cPaint.call(p,"",retorna); | |
447 | -} | |
448 | -function pegaMetadados(codigoMap,codigoLayer) | |
449 | -{ | |
450 | - var ins = "<br><fieldset><legend>+- Metadados</legend><div style=display:none >" | |
451 | - var retorna = function(retorna) | |
452 | - { | |
453 | - ins += ""; | |
454 | - var param = { | |
455 | - "linhas":[ | |
456 | - {texto:"Nome que será utilizado na legenda do mapa e na guia 'Temas'", | |
457 | - titulo:"tema",prefixoid:"tema_",id:codigoLayer,valor:"tema"}, | |
458 | - {texto:"Denominador da escala da fonte dos dados utilizado pelo tema. É utilizado para apresentar a indicação de compatibilidade entre a escala do tema e a escala do mapa que está sendo visto.", | |
459 | - titulo:"escala",prefixoid:"escala_",id:codigoLayer,valor:"escala"}, | |
460 | - {texto:"Extensão geográfica máxima do tema, no formato xmin ymin xmax ymax. É utilizado na opção de 'zoom para o tema'. Quando o tema é baseado em shapefile, esse metadata não é necessário, pois o mapserver consegue calcular a extensão. Já em outros tipos de dados, como Postgis, o parâmetro é necessário. Nesse caso, se não for indicado, o botão de zoom para o tema não será visível para o usuário", | |
461 | - titulo:"extensao",prefixoid:"extensao_",id:codigoLayer,valor:"extensao"} | |
462 | - ] | |
463 | - } | |
464 | - ins += (geraLinhas2(retorna.data,param,"salvarMetadados")); | |
465 | - | |
466 | - ins += "<br><fieldset><legend>+- aplicaextensao</legend><div style=display:none >" | |
467 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se a extensão geográfica do mapa deve ser alterada quando o tema for adicionado ao mapa</p>" | |
468 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='aplicaextensao_"+codigoLayer+"' >" | |
469 | - ins += combosimnao(retorna.data.aplicaextensao) | |
470 | - ins += "</select>" | |
471 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"aplicaextensao\",this)'/>" | |
472 | - ins += "</p></div></fieldset>" | |
473 | - | |
474 | - | |
475 | - ins += "<br><fieldset><legend>+- download</legend><div style=display:none >" | |
476 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se o usuário pode fazer download do tema</p>" | |
477 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='download_"+codigoLayer+"' >" | |
478 | - ins += combosimnao(retorna.data.download) | |
479 | - ins += "</select>" | |
480 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"download\",this)'/>" | |
481 | - ins += "</p></div></fieldset>" | |
482 | - | |
483 | - var param = { | |
484 | - "linhas":[ | |
485 | - {texto:"Nomes das colunas da tabela de atributos do tema, que serão mostradas na ferramenta de identificação. Se for vazio, todas as colunas serão mostradas. A lista de itens deve ser separada por ',' e grafada em caixa alta no caso de shapefile.", | |
486 | - titulo:"itens",prefixoid:"itens_",id:codigoLayer,valor:"itens"}, | |
487 | - {texto:"Lista com os 'alias', ou apelidos, para os nomes das colunas listados no metadata 'itens'. Os alias devem ser separados por ',' e seguir a ordem definida em ITENS.", | |
488 | - titulo:"itensdesc",prefixoid:"itensdesc_",id:codigoLayer,valor:"itensdesc"}, | |
489 | - {texto:"Lista de links que serão incluídos em cada resultado de busca da ferramenta de identificação. A lista de links deve ser separada por ',', podendo-se incluir '' para indicar que o item não tem link. Exemplo de uso para inclusão de links para o site do IBGE quando um município é clicado no mapa:<br>ITENS 'codigo,nome2,uf'<br>ITENSDESC 'codigo do IBGE,nome do município,uf'<br>ITENSLLINK ',http://www.ibge.gov.br/munic2001/tabelas.php?codmun=[codigo]&descricao=[nome],'", | |
490 | - titulo:"itenslink",prefixoid:"itenslink_",id:codigoLayer,valor:"itenslink"}, | |
491 | - {texto:"Lista de colunas que serão utilizadas na opção de inclusão de 'etiquetas'. As etiquetas são mostradas no mapa quando o usuário estaciona o mouse por alguns instantes sobre o mapa. Separe a lista com ','.", | |
492 | - titulo:"tip",prefixoid:"tip_",id:codigoLayer,valor:"tip"}, | |
493 | - {texto:"Mensagem que será mostrada no rodapé do mapa quando o tema estiver visível. É útil para apresentar ao usuário observações especiais sobre o uso daquele tema.", | |
494 | - titulo:"mensagem",prefixoid:"mensagem_",id:codigoLayer,valor:"mensagem"}, | |
495 | - {texto:"É possível a geração de classes automaticamente por meio da definição de colunas na tabela de atributos do tema que armazenam as informações sobre cor, tamanho, etc. Esse metadata é utilizado para definir qual a coluna da tabela que identifica unicamente cada classe. Para cada valor será criada uma classe.<br>O tema que utiliza a geração de classes de forma automática, deve ter definido apenas uma classe. Essa classe será utilizada como padrão para geração das demais.", | |
496 | - titulo:"classesitem",prefixoid:"classesitem_",id:codigoLayer,valor:"classesitem"}, | |
497 | - {texto:"Nome da coluna que será utilizada para compor o nome das classes geradas automaticamente.", | |
498 | - titulo:"classesnome",prefixoid:"classesnome_",id:codigoLayer,valor:"classesnome"}, | |
499 | - {texto:"Nome da coluna que definirá a cor do símbolo utilizado em cada classe. As cores devem ser definidas em RGB.", | |
500 | - titulo:"classescor",prefixoid:"classescor_",id:codigoLayer,valor:"classescor"}, | |
501 | - {texto:"Nome da coluna que definirá o símbolo utilizado em cada classe.", | |
502 | - titulo:"classessimbolo",prefixoid:"classessimbolo_",id:codigoLayer,valor:"classessimbolo"}, | |
503 | - {texto:"Nome da coluna que definirá o tamanho de cada símbolo.", | |
504 | - titulo:"classestamanho",prefixoid:"classestamanho_",id:codigoLayer,valor:"classestamanho"} | |
505 | - ] | |
506 | - } | |
507 | - | |
508 | - | |
509 | - ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
510 | - | |
511 | - ins += (geraLinhas2(retorna.data,param,"salvarMetadados")); | |
512 | - | |
513 | - ins += "<br><fieldset><legend>+- classe</legend><div style=display:none >" | |
514 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se as classes serão mostradas ou não na legenda. Por padrão é SIM.</p>" | |
515 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='classe_"+codigoLayer+"' >" | |
516 | - ins += combosimnao(retorna.data.classe) | |
517 | - ins += "</select>" | |
518 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"classe\",this)'/>" | |
519 | - ins += "</p></div></fieldset>" | |
520 | - | |
521 | - ins += "<br><fieldset><legend>+- escondido</legend><div style=display:none >" | |
522 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se o tema é mostrado no mapa mas não nas listas da legenda e na guia 'temas'</p>" | |
523 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='escondido_"+codigoLayer+"' >" | |
524 | - ins += combosimnao(retorna.data.escondido) | |
525 | - ins += "</select>" | |
526 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"escondido\",this)'/>" | |
527 | - ins += "</p></div></fieldset>" | |
528 | - | |
529 | - ins += "<br><fieldset><legend>+- identifica</legend><div style=display:none >" | |
530 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se o tema irá ser mostrado na ferramenta de identificação</p>" | |
531 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='identifica_"+codigoLayer+"' >" | |
532 | - ins += combosimnao(retorna.data.identifica) | |
533 | - ins += "</select>" | |
534 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"identifica\",this)'/>" | |
535 | - ins += "</p></div></fieldset>" | |
536 | - | |
537 | - ins += "</div></fieldset>" | |
538 | - | |
539 | - $i("metadados_"+codigoLayer+"_"+codigoMap).innerHTML = ins | |
540 | - } | |
541 | - var p = "../php/temas.php?funcao=pegaMetadados&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
542 | - cPaint.call(p,"",retorna); | |
543 | -} | |
544 | -function pegaCaracteristicasGerais(codigoMap,codigoLayer) | |
545 | -{ | |
546 | - var ins = "<p><input onclick=excluirLayer('"+codigoLayer+"',this) type=button value='Excluir este layer' /></p>" | |
547 | - ins += "<br><fieldset><legend>+- Características gerais</legend><div style=display:none >" | |
548 | - var retorna = function(retorna) | |
549 | - { | |
550 | - var param = { | |
551 | - "linhas":[ | |
552 | - {texto:"Layer name", | |
553 | - titulo:"name",prefixoid:"name_",id:codigoLayer,valor:"name"}, | |
554 | - {texto:"Database connection string to retrieve remote data.An SDE connection string consists of a hostname, instance name, database name, username and password separated by commas.A PostGIS connection string is basically a regular PostgreSQL connection string, it takes the form of 'user=nobody password=****** dbname=dbname host=localhost port=5432' An Oracle connection string: user/pass[@db]", | |
555 | - titulo:"connection",prefixoid:"connection_",id:codigoLayer,valor:"connection"}, | |
556 | - {texto:"Full filename of the spatial data to process. No file extension is necessary for shapefiles. Can be specified relative to the SHAPEPATH option from the Map Object.If this is an SDE layer, the parameter should include the name of the layer as well as the geometry column, i.e. 'mylayer,shape,myversion'.If this is a PostGIS layer, the parameter should be in the form of '<columnname> from <tablename>', where 'columnname' is the name of the column containing the geometry objects and 'tablename' is the name of the table from which the geometry data will be read.For Oracle, use 'shape FROM table' or 'shape FROM (SELECT statement)' or even more complex Oracle compliant queries! Note that there are important performance impacts when using spatial subqueries however. Try using MapServer's FILTER whenever possible instead. You can also see the SQL submitted by forcing an error, for instance by submitting a DATA parameter you know won't work, using for example a bad column name.", | |
557 | - titulo:"data",prefixoid:"data_",id:codigoLayer,valor:"data"} | |
558 | - ] | |
559 | - } | |
560 | - ins += "<p>Colunas: "+retorna.data.colunas+"</p>" | |
561 | - ins += "<br><fieldset><legend>+- status</legend><div style=display:none >" | |
562 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Sets the current status of the layer. Often modified by MapServer itself. Default turns the layer on permanently.</b></p>" | |
563 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='status_"+codigoLayer+"' >" | |
564 | - ins += comboObjeto(objstatus,"valor","texto",retorna.data.status) | |
565 | - ins += "</select>" | |
566 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"status\",this)'/>" | |
567 | - ins += "</p></fieldset>" | |
568 | - | |
569 | - ins += "<br><fieldset><legend>+- type</legend><div style=display:none >" | |
570 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Specifies how the data should be drawn. Need not be the same as the shapefile type. For example, a polygon shapefile may be drawn as a point layer, but a point shapefile may not be drawn as a polygon layer. Common sense rules. Annotation means that a label point will be calculated for the features, but the feature itself will not be drawn although a marker symbol can be optionally drawn. this allows for advanced labeling like numbered highway shields. Points are labeled at that point. Polygons are labeled first using a centroid, and if that doesn't fall in the polygon a scanline approach is used to guarantee the label falls within the feature. Lines are labeled at the middle of the longest arc in the visible portion of the line. Query only means the layer can be queried but not drawn.In order to differentiate between POLYGONs and POLYLINEs (which do not exist as a type), simply respectively use or ommit the COLOR keyword when classifying. If you use it, it's a polygon with a fill color, otherwise it's a polyline with only an OUTLINECOLOR.For CHART layers, see the Dynamic Charting howto.A circle must be defined by a a minimum bounding rectangle. That is, 2 points that define the smallest square that can contain it. These 2 points are the two opposite corners of said box.</b></p>" | |
571 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='type_"+codigoLayer+"' >" | |
572 | - ins += comboObjeto(objlayertypes,"valor","texto",retorna.data.type) | |
573 | - ins += "</select>" | |
574 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"type\",this)'/>" | |
575 | - ins += "</p></fieldset>" | |
576 | - | |
577 | - ins += "<br><fieldset><legend>+- connectiontype</legend><div style=display:none >" | |
578 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Type of connection. Default is local.</b></p>" | |
579 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='connectiontype_"+codigoLayer+"' >" | |
580 | - ins += comboObjeto(objcontype,"valor","texto",retorna.data.connectiontype) | |
581 | - ins += "</select>" | |
582 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"connectiontype\",this)'/>" | |
583 | - ins += "</p></div></fieldset>" | |
584 | - | |
585 | - ins += (geraLinhas2(retorna.data,param,"salvarLayer")); | |
586 | - | |
587 | - | |
588 | - var param = { | |
589 | - "linhas":[ | |
590 | - {texto:"Name of a group that this layer belongs to. The group name can then be reference as a regular layer name in the template files, allowing to do things like turning on and off a group of layers at once.", | |
591 | - titulo:"group",prefixoid:"group_",id:codigoLayer,valor:"group"}, | |
592 | - {texto:"Item that contains the location of an individual tile, default is 'location'.", | |
593 | - titulo:"tileitem",prefixoid:"tileitem_",id:codigoLayer,valor:"tileitem"}, | |
594 | - {texto:"Name of the tileindex file or layer. A tileindex is similar to an ArcInfo library index. The tileindex contains polygon features for each tile. The item that contains the location of the tiled data is given using the TILEITEM parameter. When a file is used as the tileindex for shapefile or raster layers, the tileindex should be a shapefile. For CONNECTIONTYPE OGR layers, any OGR supported datasource can be a tileindex. Normally the location should contain the path to the tile file relative to the shapepath, not relative to the tileindex itself. If the DATA parameter contains a value then it is added to the end of the location. When a tileindex layer is used, it works similarly to directly referring to a file, but any supported feature source can be used (ie. postgres, oracle).NOTE: All files in the tileindex should have the same coordinate system, and for vector files the same set of attributes in the same order.", | |
595 | - titulo:"tileindex",prefixoid:"tileindex_",id:codigoLayer,valor:"tileindex"}, | |
596 | - {texto:"Maximum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
597 | - titulo:"maxscale",prefixoid:"maxscale_",id:codigoLayer,valor:"maxscale"}, | |
598 | - {texto:"Minimum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
599 | - titulo:"minscale",prefixoid:"minscale_",id:codigoLayer,valor:"minscale"}, | |
600 | - {texto:"Sets the color index to treat as transparent for raster layers.", | |
601 | - titulo:"offsite (R,G,B)",prefixoid:"offsite_",id:codigoLayer,valor:"offsite"}, | |
602 | - {texto:"Sets the opacity level (or the inability to see through the layer) of all classed pixels for a given layer. The value can either be an integer in the range (0-100) or the named symbol 'ALPHA'. A value of 100 is opaque and 0 is fully transparent. Implemented in MapServer 5.0, to replace the deprecated TRANSPARENCY parameter.The 'ALPHA' symbol directs the MapServer rendering code to honor the indexed or alpha transparency of pixmap symbols used to style a layer. This is only needed in the case of RGB output formats, and should be used only when necessary as it is expensive to render transparent pixmap symbols onto an RGB map image.", | |
603 | - titulo:"opacity",prefixoid:"opacity_",id:codigoLayer,valor:"opacity"}, | |
604 | - {texto:"This parameter allows for data specific attribute filtering that is done at the same time spatial filtering is done, but before any CLASS expressions are evaluated. For OGR and shapefiles the string is simply a mapserver regular expression. For spatial databases the string is a SQL WHERE clause that is valid with respect to the underlying database.For example: FILTER type='road' and size <2", | |
605 | - titulo:"filter",prefixoid:"filter_",id:codigoLayer,valor:"filter"}, | |
606 | - {texto:"Item to use with simple FILTER expressions. OGR and shapefiles only.", | |
607 | - titulo:"filteritem",prefixoid:"filteritem_",id:codigoLayer,valor:"filteritem"}, | |
608 | - {texto:"Item name in attribute table to use for class annotation angles. Values should be in degrees.", | |
609 | - titulo:"labelangleitem",prefixoid:"labelangleitem_",id:codigoLayer,valor:"labelangleitem"}, | |
610 | - {texto:"Item name in attribute table to use for class annotation (i.e. labeling).", | |
611 | - titulo:"labelitem",prefixoid:"labelitem_",id:codigoLayer,valor:"labelitem"}, | |
612 | - {texto:"Maximum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
613 | - titulo:"labelmaxscale",prefixoid:"labelmaxscale_",id:codigoLayer,valor:"labelmaxscale"}, | |
614 | - {texto:"Minimum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
615 | - titulo:"labelminscale",prefixoid:"labelminscale_",id:codigoLayer,valor:"labelminscale"}, | |
616 | - {texto:"Item name in attribute table to use for class annotation sizes. Values should be in pixels.", | |
617 | - titulo:"labelsizeitem",prefixoid:"labelsizeitem_",id:codigoLayer,valor:"labelsizeitem"}, | |
618 | - {texto:"The scale at which symbols and/or text appear full size. This allows for dynamic scaling of objects based on the scale of the map. If not set then this layer will always appear at the same size. Scaling only takes place within the limits of MINSIZE and MAXSIZE as described above. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
619 | - titulo:"symbolscale",prefixoid:"symbolscale_",id:codigoLayer,valor:"symbolscale"}, | |
620 | - {texto:"Sensitivity for point based queries (i.e. via mouse and/or map coordinates). Given in TOLERANCEUNITS. If the layer is a POINT or a LINE, the default is 3. For all other layer types, the default is 0. To restrict polygon searches so that the point must occur in the polygon set the tolerance to zero.", | |
621 | - titulo:"tolerance",prefixoid:"tolerance_",id:codigoLayer,valor:"tolerance"}, | |
622 | - {texto:" ", | |
623 | - titulo:"projection",prefixoid:"projection_",id:codigoLayer,valor:"projection"} | |
624 | - ] | |
625 | - } | |
626 | - | |
627 | - | |
628 | - ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
629 | - ins += (geraLinhas2(retorna.data,param,"salvarLayer")); | |
630 | - | |
631 | - ins += "<br><fieldset><legend>+- sizeunits</legend><div style=display:none >" | |
632 | - ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Sets the unit of CLASS object SIZE values (default is pixels). Useful for simulating buffering.</b><p>" | |
633 | - ins += "<p><select onchange='this.style.color=\"blue\"' id='sizeunits_"+codigoLayer+"' >" | |
634 | - ins += comboObjeto(objmapunits,"valor","texto",retorna.data.sizeunits) | |
635 | - ins += "</select>" | |
636 | - ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"sizeunits\",this)'/>" | |
637 | - ins += "</p></div></fieldset>" | |
638 | - | |
639 | - ins += "</div></fieldset>" | |
640 | - | |
641 | - ins += "</div></fieldset>" | |
642 | - $i("geral_"+codigoLayer+"_"+codigoMap).innerHTML = ins | |
643 | - } | |
644 | - var p = "../php/temas.php?funcao=pegaCaracteristicasGerais&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
645 | - cPaint.call(p,"",retorna); | |
270 | + catch(e){core_handleFailure(e,o.responseText);} | |
271 | + }, | |
272 | + failure:core_handleFailure, | |
273 | + argument: { foo:"foo", bar:"bar" } | |
274 | + }; | |
275 | + core_makeRequest(sUrl,callback) | |
646 | 276 | } |
647 | -function testarMap() | |
277 | +function adicionaNovoLayer(codigoMap) | |
648 | 278 | { |
649 | - var codigo = $i("temaAtivo").value | |
650 | - window.open("../testamapfile.php?map="+codigo+".map") | |
651 | -} | |
652 | -function salvarLayer(layer,parametro,icone) | |
653 | -{ | |
654 | - icone.src="../imagens/aguarde.gif" | |
655 | - var retorna = function(retorno) | |
656 | - {icone.src="../imagens/02.png";} | |
657 | - var valor = $i(parametro+"_"+layer).value | |
658 | - $i(parametro+"_"+layer).style.color="black" | |
659 | - var p = "../php/temas.php?funcao=alteraLayer&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; | |
660 | - cPaint.call(p,"",retorna); | |
661 | -} | |
662 | -function salvarMetadados(layer,parametro,icone) | |
663 | -{ | |
664 | - icone.src="../imagens/aguarde.gif" | |
665 | - var retorna = function(retorno) | |
666 | - {icone.src="../imagens/02.png";} | |
667 | - var valor = $i(parametro+"_"+layer).value | |
668 | - $i(parametro+"_"+layer).style.color="black" | |
669 | - var p = "../php/temas.php?funcao=alteraMetadados&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; | |
670 | - cPaint.call(p,"",retorna); | |
671 | -} | |
672 | -function salvarClasse(layer,parametro,icone) | |
673 | -{ | |
674 | - icone.src="../imagens/aguarde.gif" | |
675 | - var temp = layer.split("_") | |
676 | - var layer = temp[0] | |
677 | - var classe = temp[1] | |
678 | - var retorna = function(retorno) | |
279 | + core_carregando("ativa"); | |
280 | + core_carregando(" adicionando um novo layer"); | |
281 | + sUrl = "../php/temas.php?funcao=criarNovoLayer&codigoMap="+codigoMap | |
282 | + var callback = | |
679 | 283 | { |
680 | - icone.src="../imagens/02.png"; | |
681 | - contaN++ | |
682 | - $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN | |
683 | - } | |
684 | - var valor = $i(parametro+"_"+layer+"_"+classe).value | |
685 | - $i(parametro+"_"+layer+"_"+classe).style.color="black" | |
686 | - var p = "../php/temas.php?funcao=alteraClasse&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; | |
687 | - cPaint.call(p,"",retorna); | |
688 | -} | |
689 | -function salvarClasseLabel(layer,parametro,icone) | |
690 | -{ | |
691 | - icone.src="../imagens/aguarde.gif" | |
692 | - var temp = layer.split("_") | |
693 | - var layer = temp[0] | |
694 | - var classe = temp[1] | |
695 | - var parametro = parametro.split("."); | |
696 | - var parametro = parametro[1] | |
697 | - var retorna = function(retorno) | |
698 | - {icone.src="../imagens/02.png";} | |
699 | - var valor = $i("label_"+parametro+"_"+layer+"_"+classe).value | |
700 | - $i("label_"+parametro+"_"+layer+"_"+classe).style.color="black" | |
701 | - var p = "../php/temas.php?funcao=alteraClasseLabel&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; | |
702 | - cPaint.call(p,"",retorna); | |
703 | -} | |
704 | -function salvarEstilo(estilo,parametro,icone) | |
705 | -{ | |
706 | - icone.src="../imagens/aguarde.gif" | |
707 | - var temp = estilo.split("_") | |
708 | - var layer = temp[1] | |
709 | - var classe = temp[2] | |
710 | - var estilo = temp[3] | |
711 | - var retorna = function(retorno) | |
712 | - { | |
713 | - icone.src="../imagens/02.png"; | |
714 | - contaN++ | |
715 | - $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN | |
716 | - } | |
717 | - var valor = $i(parametro+"_"+layer+"_"+classe+"_"+estilo).value | |
718 | - $i(parametro+"_"+layer+"_"+classe+"_"+estilo).style.color="black" | |
719 | - var p = "../php/temas.php?funcao=alteraEstilo&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"&estilo="+estilo+"¶metro="+parametro+"&valor="+valor; | |
720 | - cPaint.call(p,"",retorna); | |
721 | -} | |
722 | -function adicionarClasse(codigoLayer,botao) | |
723 | -{ | |
724 | - botao.style.color="red" | |
725 | - var o = botao.value | |
726 | - botao.value = "Aguarde..." | |
727 | - var codigoMap = $i("temaAtivo").value | |
728 | - if(codigoMap != "") | |
729 | - { | |
730 | - var retorna = function(retorno) | |
731 | - { | |
732 | - pegaClasses(codigoMap,codigoLayer) | |
733 | - } | |
734 | - var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
735 | - cPaint.call(p,"",retorna); | |
736 | - } | |
737 | -} | |
738 | -function adicionarEstilo(codigoLayer,codigoClasse,botao) | |
739 | -{ | |
740 | - botao.style.color="red" | |
741 | - var o = botao.value | |
742 | - botao.value = "Aguarde..." | |
743 | - var codigoMap = $i("temaAtivo").value | |
744 | - if(codigoMap != "") | |
745 | - { | |
746 | - var retorna = function(retorno) | |
747 | - { | |
748 | - pegaEstilos(codigoMap,codigoLayer) | |
749 | - } | |
750 | - var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; | |
751 | - cPaint.call(p,"",retorna); | |
752 | - } | |
753 | -} | |
754 | -function excluirClasse(codigoLayer,codigoClasse,botao) | |
755 | -{ | |
756 | - if(confirm("Você realmente quer fazer isso?")) | |
757 | - { | |
758 | - botao.style.color="red" | |
759 | - var o = botao.value | |
760 | - botao.value = "Aguarde..." | |
761 | - var codigoMap = $i("temaAtivo").value | |
762 | - if(codigoMap != "") | |
284 | + success:function(o) | |
763 | 285 | { |
764 | - var retorna = function(retorno) | |
286 | + try | |
765 | 287 | { |
766 | - pegaClasses(codigoMap,codigoLayer) | |
288 | + if(YAHOO.lang.JSON.parse(o.responseText) == "erro") | |
289 | + { | |
290 | + core_carregando("<span style=color:red >Erro</span>"); | |
291 | + setTimeout("core_carregando('desativa')",3000) | |
292 | + } | |
293 | + else | |
294 | + { | |
295 | + var dados = YAHOO.lang.JSON.parse(o.responseText) | |
296 | + var no = tree.getNodeByProperty("codigoMap",codigoMap) | |
297 | + montaRaizTema(no,dados) | |
298 | + core_carregando("desativa"); | |
299 | + } | |
300 | + YAHOO.example.container.panelEditor.destroy(); | |
301 | + YAHOO.example.container.panelEditor = null; | |
767 | 302 | } |
768 | - var p = "../php/temas.php?funcao=excluirClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; | |
769 | - cPaint.call(p,"",retorna); | |
770 | - } | |
771 | - } | |
303 | + catch(e){core_handleFailure(e,o.responseText);} | |
304 | + }, | |
305 | + failure:core_handleFailure, | |
306 | + argument: { foo:"foo", bar:"bar" } | |
307 | + }; | |
308 | + core_makeRequest(sUrl,callback) | |
772 | 309 | } |
773 | -function excluirLayer(codigoLayer,botao) | |
310 | + | |
311 | +function excluirLayer(codigoMap,codigoLayer) | |
774 | 312 | { |
775 | - if(confirm("Você realmente quer fazer isso?")) | |
776 | - { | |
777 | - botao.style.color="red" | |
778 | - var o = botao.value | |
779 | - botao.value = "Aguarde..." | |
780 | - var codigoMap = $i("temaAtivo").value | |
781 | - if(codigoMap != "") | |
782 | - { | |
783 | - var retorna = function(retorno) | |
784 | - { | |
785 | - ativaTema(codigoMap) | |
786 | - } | |
787 | - var p = "../php/temas.php?funcao=excluirLayer&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
788 | - cPaint.call(p,"",retorna); | |
789 | - } | |
790 | - } | |
791 | -} | |
792 | 313 | \ No newline at end of file |
314 | + var mensagem = " excluindo "+codigoLayer; | |
315 | + var no = tree.getNodeByProperty("id",codigoMap+"_"+codigoLayer) | |
316 | + var sUrl = "../php/temas.php?funcao=excluirLayer&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
317 | + core_excluiNoTree(sUrl,no,mensagem) | |
318 | +} | |
319 | +YAHOO.util.Event.addListener(window, "load", initMenu); | |
793 | 320 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,796 @@ |
1 | +/* | |
2 | +Title: Arvore | |
3 | + | |
4 | +Funções javascript utilizadas no sistema de administração do menu de mapas | |
5 | + | |
6 | +File: i3geo/admin/mapas.js | |
7 | + | |
8 | +About: Licença | |
9 | + | |
10 | +I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | |
11 | + | |
12 | +Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | |
13 | +Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | |
14 | + | |
15 | +Este programa é software livre; você pode redistribuí-lo | |
16 | +e/ou modificá-lo sob os termos da Licença Pública Geral | |
17 | +GNU conforme publicada pela Free Software Foundation; | |
18 | +tanto a versão 2 da Licença. | |
19 | +Este programa é distribuído na expectativa de que seja útil, | |
20 | +porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | |
21 | +de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | |
22 | +Consulte a Licença Pública Geral do GNU para mais detalhes. | |
23 | +Você deve ter recebido uma cópia da Licença Pública Geral do | |
24 | +GNU junto com este programa; se não, escreva para a | |
25 | +Free Software Foundation, Inc., no endereço | |
26 | +59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | |
27 | +*/ | |
28 | +contaN = 0; | |
29 | +objcontype = [ | |
30 | + {texto:"MS_INLINE",valor:"0"}, | |
31 | + {texto:"MS_SHAPEFILE",valor:"1"}, | |
32 | + {texto:"MS_TILED_SHAPEFILE",valor:"2"}, | |
33 | + {texto:"MS_SDE",valor:"3"}, | |
34 | + {texto:"MS_OGR",valor:"4"}, | |
35 | + {texto:"MS_TILED_OGR",valor:"5"}, | |
36 | + {texto:"MS_POSTGIS",valor:"6"}, | |
37 | + {texto:"MS_WMS",valor:"7"}, | |
38 | + {texto:"MS_ORACLESPATIAL",valor:"8"}, | |
39 | + {texto:"MS_WFS",valor:"9"}, | |
40 | + {texto:"MS_GRATICULE",valor:"10"}, | |
41 | + {texto:"MS_MYGIS",valor:"11"}, | |
42 | + {texto:"MS_RASTER",valor:"12"}, | |
43 | + {texto:"MS_PLUGIN",valor:"13"} | |
44 | +]; | |
45 | +objbool_tf = [ | |
46 | + {texto:"MS_TRUE",valor:"0"}, | |
47 | + {texto:"MS_FALSE",valor:"1"} | |
48 | +]; | |
49 | +objbool_of = [ | |
50 | + {texto:"MS_ON",valor:"2"}, | |
51 | + {texto:"MS_OFF",valor:"3"} | |
52 | +]; | |
53 | +objbool_yn = [ | |
54 | + {texto:"MS_YES",valor:"4"}, | |
55 | + {texto:"MS_NO",valor:"5"} | |
56 | +]; | |
57 | +objmapunits = [ | |
58 | + {texto:"MS_INCHES",valor:"0"}, | |
59 | + {texto:"MS_FEET",valor:"1"}, | |
60 | + {texto:"MS_MILES",valor:"2"}, | |
61 | + {texto:"MS_METERS",valor:"3"}, | |
62 | + {texto:"MS_KILOMETERS",valor:"4"}, | |
63 | + {texto:"MS_DD",valor:"5"}, | |
64 | + {texto:"MS_PIXELS",valor:"6"} | |
65 | +]; | |
66 | +objlayertypes = [ | |
67 | + {texto:"MS_LAYER_POINT",valor:"0"}, | |
68 | + {texto:"MS_LAYER_LINE",valor:"1"}, | |
69 | + {texto:"MS_LAYER_POLYGON",valor:"2"}, | |
70 | + {texto:"MS_LAYER_RASTER",valor:"3"}, | |
71 | + {texto:"MS_LAYER_ANNOTATION",valor:"4"}, | |
72 | + {texto:"MS_LAYER_QUERY",valor:"5"}, | |
73 | + {texto:"MS_LAYER_CIRCLE",valor:"6"}, | |
74 | + {texto:"MS_LAYER_TILEINDEX",valor:"7"}, | |
75 | + {texto:"MS_LAYER_CHART",valor:"8"} | |
76 | +]; | |
77 | +objstatus = [ | |
78 | + {texto:"MS_ON",valor:"1"}, | |
79 | + {texto:"MS_OFF",valor:"0"}, | |
80 | + {texto:"MS_DEFAULT",valor:"2"} | |
81 | +]; | |
82 | +objfonttypes = [ | |
83 | + {texto:"MS_TRUETYPE",valor:"0"}, | |
84 | + {texto:"MS_BITMAP",valor:"1"} | |
85 | +]; | |
86 | +objposition = [ | |
87 | + {texto:"MS_UL",valor:"0"}, | |
88 | + {texto:"MS_LR",valor:"1"}, | |
89 | + {texto:"MS_UR",valor:"2"}, | |
90 | + {texto:"MS_LL",valor:"3"}, | |
91 | + {texto:"MS_CR",valor:"4"}, | |
92 | + {texto:"MS_CL",valor:"5"}, | |
93 | + {texto:"MS_UC",valor:"6"}, | |
94 | + {texto:"MS_WMS",valor:"7"}, | |
95 | + {texto:"MS_LC",valor:"8"}, | |
96 | + {texto:"MS_CC",valor:"9"}, | |
97 | + {texto:"MS_AUTO",valor:"10"}, | |
98 | + {texto:"MS_XY",valor:"11"}, | |
99 | + {texto:"MS_FOLLOW",valor:"12"} | |
100 | +]; | |
101 | +objfontstyle = [ | |
102 | + {texto:"MS_TINY",valor:"0"}, | |
103 | + {texto:"MS_SMALL",valor:"1"}, | |
104 | + {texto:"MS_MEDIUM",valor:"2"}, | |
105 | + {texto:"MS_LARGE",valor:"3"}, | |
106 | + {texto:"MS_GIANT",valor:"4"}, | |
107 | +]; | |
108 | +objshapetype = [ | |
109 | + {texto:"MS_SHAPE_POINT",valor:"0"}, | |
110 | + {texto:"MS_SHAPE_LINE",valor:"1"}, | |
111 | + {texto:"MS_SHAPE_POLYGON",valor:"2"}, | |
112 | + {texto:"MS_SHAPE_NULL",valor:"3"} | |
113 | +]; | |
114 | +objshapefiletype = [ | |
115 | + {texto:"MS_SHP_POINT",valor:"0"}, | |
116 | + {texto:"MS_SHP_ARC",valor:"1"}, | |
117 | + {texto:"MS_SHP_POLYGON",valor:"2"}, | |
118 | + {texto:"MS_SHP_MULTIPOINT",valor:"3"} | |
119 | +]; | |
120 | +objalignment = [ | |
121 | + {texto:"MS_ALIGN_LEFT",valor:"0"}, | |
122 | + {texto:"MS_ALIGN_CENTER",valor:"1"}, | |
123 | + {texto:"MS_ALIGN_RIGHT",valor:"2"} | |
124 | +]; | |
125 | + | |
126 | +$i = function(i) | |
127 | +{return document.getElementById(i);}; | |
128 | + | |
129 | +YAHOO.namespace("example.container"); | |
130 | + | |
131 | +/* | |
132 | +var retorna = function(retorno) | |
133 | +{ | |
134 | + fontes = retorno.data; | |
135 | +} | |
136 | +var p = "../php/temas.php?funcao=pegaFontes"; | |
137 | +cPaint.call(p,"",retorna); | |
138 | +*/ | |
139 | + | |
140 | +function iniciaMenu() | |
141 | +{ | |
142 | + verificaEditores() | |
143 | +} | |
144 | +function montaParametros() | |
145 | +{ | |
146 | + var retorna = function(retorno) | |
147 | + { | |
148 | + ins = "<select id=temaAtivo onchange='ativaTema(this.value)'>" | |
149 | + ins += comboObjeto(retorno.data,"codigo_tema","nome_tema","") | |
150 | + ins += "</select>" | |
151 | + $i("arquivoAtivo").innerHTML = ins | |
152 | + } | |
153 | + var p = "../php/menutemas.php?funcao=pegaTemas"; | |
154 | + cPaint.call(p,"",retorna); | |
155 | +} | |
156 | +function adicionarLayer() | |
157 | +{ | |
158 | + var codigoMap = $i("temaAtivo").value | |
159 | + if(codigoMap != "") | |
160 | + { | |
161 | + var retorna = function(retorno) | |
162 | + { | |
163 | + ativaTema(codigoMap) | |
164 | + } | |
165 | + var p = "../php/temas.php?funcao=criarNovoLayer&codigoMap="+codigoMap; | |
166 | + cPaint.call(p,"",retorna); | |
167 | + } | |
168 | +} | |
169 | +function criarNovoMap() | |
170 | +{ | |
171 | + var nome = $i("nomeNovoMap").value | |
172 | + var codigo = $i("codigoNovoMap").value | |
173 | + if(nome != "" && codigo != "") | |
174 | + { | |
175 | + var retorna = function(retorno) | |
176 | + { | |
177 | + $i("nomeNovoMap").value = "" | |
178 | + $i("codigoNovoMap").value = "" | |
179 | + $i("forms").style.display="none" | |
180 | + montaParametros() | |
181 | + } | |
182 | + var p = "../php/temas.php?funcao=criarNovoMap&nome="+nome+"&codigo="+codigo; | |
183 | + cPaint.call(p,"",retorna); | |
184 | + } | |
185 | +} | |
186 | +function ativaTema(codigoMap) | |
187 | +{ | |
188 | + var retorna = function(retorno) | |
189 | + { | |
190 | + var cl = retorno.data.layers | |
191 | + var ins = "" | |
192 | + for(c=0;c<cl.length;c++) | |
193 | + { | |
194 | + ins += "<br><fieldset><legend>+- "+cl[c]+"</legend><div >" | |
195 | + ins += "<div id='geral_"+cl[c]+"_"+codigoMap+"' >" | |
196 | + ins += "</div>" | |
197 | + ins += "<div id='metadados_"+cl[c]+"_"+codigoMap+"' >" | |
198 | + ins += "</div>" | |
199 | + ins += "<div id='classes_"+cl[c]+"_"+codigoMap+"' >" | |
200 | + ins += "</div>" | |
201 | + | |
202 | + ins += "</div></fieldset>" | |
203 | + } | |
204 | + $i("forms").innerHTML = ins | |
205 | + var ins = "" | |
206 | + for(c=0;c<cl.length;c++) | |
207 | + { | |
208 | + pegaCaracteristicasGerais(codigoMap,cl[c]) | |
209 | + pegaMetadados(codigoMap,cl[c]) | |
210 | + pegaClasses(codigoMap,cl[c]) | |
211 | + } | |
212 | + } | |
213 | + $i("forms").style.display="block" | |
214 | + var p = "../php/temas.php?funcao=pegaLayers&codigoMap="+codigoMap; | |
215 | + cPaint.call(p,"",retorna); | |
216 | +} | |
217 | +function pegaClasses(codigoMap,codigoLayer) | |
218 | +{ | |
219 | + var ins = "<br><fieldset style='background-color:beige'><legend>+- Classes</legend><div style=display:none >" | |
220 | + ins += "<p><input onclick=adicionarClasse('"+codigoLayer+"',this) type=button value='Adicionar classe' /></p>" | |
221 | + ins += "<br><fieldset><legend>+- Legenda (amostra)</legend><div style=display:none >" | |
222 | + ins += "<img id='legenda_"+codigoLayer+"' src='../ogc.php?tema=bioma&service=wms&request=getlegendgraphic&layer="+codigoLayer+"&format=image/png' />" | |
223 | + ins += "</div></fieldset>" | |
224 | + var retorna = function(retorna) | |
225 | + { | |
226 | + var nc = retorna.data.length | |
227 | + for(c=0;c<nc;c++) | |
228 | + { | |
229 | + d = retorna.data[c] | |
230 | + var param = { | |
231 | + "linhas":[ | |
232 | + {texto:"Nome da classe para ser mostrada na legenda", | |
233 | + titulo:"name",prefixoid:"name_",id:codigoLayer+"_"+d.id,valor:"name"} | |
234 | + ] | |
235 | + } | |
236 | + | |
237 | + ins += "<br><fieldset><legend>+- "+d.id+"</legend><div style=display:none >" | |
238 | + ins += "<p><input onclick=excluirClasse('"+codigoLayer+"','"+d.id+"',this) type=button value='Excluir classe' /></p>" | |
239 | + ins += "<br><fieldset><legend>+- status</legend><div style=display:none >" | |
240 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Sets the current display status of the class. Default turns the class on.</p>" | |
241 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='status_"+codigoLayer+"_"+d.id+"' >" | |
242 | + ins += comboObjeto(objstatus,"valor","texto",d.dados.status) | |
243 | + ins += "</select>" | |
244 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasse(\""+codigoLayer+"_"+d.id+"\",\"status\",this)'/>" | |
245 | + ins += "</p></div></fieldset>" | |
246 | + | |
247 | + ins += "<br><fieldset><legend>+- expression</legend><div style=display:none >" | |
248 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Four types of expressions are now supported to define class membership. String comparisons, regular expressions, simple logical expressions, and string functions. If no expression is given, then all features are said to belong to this class.<br>String comparisons are case sensitive and are the fastest to evaluate. No special delimiters are necessary although string must be quoted if they contain special characters. (As a matter of good habit, it is recommended you quote all strings).<br>Regular expressions function just like previous versions of MapServer. However, you must now delimit a regular expression using /regex/. No quotes should be used.<br><br>Logical expressions allow you to build fairly complex tests based on one or more attributes and therefore are only available with shapefiles. Logical expressions are delimited by parentheses '(expression)'. Attribute names are delimited by square brackets '[ATTRIBUTE]'. These names are case sensitive and must match the items in the shapefile. For example: EXPRESSION ([POPULATION] > 50000 AND '[LANGUAGE]' eq 'FRENCH') ... The following logical operators are supported: =,>,<,<=,>=,=,or,and,lt,gt,ge,le,eq,ne. As you might expect this level of complexity is slower to process.<br>One string function exists: length(). This obviously computes the length of a string. An example follows:<br>EXPRESSION (length('[NAME_E]') < 8)<br>String comparisons and regular expressions work from the classitem defined at the layer level. You may mix expression types within the different classes of a layer.</p>" | |
249 | + ins += "<p><input type=text onchange='this.style.color=\"blue\"' id='expression_"+codigoLayer+"_"+d.id+"' value=\""+d.dados.expression+"\" />" | |
250 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasse(\""+codigoLayer+"_"+d.id+"\",\"expression\",this)'/>" | |
251 | + ins += "</p></div></fieldset>" | |
252 | + | |
253 | + ins += (geraLinhas2(d.dados,param,"salvarClasse")); | |
254 | + | |
255 | + var param = { | |
256 | + "linhas":[ | |
257 | + {texto:"Full filename of the legend image for the CLASS. This image is used when building a legend (or requesting a legend icon via MapScript or the CGI application).", | |
258 | + titulo:"keyimage",prefixoid:"keyimage_",id:codigoLayer+"_"+d.id,valor:"keyimage"}, | |
259 | + {texto:"Maximum scale at which this CLASS is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
260 | + titulo:"maxscale",prefixoid:"maxscale_",id:codigoLayer+"_"+d.id,valor:"maxscale"}, | |
261 | + {texto:"Minimum scale at which this CLASS is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
262 | + titulo:"minscale",prefixoid:"minscale_",id:codigoLayer+"_"+d.id,valor:"minscale"}, | |
263 | + {texto:"Maximum size in pixels to draw a symbol. Default is 50.", | |
264 | + titulo:"maxsize",prefixoid:"maxsize_",id:codigoLayer+"_"+d.id,valor:"maxsize"}, | |
265 | + {texto:"Minimum size in pixels to draw a symbol. Default is 0.", | |
266 | + titulo:"minsize",prefixoid:"minsize_",id:codigoLayer+"_"+d.id,valor:"minsize"}, | |
267 | + {texto:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. For vector (and ellipse) symbol types the default size is based on the range of Y values in the POINTS defining the symbol. For pixmaps, the default is the vertical size of the image. Default size is 1 for TTF symbols.", | |
268 | + titulo:"size",prefixoid:"size_",id:codigoLayer+"_"+d.id,valor:"size"}, | |
269 | + {texto:"Static text to label features in this class with. This overrides values obtained from the LABELTIEM. The string may be given as an expression delimited using the ()'s. This allows you to concatenate multiple attributes into a single label. For example: ([FIRSTNAME],[LASTNAME]).", | |
270 | + titulo:"text",prefixoid:"text_",id:codigoLayer+"_"+d.id,valor:"text"} | |
271 | + ] | |
272 | + } | |
273 | + | |
274 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
275 | + ins += (geraLinhas2(d.dados,param,"salvarClasse")); | |
276 | + ins += "</fieldset>" | |
277 | + //labels | |
278 | + ins += "<br><fieldset><legend style=color:brown >+- Label (para ativar, defina LABELITEM em caract. gerais)</legend><div style=display:none >" | |
279 | + var param = { | |
280 | + "linhas":[ | |
281 | + {texto:"Color to draw text with.", | |
282 | + titulo:"color",prefixoid:"label_color_",id:codigoLayer+"_"+d.id,valor:"label.color"}, | |
283 | + {texto:"Text size. Use integer to give the size in pixels of your TrueType font based label, or any of theother 5 listed keywords to bitmap fonts.", | |
284 | + titulo:"size",prefixoid:"label_size_",id:codigoLayer+"_"+d.id,valor:"label.size"}, | |
285 | + {texto:"Position of the label relative to the labeling point (layers only). First letter is Y position, second letter is X position. Auto tells MapServer to calculate a label position that will not interfere with other labels. With points and polygons, MapServer selects from the 8 outer positions (i.e. excluding cc). With lines, it only uses lc or uc, until it finds a position that doesn't collide with labels that have already been drawn. If all positions cause a conflict, then the label is not drawn (Unless the label's FORCE a parameter is set to true). Auto placement is only available with cached labels.", | |
286 | + titulo:"position",prefixoid:"label_position_",id:codigoLayer+"_"+d.id,valor:"label.position"}, | |
287 | + {texto:"Padding, in pixels, around labels. Useful for maintaining spacing around text to enhance readability. Available only for cached labels. Default is 0.", | |
288 | + titulo:"buffer",prefixoid:"label_buffer_",id:codigoLayer+"_"+d.id,valor:"label.buffer"} | |
289 | + ] | |
290 | + } | |
291 | + | |
292 | + ins += "<br><fieldset><legend>+- font</legend><div style=display:none >" | |
293 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Font alias (as defined in the FONTSET) to use for labeling.</p>" | |
294 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='label_font_"+codigoLayer+"_"+d.id+"' >" | |
295 | + ins += combolista(fontes,d.dados.label.font) | |
296 | + ins += "</select>" | |
297 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".font\",this)'/>" | |
298 | + ins += "</p></div></fieldset>" | |
299 | + | |
300 | + ins += "<br><fieldset><legend>+- type</legend><div style=display:none >" | |
301 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Type of font to use. Generally bitmap fonts are faster to draw then TrueType fonts. However,TrueType fonts are scalable and available in a variety of faces. Be sure to set the FONT parameter ifyou select TrueType.</p>" | |
302 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='label_type_"+codigoLayer+"_"+d.id+"' >" | |
303 | + ins += comboObjeto(objfonttypes,"valor","texto",d.dados.label.type) | |
304 | + ins += "</select>" | |
305 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".type\",this)'/>" | |
306 | + ins += "</p></div></fieldset>" | |
307 | + | |
308 | + ins += "<br><fieldset><legend>+- partials</legend><div style=display:none >" | |
309 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Can text run off the edge of the map? Default is true.</p>" | |
310 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='label_type_"+codigoLayer+"_"+d.id+"' >" | |
311 | + ins += comboObjeto(objbool_tf,"valor","texto",d.dados.label.partials) | |
312 | + ins += "</select>" | |
313 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".partials\",this)'/>" | |
314 | + ins += "</p></div></fieldset>" | |
315 | + | |
316 | + ins += "<br><fieldset><legend>+- force</legend><div style=display:none >" | |
317 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Forces labels for a particular class on, regardless of collisions. Available only for cached labels. Default is false.</p>" | |
318 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='label_type_"+codigoLayer+"_"+d.id+"' >" | |
319 | + ins += comboObjeto(objbool_tf,"valor","texto",d.dados.label.force) | |
320 | + ins += "</select>" | |
321 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarClasseLabel(\""+codigoLayer+"_"+d.id+"\",\".force\",this)'/>" | |
322 | + ins += "</p></div></fieldset>" | |
323 | + | |
324 | + ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); | |
325 | + var param = { | |
326 | + "linhas":[ | |
327 | + {texto:"Color to draw a background rectangle (i.e. billboard). Off by default.", | |
328 | + titulo:"backgroundcolor",prefixoid:"label_backgroundcolor_",id:codigoLayer+"_"+d.id,valor:"label.backgroundcolor"}, | |
329 | + {texto:"Color to draw a background rectangle (i.e. billboard) shadow. Off by default.", | |
330 | + titulo:"backgroundshadowcolor",prefixoid:"label_backgroundshadowcolor_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowcolor"}, | |
331 | + {texto:"Color to draw a one pixel outline around the text.", | |
332 | + titulo:"outlinecolor",prefixoid:"label_outlinecolor_",id:codigoLayer+"_"+d.id,valor:"label.outlinecolor"}, | |
333 | + {texto:"Color of drop shadow.", | |
334 | + titulo:"shadowcolor",prefixoid:"label_shadowcolor_",id:codigoLayer+"_"+d.id,valor:"label.shadowcolor"}, | |
335 | + {texto:"Shadow offset in pixels.", | |
336 | + titulo:"shadowsizex",prefixoid:"label_shadowsizex_",id:codigoLayer+"_"+d.id,valor:"label.shadowsizex"}, | |
337 | + {texto:"Shadow offset in pixels.", | |
338 | + titulo:"shadowsizey",prefixoid:"label_shadowsizey_",id:codigoLayer+"_"+d.id,valor:"label.shadowsizey"}, | |
339 | + {texto:"How far should the background rectangle be offset? Default is 1.", | |
340 | + titulo:"backgroundshadowsizex",prefixoid:"label_backgroundshadowsizex_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowsizex"}, | |
341 | + {texto:"How far should the background rectangle be offset? Default is 1.", | |
342 | + titulo:"backgroundshadowsizey",prefixoid:"label_backgroundshadowsizey_",id:codigoLayer+"_"+d.id,valor:"label.backgroundshadowsizey"}, | |
343 | + {texto:"Minimum font size to use when scaling text (pixels). Default is 4.", | |
344 | + titulo:"minsize",prefixoid:"label_minsize_",id:codigoLayer+"_"+d.id,valor:"label.minsize"}, | |
345 | + {texto:"Maximum font size to use when scaling text (pixels). Default is 256.", | |
346 | + titulo:"maxsize",prefixoid:"label_maxsize_",id:codigoLayer+"_"+d.id,valor:"label.maxsize"}, | |
347 | + {texto:"Offset values for labels, relative to the lower left hand corner of the label and the label point. Given in pixels. In the case of rotated text specify the values as if all labels are horizontal and any rotation will be compensated for.", | |
348 | + titulo:"offsetx",prefixoid:"label_offsetx_",id:codigoLayer+"_"+d.id,valor:"label.offsetx"}, | |
349 | + {texto:"Offset values for labels, relative to the lower left hand corner of the label and the label point. Given in pixels. In the case of rotated text specify the values as if all labels are horizontal and any rotation will be compensated for.", | |
350 | + titulo:"offsety",prefixoid:"label_offsety_",id:codigoLayer+"_"+d.id,valor:"label.offsety"}, | |
351 | + {texto:"Angle, given in degrees, to draw the label or AUTO to allow the software to compute the angle, AUTO is valid for LINE layers only. FOLLOW was introduced in version 4.10 and tells map server to compute a curved label for appropriate linear features", | |
352 | + titulo:"angle",prefixoid:"label_angle_",id:codigoLayer+"_"+d.id,valor:"label.angle"}, | |
353 | + {texto:"Should text be antialiased? Note that this requires more available colors, decreased drawing performance, and results in slightly larger output images.", | |
354 | + titulo:"antialias",prefixoid:"label_antialias_",id:codigoLayer+"_"+d.id,valor:"label.antialias"}, | |
355 | + {texto:"Character that represents an end-of-line condition in label text, thus resulting in a multi-line label.", | |
356 | + titulo:"wrap",prefixoid:"label_wrap_",id:codigoLayer+"_"+d.id,valor:"label.wrap"}, | |
357 | + {texto:"Minimum size a feature must be to be labeled. Given in pixels. For line data the overall length of the displayed line is used, for polygons features the smallest dimension of the bounding box is used. Auto keyword tells MapServer to only label features that are larger than their corresponding label. Available for cached labels only.", | |
358 | + titulo:"minfeaturesize",prefixoid:"label_minfeaturesize_",id:codigoLayer+"_"+d.id,valor:"label.minfeaturesize"}, | |
359 | + {texto:"Minimum distance between duplicate labels. Given in pixels.", | |
360 | + titulo:"mindistance",prefixoid:"label_mindistance_",id:codigoLayer+"_"+d.id,valor:"label.mindistance"}, | |
361 | + {texto:"Supported encoding format to be used for labels. If the format is not supported, the label will not be drawn. Requires the iconv library (present on most systems). The library is always detected if present on the system, but if not the label will not be drawn. Required for displaying international characters in MapServer. More information can be found at: http://www.foss4g.org/FOSS4G/MAPSERVER/mpsnf-i18n-en.html.", | |
362 | + titulo:"encoding",prefixoid:"label_encoding_",id:codigoLayer+"_"+d.id,valor:"label.encoding"} | |
363 | + ] | |
364 | + } | |
365 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
366 | + ins += (geraLinhas2(d.dados,param,"salvarClasseLabel")); | |
367 | + ins += "</fieldset>" | |
368 | + | |
369 | + ins += "</div></fieldset>" | |
370 | + | |
371 | + ins += "<br><fieldset><legend style=color:brown >+- Estilos</legend><div style=display:none >" | |
372 | + ins += "<p><input onclick=adicionarEstilo('"+codigoLayer+"','"+d.id+"',this) type=button value='Adicionar estilo' /></p>" | |
373 | + ins += "<div id='estilos_"+codigoLayer+"_"+d.id+"' ></div>" | |
374 | + ins += "</div></fieldset>" | |
375 | + ins += "</div></fieldset>" | |
376 | + } | |
377 | + ins += "</div></fieldset>" | |
378 | + $i("classes_"+codigoLayer+"_"+codigoMap).innerHTML = ins | |
379 | + pegaEstilos(codigoMap,codigoLayer) | |
380 | + } | |
381 | + var p = "../php/temas.php?funcao=pegaClasses&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
382 | + cPaint.call(p,"",retorna); | |
383 | + | |
384 | +} | |
385 | +function pegaEstilos(codigoMap,codigoLayer) | |
386 | +{ | |
387 | + var retorna = function(retorno) | |
388 | + { | |
389 | + var nc = retorno.data.length | |
390 | + for(c=0;c<nc;c++) | |
391 | + { | |
392 | + var idclasse = retorno.data[c].classe | |
393 | + var estilos = retorno.data[c].estilos | |
394 | + var divestilos = "estilos_"+codigoLayer+"_"+idclasse; | |
395 | + var nes = retorno.data[c].estilos.length | |
396 | + for(est=0;est<nes;est++) | |
397 | + { | |
398 | + var ins = "" | |
399 | + var d = retorno.data[c].estilos[est].dados | |
400 | + var preid = codigoLayer+"_"+idclasse+"_"+est | |
401 | + var param = { | |
402 | + "linhas":[ | |
403 | + {texto:"The symbol name or number to use for all features if attribute tables are not used. The number is the index of the symbol in the symbol file, starting at 1, the 5th symbol in the file is therefore symbol number 5. You can also give your symbols names using the NAME keyword in the symbol definition file, and use those to refer to them. Default is 0, which results in a single pixel, single width line, or solid polygon fill, depending on layer type.You can also specify a gif or png filename. The path is relative to the location of the mapfile.", | |
404 | + titulo:"symbolname",prefixoid:"",id:"symbolname_"+preid,valor:"symbolname"}, | |
405 | + {texto:"Color to use for drawing features.", | |
406 | + titulo:"color",prefixoid:"",id:"color_"+preid,valor:"color"}, | |
407 | + {texto:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. Default is 1. For symbols of Type HATCH, the SIZE is the distance between hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
408 | + titulo:"size",prefixoid:"",id:"size_"+preid,valor:"size"}, | |
409 | + {texto:"Color to use for outlining polygons and certain marker symbols. Line symbols do not support outline colors.", | |
410 | + titulo:"outlinecolor",prefixoid:"",id:"outlinecolor_"+preid,valor:"outlinecolor"}, | |
411 | + {texto:"Width refers to the thickness of line work drawn, in pixels. Default is 1. For symbols of Type HATCH, the WIDTH is how thick the hatched lines are. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
412 | + titulo:"width",prefixoid:"",id:"width_"+preid,valor:"width"}, | |
413 | + ] | |
414 | + } | |
415 | + ins += "<br><fieldset style='background-color:rgb(240,240,240)'><legend>+- "+est+"</legend>" | |
416 | + ins += (geraLinhas2(d,param,"salvarEstilo")); | |
417 | + | |
418 | + var param = { | |
419 | + "linhas":[ | |
420 | + {texto:"Height, in pixels, of the symbol/pattern to be used. Only useful with scalable symbols. Default is 1. For symbols of Type HATCH, the SIZE is the distance between hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
421 | + titulo:"minsize",prefixoid:"",id:"minsize_"+preid,valor:"minsize"}, | |
422 | + {texto:"Maximum size in pixels to draw a symbol. Default is 50.", | |
423 | + titulo:"maxsize",prefixoid:"",id:"maxsize_"+preid,valor:"maxsize"}, | |
424 | + {texto:"Offset values for shadows, hollow symbols, etc ...", | |
425 | + titulo:"offsetx",prefixoid:"",id:"offsetx_"+preid,valor:"offsetx"}, | |
426 | + {texto:"Offset values for shadows, hollow symbols, etc ...", | |
427 | + titulo:"offsety",prefixoid:"",id:"offsety_"+preid,valor:"offsety"}, | |
428 | + {texto:"Should TrueType fonts and Cartoline symbols be antialiased.", | |
429 | + titulo:"antialias",prefixoid:"",id:"antialias_"+preid,valor:"antialias"}, | |
430 | + {texto:"Minimum width in pixels to draw the line work.", | |
431 | + titulo:"minwidth",prefixoid:"",id:"minwidth_"+preid,valor:"minwidth"}, | |
432 | + {texto:"Angle, given in degrees, to draw the line work. Default is 0. For symbols of Type HATCH, this is the angle of the hatched lines. For its use with hatched lines, see Example#8 in the SYMBOL examples.", | |
433 | + titulo:"angle",prefixoid:"",id:"angle_"+preid,valor:"angle"}, | |
434 | + {texto:"For MapServer versions <5, this is the attribute/field that stores the angle to be used in rendering. Angle is given in degrees with 0 meaning no rotation.", | |
435 | + titulo:"angleitem",prefixoid:"",id:"angleitem_"+preid,valor:"angleitem"}, | |
436 | + {texto:"For MapServer versions <5, this is the attribute/field that stores the size to be used in rendering. Value is given in pixels.", | |
437 | + titulo:"sizeitem",prefixoid:"",id:"sizeitem_"+preid,valor:"sizeitem"} | |
438 | + ] | |
439 | + } | |
440 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
441 | + ins += (geraLinhas2(d,param,"salvarEstilo")); | |
442 | + ins += "</fieldset>" | |
443 | + ins += "</fieldset>" | |
444 | + $i(divestilos).innerHTML = ins | |
445 | + } | |
446 | + } | |
447 | + ativaLegenda() | |
448 | + } | |
449 | + var p = "../php/temas.php?funcao=pegaEstilos&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
450 | + cPaint.call(p,"",retorna); | |
451 | +} | |
452 | +function pegaMetadados(codigoMap,codigoLayer) | |
453 | +{ | |
454 | + var ins = "<br><fieldset><legend>+- Metadados</legend><div style=display:none >" | |
455 | + var retorna = function(retorna) | |
456 | + { | |
457 | + ins += ""; | |
458 | + var param = { | |
459 | + "linhas":[ | |
460 | + {texto:"Nome que será utilizado na legenda do mapa e na guia 'Temas'", | |
461 | + titulo:"tema",prefixoid:"tema_",id:codigoLayer,valor:"tema"}, | |
462 | + {texto:"Denominador da escala da fonte dos dados utilizado pelo tema. É utilizado para apresentar a indicação de compatibilidade entre a escala do tema e a escala do mapa que está sendo visto.", | |
463 | + titulo:"escala",prefixoid:"escala_",id:codigoLayer,valor:"escala"}, | |
464 | + {texto:"Extensão geográfica máxima do tema, no formato xmin ymin xmax ymax. É utilizado na opção de 'zoom para o tema'. Quando o tema é baseado em shapefile, esse metadata não é necessário, pois o mapserver consegue calcular a extensão. Já em outros tipos de dados, como Postgis, o parâmetro é necessário. Nesse caso, se não for indicado, o botão de zoom para o tema não será visível para o usuário", | |
465 | + titulo:"extensao",prefixoid:"extensao_",id:codigoLayer,valor:"extensao"} | |
466 | + ] | |
467 | + } | |
468 | + ins += (geraLinhas2(retorna.data,param,"salvarMetadados")); | |
469 | + | |
470 | + ins += "<br><fieldset><legend>+- aplicaextensao</legend><div style=display:none >" | |
471 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se a extensão geográfica do mapa deve ser alterada quando o tema for adicionado ao mapa</p>" | |
472 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='aplicaextensao_"+codigoLayer+"' >" | |
473 | + ins += combosimnao(retorna.data.aplicaextensao) | |
474 | + ins += "</select>" | |
475 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"aplicaextensao\",this)'/>" | |
476 | + ins += "</p></div></fieldset>" | |
477 | + | |
478 | + | |
479 | + ins += "<br><fieldset><legend>+- download</legend><div style=display:none >" | |
480 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se o usuário pode fazer download do tema</p>" | |
481 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='download_"+codigoLayer+"' >" | |
482 | + ins += combosimnao(retorna.data.download) | |
483 | + ins += "</select>" | |
484 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"download\",this)'/>" | |
485 | + ins += "</p></div></fieldset>" | |
486 | + | |
487 | + var param = { | |
488 | + "linhas":[ | |
489 | + {texto:"Nomes das colunas da tabela de atributos do tema, que serão mostradas na ferramenta de identificação. Se for vazio, todas as colunas serão mostradas. A lista de itens deve ser separada por ',' e grafada em caixa alta no caso de shapefile.", | |
490 | + titulo:"itens",prefixoid:"itens_",id:codigoLayer,valor:"itens"}, | |
491 | + {texto:"Lista com os 'alias', ou apelidos, para os nomes das colunas listados no metadata 'itens'. Os alias devem ser separados por ',' e seguir a ordem definida em ITENS.", | |
492 | + titulo:"itensdesc",prefixoid:"itensdesc_",id:codigoLayer,valor:"itensdesc"}, | |
493 | + {texto:"Lista de links que serão incluídos em cada resultado de busca da ferramenta de identificação. A lista de links deve ser separada por ',', podendo-se incluir '' para indicar que o item não tem link. Exemplo de uso para inclusão de links para o site do IBGE quando um município é clicado no mapa:<br>ITENS 'codigo,nome2,uf'<br>ITENSDESC 'codigo do IBGE,nome do município,uf'<br>ITENSLLINK ',http://www.ibge.gov.br/munic2001/tabelas.php?codmun=[codigo]&descricao=[nome],'", | |
494 | + titulo:"itenslink",prefixoid:"itenslink_",id:codigoLayer,valor:"itenslink"}, | |
495 | + {texto:"Lista de colunas que serão utilizadas na opção de inclusão de 'etiquetas'. As etiquetas são mostradas no mapa quando o usuário estaciona o mouse por alguns instantes sobre o mapa. Separe a lista com ','.", | |
496 | + titulo:"tip",prefixoid:"tip_",id:codigoLayer,valor:"tip"}, | |
497 | + {texto:"Mensagem que será mostrada no rodapé do mapa quando o tema estiver visível. É útil para apresentar ao usuário observações especiais sobre o uso daquele tema.", | |
498 | + titulo:"mensagem",prefixoid:"mensagem_",id:codigoLayer,valor:"mensagem"}, | |
499 | + {texto:"É possível a geração de classes automaticamente por meio da definição de colunas na tabela de atributos do tema que armazenam as informações sobre cor, tamanho, etc. Esse metadata é utilizado para definir qual a coluna da tabela que identifica unicamente cada classe. Para cada valor será criada uma classe.<br>O tema que utiliza a geração de classes de forma automática, deve ter definido apenas uma classe. Essa classe será utilizada como padrão para geração das demais.", | |
500 | + titulo:"classesitem",prefixoid:"classesitem_",id:codigoLayer,valor:"classesitem"}, | |
501 | + {texto:"Nome da coluna que será utilizada para compor o nome das classes geradas automaticamente.", | |
502 | + titulo:"classesnome",prefixoid:"classesnome_",id:codigoLayer,valor:"classesnome"}, | |
503 | + {texto:"Nome da coluna que definirá a cor do símbolo utilizado em cada classe. As cores devem ser definidas em RGB.", | |
504 | + titulo:"classescor",prefixoid:"classescor_",id:codigoLayer,valor:"classescor"}, | |
505 | + {texto:"Nome da coluna que definirá o símbolo utilizado em cada classe.", | |
506 | + titulo:"classessimbolo",prefixoid:"classessimbolo_",id:codigoLayer,valor:"classessimbolo"}, | |
507 | + {texto:"Nome da coluna que definirá o tamanho de cada símbolo.", | |
508 | + titulo:"classestamanho",prefixoid:"classestamanho_",id:codigoLayer,valor:"classestamanho"} | |
509 | + ] | |
510 | + } | |
511 | + | |
512 | + | |
513 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
514 | + | |
515 | + ins += (geraLinhas2(retorna.data,param,"salvarMetadados")); | |
516 | + | |
517 | + ins += "<br><fieldset><legend>+- classe</legend><div style=display:none >" | |
518 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se as classes serão mostradas ou não na legenda. Por padrão é SIM.</p>" | |
519 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='classe_"+codigoLayer+"' >" | |
520 | + ins += combosimnao(retorna.data.classe) | |
521 | + ins += "</select>" | |
522 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"classe\",this)'/>" | |
523 | + ins += "</p></div></fieldset>" | |
524 | + | |
525 | + ins += "<br><fieldset><legend>+- escondido</legend><div style=display:none >" | |
526 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se o tema é mostrado no mapa mas não nas listas da legenda e na guia 'temas'</p>" | |
527 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='escondido_"+codigoLayer+"' >" | |
528 | + ins += combosimnao(retorna.data.escondido) | |
529 | + ins += "</select>" | |
530 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"escondido\",this)'/>" | |
531 | + ins += "</p></div></fieldset>" | |
532 | + | |
533 | + ins += "<br><fieldset><legend>+- identifica</legend><div style=display:none >" | |
534 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);'>Indica se o tema irá ser mostrado na ferramenta de identificação</p>" | |
535 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='identifica_"+codigoLayer+"' >" | |
536 | + ins += combosimnao(retorna.data.identifica) | |
537 | + ins += "</select>" | |
538 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarMetadados(\""+codigoLayer+"\",\"identifica\",this)'/>" | |
539 | + ins += "</p></div></fieldset>" | |
540 | + | |
541 | + ins += "</div></fieldset>" | |
542 | + | |
543 | + $i("metadados_"+codigoLayer+"_"+codigoMap).innerHTML = ins | |
544 | + } | |
545 | + var p = "../php/temas.php?funcao=pegaMetadados&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
546 | + cPaint.call(p,"",retorna); | |
547 | +} | |
548 | +function pegaCaracteristicasGerais(codigoMap,codigoLayer) | |
549 | +{ | |
550 | + var ins = "<p><input onclick=excluirLayer('"+codigoLayer+"',this) type=button value='Excluir este layer' /></p>" | |
551 | + ins += "<br><fieldset><legend>+- Características gerais</legend><div style=display:none >" | |
552 | + var retorna = function(retorna) | |
553 | + { | |
554 | + var param = { | |
555 | + "linhas":[ | |
556 | + {texto:"Layer name", | |
557 | + titulo:"name",prefixoid:"name_",id:codigoLayer,valor:"name"}, | |
558 | + {texto:"Database connection string to retrieve remote data.An SDE connection string consists of a hostname, instance name, database name, username and password separated by commas.A PostGIS connection string is basically a regular PostgreSQL connection string, it takes the form of 'user=nobody password=****** dbname=dbname host=localhost port=5432' An Oracle connection string: user/pass[@db]", | |
559 | + titulo:"connection",prefixoid:"connection_",id:codigoLayer,valor:"connection"}, | |
560 | + {texto:"Full filename of the spatial data to process. No file extension is necessary for shapefiles. Can be specified relative to the SHAPEPATH option from the Map Object.If this is an SDE layer, the parameter should include the name of the layer as well as the geometry column, i.e. 'mylayer,shape,myversion'.If this is a PostGIS layer, the parameter should be in the form of '<columnname> from <tablename>', where 'columnname' is the name of the column containing the geometry objects and 'tablename' is the name of the table from which the geometry data will be read.For Oracle, use 'shape FROM table' or 'shape FROM (SELECT statement)' or even more complex Oracle compliant queries! Note that there are important performance impacts when using spatial subqueries however. Try using MapServer's FILTER whenever possible instead. You can also see the SQL submitted by forcing an error, for instance by submitting a DATA parameter you know won't work, using for example a bad column name.", | |
561 | + titulo:"data",prefixoid:"data_",id:codigoLayer,valor:"data"} | |
562 | + ] | |
563 | + } | |
564 | + ins += "<p>Colunas: "+retorna.data.colunas+"</p>" | |
565 | + ins += "<br><fieldset><legend>+- status</legend><div style=display:none >" | |
566 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Sets the current status of the layer. Often modified by MapServer itself. Default turns the layer on permanently.</b></p>" | |
567 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='status_"+codigoLayer+"' >" | |
568 | + ins += comboObjeto(objstatus,"valor","texto",retorna.data.status) | |
569 | + ins += "</select>" | |
570 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"status\",this)'/>" | |
571 | + ins += "</p></fieldset>" | |
572 | + | |
573 | + ins += "<br><fieldset><legend>+- type</legend><div style=display:none >" | |
574 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Specifies how the data should be drawn. Need not be the same as the shapefile type. For example, a polygon shapefile may be drawn as a point layer, but a point shapefile may not be drawn as a polygon layer. Common sense rules. Annotation means that a label point will be calculated for the features, but the feature itself will not be drawn although a marker symbol can be optionally drawn. this allows for advanced labeling like numbered highway shields. Points are labeled at that point. Polygons are labeled first using a centroid, and if that doesn't fall in the polygon a scanline approach is used to guarantee the label falls within the feature. Lines are labeled at the middle of the longest arc in the visible portion of the line. Query only means the layer can be queried but not drawn.In order to differentiate between POLYGONs and POLYLINEs (which do not exist as a type), simply respectively use or ommit the COLOR keyword when classifying. If you use it, it's a polygon with a fill color, otherwise it's a polyline with only an OUTLINECOLOR.For CHART layers, see the Dynamic Charting howto.A circle must be defined by a a minimum bounding rectangle. That is, 2 points that define the smallest square that can contain it. These 2 points are the two opposite corners of said box.</b></p>" | |
575 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='type_"+codigoLayer+"' >" | |
576 | + ins += comboObjeto(objlayertypes,"valor","texto",retorna.data.type) | |
577 | + ins += "</select>" | |
578 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"type\",this)'/>" | |
579 | + ins += "</p></fieldset>" | |
580 | + | |
581 | + ins += "<br><fieldset><legend>+- connectiontype</legend><div style=display:none >" | |
582 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Type of connection. Default is local.</b></p>" | |
583 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='connectiontype_"+codigoLayer+"' >" | |
584 | + ins += comboObjeto(objcontype,"valor","texto",retorna.data.connectiontype) | |
585 | + ins += "</select>" | |
586 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"connectiontype\",this)'/>" | |
587 | + ins += "</p></div></fieldset>" | |
588 | + | |
589 | + ins += (geraLinhas2(retorna.data,param,"salvarLayer")); | |
590 | + | |
591 | + | |
592 | + var param = { | |
593 | + "linhas":[ | |
594 | + {texto:"Name of a group that this layer belongs to. The group name can then be reference as a regular layer name in the template files, allowing to do things like turning on and off a group of layers at once.", | |
595 | + titulo:"group",prefixoid:"group_",id:codigoLayer,valor:"group"}, | |
596 | + {texto:"Item that contains the location of an individual tile, default is 'location'.", | |
597 | + titulo:"tileitem",prefixoid:"tileitem_",id:codigoLayer,valor:"tileitem"}, | |
598 | + {texto:"Name of the tileindex file or layer. A tileindex is similar to an ArcInfo library index. The tileindex contains polygon features for each tile. The item that contains the location of the tiled data is given using the TILEITEM parameter. When a file is used as the tileindex for shapefile or raster layers, the tileindex should be a shapefile. For CONNECTIONTYPE OGR layers, any OGR supported datasource can be a tileindex. Normally the location should contain the path to the tile file relative to the shapepath, not relative to the tileindex itself. If the DATA parameter contains a value then it is added to the end of the location. When a tileindex layer is used, it works similarly to directly referring to a file, but any supported feature source can be used (ie. postgres, oracle).NOTE: All files in the tileindex should have the same coordinate system, and for vector files the same set of attributes in the same order.", | |
599 | + titulo:"tileindex",prefixoid:"tileindex_",id:codigoLayer,valor:"tileindex"}, | |
600 | + {texto:"Maximum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
601 | + titulo:"maxscale",prefixoid:"maxscale_",id:codigoLayer,valor:"maxscale"}, | |
602 | + {texto:"Minimum scale at which this LAYER is drawn. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
603 | + titulo:"minscale",prefixoid:"minscale_",id:codigoLayer,valor:"minscale"}, | |
604 | + {texto:"Sets the color index to treat as transparent for raster layers.", | |
605 | + titulo:"offsite (R,G,B)",prefixoid:"offsite_",id:codigoLayer,valor:"offsite"}, | |
606 | + {texto:"Sets the opacity level (or the inability to see through the layer) of all classed pixels for a given layer. The value can either be an integer in the range (0-100) or the named symbol 'ALPHA'. A value of 100 is opaque and 0 is fully transparent. Implemented in MapServer 5.0, to replace the deprecated TRANSPARENCY parameter.The 'ALPHA' symbol directs the MapServer rendering code to honor the indexed or alpha transparency of pixmap symbols used to style a layer. This is only needed in the case of RGB output formats, and should be used only when necessary as it is expensive to render transparent pixmap symbols onto an RGB map image.", | |
607 | + titulo:"opacity",prefixoid:"opacity_",id:codigoLayer,valor:"opacity"}, | |
608 | + {texto:"This parameter allows for data specific attribute filtering that is done at the same time spatial filtering is done, but before any CLASS expressions are evaluated. For OGR and shapefiles the string is simply a mapserver regular expression. For spatial databases the string is a SQL WHERE clause that is valid with respect to the underlying database.For example: FILTER type='road' and size <2", | |
609 | + titulo:"filter",prefixoid:"filter_",id:codigoLayer,valor:"filter"}, | |
610 | + {texto:"Item to use with simple FILTER expressions. OGR and shapefiles only.", | |
611 | + titulo:"filteritem",prefixoid:"filteritem_",id:codigoLayer,valor:"filteritem"}, | |
612 | + {texto:"Item name in attribute table to use for class annotation angles. Values should be in degrees.", | |
613 | + titulo:"labelangleitem",prefixoid:"labelangleitem_",id:codigoLayer,valor:"labelangleitem"}, | |
614 | + {texto:"Item name in attribute table to use for class annotation (i.e. labeling).", | |
615 | + titulo:"labelitem",prefixoid:"labelitem_",id:codigoLayer,valor:"labelitem"}, | |
616 | + {texto:"Maximum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
617 | + titulo:"labelmaxscale",prefixoid:"labelmaxscale_",id:codigoLayer,valor:"labelmaxscale"}, | |
618 | + {texto:"Minimum scale at which this LAYER is labeled. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
619 | + titulo:"labelminscale",prefixoid:"labelminscale_",id:codigoLayer,valor:"labelminscale"}, | |
620 | + {texto:"Item name in attribute table to use for class annotation sizes. Values should be in pixels.", | |
621 | + titulo:"labelsizeitem",prefixoid:"labelsizeitem_",id:codigoLayer,valor:"labelsizeitem"}, | |
622 | + {texto:"The scale at which symbols and/or text appear full size. This allows for dynamic scaling of objects based on the scale of the map. If not set then this layer will always appear at the same size. Scaling only takes place within the limits of MINSIZE and MAXSIZE as described above. Scale is given as the denominator of the actual scale fraction, for example for a map at a scale of 1:24,000 use 24000.", | |
623 | + titulo:"symbolscale",prefixoid:"symbolscale_",id:codigoLayer,valor:"symbolscale"}, | |
624 | + {texto:"Sensitivity for point based queries (i.e. via mouse and/or map coordinates). Given in TOLERANCEUNITS. If the layer is a POINT or a LINE, the default is 3. For all other layer types, the default is 0. To restrict polygon searches so that the point must occur in the polygon set the tolerance to zero.", | |
625 | + titulo:"tolerance",prefixoid:"tolerance_",id:codigoLayer,valor:"tolerance"}, | |
626 | + {texto:" ", | |
627 | + titulo:"projection",prefixoid:"projection_",id:codigoLayer,valor:"projection"} | |
628 | + ] | |
629 | + } | |
630 | + | |
631 | + | |
632 | + ins += "<br><fieldset style=background-color:#f0e68c ><legend style=color:brown >+- Mais...</legend><div style=display:none >" | |
633 | + ins += (geraLinhas2(retorna.data,param,"salvarLayer")); | |
634 | + | |
635 | + ins += "<br><fieldset><legend>+- sizeunits</legend><div style=display:none >" | |
636 | + ins += "<p class=textoAjuda style='background-color:rgb(250,250,250);' >Sets the unit of CLASS object SIZE values (default is pixels). Useful for simulating buffering.</b><p>" | |
637 | + ins += "<p><select onchange='this.style.color=\"blue\"' id='sizeunits_"+codigoLayer+"' >" | |
638 | + ins += comboObjeto(objmapunits,"valor","texto",retorna.data.sizeunits) | |
639 | + ins += "</select>" | |
640 | + ins += "<img src=../imagens/02.png style=cursor:pointer title='Aplicar' onclick='salvarLayer(\""+codigoLayer+"\",\"sizeunits\",this)'/>" | |
641 | + ins += "</p></div></fieldset>" | |
642 | + | |
643 | + ins += "</div></fieldset>" | |
644 | + | |
645 | + ins += "</div></fieldset>" | |
646 | + $i("geral_"+codigoLayer+"_"+codigoMap).innerHTML = ins | |
647 | + } | |
648 | + var p = "../php/temas.php?funcao=pegaCaracteristicasGerais&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
649 | + cPaint.call(p,"",retorna); | |
650 | +} | |
651 | +function testarMap() | |
652 | +{ | |
653 | + var codigo = $i("temaAtivo").value | |
654 | + window.open("../testamapfile.php?map="+codigo+".map") | |
655 | +} | |
656 | +function salvarLayer(layer,parametro,icone) | |
657 | +{ | |
658 | + icone.src="../imagens/aguarde.gif" | |
659 | + var retorna = function(retorno) | |
660 | + {icone.src="../imagens/02.png";} | |
661 | + var valor = $i(parametro+"_"+layer).value | |
662 | + $i(parametro+"_"+layer).style.color="black" | |
663 | + var p = "../php/temas.php?funcao=alteraLayer&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; | |
664 | + cPaint.call(p,"",retorna); | |
665 | +} | |
666 | +function salvarMetadados(layer,parametro,icone) | |
667 | +{ | |
668 | + icone.src="../imagens/aguarde.gif" | |
669 | + var retorna = function(retorno) | |
670 | + {icone.src="../imagens/02.png";} | |
671 | + var valor = $i(parametro+"_"+layer).value | |
672 | + $i(parametro+"_"+layer).style.color="black" | |
673 | + var p = "../php/temas.php?funcao=alteraMetadados&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"¶metro="+parametro+"&valor="+valor; | |
674 | + cPaint.call(p,"",retorna); | |
675 | +} | |
676 | +function salvarClasse(layer,parametro,icone) | |
677 | +{ | |
678 | + icone.src="../imagens/aguarde.gif" | |
679 | + var temp = layer.split("_") | |
680 | + var layer = temp[0] | |
681 | + var classe = temp[1] | |
682 | + var retorna = function(retorno) | |
683 | + { | |
684 | + icone.src="../imagens/02.png"; | |
685 | + contaN++ | |
686 | + $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN | |
687 | + } | |
688 | + var valor = $i(parametro+"_"+layer+"_"+classe).value | |
689 | + $i(parametro+"_"+layer+"_"+classe).style.color="black" | |
690 | + var p = "../php/temas.php?funcao=alteraClasse&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; | |
691 | + cPaint.call(p,"",retorna); | |
692 | +} | |
693 | +function salvarClasseLabel(layer,parametro,icone) | |
694 | +{ | |
695 | + icone.src="../imagens/aguarde.gif" | |
696 | + var temp = layer.split("_") | |
697 | + var layer = temp[0] | |
698 | + var classe = temp[1] | |
699 | + var parametro = parametro.split("."); | |
700 | + var parametro = parametro[1] | |
701 | + var retorna = function(retorno) | |
702 | + {icone.src="../imagens/02.png";} | |
703 | + var valor = $i("label_"+parametro+"_"+layer+"_"+classe).value | |
704 | + $i("label_"+parametro+"_"+layer+"_"+classe).style.color="black" | |
705 | + var p = "../php/temas.php?funcao=alteraClasseLabel&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"¶metro="+parametro+"&valor="+valor; | |
706 | + cPaint.call(p,"",retorna); | |
707 | +} | |
708 | +function salvarEstilo(estilo,parametro,icone) | |
709 | +{ | |
710 | + icone.src="../imagens/aguarde.gif" | |
711 | + var temp = estilo.split("_") | |
712 | + var layer = temp[1] | |
713 | + var classe = temp[2] | |
714 | + var estilo = temp[3] | |
715 | + var retorna = function(retorno) | |
716 | + { | |
717 | + icone.src="../imagens/02.png"; | |
718 | + contaN++ | |
719 | + $i('legenda_'+layer).src='../ogc.php?tema='+layer+'&service=wms&request=getlegendgraphic&layer='+layer+'&format=image/png&'+contaN | |
720 | + } | |
721 | + var valor = $i(parametro+"_"+layer+"_"+classe+"_"+estilo).value | |
722 | + $i(parametro+"_"+layer+"_"+classe+"_"+estilo).style.color="black" | |
723 | + var p = "../php/temas.php?funcao=alteraEstilo&codigoMap="+$i("temaAtivo").value+"&codigoLayer="+layer+"&classe="+classe+"&estilo="+estilo+"¶metro="+parametro+"&valor="+valor; | |
724 | + cPaint.call(p,"",retorna); | |
725 | +} | |
726 | +function adicionarClasse(codigoLayer,botao) | |
727 | +{ | |
728 | + botao.style.color="red" | |
729 | + var o = botao.value | |
730 | + botao.value = "Aguarde..." | |
731 | + var codigoMap = $i("temaAtivo").value | |
732 | + if(codigoMap != "") | |
733 | + { | |
734 | + var retorna = function(retorno) | |
735 | + { | |
736 | + pegaClasses(codigoMap,codigoLayer) | |
737 | + } | |
738 | + var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
739 | + cPaint.call(p,"",retorna); | |
740 | + } | |
741 | +} | |
742 | +function adicionarEstilo(codigoLayer,codigoClasse,botao) | |
743 | +{ | |
744 | + botao.style.color="red" | |
745 | + var o = botao.value | |
746 | + botao.value = "Aguarde..." | |
747 | + var codigoMap = $i("temaAtivo").value | |
748 | + if(codigoMap != "") | |
749 | + { | |
750 | + var retorna = function(retorno) | |
751 | + { | |
752 | + pegaEstilos(codigoMap,codigoLayer) | |
753 | + } | |
754 | + var p = "../php/temas.php?funcao=adicionarClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; | |
755 | + cPaint.call(p,"",retorna); | |
756 | + } | |
757 | +} | |
758 | +function excluirClasse(codigoLayer,codigoClasse,botao) | |
759 | +{ | |
760 | + if(confirm("Você realmente quer fazer isso?")) | |
761 | + { | |
762 | + botao.style.color="red" | |
763 | + var o = botao.value | |
764 | + botao.value = "Aguarde..." | |
765 | + var codigoMap = $i("temaAtivo").value | |
766 | + if(codigoMap != "") | |
767 | + { | |
768 | + var retorna = function(retorno) | |
769 | + { | |
770 | + pegaClasses(codigoMap,codigoLayer) | |
771 | + } | |
772 | + var p = "../php/temas.php?funcao=excluirClasse&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer+"&codigoClasse="+codigoClasse; | |
773 | + cPaint.call(p,"",retorna); | |
774 | + } | |
775 | + } | |
776 | +} | |
777 | +function excluirLayer(codigoLayer,botao) | |
778 | +{ | |
779 | + if(confirm("Você realmente quer fazer isso?")) | |
780 | + { | |
781 | + botao.style.color="red" | |
782 | + var o = botao.value | |
783 | + botao.value = "Aguarde..." | |
784 | + var codigoMap = $i("temaAtivo").value | |
785 | + if(codigoMap != "") | |
786 | + { | |
787 | + var retorna = function(retorno) | |
788 | + { | |
789 | + ativaTema(codigoMap) | |
790 | + } | |
791 | + var p = "../php/temas.php?funcao=excluirLayer&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer; | |
792 | + cPaint.call(p,"",retorna); | |
793 | + } | |
794 | + } | |
795 | +} | |
796 | +YAHOO.util.Event.addListener(window, "load", initMenu); | |
0 | 797 | \ No newline at end of file | ... | ... |
admin/php/admin.php
... | ... | @@ -51,7 +51,6 @@ error_reporting(E_ALL); |
51 | 51 | //carrega o phpmapscript |
52 | 52 | // |
53 | 53 | include_once ($locaplic."/classesphp/carrega_ext.php"); |
54 | -include_once($locaplic."/pacotes/cpaint/cpaint2.inc.php"); | |
55 | 54 | set_time_limit(120); |
56 | 55 | // |
57 | 56 | //verifica se o cliente pode editar |
... | ... | @@ -243,6 +242,12 @@ function verificaFilhos() |
243 | 242 | if(count($r) > 0) |
244 | 243 | $res = true; |
245 | 244 | } |
245 | + if($tabela == "mapfiles") | |
246 | + { | |
247 | + $r = pegaDados("SELECT id_tema from i3geoadmin_temas where codigo_tema ='$id'"); | |
248 | + if(count($r) > 0) | |
249 | + $res = true; | |
250 | + } | |
246 | 251 | return $res; |
247 | 252 | } |
248 | 253 | catch (PDOException $e) | ... | ... |
admin/php/arvore.php
admin/php/mapfiles.php
... | ... | @@ -32,11 +32,6 @@ $cp = new cpaint(); |
32 | 32 | //faz a busca da função que deve ser executada |
33 | 33 | switch ($funcao) |
34 | 34 | { |
35 | - //verifica os editores | |
36 | - case "verificaEditores": | |
37 | - $cp->set_data(verificaEditores($editores)); | |
38 | - $cp->return_data(); | |
39 | - break; | |
40 | 35 | //pega os parâmetros do ms_configura |
41 | 36 | case "pegaParametrosConfigura": |
42 | 37 | $vs = array( |
... | ... | @@ -67,8 +62,8 @@ switch ($funcao) |
67 | 62 | } |
68 | 63 | } |
69 | 64 | } |
70 | - $cp->set_data($par); | |
71 | - $cp->return_data(); | |
65 | + retornaJSON($par); | |
66 | + exit; | |
72 | 67 | break; |
73 | 68 | |
74 | 69 | //retorna o mapfile atual como texto |
... | ... | @@ -82,10 +77,9 @@ switch ($funcao) |
82 | 77 | |
83 | 78 | //salva um novo valor para uma variável do ms_configura |
84 | 79 | case "salvaConfigura": |
85 | - $cp->register('salvaConfigura'); | |
86 | 80 | salvaConfigura($variavel,$valor,$mapfile,$temasaplic); |
87 | - $cp->set_data("ok"); | |
88 | - $cp->return_data(); | |
81 | + retornaJSON("ok"); | |
82 | + exit; | |
89 | 83 | break; |
90 | 84 | } |
91 | 85 | /* | ... | ... |
admin/php/menutemas.php
admin/php/ms_configura.php
... | ... | @@ -30,15 +30,9 @@ File: i3geo/admin/ms_configura.php |
30 | 30 | |
31 | 31 | */ |
32 | 32 | include_once("admin.php"); |
33 | -$cp = new cpaint(); | |
34 | 33 | //faz a busca da função que deve ser executada |
35 | 34 | switch ($funcao) |
36 | 35 | { |
37 | - //verifica os editores | |
38 | - case "verificaEditores": | |
39 | - $cp->set_data(verificaEditores($editores)); | |
40 | - $cp->return_data(); | |
41 | - break; | |
42 | 36 | //pega os parâmetros do ms_configura |
43 | 37 | case "pegaParametrosConfigura": |
44 | 38 | $vs = array( |
... | ... | @@ -71,25 +65,16 @@ switch ($funcao) |
71 | 65 | $par[$v] = $s; |
72 | 66 | } |
73 | 67 | else |
74 | - $par[$v] = mb_convert_encoding($s,"UTF-8","ISO-8859-1"); | |
68 | + $par[$v] = $s; | |
75 | 69 | } |
76 | - $cp->set_data($par); | |
77 | - $cp->return_data(); | |
78 | - break; | |
79 | - //retorna o mapfile atual como texto | |
80 | - case "restauraConfigura": | |
81 | - $cp->register('restauraConfigura'); | |
82 | - unlink("../../ms_configura.php"); | |
83 | - copy ("../../ms_configura.default","../../ms_configura.php"); | |
84 | - $cp->set_data("ok"); | |
85 | - $cp->return_data(); | |
70 | + retornaJSON($par); | |
71 | + exit; | |
86 | 72 | break; |
87 | 73 | //salva um novo valor para uma variável do ms_configura |
88 | 74 | case "salvaConfigura": |
89 | - $cp->register('salvaConfigura'); | |
90 | - salvaConfigura($variavel,mb_convert_encoding($valor,"ISO-8859-1","UTF-8")); | |
91 | - $cp->set_data("ok"); | |
92 | - $cp->return_data(); | |
75 | + salvaConfigura($variavel,$valor); | |
76 | + retornaJSON("ok"); | |
77 | + exit; | |
93 | 78 | break; |
94 | 79 | } |
95 | 80 | /* | ... | ... |
admin/php/parsemapfile.php
... | ... | @@ -4,6 +4,7 @@ include_once("../../classesphp/funcoes_gerais.php"); |
4 | 4 | include_once("../../classesphp/carrega_ext.php"); |
5 | 5 | include_once("../../classesphp/pega_variaveis.php"); |
6 | 6 | error_reporting(0); |
7 | +if(!isset($forcawms)){$forcawms = "nao";} | |
7 | 8 | $objcontype[0] = "MS_INLINE"; |
8 | 9 | $objcontype[1] = "MS_SHAPEFILE"; |
9 | 10 | $objcontype[2] = "MS_TILED_SHAPEFILE"; |
... | ... | @@ -38,9 +39,10 @@ if(!isset($tipoparse) || $tipoparse=="") |
38 | 39 | if($tipoparse == "legenda") |
39 | 40 | { |
40 | 41 | $tipoLegenda = tipoLegenda($layername); |
41 | - //if($tipoLegenda == "simples") | |
42 | - //{legendaSimples($layername);} | |
43 | - legendaSimples($layername); | |
42 | + if($tipoLegenda == "simples") | |
43 | + {legendaSimples($layername);} | |
44 | + if($tipoLegenda == "valorunico") | |
45 | + legendaValorUnico($layername); | |
44 | 46 | } |
45 | 47 | // |
46 | 48 | //verifica o tipo de legenda |
... | ... | @@ -61,6 +63,12 @@ function tipoLegenda($layername) |
61 | 63 | $expressao = $classe->getExpression(); |
62 | 64 | if($expressao == "") |
63 | 65 | {return "simples";exit;} |
66 | + $expressao = str_replace("'eq'","="); | |
67 | + $expressao = str_replace("'eq '","="); | |
68 | + $expressao = str_replace("' eq'","="); | |
69 | + $expressao = str_replace("' eq '","="); | |
70 | + if(count(explode("=",$expressao)) != 2) | |
71 | + {return "simples";exit;} | |
64 | 72 | } |
65 | 73 | $verItem = array(); |
66 | 74 | for($i=0;$i<$nclasses;++$i) |
... | ... | @@ -83,6 +91,95 @@ function tipoLegenda($layername) |
83 | 91 | else |
84 | 92 | return "simples"; |
85 | 93 | } |
94 | +function legendaValorUnico($layername) | |
95 | +{ | |
96 | + global $mapa; | |
97 | + $tipolegenda = ""; | |
98 | + $layer = $mapa->getlayerbyname($layername); | |
99 | + $nclasses = $layer->numclasses; | |
100 | + $outlinecolor = array(); | |
101 | + $color = array(); | |
102 | + $nomes = array(); | |
103 | + $valor = array(); | |
104 | + // | |
105 | + $classe = $layer->getclass(0); | |
106 | + $expressao = $classe->getExpression(); | |
107 | + $item = preg_replace('/.*\[|\].*/i','\1', $expressao); | |
108 | + for($i=0;$i<$nclasses;++$i) | |
109 | + { | |
110 | + $classe = $layer->getclass($i); | |
111 | + $estilo = $classe->getstyle(0); | |
112 | + $nomes[] = $classe->name; | |
113 | + $cor = $estilo->outlinecolor; | |
114 | + $outlinecolor[] = "'".$cor->red.",".$cor->green.",".$cor->blue.",255'"; | |
115 | + $cor = $estilo->color; | |
116 | + $color[] = "'".$cor->red.",".$cor->green.",".$cor->blue.",255'"; | |
117 | + $expressao = $classe->getExpression(); | |
118 | + $expressao = str_replace("'eq","=",$expressao); | |
119 | + $expressao = str_replace("'eq ","=",$expressao); | |
120 | + $expressao = str_replace("' eq","=",$expressao); | |
121 | + $expressao = str_replace("' eq ","=",$expressao); | |
122 | + $temp = explode("=",$expressao); | |
123 | + $temp = trim($temp[1]); | |
124 | + $temp = trim(str_replace("'","",$temp)); | |
125 | + $temp = trim(str_replace(")","",$temp)); | |
126 | + $valor[] = trim(str_replace("'","",$temp)); | |
127 | + } | |
128 | + // | |
129 | + //monta o xml | |
130 | + // | |
131 | + $xml = "<"."\x3F"."xml version='1.0' encoding='ISO-8859-1' "."\x3F".">"; | |
132 | + $xml .= "<xml-tag xmlns='http://www.gvsig.gva.es'>\n"; | |
133 | + $xml .= "<property key='className' value='com.iver.cit.gvsig.fmap.rendering.VectorialUniqueValueLegend'/>\n"; | |
134 | + $xml .= "<property key='fieldName' value='$item'/>\n"; | |
135 | + $xml .= "<property key='labelfield'/><property key='labelFieldHeight'/><property key='labelFieldRotation'/><property key='useDefaultSymbol' value='true'/><property key='sorter' value='true'/>\n"; | |
136 | + $xml .= "<property key='numKeys' value='".(count($valor) + 1)."'/>\n"; | |
137 | + $xml .= "<property key='tipoValueKeys' value='com.hardcode.gdbms.engine.values.StringValue'/>\n"; | |
138 | + $xml .= "<property key='keys' value='Default ,".implode(" ,",$nomes)."'/>\n"; | |
139 | + $xml .= "<property key='values' value='Default ,".implode(" ,",$valor)."'/>\n"; | |
140 | + $temp = array(); | |
141 | + $temp[] = "1111"; | |
142 | + foreach($valor as $v) | |
143 | + {$temp[] = "-1";} | |
144 | + $temp = implode(" ,",$temp); | |
145 | + //$temp = "1111 ,-1 ,-1 ,-1 ,-1 ,-1 ,-1"; | |
146 | + $xml .= "<property key='typeKeys' value='$temp'/>\n"; | |
147 | + $xml .= "<property key='typeValues' value='$temp'/>\n"; | |
148 | + $xml .= "<property key='followHeaderEncoding' value='true'/>\n"; | |
149 | + $xml .= "<xml-tag><property key='className' value='com.iver.cit.gvsig.fmap.core.v02.FSymbol'/><property key='m_symbolType' value='4'/><property key='m_Style' value='1'/><property key='m_useOutline' value='true'/><property key='m_Color' value='150,150,150,255'/><property key='m_outlineColor' value='255,255,255,255'/><property key='m_bUseFontSize' value='true'/><property key='m_bDrawShape' value='true'/><property key='m_Size' value='2'/><property key='m_Rotation' value='0'/><property key='m_LinePattern' value='0'/><property key='m_stroke' value='1.0'/><property key='m_bUseSize' value='false'/><property key='m_AlingVert' value='0'/><property key='m_AlingHoriz' value='0'/><property key='m_Descrip' value='Default'/><property key='rgb' value='-14902251'/></xml-tag>"; | |
150 | + $xml .= "<xml-tag><property key='className' value='com.iver.cit.gvsig.fmap.core.v02.FSymbol'/><property key='m_symbolType' value='4'/><property key='m_Style' value='1'/><property key='m_useOutline' value='true'/><property key='m_Color' value='150,150,150,255'/><property key='m_outlineColor' value='255,255,255,255'/><property key='m_bUseFontSize' value='true'/><property key='m_bDrawShape' value='true'/><property key='m_Size' value='2'/><property key='m_Rotation' value='0'/><property key='m_LinePattern' value='0'/><property key='m_stroke' value='1.0'/><property key='m_bUseSize' value='false'/><property key='m_AlingVert' value='0'/><property key='m_AlingHoriz' value='0'/><property key='m_Descrip' value='Default'/><property key='rgb' value='-14902251'/></xml-tag>\n"; | |
151 | + $c = count($valor); | |
152 | + for($i=0;$i<$c;++$i) | |
153 | + { | |
154 | + $xml .= "<xml-tag>\n"; | |
155 | + $xml .= "<property key='className' value='com.iver.cit.gvsig.fmap.core.v02.FSymbol'/>\n"; | |
156 | + $xml .= "<property key='m_symbolType' value='4'/>\n"; | |
157 | + $xml .= "<property key='m_Style' value='1'/>\n"; | |
158 | + $temp = "true"; | |
159 | + if($outlinecolor[$i] == "'-1,-1,-1,255'"){$temp = "false";} | |
160 | + $xml .= "<property key='m_useOutline' value='$temp'/>\n"; | |
161 | + if($color[$i] != "'-1,-1,-1,255'") | |
162 | + $xml .= "<property key='m_Color' value=$color[$i]/>\n"; | |
163 | + if($temp != "false") | |
164 | + $xml .= "<property key='m_outlineColor' value=$outlinecolor[$i]/>\n"; | |
165 | + $xml .= "<property key='m_bUseFontSize' value='true'/>\n"; | |
166 | + $xml .= "<property key='m_bDrawShape' value='true'/>\n"; | |
167 | + $xml .= "<property key='m_Size' value='2'/>\n"; | |
168 | + $xml .= "<property key='m_Rotation' value='0'/>\n"; | |
169 | + $xml .= "<property key='m_LinePattern' value='0'/>\n"; | |
170 | + $xml .= "<property key='m_stroke' value='1.0'/>\n"; | |
171 | + $xml .= "<property key='m_bUseSize' value='false'/>\n"; | |
172 | + $xml .= "<property key='m_AlingVert' value='0'/>\n"; | |
173 | + $xml .= "<property key='m_AlingHoriz' value='0'/>\n"; | |
174 | + $xml .= "<property key='m_Descrip' value='$nomes[$i]'/>\n"; | |
175 | + $xml .= "<property key='rgb' value='-16145084'/>\n"; | |
176 | + $xml .= "</xml-tag>\n"; | |
177 | + } | |
178 | + $xml .= "</xml-tag>\n"; | |
179 | + echo header("Content-type: application/xml"); | |
180 | + echo $xml; | |
181 | + exit; | |
182 | +} | |
86 | 183 | function legendaSimples($layername) |
87 | 184 | { |
88 | 185 | global $mapa; |
... | ... | @@ -132,7 +229,7 @@ function legendaSimples($layername) |
132 | 229 | // |
133 | 230 | function mapfile() |
134 | 231 | { |
135 | - global $codigoLayer,$mapfile,$mapa,$objcontype,$objlayertypes; | |
232 | + global $codigoLayer,$mapfile,$mapa,$objcontype,$objlayertypes,$forcawms; | |
136 | 233 | $layers = $mapa->getalllayernames(); |
137 | 234 | $dados = array(); |
138 | 235 | $xml = "<"."\x3F"."xml version='1.0' encoding='ISO-8859-1' "."\x3F".">"; |
... | ... | @@ -165,7 +262,7 @@ function mapfile() |
165 | 262 | $ct = $objcontype[$layer->connectiontype]; |
166 | 263 | $tagLegenda = "parsemapfile.php?id=".$codigoLayer."&layername=".$layer->name."&tipoparse=legenda"; |
167 | 264 | $nomeLayer = $layer->name; |
168 | - if ($ct == "MS_SHAPEFILE" || $ct == "" || $ct == "MS_RASTER" && $ct != "MS_WMS") | |
265 | + if ($forcawms == "sim" || $ct == "MS_SHAPEFILE" || $ct == "" || $ct == "MS_RASTER" && $ct != "MS_WMS") | |
169 | 266 | { |
170 | 267 | $ct = "MS_WMS"; |
171 | 268 | $d = "http://".$_SERVER['HTTP_HOST'].str_replace("/admin/php/parsemapfile.php","",$_SERVER['PHP_SELF'])."/ogc.php?tema=".$codigoLayer; | ... | ... |
admin/php/temas.php
... | ... | @@ -30,19 +30,47 @@ File: i3geo/admin/sistemas.php |
30 | 30 | include_once("admin.php"); |
31 | 31 | include_once("../../ms_configura.php"); |
32 | 32 | include_once("../../classesphp/funcoes_gerais.php"); |
33 | -$cp = new cpaint(); | |
34 | 33 | //faz a busca da função que deve ser executada |
35 | 34 | switch ($funcao) |
36 | 35 | { |
37 | - //verifica os editores | |
36 | + case "pegaMapfiles": | |
37 | + retornaJSON(pegaLayers()); | |
38 | + exit; | |
38 | 39 | case "criarNovoMap": |
39 | - $cp->set_data(criarNovoMap()); | |
40 | - $cp->return_data(); | |
40 | + retornaJSON(criarNovoMap()); | |
41 | + exit; | |
41 | 42 | break; |
42 | 43 | case "pegaLayers": |
43 | - $cp->set_data(pegaLayers()); | |
44 | - $cp->return_data(); | |
44 | + retornaJSON(pegaLayers()); | |
45 | + exit; | |
46 | + break; | |
47 | + case "excluirMapfile": | |
48 | + $tabela = "mapfiles"; | |
49 | + $id = $codigoMap; | |
50 | + $f = verificaFilhos(); | |
51 | + if($f) | |
52 | + { | |
53 | + retornaJSON("erro"); | |
54 | + exit; | |
55 | + } | |
56 | + else | |
57 | + { | |
58 | + unlink("../../temas/".$codigoMap.".map"); | |
59 | + retornaJSON("ok"); | |
60 | + exit; | |
61 | + } | |
62 | + break; | |
63 | + case "criarNovoLayer": | |
64 | + retornaJSON(criarNovoLayer()); | |
65 | + exit; | |
66 | + break; | |
67 | + case "excluirLayer": | |
68 | + retornaJSON(excluirLayer()); | |
69 | + exit; | |
45 | 70 | break; |
71 | + | |
72 | + | |
73 | + | |
46 | 74 | case "pegaCaracteristicasGerais": |
47 | 75 | $cp->set_data(pegaCaracteristicasGerais()); |
48 | 76 | $cp->return_data(); |
... | ... | @@ -87,14 +115,7 @@ switch ($funcao) |
87 | 115 | $cp->set_data(pegaFontes()); |
88 | 116 | $cp->return_data(); |
89 | 117 | break; |
90 | - case "criarNovoLayer": | |
91 | - $cp->set_data(criarNovoLayer()); | |
92 | - $cp->return_data(); | |
93 | - break; | |
94 | - case "excluirLayer": | |
95 | - $cp->set_data(excluirLayer()); | |
96 | - $cp->return_data(); | |
97 | - break; | |
118 | + | |
98 | 119 | case "adicionarClasse": |
99 | 120 | substituiCon($map_file,$postgis_mapa); |
100 | 121 | $cp->set_data(adicionarClasse()); |
... | ... | @@ -149,8 +170,8 @@ function adicionarClasse() |
149 | 170 | } |
150 | 171 | function excluirLayer() |
151 | 172 | { |
152 | - global $codigoMap,$codigoLayer; | |
153 | - $mapfile = "../../temas/".$codigoMap.".map"; | |
173 | + global $codigoMap,$codigoLayer,$locaplic; | |
174 | + $mapfile = $locaplic."/temas/".$codigoMap.".map"; | |
154 | 175 | $mapa = ms_newMapObj($mapfile); |
155 | 176 | $nl = $mapa->getlayerbyname($codigoLayer); |
156 | 177 | $nl->set("status",MS_DELETE); |
... | ... | @@ -160,17 +181,16 @@ function excluirLayer() |
160 | 181 | } |
161 | 182 | function criarNovoLayer() |
162 | 183 | { |
163 | - global $codigoMap; | |
184 | + global $locaplic,$codigoMap; | |
164 | 185 | include_once("../../classesphp/funcoes_gerais.php"); |
165 | - $mapfile = "../../temas/".$codigoMap.".map"; | |
166 | - $mapat = ms_newMapObj("base.map"); | |
167 | - $layer = $mapat->getlayerbyname("base"); | |
186 | + $mapfile = $locaplic."/temas/".$codigoMap.".map"; | |
168 | 187 | $mapa = ms_newMapObj($mapfile); |
169 | - $nl = ms_newLayerObj($mapa,$layer); | |
188 | + $nl = ms_newLayerObj($mapa); | |
170 | 189 | $nl->set("name",nomeRandomico()); |
190 | + $nl->set("type",MS_LAYER_LINE); | |
171 | 191 | $mapa->save($mapfile); |
172 | 192 | removeCabecalho($mapfile); |
173 | - return "ok"; | |
193 | + return array("layers"=>(array($nl->name))); | |
174 | 194 | } |
175 | 195 | function pegaFontes() |
176 | 196 | { |
... | ... | @@ -557,20 +577,29 @@ function pegaEstilos() |
557 | 577 | function criarNovoMap() |
558 | 578 | { |
559 | 579 | global $nome,$codigo; |
560 | - if(!file_exists("../../temas/".$codigo.".map")) | |
580 | + $arq = "../../temas/".$codigo.".map"; | |
581 | + if(!file_exists($arq)) | |
561 | 582 | { |
562 | - $nome = mb_convert_encoding($nome,"UTF-8","ISO-8859-1"); | |
563 | - copy("base.map","../../temas/".$codigo.".map"); | |
564 | - $mapfile = "../../temas/".$codigo.".map"; | |
565 | - $mapa = ms_newMapObj($mapfile); | |
566 | - $layer = $mapa->getlayerbyname("base"); | |
567 | - $layer->set("name",$codigo); | |
568 | - $mapa->save($mapfile); | |
583 | + $dados[] = "SYMBOLSET ../symbols/simbolos.sym"; | |
584 | + $dados[] = 'FONTSET "../symbols/fontes.txt"'; | |
585 | + $dados[] = "LAYER"; | |
586 | + $dados[] = " NAME base"; | |
587 | + $dados[] = " TYPE line"; | |
588 | + $dados[] = ' DATA ""'; | |
589 | + $dados[] = ' METADATA'; | |
590 | + $dados[] = ' TEMA "'.$nome.'"'; | |
591 | + $dados[] = ' METADATA'; | |
592 | + $dados[] = "END"; | |
593 | + $dados[] = "END"; | |
594 | + $fp = fopen($arq,"w"); | |
595 | + foreach ($dados as $dado) | |
596 | + { | |
597 | + fwrite($fp,$dado."\n"); | |
598 | + } | |
569 | 599 | require_once("conexao.php"); |
570 | 600 | $dbh->query("INSERT INTO i3geoadmin_temas (link_tema,kml_tema,ogc_tema,download_tema,desc_tema,tipoa_tema,tags_tema,nome_tema,codigo_tema) VALUES ('','', '','','','','','$nome','$codigo')"); |
571 | 601 | $dbh = null; |
572 | 602 | $dbhw = null; |
573 | - | |
574 | 603 | return "ok"; |
575 | 604 | } |
576 | 605 | return "erro"; | ... | ... |
aplicmap/geral1windows.map
... | ... | @@ -17,7 +17,7 @@ MAP |
17 | 17 | # |
18 | 18 | #edite os caminhos caso a aplicacao esteja instalada em um local diferente do defaul |
19 | 19 | # |
20 | - FONTSET "c:\ms4w\apache\htdocs\i3geo/symbols/fontes.txt" | |
20 | +FONTSET "c:\ms4w\apache\htdocs\i3geo/symbols/fontes.txt" | |
21 | 21 | SYMBOLSET "c:\ms4w\apache\htdocs\i3geo/symbols/simbolos.sym" |
22 | 22 | SHAPEPATH "c:\ms4w\apache\htdocs\geodados" |
23 | 23 | IMAGECOLOR 157 211 255 | ... | ... |
kml.php
... | ... | @@ -115,7 +115,7 @@ foreach ($menus as $menu) |
115 | 115 | echo "<description><![CDATA[".$fonte.$legenda.$desc."]]></description>\n"; |
116 | 116 | echo "<visibility>0</visibility>\n"; |
117 | 117 | echo "<Icon>\n"; |
118 | - $l = $protocolo."/i3geo/ogc.php?tema=$id&width=1500&height=1500&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&STYLES=&BGCOLOR=0xFFFFFF&FORMAT=image/png&TRANSPARENT=TRUE&layers=$id"; | |
118 | + $l = $protocolo."/i3geo/ogc.php?tema=$id&width=800&height=800&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&STYLES=&BGCOLOR=0xFFFFFF&FORMAT=image/png&TRANSPARENT=TRUE&layers=$id"; | |
119 | 119 | echo "<viewRefreshMode>onStop</viewRefreshMode>\n"; |
120 | 120 | echo "<href>$l</href>\n"; |
121 | 121 | echo "</Icon>\n"; | ... | ... |
menutemas/admin.db
No preview for this file type
ms_configura.php
... | ... | @@ -43,7 +43,7 @@ Free Software Foundation, Inc., no endereço |
43 | 43 | |
44 | 44 | Mensagem de inicialização mostrada pelo programa ms_criamapa.php |
45 | 45 | */ |
46 | -$mensagemInicia = "I3Geo versão 4.1"; | |
46 | +$mensagemInicia = 'I3Geo versão 4.1'; | |
47 | 47 | /* |
48 | 48 | Variable: $tituloInstituicao |
49 | 49 | |
... | ... | @@ -167,7 +167,7 @@ if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) |
167 | 167 | |
168 | 168 | Para usar as funções default, utilize apenas $menutemas = ""; nesse caso, as funções serão obtidas do banco de dados de administração. |
169 | 169 | */ |
170 | - $locmapas = ""; | |
170 | + $locmapas = "../menutemas/mapas.xml"; | |
171 | 171 | /* |
172 | 172 | Variable: $R_path |
173 | 173 | ... | ... |
temas/atlas_biomas.map
1 | -SYMBOLSET ../symbols/simbolos.sym | |
2 | -FONTSET "../symbols/fontes.txt" | |
1 | +SYMBOLSET ../symbols/simbolos.sym | |
2 | +FONTSET "../symbols/fontes.txt" | |
3 | 3 | LAYER |
4 | + | |
4 | 5 | CONNECTION "http://mapas.mma.gov.br/i3geo/ogc.php?tema=bioma" |
6 | + | |
5 | 7 | CONNECTIONTYPE WMS |
8 | + | |
6 | 9 | DATA "" |
7 | - METADATA | |
8 | - "wms_srs" "EPSG:4291 EPSG:4326" | |
9 | - "wms_exceptions_format" "application/vnd.ogc.se_xml" | |
10 | - "CLASSE" "SIM" | |
11 | - "wms_force_separate_request" "1" | |
12 | - "wms_name" "bioma" | |
13 | - "formatosinfo" "text/plain,application/vnd.ogc.gml" | |
14 | - "wms_formatlist" "image/gif,image/png,image/png; mode=24bit,image/jpeg,image/wbmp,image/tiff" | |
15 | - "wms_format" "image/png" | |
16 | - "wms_connectiontimeout" "30" | |
17 | - "TEMA" "Biomas segundo IBGE-MMA" | |
18 | - "wms_server_version" "1.1.0" | |
19 | - "wms_style" "default" | |
20 | - END | |
10 | + | |
11 | + METADATA | |
12 | + | |
13 | + "wms_srs" "EPSG:4291 EPSG:4326" | |
14 | + | |
15 | + "wms_exceptions_format" "application/vnd.ogc.se_xml" | |
16 | + | |
17 | + "CLASSE" "SIM" | |
18 | + | |
19 | + "wms_force_separate_request" "1" | |
20 | + | |
21 | + "formatosinfo" "text/plain,application/vnd.ogc.gml" | |
22 | + | |
23 | + "wms_name" "bioma" | |
24 | + | |
25 | + "wms_format" "image/png" | |
26 | + | |
27 | + "wms_formatlist" "image/gif,image/png,image/png; mode=24bit,image/jpeg,image/wbmp,image/tiff" | |
28 | + | |
29 | + "wms_connectiontimeout" "30" | |
30 | + | |
31 | + "TEMA" "Biomas segundo IBGE-MMA" | |
32 | + | |
33 | + "wms_server_version" "1.1.0" | |
34 | + | |
35 | + "wms_style" "default" | |
36 | + | |
37 | + END | |
38 | + | |
21 | 39 | NAME "atlas_biomas" |
40 | + | |
22 | 41 | OFFSITE 255 255 255 |
23 | - SIZEUNITS PIXELS | |
42 | + | |
24 | 43 | STATUS OFF |
44 | + | |
25 | 45 | TOLERANCE 0 |
26 | - TOLERANCEUNITS PIXELS | |
46 | + | |
27 | 47 | TYPE RASTER |
48 | + | |
28 | 49 | UNITS METERS |
50 | + | |
29 | 51 | CLASS |
52 | + | |
30 | 53 | NAME " " |
31 | - METADATA | |
32 | - END | |
54 | + | |
33 | 55 | STYLE |
56 | + | |
34 | 57 | ANGLE 360 |
58 | + | |
35 | 59 | COLOR 200 50 0 |
60 | + | |
61 | + OPACITY 100 | |
62 | + | |
36 | 63 | OUTLINECOLOR 0 0 0 |
64 | + | |
37 | 65 | SYMBOL 0 |
66 | + | |
38 | 67 | END |
68 | + | |
39 | 69 | END |
40 | - END | |
41 | -END | |
42 | 70 | \ No newline at end of file |
71 | + | |
72 | + END | |
73 | + | |
74 | + | |
75 | + | |
76 | +END | |
77 | + | |
78 | + | ... | ... |
temas/testexx.map
... | ... | @@ -1,85 +0,0 @@ |
1 | -MAP | |
2 | - EXTENT -1 -1 -1 -1 | |
3 | - FONTSET "../symbols/fontes.txt" | |
4 | - IMAGECOLOR 255 255 255 | |
5 | - IMAGETYPE gif | |
6 | - SYMBOLSET "../symbols/simbolos.sym" | |
7 | - SIZE -1 -1 | |
8 | - STATUS ON | |
9 | - UNITS METERS | |
10 | - NAME "MS" | |
11 | - | |
12 | - OUTPUTFORMAT | |
13 | - NAME "gif" | |
14 | - MIMETYPE "image/gif" | |
15 | - DRIVER "GD/GIF" | |
16 | - EXTENSION "gif" | |
17 | - IMAGEMODE "PC256" | |
18 | - TRANSPARENT FALSE | |
19 | - END | |
20 | - | |
21 | - LEGEND | |
22 | - IMAGECOLOR 255 255 255 | |
23 | - KEYSIZE 20 10 | |
24 | - KEYSPACING 5 5 | |
25 | - LABEL | |
26 | - SIZE MEDIUM | |
27 | - TYPE BITMAP | |
28 | - BUFFER 0 | |
29 | - COLOR 0 0 0 | |
30 | - FORCE FALSE | |
31 | - MINDISTANCE -1 | |
32 | - MINFEATURESIZE -1 | |
33 | - OFFSET 0 0 | |
34 | - PARTIALS TRUE | |
35 | - END | |
36 | - POSITION LL | |
37 | - STATUS OFF | |
38 | - END | |
39 | - | |
40 | - QUERYMAP | |
41 | - COLOR 255 255 0 | |
42 | - SIZE -1 -1 | |
43 | - STATUS OFF | |
44 | - STYLE HILITE | |
45 | - END | |
46 | - | |
47 | - SCALEBAR | |
48 | - COLOR 0 0 0 | |
49 | - IMAGECOLOR 255 255 255 | |
50 | - INTERVALS 4 | |
51 | - LABEL | |
52 | - SIZE MEDIUM | |
53 | - TYPE BITMAP | |
54 | - BUFFER 0 | |
55 | - COLOR 0 0 0 | |
56 | - FORCE FALSE | |
57 | - MINDISTANCE -1 | |
58 | - MINFEATURESIZE -1 | |
59 | - OFFSET 0 0 | |
60 | - PARTIALS TRUE | |
61 | - END | |
62 | - POSITION LL | |
63 | - SIZE 200 3 | |
64 | - STATUS OFF | |
65 | - STYLE 0 | |
66 | - UNITS MILES | |
67 | - END | |
68 | - | |
69 | - WEB | |
70 | - IMAGEPATH "" | |
71 | - IMAGEURL "" | |
72 | - QUERYFORMAT text/html | |
73 | - LEGENDFORMAT text/html | |
74 | - BROWSEFORMAT text/html | |
75 | - END | |
76 | - | |
77 | - LAYER | |
78 | - DATA "" | |
79 | - NAME "testexx" | |
80 | - STATUS OFF | |
81 | - TYPE LINE | |
82 | - UNITS METERS | |
83 | - END | |
84 | - | |
85 | -END |
temas/wwfterr.map
... | ... | @@ -1,99 +0,0 @@ |
1 | -SYMBOLSET ../symbols/simbolos.sym | |
2 | -FONTSET "../symbols/fontes.txt" | |
3 | -LAYER | |
4 | - NAME wwfterr # ok | |
5 | - TYPE Polygon | |
6 | - STATUS OFF | |
7 | - TEMPLATE "wwf_terr.htm" | |
8 | - CONNECTIONTYPE postgis | |
9 | - CONNECTION "user=geodados password=geodados dbname=geodados host=pgsql1.mma.gov.br port=5432" | |
10 | - DATA "the_geom FROM (select * from mundo.munesr18) as foo USING UNIQUE gid USING SRID=4291" | |
11 | - METADATA | |
12 | - ITENS "eco_name,ecorregiao" | |
13 | - ITENSDESC "Ecorregião," | |
14 | - TEMA "Biomas e ecorregiões" | |
15 | - CLASSE "SIM" | |
16 | - ESACALA "3000000" | |
17 | - EXTENSAO "-109.396349448 -59.3054490089 -9.93532751916 22.1657415108" | |
18 | - END | |
19 | - TRANSPARENCY 80 | |
20 | - CLASS | |
21 | - Name 'Tropical and subtropical moist broadleaf forest' | |
22 | - EXPRESSION ('[biome]'eq'1') | |
23 | - COLOR 0 115 0 | |
24 | - OUTLINECOLOR 200 200 200 | |
25 | - END # CLASS | |
26 | - CLASS | |
27 | - Name 'Tropical and subtropical dry broadleaf forests' | |
28 | - EXPRESSION ('[biome]'eq'2') | |
29 | - COLOR 113 235 82 | |
30 | - OUTLINECOLOR 200 200 200 | |
31 | - END # CLASS | |
32 | - CLASS | |
33 | - Name 'Tropical and subtropical coniferous forests' | |
34 | - EXPRESSION ('[biome]'eq'3') | |
35 | - COLOR 148 127 64 | |
36 | - OUTLINECOLOR 200 200 200 | |
37 | - END # CLASS | |
38 | - CLASS | |
39 | - Name 'Temperate broadleaf and mixed forests' | |
40 | - EXPRESSION ('[biome]'eq'4') | |
41 | - COLOR 255 255 0 | |
42 | - OUTLINECOLOR 200 200 200 | |
43 | - END # CLASS | |
44 | - CLASS | |
45 | - Name 'Trop. and subtrop. grasslands, savannas and shrublands' | |
46 | - EXPRESSION ('[biome]'eq'7') | |
47 | - COLOR 209 255 115 | |
48 | - OUTLINECOLOR 200 200 200 | |
49 | - END # CLASS | |
50 | - CLASS | |
51 | - Name 'Temperate grasslands, savannas and shrublands' | |
52 | - EXPRESSION ('[biome]'eq'8') | |
53 | - COLOR 230 152 0 | |
54 | - OUTLINECOLOR 200 200 200 | |
55 | - END # CLASS | |
56 | - CLASS | |
57 | - Name 'Flooded grasslands and savannas' | |
58 | - EXPRESSION ('[biome]'eq'9') | |
59 | - COLOR 190 255 232 | |
60 | - OUTLINECOLOR 200 200 200 | |
61 | - END # CLASS | |
62 | - CLASS | |
63 | - Name 'Montane grasslands and shrublands' | |
64 | - EXPRESSION ('[biome]'eq'10') | |
65 | - COLOR 189 79 74 | |
66 | - OUTLINECOLOR 200 200 200 | |
67 | - END # CLASS | |
68 | - CLASS | |
69 | - Name 'Mediterranean forests, woodlands and scrub' | |
70 | - EXPRESSION ('[biome]'eq'12') | |
71 | - COLOR 237 222 83 | |
72 | - OUTLINECOLOR 200 200 200 | |
73 | - END # CLASS | |
74 | - CLASS | |
75 | - Name 'Desert and xeric shrublands' | |
76 | - EXPRESSION ('[biome]'eq'13') | |
77 | - COLOR 156 156 156 | |
78 | - OUTLINECOLOR 200 200 200 | |
79 | - END # CLASS | |
80 | - CLASS | |
81 | - Name 'Mangroves' | |
82 | - EXPRESSION ('[biome]'eq'14') | |
83 | - COLOR 255 0 197 | |
84 | - OUTLINECOLOR 200 200 200 | |
85 | - END # CLASS | |
86 | - CLASS | |
87 | - Name 'Water' | |
88 | - EXPRESSION ('[biome]'eq'98') | |
89 | - COLOR 0 0 255 | |
90 | - OUTLINECOLOR 200 200 200 | |
91 | - END # CLASS | |
92 | - CLASS | |
93 | - Name 'Snow, ice, glaciers and rock' | |
94 | - EXPRESSION ('[biome]'eq'99') | |
95 | - COLOR 255 255 255 | |
96 | - OUTLINECOLOR 200 200 200 | |
97 | - END | |
98 | -END | |
99 | -END |