Commit 8f12b8477e97fcee878f98fd9b531bb8e96a5a5b
1 parent
967f4d47
Exists in
master
and in
7 other branches
integração da página de download com a página ogc
Showing
11 changed files
with
146 additions
and
627 deletions
Show diff stats
admin/php/classe_arvore.php
@@ -113,7 +113,7 @@ class Arvore | @@ -113,7 +113,7 @@ class Arvore | ||
113 | $coluna = $idioma; | 113 | $coluna = $idioma; |
114 | } | 114 | } |
115 | 115 | ||
116 | - $this->sql_temasraiz = "select codigo_tema,id_raiz,i3geoadmin_raiz.id_tema,CASE $coluna WHEN '' THEN nome_tema ELSE $coluna END as nome_tema,tipoa_tema,perfil, ogc_tema, link_tema FROM ".$this->esquemaadmin."i3geoadmin_raiz LEFT JOIN ".$this->esquemaadmin."i3geoadmin_temas ON i3geoadmin_temas.id_tema = i3geoadmin_raiz.id_tema "; | 116 | + $this->sql_temasraiz = "select codigo_tema,id_raiz,i3geoadmin_raiz.id_tema,CASE $coluna WHEN '' THEN nome_tema ELSE $coluna END as nome_tema,tipoa_tema,perfil, ogc_tema, download_tema, link_tema FROM ".$this->esquemaadmin."i3geoadmin_raiz LEFT JOIN ".$this->esquemaadmin."i3geoadmin_temas ON i3geoadmin_temas.id_tema = i3geoadmin_raiz.id_tema "; |
117 | $this->sql_temasSubgrupo = "select i3geoadmin_temas.tipoa_tema, i3geoadmin_temas.codigo_tema,i3geoadmin_temas.tags_tema,i3geoadmin_n3.id_n3,CASE i3geoadmin_temas.$coluna WHEN '' THEN nome_tema ELSE i3geoadmin_temas.$coluna END as nome_tema,i3geoadmin_n3.publicado,i3geoadmin_n3.n3_perfil,i3geoadmin_n3.id_tema,i3geoadmin_temas.download_tema,i3geoadmin_temas.ogc_tema from ".$this->esquemaadmin."i3geoadmin_n3 LEFT JOIN ".$this->esquemaadmin."i3geoadmin_temas ON i3geoadmin_n3.id_tema = i3geoadmin_temas.id_tema "; | 117 | $this->sql_temasSubgrupo = "select i3geoadmin_temas.tipoa_tema, i3geoadmin_temas.codigo_tema,i3geoadmin_temas.tags_tema,i3geoadmin_n3.id_n3,CASE i3geoadmin_temas.$coluna WHEN '' THEN nome_tema ELSE i3geoadmin_temas.$coluna END as nome_tema,i3geoadmin_n3.publicado,i3geoadmin_n3.n3_perfil,i3geoadmin_n3.id_tema,i3geoadmin_temas.download_tema,i3geoadmin_temas.ogc_tema from ".$this->esquemaadmin."i3geoadmin_n3 LEFT JOIN ".$this->esquemaadmin."i3geoadmin_temas ON i3geoadmin_n3.id_tema = i3geoadmin_temas.id_tema "; |
118 | 118 | ||
119 | //$this->sql_temas = "select kmz_tema,nacessos,id_tema,kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,$coluna as nome_tema,codigo_tema from i3geoadmin_temas "; | 119 | //$this->sql_temas = "select kmz_tema,nacessos,id_tema,kml_tema,ogc_tema,download_tema,tags_tema,tipoa_tema,link_tema,desc_tema,$coluna as nome_tema,codigo_tema from i3geoadmin_temas "; |
datadownload.htm
1 | -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> | ||
2 | <html> | 1 | <html> |
3 | <head> | 2 | <head> |
4 | -<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | ||
5 | -<title>Download de dados geográficos</title> | ||
6 | -<meta name="description" content="Mapa interativo do MMA"> | ||
7 | -<meta name="keywords" content="WMS OGC mapa sig gis webmapping geo geoprocessamento interativo meio ambiente MMA cartografia geografia"> | ||
8 | -<meta name="robots" content="index,follow"> | ||
9 | -<script type="text/javascript" src="classesjs/i3geo.js"></script> | ||
10 | -<script type="text/javascript" src="classesjs/datadownload.js"></script> | ||
11 | -<link rel="stylesheet" type="text/css" href="admin/html/admin.css"> | ||
12 | -<style> | ||
13 | -.ajuda_usuario { | ||
14 | - margin-left: 10px; | ||
15 | -} | ||
16 | - | ||
17 | -P { | ||
18 | - padding-top: 12px; | ||
19 | - COLOR: #2F4632; | ||
20 | - text-align: left; | ||
21 | - font-size: 12px; | ||
22 | - font-family: Verdana, Arial, Helvetica, sans-serif; | ||
23 | -} | ||
24 | - | ||
25 | -#corpo { | ||
26 | - text-align: left; | ||
27 | - font-size: 12px; | ||
28 | - width: 450px; | ||
29 | - position: absolute; | ||
30 | - top: 0px; | ||
31 | - left: 300px; | ||
32 | - background: white; | ||
33 | -} | ||
34 | - | ||
35 | -#arvoreTemas { | ||
36 | - width: 280px; | ||
37 | -} | ||
38 | - | ||
39 | -body { | ||
40 | - padding-top: 0px; | ||
41 | - COLOR: #2F4632; | ||
42 | - text-align: center; | ||
43 | - font-size: 0.6cm; | ||
44 | - font-family: Verdana, Arial, Helvetica, sans-serif; | ||
45 | - background-color: white; | ||
46 | - margin: auto; | ||
47 | -} | ||
48 | - | ||
49 | -#brasil { | ||
50 | - background-image: url("imagens/sprite.png"); | ||
51 | - background-position: 0 -600px; | ||
52 | - background-repeat: no-repeat; | ||
53 | - cursor: pointer; | ||
54 | - height: 10px; | ||
55 | - width: 20px; | ||
56 | -} | ||
57 | - | ||
58 | -#uk { | ||
59 | - background-image: url("imagens/sprite.png"); | ||
60 | - background-position: 0 -625px; | ||
61 | - background-repeat: no-repeat; | ||
62 | - cursor: pointer; | ||
63 | - height: 10px; | ||
64 | - width: 20px; | ||
65 | -} | ||
66 | - | ||
67 | -#espanhol { | ||
68 | - background-image: url("imagens/sprite.png"); | ||
69 | - background-position: 0 -1400px; | ||
70 | - background-repeat: no-repeat; | ||
71 | - cursor: pointer; | ||
72 | - height: 10px; | ||
73 | - width: 20px; | ||
74 | -} | ||
75 | - | ||
76 | -#bandeiras img { | ||
77 | - margin-left: 7px; | ||
78 | -} | ||
79 | - | ||
80 | -#bandeiras { | ||
81 | - width: 100px; | ||
82 | - text-align: left; | ||
83 | - position: absolute; | ||
84 | - left: 0.2cm; | ||
85 | - z-index: 10; | ||
86 | -} | ||
87 | - | ||
88 | -a { | ||
89 | - margin: 0px auto; | ||
90 | - text-decoration: none; | ||
91 | - font-size: 14px; | ||
92 | - color: #26298D; | ||
93 | - outline: none; | ||
94 | -} | ||
95 | - | ||
96 | -A:hover { | ||
97 | - color: #4142ff; | ||
98 | -} | ||
99 | - | ||
100 | -#panellistaarquivos_h{ | ||
101 | - line-height: 1.5; | ||
102 | -} | ||
103 | - | ||
104 | -</style> | ||
105 | -</head> | ||
106 | -<body class=" yui-skin-sam " style="background-color: white;"> | ||
107 | - <div class="borda"> | ||
108 | - <div id="bandeiras"></div> | ||
109 | - <div style="text-align: center"> | ||
110 | - <a href="http://www.softwarepublico.gov.br" target="_blank" style="color: white;"> | ||
111 | - <b>Download</b> | ||
112 | - </a> | ||
113 | - </div> | ||
114 | - </div> | ||
115 | - | ||
116 | - <div id="conteudo" style="position: relative; top: 10px; margin: auto; max-width: 1000px; left: 10px;"> | ||
117 | - | ||
118 | - <div id=arvoreDir> | ||
119 | - <div id=RSSl style="width: 230px; text-align: left"></div> | ||
120 | - </div> | ||
121 | - <br></br> | ||
122 | - <!-- aqui vai o menu de opções --> | ||
123 | - <div id=arvoreTemas></div> | ||
124 | - <!-- aqui vai o corpo da aplicação --> | ||
125 | - <div id=corpo style="background-color: rgb(250, 250, 250)"> | ||
126 | - <H1>Download de dados geográficos</H1> | ||
127 | - <p>Navegue pela árvore ao lado para localizar o tema desejado para download. | ||
128 | - <p>Para fazer o download, clique no ícone mostrado ao lado de cada tema. | ||
129 | - <p>Quando um usuário escolhe um tema para download, os arquivos são gerados e armazenados temporariamente. Conforme a configuração do servidor, os dados obtidos podem ter sido gerados em uma data anterior à atual. | ||
130 | - <p>Apenas os dados armazenados no servidor de arquivos do i3Geo, e autorizados pela fonte produtora ou obtidos de locais públicos, estão disponíveis para download. | ||
131 | - <p>Caso exista interesse por algum outro arquivo não listado aqui, entre em contato com o administrador do sistema. | ||
132 | - <p>Dependendo do tráfego na web, o download pode não operar corretamente. Após escolhido o tema, será gerado um arquivo no formato "shape file". O formato "shape file" é composto por três arquivos (shp, shx e dbf) que devem ser obtidos separadamente e armazenados em um mesmo local em seu disco rígido. | ||
133 | - <p> | ||
134 | - Para abrir o "shape file", você poderá utilizar softwares livres como o <a href="http://www.gvsig.gva.es/index.php?id=gvsig&L=0" target=blank>GVSIG</a>, <a href="http://qgis.org/" target=blank> QGIS</a>, ou <a href="http://jump-pilot.sourceforge.net/OpenJUMP.html" target=blank>JUMP</a>. | ||
135 | - <p> | ||
136 | - Conheça também o <a href="http://mapas.mma.gov.br/i3geo/ms_criamapa.php" target=blank>mapa interativo do MMA.</a> | ||
137 | - <p> | ||
138 | - Bookmark: <span id=bm1></span> | ||
139 | - <p> | ||
140 | - <div style="text-align: left" id=curtir></div> | ||
141 | - </div> | ||
142 | - </div> | ||
143 | -</body> | ||
144 | <script> | 3 | <script> |
145 | - /* | ||
146 | - datadownload.htm | ||
147 | - | ||
148 | - Esse aplicativo permite ao usuário fazer o download de arquivos no formato shapefile. | ||
149 | - | ||
150 | - A lista de temas é baseada nas árvores de menus disponíveis. Apenas os temas que estiverem marcados com o item <DOWNLOAD>sim</DOWNLOAD> são mostrados na lista. | ||
151 | - | ||
152 | - Pode-se também definir um arquivo XML, no padrão RSS, que mostrará uma lista adicional de links para download de dados. | ||
153 | - | ||
154 | - About: Licença | ||
155 | - | ||
156 | - I3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
157 | - | ||
158 | - Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
159 | - Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br | ||
160 | - | ||
161 | - Este programa é software livre; você pode redistribuí-lo | ||
162 | - e/ou modificá-lo sob os termos da Licença Pública Geral | ||
163 | - GNU conforme publicada pela Free Software Foundation; | ||
164 | - | ||
165 | - Este programa é distribuído na expectativa de que seja útil, | ||
166 | - porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
167 | - de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. | ||
168 | - Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
169 | - Você deve ter recebido uma cópia da Licença Pública Geral do | ||
170 | - GNU junto com este programa; se não, escreva para a | ||
171 | - Free Software Foundation, Inc., no endereço | ||
172 | - 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
173 | - */ | ||
174 | - /* | ||
175 | - Essa variável indica o endereço de um arquivo no formato RSS que lista outros endereços que permitem o download de dados. | ||
176 | - | ||
177 | - A lista dos endereços é mostrada como links, colocados antes da lista de temas para download. | ||
178 | - | ||
179 | - Se o array estiver vazio, será utilizado o default, baseado no sistema de administração do i3geo. | ||
180 | - */ | ||
181 | - g_RSSl = new Array(""); | ||
182 | - i3GEO.idioma.IDSELETOR = "bandeiras"; | ||
183 | - i3GEO.idioma.mostraSeletor(); | ||
184 | - i3GEO.arvoreDeTemas.TIPOBOTAO = "download"; | ||
185 | - i3GEO.arvoreDeTemas.INCLUIWMSMETAESTAT = true; | ||
186 | - i3GEO.arvoreDeTemas.INCLUIINDIBR = false; | ||
187 | - i3GEO.arvoreDeTemas.OPCOESADICIONAIS.navegacaoDir = false; | ||
188 | - i3GEO.arvoreDeTemas.INCLUIMAPASCADASTRADOS = true; | ||
189 | - i3GEO.arvoreDeTemas.OPCOESADICIONAIS.flutuante = false; | ||
190 | - i3GEO.arvoreDeTemas.INCLUIESTRELAS = false; | ||
191 | - $i("bm1").innerHTML = i3GEO.social.bookmark(window.location.href); | ||
192 | - loc = window.location.href; | ||
193 | - //i3GEO.social.compartilhar("curtir", loc, loc, "comtotal"); | ||
194 | - | ||
195 | - DDinicia(); | 4 | +window.location=window.location.href.replace("datadownload.htm","ogc/index.php"); |
196 | </script> | 5 | </script> |
6 | +<head> | ||
7 | +<body> | ||
8 | +</body> | ||
197 | </html> | 9 | </html> |
guia_de_migracao.txt
@@ -4,6 +4,14 @@ GUIA DE UPDATES e UPGRADES | @@ -4,6 +4,14 @@ GUIA DE UPDATES e UPGRADES | ||
4 | Para a versão 7.0 | 4 | Para a versão 7.0 |
5 | 5 | ||
6 | Inclusão da variável $ogrOutput em ms_configura.php, que indica se o OGR esta corretamente instalado, permitindo o seu uso nos servicos OGC de exportacao de dados | 6 | Inclusão da variável $ogrOutput em ms_configura.php, que indica se o OGR esta corretamente instalado, permitindo o seu uso nos servicos OGC de exportacao de dados |
7 | + | ||
8 | +Inclusão da variável $logTransacoes em ms_configura.php para ativar/desativar o log de transações com o banco de dados de administração | ||
9 | + | ||
10 | +Os programas javascript do core do i3Geo agora ficam na pasta i3geo/js | ||
11 | + | ||
12 | +O aplicativo datadownload foi removido | ||
13 | + | ||
14 | +As funcionalidades de download foram concentrados no aplicativo de acesso aos webservices OGC | ||
7 | ------------------------------------------------------------------------------------------------- | 15 | ------------------------------------------------------------------------------------------------- |
8 | Para a versão 6.0 | 16 | Para a versão 6.0 |
9 | 17 |
init/dicionario.js
@@ -136,14 +136,14 @@ g_traducao_init = | @@ -136,14 +136,14 @@ g_traducao_init = | ||
136 | ], | 136 | ], |
137 | 11 : [ | 137 | 11 : [ |
138 | { | 138 | { |
139 | - pt : "Serviços OGC", | 139 | + pt : "OGC/Download", |
140 | en : "OGC services ", | 140 | en : "OGC services ", |
141 | es : "Servicios OGC" | 141 | es : "Servicios OGC" |
142 | } | 142 | } |
143 | ], | 143 | ], |
144 | "11a" : [ | 144 | "11a" : [ |
145 | { | 145 | { |
146 | - pt : "Dados públicos podem ser acessados por meio dos padrões OGC mais comuns, como WMS e WFS. Veja aqui a lista e os links dos serviços", | 146 | + pt : "Dados públicos podem ser acessados por meio de download ou dos padrões OGC mais comuns, como WMS e WFS. Veja aqui a lista e os links dos serviços", |
147 | en : "", | 147 | en : "", |
148 | es : "" | 148 | es : "" |
149 | } | 149 | } |
init/index.js
@@ -56,13 +56,6 @@ botoesIni = [ | @@ -56,13 +56,6 @@ botoesIni = [ | ||
56 | "fa": "map-o", | 56 | "fa": "map-o", |
57 | "target": "_self" | 57 | "target": "_self" |
58 | },{ | 58 | },{ |
59 | - "img":"svn-update.png", | ||
60 | - "href": location.href.replace("index.php","") + "../datadownload.htm", | ||
61 | - "titulo":$trad(10,g_traducao_init), | ||
62 | - "subtitulo": $trad("10a",g_traducao_init), | ||
63 | - "fa": "download", | ||
64 | - "target": "_self" | ||
65 | -},{ | ||
66 | "img":"ogc_logo.png", | 59 | "img":"ogc_logo.png", |
67 | "href": location.href.replace("index.php","") + "../ogc/index.php", | 60 | "href": location.href.replace("index.php","") + "../ogc/index.php", |
68 | "titulo":$trad(11,g_traducao_init), | 61 | "titulo":$trad(11,g_traducao_init), |
init/index.php
@@ -76,7 +76,7 @@ include "head.php"; | @@ -76,7 +76,7 @@ include "head.php"; | ||
76 | <div id="menuTpl" class="hidden"> | 76 | <div id="menuTpl" class="hidden"> |
77 | <ul class="nav navbar-nav"> | 77 | <ul class="nav navbar-nav"> |
78 | <li><a href="#topo" onclick="$('.cartao').hide();$('.map-o').fadeIn(600);">{{{mapas}}}</a></li> | 78 | <li><a href="#topo" onclick="$('.cartao').hide();$('.map-o').fadeIn(600);">{{{mapas}}}</a></li> |
79 | - <li><a href="#topo" onclick="$('.cartao').hide();$('.download').fadeIn(600);">Download</a></li> | 79 | + <li><a href="#topo" onclick="$('.cartao').hide();$('.download').fadeIn(600);">OGC/Download</a></li> |
80 | <li><a href="#topo" onclick="$('.cartao').hide();$('.cogs').fadeIn(600);">{{{admin}}}</a></li> | 80 | <li><a href="#topo" onclick="$('.cartao').hide();$('.cogs').fadeIn(600);">{{{admin}}}</a></li> |
81 | <li><a href="#topo" onclick="$('.cartao').hide();$('.book').fadeIn(600);">{{{docs}}}</a></li> | 81 | <li><a href="#topo" onclick="$('.cartao').hide();$('.book').fadeIn(600);">{{{docs}}}</a></li> |
82 | <li><a href="#topo" onclick="$('.cartao').hide();$('.group').fadeIn(600);">{{{comunidade}}}</a></li> | 82 | <li><a href="#topo" onclick="$('.cartao').hide();$('.group').fadeIn(600);">{{{comunidade}}}</a></li> |
js/datadownload.js
@@ -1,389 +0,0 @@ | @@ -1,389 +0,0 @@ | ||
1 | -/* | ||
2 | -Sistema de download de dados geográficos. | ||
3 | - | ||
4 | -Lista os temas configurados no menu de temas e que permitem download. | ||
5 | - | ||
6 | -Para utilizar esse sistema acesse http://localhost/i3geo/datadownload.htm | ||
7 | - | ||
8 | -Pode-se usar um parametro para abrir o aplicativo e imediatamente mostrar os arquivos para download, por exemplo | ||
9 | - | ||
10 | -datadownload.htm?bioma | ||
11 | - | ||
12 | -Arquivo: | ||
13 | - | ||
14 | -i3geo/classesjs/datadownload.js | ||
15 | - | ||
16 | -Licença: | ||
17 | - | ||
18 | -GPL2 | ||
19 | - | ||
20 | -i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet | ||
21 | - | ||
22 | -Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil | ||
23 | -Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com | ||
24 | - | ||
25 | -Este programa é software livre; você pode redistribuí-lo | ||
26 | -e/ou modificá-lo sob os termos da Licença Pública Geral | ||
27 | -GNU conforme publicada pela Free Software Foundation; | ||
28 | - | ||
29 | -Este programa é distribuído na expectativa de que seja útil, | ||
30 | -porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita | ||
31 | -de COMERCIABILIDADE OU ADEQUACÃO A UMA FINALIDADE ESPECÍFICA. | ||
32 | -Consulte a Licença Pública Geral do GNU para mais detalhes. | ||
33 | -Você deve ter recebido uma cópia da Licença Pública Geral do | ||
34 | -GNU junto com este programa; se não, escreva para a | ||
35 | -Free Software Foundation, Inc., no endereço | ||
36 | -59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. | ||
37 | - | ||
38 | -Veja: | ||
39 | - | ||
40 | -<datadownload.htm> | ||
41 | -*/ | ||
42 | -/* | ||
43 | -Indica a localização do i3geo. Por default, procura no diretório onde foi executada a plicação datadownload. | ||
44 | -No caso do datadownload.htm ser disparado de outro local, é necessário definir essa variável antes de chamar a função DDinicia | ||
45 | -*/ | ||
46 | -loc = window.location.href; | ||
47 | -g_locaplic = loc.split("/datadownload.htm"); | ||
48 | -g_locaplic = g_locaplic[0]; | ||
49 | - | ||
50 | -temp = loc.split("temaDownload="); | ||
51 | -if(temp[1]){ | ||
52 | - temaDownload = temp[1]; | ||
53 | - temaDownload = temaDownload.split("&"); | ||
54 | - temaDownload = temaDownload[0]; | ||
55 | -} | ||
56 | -else{ | ||
57 | - temaDownload = ""; | ||
58 | -} | ||
59 | -// | ||
60 | -//para efeitos de compatibilidade | ||
61 | -// | ||
62 | -try{i3GEO.configura.locaplic = g_locaplic;} | ||
63 | -catch(e){} | ||
64 | -// | ||
65 | -//diretorio onde esta o i3geo | ||
66 | -// | ||
67 | -g_i3geo = ""; | ||
68 | -// | ||
69 | -//função que será utilizada quando o usuário clicar na árvore | ||
70 | -// | ||
71 | -g_arvoreClicks = ""; | ||
72 | -/* | ||
73 | -Tipo de acesso aos dados. | ||
74 | - | ||
75 | -g_tipo é uma variável que pode ser definida antes de iniciar a funcao DDinicia | ||
76 | -g_tipo = "menutemas", indica que a lista de temas para download será buscada no xml com a lista de temas do I3Geo | ||
77 | -se g_tipo for "dir", a aplicação entenderá que se trata de uma busca em diretórios | ||
78 | -nesse caso, g_dirbase deve conter a raiz da busca no servidor, por exemplo: | ||
79 | -g_dirbase = "/opt/www/html/geodados" | ||
80 | -g_dirarquivos indica o diretório inicial para listagem dos arquivos | ||
81 | -por default, g_tipo = "menutemas" | ||
82 | - | ||
83 | -Exemplo que pode ser utilizado em um HTML armazenado no diretório vegetacao2002: | ||
84 | - | ||
85 | -g_tipo = "dir" | ||
86 | -g_dirbase = "/opt/www/html/geodados/brasil/vegetacao/vegetacao2002" | ||
87 | -g_dirbaseDown = "http://"+window.location.host+"/geodados/brasil/vegetacao/vegetacao2002" | ||
88 | -g_dirarquivos = "/opt/www/html/geodados/brasil/vegetacao/vegetacao2002" | ||
89 | -g_i3geo = "/i3geo" | ||
90 | -g_locaplic = "http://"+window.location.host+g_i3geo | ||
91 | - | ||
92 | -Tipo: | ||
93 | -{string} | ||
94 | - | ||
95 | -Valores: | ||
96 | - | ||
97 | -dir - indica que os dados serão buscados em diretórios no servidor. | ||
98 | - | ||
99 | -menutemas - indica que os dados serão buscados no arquivo menutemas/menutemas.xml ou | ||
100 | -no sistema de administração do i3geo | ||
101 | -*/ | ||
102 | -g_tipo = "menutemas"; | ||
103 | -/* | ||
104 | -Url para o endereço definido em g_dirbase. | ||
105 | -É utilizada para montar o link de acesso aos arquivos quando g_tipo = 'dir' | ||
106 | - | ||
107 | -Tipo: | ||
108 | -{string} | ||
109 | - | ||
110 | -*/ | ||
111 | -g_dirbaseDown = ""; | ||
112 | - | ||
113 | -/* | ||
114 | -Endereço no servidor onde estão os arquivos ou diretórios que poderão ser acessados | ||
115 | - | ||
116 | -Tipo: | ||
117 | -{string} | ||
118 | - | ||
119 | -*/ | ||
120 | -g_dirbase = ""; | ||
121 | -/* | ||
122 | -Endereço do diretório que será acessado na inicialização da aplicação | ||
123 | - | ||
124 | -Tipo: | ||
125 | -{string} | ||
126 | - | ||
127 | -*/ | ||
128 | -g_dirarquivos = ""; | ||
129 | -/* | ||
130 | -Inicia o aplicativo montando a árvore de opções e preenchendo a DIV arvore. | ||
131 | - | ||
132 | -Deve existir no HTML um DIV com id='arvore'. | ||
133 | -*/ | ||
134 | -function DDinicia() | ||
135 | -{ | ||
136 | - if(!document.getElementById("arvoreTemas")) | ||
137 | - { | ||
138 | - alert("Nao foi encontrado o DIV arvoreTemas"); | ||
139 | - return; | ||
140 | - } | ||
141 | - if (g_tipo == "menutemas") | ||
142 | - { | ||
143 | - i3GEO.arvoreDeTemas.INCLUISISTEMAS = false; | ||
144 | - i3GEO.arvoreDeTemas.FILTRADOWNLOAD = true; | ||
145 | - i3GEO.arvoreDeTemas.INCLUIWMS = false; | ||
146 | - i3GEO.arvoreDeTemas.OPCOESADICIONAIS.incluiArvore = false; | ||
147 | - i3GEO.arvoreDeTemas.OPCOESADICIONAIS.incluibusca = false; | ||
148 | - //i3GEO.arvoreDeTemas.TIPOBOTAO = "radio"; | ||
149 | - i3GEO.arvoreDeTemas.cria("",g_locaplic,"arvoreTemas","datadownload_download\(this\)"); | ||
150 | - } | ||
151 | - if (g_tipo == "dir") | ||
152 | - { | ||
153 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=listaDiretorios&map_file=&diretorio="+g_dirbase; | ||
154 | - var cp = new cpaint(); | ||
155 | - //cp.set_debug(2) | ||
156 | - cp.set_response_type("JSON"); | ||
157 | - cp.call(p,"listaDiretorios",processaDiretorios); | ||
158 | - } | ||
159 | - dataDownloadLinks(g_RSSl); | ||
160 | - if(temaDownload != ""){ | ||
161 | - datadownload_download({"title":temaDownload}); | ||
162 | - } | ||
163 | -} | ||
164 | -/* | ||
165 | -Cahamado pela função DDinicia. Recebe os dados da função Ajax com a lista de diretorios. | ||
166 | - | ||
167 | -Monta a árvore para navegação pelos diretórios. | ||
168 | - | ||
169 | -Parametros: | ||
170 | - | ||
171 | -retorno - string formatada com os dados para montagem da árvore. | ||
172 | -*/ | ||
173 | -function processaDiretorios(retorno) | ||
174 | -{ | ||
175 | - if(!document.getElementById("arvoreTemas")) | ||
176 | - { | ||
177 | - alert("Nao foi encontrado o DIV arvoreTemas"); | ||
178 | - return; | ||
179 | - } | ||
180 | - if ((retorno.data != "erro") && (retorno.data != undefined)) | ||
181 | - { | ||
182 | - treeDir = new Object(); | ||
183 | - treeDir = treeviewNew("treeDir", "default", "arvoreTemas", null); | ||
184 | - treeDir.createItem("raiz", "<b>Diretórios</b>", g_locaplic+"/imagens/temas.png", true, true, true, null); | ||
185 | - treeDir.itemExpand = expandeDiretorio; | ||
186 | - for (var ig=0;ig<retorno.data.length; ig++) | ||
187 | - { | ||
188 | - var nomeDir = retorno.data[ig]; | ||
189 | - treeDir.createItem(g_dirbase+"/"+nomeDir, nomeDir, g_locaplic+"/imagens/folder-s.gif", true, true, true, "raiz"); | ||
190 | - } | ||
191 | - } | ||
192 | -} | ||
193 | -/* | ||
194 | -Expande um diretório quando o usuário clica no nó da árvore de diretórios. | ||
195 | - | ||
196 | -Definido na função processaDiretorios. Após serem mostrados os sub-diretórios é disparada a função listaArquivos para mostrar a lista de arquivos existentes no diretório selecionado. | ||
197 | - | ||
198 | -Parametros: | ||
199 | - | ||
200 | -id - id do nó clicado na árvore treeview | ||
201 | -*/ | ||
202 | -function expandeDiretorio(id) | ||
203 | -{ | ||
204 | - var volta = function (retorno) | ||
205 | - { | ||
206 | - if ((retorno.data != "erro") && (retorno.data != undefined)) | ||
207 | - { | ||
208 | - for (var ig=0;ig<retorno.data.length; ig++) | ||
209 | - { | ||
210 | - var nomeDir = retorno.data[ig]; | ||
211 | - if (!document.getElementById(id+"/"+nomeDir)) | ||
212 | - treeDir.createItem(id+"/"+nomeDir, nomeDir, g_locaplic+"/imagens/folder-s.gif", true, true, true, id); | ||
213 | - } | ||
214 | - listaArquivos(id); | ||
215 | - } | ||
216 | - }; | ||
217 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=listaDiretorios&map_file=&diretorio="+id; | ||
218 | - var cp = new cpaint(); | ||
219 | - //cp.set_debug(2) | ||
220 | - cp.set_response_type("JSON"); | ||
221 | - cp.call(p,"listaDiretorios",volta); | ||
222 | -} | ||
223 | -/* | ||
224 | -Lista os arquivos de um diretório. | ||
225 | - | ||
226 | -No HTML deve existir um DIV com id='corpo'. Nesse div será incluída a lista. | ||
227 | - | ||
228 | -Parametros: | ||
229 | - | ||
230 | -dir - diretório no servidor | ||
231 | -*/ | ||
232 | -function listaArquivos(dir) | ||
233 | -{ | ||
234 | - if(!document.getElementById("corpo")) | ||
235 | - { | ||
236 | - alert("Nao foi encontrado o DIV corpo"); | ||
237 | - return; | ||
238 | - } | ||
239 | - document.getElementById("corpo").innerHTML = ""; | ||
240 | - var re = new RegExp(g_dirbase, "g"); | ||
241 | - var d = dir.replace(re,''); | ||
242 | - var ins = "<div style=text-align:left; >Diretório: "+d+"<br><br>"; | ||
243 | - var volta = function (retorno) | ||
244 | - { | ||
245 | - if ((retorno.data != "erro") && (retorno.data != undefined)) | ||
246 | - { | ||
247 | - ins += "<b>Diretórios:</b><br><br>"; | ||
248 | - for (var ig=0;ig<retorno.data.diretorios.length; ig++){ | ||
249 | - ins += "<span style=cursor:pointer onclick=listaArquivos('"+g_dirbase+d+"/"+retorno.data.diretorios[ig]+"') ><img src="+g_locaplic+"/imagens/folder-s.gif />"+retorno.data.diretorios[ig]+"</span><br><br>"; | ||
250 | - } | ||
251 | - ins += "<b>Arquivos:</b><br><br>"; | ||
252 | - for (var ig=0;ig<retorno.data.arquivos.length; ig++){ | ||
253 | - ins += "<a href='"+g_dirbaseDown+d+"/"+retorno.data.arquivos[ig]+"' target=new >"+retorno.data.arquivos[ig]+"</a><br><br>"; | ||
254 | - } | ||
255 | - document.getElementById("corpo").innerHTML = ins; | ||
256 | - } | ||
257 | - }; | ||
258 | - var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=listaArquivos&map_file=&diretorio="+dir; | ||
259 | - var cp = new cpaint(); | ||
260 | - //cp.set_debug(2) | ||
261 | - cp.set_response_type("JSON"); | ||
262 | - cp.call(p,"listaDiretorios",volta); | ||
263 | -} | ||
264 | -/* | ||
265 | -Gera os arquivos para download do shape file de um tema. | ||
266 | - | ||
267 | -*/ | ||
268 | -function datadownload_download(obj) | ||
269 | -{ | ||
270 | - if(!$i("panellistaarquivos")){ | ||
271 | - YAHOO.namespace("datadownloadLista"); | ||
272 | - YAHOO.datadownloadLista.panel = new YAHOO.widget.Panel("panellistaarquivos", {fixedcenter:true,zIndex:2000, iframe:true, width:"450px",align:"left", visible:false, draggable:true, close:true, modal:true } ); | ||
273 | - YAHOO.datadownloadLista.panel.setHeader("Arquivos"); | ||
274 | - YAHOO.datadownloadLista.panel.setBody(""); | ||
275 | - YAHOO.datadownloadLista.panel.setFooter(""); | ||
276 | - YAHOO.datadownloadLista.panel.render(document.body); | ||
277 | - }; | ||
278 | - YAHOO.datadownloadLista.panel.setBody($trad("d28")); | ||
279 | - YAHOO.datadownloadLista.panel.show(); | ||
280 | - YAHOO.datadownloadLista.panel.cfg.setProperty("y", 100); | ||
281 | - //document.getElementById("corpo").innerHTML = "Aguarde. Gerando arquivos..." | ||
282 | - var p = g_locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=download3&tema="+obj.title; | ||
283 | - //caso a camada venha do sistema de metadados estatisticos e seja uma variavel | ||
284 | - if(obj.name && obj.name === "metaestat"){ | ||
285 | - p = g_locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=download3&id_medida_variavel="+obj.title; | ||
286 | - } | ||
287 | - if(obj.name && obj.name === "regioesmetaestat"){ | ||
288 | - p = g_locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=download3&codigo_tipo_regiao="+obj.title.replace("metaregiao_",""); | ||
289 | - } | ||
290 | - | ||
291 | - temaEscolhidoDownload = obj.title; | ||
292 | - var cp = new cpaint(); | ||
293 | - //cp.set_debug(2) | ||
294 | - cp.set_response_type("JSON"); | ||
295 | - cp.call(p,"downloadTema2",mostraDownload); | ||
296 | -} | ||
297 | -/* | ||
298 | -Mostra na tela os arquivos convertidos para shape file com link para download. | ||
299 | -*/ | ||
300 | -function mostraDownload(retorno) | ||
301 | -{ | ||
302 | - var ins = ""; | ||
303 | - if (retorno.data != undefined) | ||
304 | - { | ||
305 | - retorno = retorno.data; | ||
306 | - var arqs = retorno.arquivos.split(","); | ||
307 | - var n = arqs.length; | ||
308 | - if(retorno == "erro") | ||
309 | - {ins = "<p style=color:red >Ocorreu um erro. O tema não foi encontrado. Pode ser que o código do tema não existe na definição do mapfile. Informe o administrador do sistema.<br>";} | ||
310 | - else | ||
311 | - { | ||
312 | - ins = "<b>Links de acesso:</b><br><br>"; | ||
313 | - ins += "<a href='"+window.location.href.split("?")[0]+"?tema="+retorno.tema+"&temaDownload="+retorno.tema+"'>Link permanente de acesso<br><br>"; | ||
314 | - ins += "<a href='"+window.location.protocol+"//"+window.location.host+"/"+retorno.mapfileurl+"' target=blank >Arquivo de configuração Mapfile</a><br>"; | ||
315 | - ins += "<a href='"+g_locaplic+"/classesphp/mapa_controle.php?funcao=TEMA2SLD&tema="+retorno.tema+"&map_file="+retorno.mapfile+"' target=blank >Arquivo de legenda SLD</a><br><br>"; | ||
316 | - ins += "Serviço OGC: "+g_locaplic+"/ogc.php?tema="+retorno.tema+"<br><br>"; | ||
317 | - ins += "<a href='"+g_locaplic+"/ogc.php?tema="+retorno.tema+"&SERVICE=WMS&VERSION=1.1.0&REQUEST=GetCapabilities' target=blank >OGC GetCapabilities</a><br><br>"; | ||
318 | - ins += "<a href='"+g_locaplic+"/ogc.php?tema="+retorno.tema+"&SERVICE=WMS&VERSION=1.1.0&format=application/openlayers&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081' target=blank >Ver com OpenLayers</a><br><br>"; | ||
319 | - ins += "<a href='"+g_locaplic+"/ogc.php?tema="+retorno.tema+"&SERVICE=WFS&VERSION=1.1.0&request=getfeature&OUTPUTFORMAT=shape-zip' target=blank >Download shapefile com WFS (arquivo compactado incluindo .prj)</a><br><br>"; | ||
320 | - ins += "<a href='"+g_locaplic+"/ogc.php?tema="+retorno.tema+"&SERVICE=WFS&VERSION=1.1.0&request=getfeature&OUTPUTFORMAT=csv' target=blank >Download CSV com WFS (arquivo compactado)</a><br><br>"; | ||
321 | - ins += "<a href='"+g_locaplic+"/ogc.php?tema="+retorno.tema+"&SERVICE=WFS&VERSION=1.1.0&request=getfeature&OUTPUTFORMAT=kmz' target=blank >Download KMZ</a><br><br>"; | ||
322 | - ins += "<a href='"+g_locaplic+"/ogc.php?tema="+retorno.tema+"&SERVICE=WFS&VERSION=1.1.0&request=getfeature&OUTPUTFORMAT=kml' target=blank >Download KML</a><br><br>"; | ||
323 | - | ||
324 | - for (var arq=0;arq<n;arq++) | ||
325 | - { | ||
326 | - ins += "<a href='"+window.location.protocol+"//"+window.location.host+"/"+arqs[arq]+"'>"+arqs[arq]+"</a><br>"; | ||
327 | - } | ||
328 | - ins += "<br><a href='"+g_locaplic+"/fontetema.php?tema="+temaEscolhidoDownload+"' target=blank >Fonte</a>"; | ||
329 | - if(retorno.nreg) | ||
330 | - {ins += "<br><br>Número de registros ="+retorno.nreg;} | ||
331 | - } | ||
332 | - } | ||
333 | - else | ||
334 | - { | ||
335 | - ins = "<p style=color:red >Ocorreu um erro<br>"; | ||
336 | - } | ||
337 | - YAHOO.datadownloadLista.panel.setBody(ins); | ||
338 | - YAHOO.datadownloadLista.panel.show(); | ||
339 | -} | ||
340 | -/* | ||
341 | -Mostra uma lista de links baseado em um arquivo rss. | ||
342 | - | ||
343 | -Utilizado para acrescentar outros links no sistema de download | ||
344 | - | ||
345 | -Por default, o rss é menutemas/linksdownload.xml | ||
346 | - | ||
347 | -Parametros: | ||
348 | - | ||
349 | -rss - endereço do arquivo rss. | ||
350 | -*/ | ||
351 | -function dataDownloadLinks(rss) | ||
352 | -{ | ||
353 | - var monta = function(retorno) | ||
354 | - { | ||
355 | - var reg = /Erro/gi; | ||
356 | - if (retorno.data.search(reg) != -1) | ||
357 | - { | ||
358 | - alert("OOps! Ocorreu um erro\n"+retorno.data); | ||
359 | - return; | ||
360 | - } | ||
361 | - var linhas = retorno.data.split("|"); | ||
362 | - var ins = ""; | ||
363 | - var n = linhas.length; | ||
364 | - if(n == 1){return;} | ||
365 | - for (var i=0;i<n; i++) | ||
366 | - { | ||
367 | - var caso = linhas[i].split("#"); | ||
368 | - if (i > 0) | ||
369 | - { | ||
370 | - ins += "<a style=text-align:left href='"+caso[2]+"' target=blank >"+caso[0]+" ("+caso[1]+")</a>"; | ||
371 | - ins += "<br>"; | ||
372 | - } | ||
373 | - else | ||
374 | - {ins += "<p class=clique ><b>"+caso[0]+"</b> "+caso[1]+" </p>";} | ||
375 | - } | ||
376 | - document.getElementById("RSSl").innerHTML = ins; | ||
377 | - }; | ||
378 | - if (document.getElementById("RSSl")) | ||
379 | - { | ||
380 | - if (rss.length > 0) | ||
381 | - { | ||
382 | - var p = g_locaplic+"/classesphp/wscliente.php?funcao=listaRSSws2&rss="+rss.join("|")+"&tipo=DOWNLOAD"; | ||
383 | - var cp = new cpaint(); | ||
384 | - //cp.set_debug(2) | ||
385 | - cp.set_response_type("JSON"); | ||
386 | - cp.call(p,"listaRSSws2",monta); | ||
387 | - } | ||
388 | - } | ||
389 | -} |
ogc/dicionario.js
@@ -86,13 +86,13 @@ g_traducao_ogc = | @@ -86,13 +86,13 @@ g_traducao_ogc = | ||
86 | en : "", | 86 | en : "", |
87 | es : "" | 87 | es : "" |
88 | }], | 88 | }], |
89 | - "1" : [{ | ||
90 | - pt : "", | 89 | + "map" : [{ |
90 | + pt : "Arquivo de configuração Mapfile", | ||
91 | en : "", | 91 | en : "", |
92 | es : "" | 92 | es : "" |
93 | }], | 93 | }], |
94 | - "1" : [{ | ||
95 | - pt : "", | 94 | + "sld" : [{ |
95 | + pt : "Arquivo de legenda SLD", | ||
96 | en : "", | 96 | en : "", |
97 | es : "" | 97 | es : "" |
98 | }], | 98 | }], |
ogc/index.js
@@ -127,7 +127,8 @@ function listaMapasSalvos(onde,templateCamadas){ | @@ -127,7 +127,8 @@ function listaMapasSalvos(onde,templateCamadas){ | ||
127 | camadas.push({ | 127 | camadas.push({ |
128 | "nome": t.NOME, | 128 | "nome": t.NOME, |
129 | "hidden": "", | 129 | "hidden": "", |
130 | - "codigo_tema": t.ID_MAPA | 130 | + "codigo_tema": t.ID_MAPA, |
131 | + "download": "nao" | ||
131 | }); | 132 | }); |
132 | } | 133 | } |
133 | 134 | ||
@@ -151,12 +152,29 @@ function ckCamada(camadas,templateCamadas,tipo){ | @@ -151,12 +152,29 @@ function ckCamada(camadas,templateCamadas,tipo){ | ||
151 | html; | 152 | html; |
152 | //marca as camadas que nao sao ogc | 153 | //marca as camadas que nao sao ogc |
153 | $(camadas).each(function() { | 154 | $(camadas).each(function() { |
154 | - if(tipo == "tema" && this.ogc_tema != "NAO"){ | 155 | + if(tipo == "tema"){ |
155 | if(this.link_tema == ""){ | 156 | if(this.link_tema == ""){ |
156 | this.hidden = "hidden"; | 157 | this.hidden = "hidden"; |
157 | } | 158 | } |
158 | this.tipo = tipo; | 159 | this.tipo = tipo; |
159 | - ncamadas.push(this); | 160 | + //para compatibilizar entre as diferencas de respostas JSON |
161 | + if(this.ogc){ | ||
162 | + this.ogc_tema = this.ogc; | ||
163 | + } | ||
164 | + if(this.download){ | ||
165 | + this.download_tema = this.download; | ||
166 | + } | ||
167 | + //nao mostra se nenhum permitir acao | ||
168 | + if(!(this.ogc_tema.toLowerCase() == "nao" && this.download_tema.toLowerCase() == "nao")){ | ||
169 | + if(this.ogc_tema.toLowerCase() == "nao"){ | ||
170 | + this.disabledogc = "disabled"; | ||
171 | + } | ||
172 | + if(this.download_tema.toLowerCase() == "nao"){ | ||
173 | + this.disableddown = "disabled"; | ||
174 | + } | ||
175 | + ncamadas.push(this); | ||
176 | + } | ||
177 | + | ||
160 | } | 178 | } |
161 | if(tipo == "meta"){ | 179 | if(tipo == "meta"){ |
162 | this.hidden = "hidden"; | 180 | this.hidden = "hidden"; |
@@ -166,6 +184,7 @@ function ckCamada(camadas,templateCamadas,tipo){ | @@ -166,6 +184,7 @@ function ckCamada(camadas,templateCamadas,tipo){ | ||
166 | if(tipo == "mapa"){ | 184 | if(tipo == "mapa"){ |
167 | this.hidden = "hidden"; | 185 | this.hidden = "hidden"; |
168 | this.tipo = tipo; | 186 | this.tipo = tipo; |
187 | + this.disableddown = "disabled"; | ||
169 | ncamadas.push(this); | 188 | ncamadas.push(this); |
170 | } | 189 | } |
171 | }); | 190 | }); |
@@ -180,24 +199,76 @@ function ckCamada(camadas,templateCamadas,tipo){ | @@ -180,24 +199,76 @@ function ckCamada(camadas,templateCamadas,tipo){ | ||
180 | return ""; | 199 | return ""; |
181 | } | 200 | } |
182 | } | 201 | } |
183 | -function mostraLinksServico(tema,tipo){ | 202 | +function mostraLinksServico(tema,tipo,disabled){ |
203 | + $(".modal-body").html('<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i><span class="sr-only">Aguarde</span>'); | ||
184 | var html; | 204 | var html; |
185 | - | ||
186 | - if(tipo == "meta"){ | ||
187 | - tradLinks["tema"] = "metaestat_"+tema; | ||
188 | - tradLinks["id_medida_variavel"] = "&id_medida_variavel="+tema; | 205 | + if(disabled != ""){ |
206 | + return; | ||
189 | } | 207 | } |
190 | - if(tipo == "mapa"){ | ||
191 | - tradLinks["tema"] = "mapa_cadastrado_"+tema; | ||
192 | - tradLinks["id_medida_variavel"] = "&mapa_cadastrado="+tema; | 208 | + else{ |
209 | + if(tipo == "meta"){ | ||
210 | + tradLinks["tema"] = "metaestat_"+tema; | ||
211 | + tradLinks["id_medida_variavel"] = "&id_medida_variavel="+tema; | ||
212 | + } | ||
213 | + if(tipo == "mapa"){ | ||
214 | + tradLinks["tema"] = "mapa_cadastrado_"+tema; | ||
215 | + tradLinks["id_medida_variavel"] = "&mapa_cadastrado="+tema; | ||
216 | + } | ||
217 | + if(tipo == "tema"){ | ||
218 | + tradLinks["tema"] = tema; | ||
219 | + } | ||
220 | + html = Mustache.to_html( | ||
221 | + $("#templateLinksOgc").html(), | ||
222 | + tradLinks | ||
223 | + ); | ||
224 | + $(".modal-body").html(html); | ||
193 | } | 225 | } |
194 | - if(tipo == "tema"){ | ||
195 | - tradLinks["tema"] = tema; | 226 | + |
227 | +} | ||
228 | +function mostraLinksDownload(tema,tipo,disabled){ | ||
229 | + $(".modal-body").html('<i class="fa fa-spinner fa-pulse fa-2x fa-fw"></i><span class="sr-only">Aguarde</span>'); | ||
230 | + var html, r, p; | ||
231 | + if(disabled != ""){ | ||
232 | + return; | ||
196 | } | 233 | } |
234 | + else{ | ||
235 | + r = function(retorno){ | ||
236 | + var html,arqs,i,n,ins = ""; | ||
237 | + retorno = retorno.data; | ||
238 | + //adiciona no hash os dados necessarios | ||
239 | + if(tipo == "meta"){ | ||
240 | + tradLinks["tema"] = "metaestat_" + tema; | ||
241 | + tradLinks["id_medida_variavel"] = "&id_medida_variavel=" + tema; | ||
242 | + } | ||
243 | + if(tipo == "tema"){ | ||
244 | + tradLinks["tema"] = tema; | ||
245 | + } | ||
246 | + tradLinks["mapfile"] = window.location.protocol + "//" + window.location.host + "/" + retorno.mapfileurl; | ||
247 | + tradLinks["sldurl"] = tradLinks["url"] + "classesphp/mapa_controle.php?funcao=TEMA2SLD&tema=" + retorno.tema + "&map_file=" + retorno.mapfile; | ||
197 | 248 | ||
198 | - html = Mustache.to_html( | ||
199 | - $("#templateLinks").html(), | ||
200 | - tradLinks | ||
201 | - ); | ||
202 | - $(".modal-body").html(html); | 249 | + arqs = retorno.arquivos.split(","); |
250 | + n = arqs.length; | ||
251 | + for (i=0; i<n; i++){ | ||
252 | + ins += "<p><a href='"+window.location.protocol+"//"+window.location.host+"/"+arqs[i]+"'>"+arqs[i]+"</a></p>"; | ||
253 | + } | ||
254 | + tradLinks["shp"] = ins; | ||
255 | + | ||
256 | + html = Mustache.to_html( | ||
257 | + $("#templateLinksDownload").html(), | ||
258 | + tradLinks | ||
259 | + ); | ||
260 | + tradLinks["shp"] = ""; | ||
261 | + tradLinks["mapfile"] = ""; | ||
262 | + tradLinks["sldurl"] = ""; | ||
263 | + | ||
264 | + $(".modal-body").html(html); | ||
265 | + } | ||
266 | + //obtem o shapefile e outros dados | ||
267 | + p = "../classesphp/mapa_controle.php?map_file=&funcao=download3&tema="+tema; | ||
268 | + //caso a camada venha do sistema de metadados estatisticos e seja uma variavel | ||
269 | + if(tipo == "meta"){ | ||
270 | + p = g_locaplic+"/classesphp/mapa_controle.php?map_file=&funcao=download3&id_medida_variavel="+tema; | ||
271 | + } | ||
272 | + cpJSON.call(p, "foo", r); | ||
273 | + } | ||
203 | } | 274 | } |
204 | \ No newline at end of file | 275 | \ No newline at end of file |
ogc/index.php
@@ -34,15 +34,24 @@ include "../init/head.php"; | @@ -34,15 +34,24 @@ include "../init/head.php"; | ||
34 | transform: rotate(90deg); | 34 | transform: rotate(90deg); |
35 | } | 35 | } |
36 | </style> | 36 | </style> |
37 | -<script id="templateLinks" type="x-tmpl-mustache"> | ||
38 | -<h3>{{{acesso}}}</h3> | 37 | +<script id="templateLinksOgc" type="x-tmpl-mustache"> |
38 | +<h3>OGC</h3> | ||
39 | +<p>{{{linkpagina}}}: <a href="{{{url}}}?temaOgc={{{tema}}}">{{{url}}}?temaOgc={{{tema}}}</a> | ||
39 | <p>{{{wstodas}}}: <a href="{{{servico}}}" target="_blank" >{{{servico}}}</a> | 40 | <p>{{{wstodas}}}: <a href="{{{servico}}}" target="_blank" >{{{servico}}}</a> |
40 | <p>{{{wscamada}}}: <a href="{{{servico}}}tema={{{tema}}}{{{id_medida_variavel}}}&" target="_blank" >{{{servico}}}tema={{{tema}}}{{{id_medida_variavel}}}&</a> | 41 | <p>{{{wscamada}}}: <a href="{{{servico}}}tema={{{tema}}}{{{id_medida_variavel}}}&" target="_blank" >{{{servico}}}tema={{{tema}}}{{{id_medida_variavel}}}&</a> |
41 | <p>{{{linkpagina}}}: <a href="{{{url}}}?temaOgc={{{tema}}}">{{{url}}}?temaOgc={{{tema}}}</a> | 42 | <p>{{{linkpagina}}}: <a href="{{{url}}}?temaOgc={{{tema}}}">{{{url}}}?temaOgc={{{tema}}}</a> |
43 | +<p><a href="{{{urli3geo}}}/fontetema.php?tema={{{tema}}}" target="_blank" >Metadata</a></p> | ||
42 | <p><a target=blank href="{{{servico}}}service=wms&version=1.1.1&request=getcapabilities&layers={{{tema}}}{{{id_medida_variavel}}}" >GetCapabilities</a> | 44 | <p><a target=blank href="{{{servico}}}service=wms&version=1.1.1&request=getcapabilities&layers={{{tema}}}{{{id_medida_variavel}}}" >GetCapabilities</a> |
43 | <p><a target=blank href="{{{servico}}}SRS=EPSG:4618&WIDTH=500&HEIGHT=500&BBOX=<?php echo $mapext;?>&FORMAT=image/png&service=wms&version=1.1.0&request=getmap&layers={{{tema}}}{{{id_medida_variavel}}}" >{{{getmap}}}</a> | 45 | <p><a target=blank href="{{{servico}}}SRS=EPSG:4618&WIDTH=500&HEIGHT=500&BBOX=<?php echo $mapext;?>&FORMAT=image/png&service=wms&version=1.1.0&request=getmap&layers={{{tema}}}{{{id_medida_variavel}}}" >{{{getmap}}}</a> |
44 | <p><a target=blank href="{{{servico}}}SRS=EPSG:4618&WIDTH=500&HEIGHT=500&BBOX=<?php echo $mapext;?>&FORMAT=image/png&service=wms&version=1.1.0&request=getlegendgraphic&layers={{{tema}}}{{{id_medida_variavel}}}" >{{{legenda}}}</a> | 46 | <p><a target=blank href="{{{servico}}}SRS=EPSG:4618&WIDTH=500&HEIGHT=500&BBOX=<?php echo $mapext;?>&FORMAT=image/png&service=wms&version=1.1.0&request=getlegendgraphic&layers={{{tema}}}{{{id_medida_variavel}}}" >{{{legenda}}}</a> |
45 | <p><a target=blank href="{{{servico}}}format=application/openlayers&bbox=<?php echo $mapext;?>&layers={{{tema}}}" >{{{vOl}}}</a> | 47 | <p><a target=blank href="{{{servico}}}format=application/openlayers&bbox=<?php echo $mapext;?>&layers={{{tema}}}" >{{{vOl}}}</a> |
48 | +</script> | ||
49 | +<script id="templateLinksDownload" type="x-tmpl-mustache"> | ||
50 | +<h3>Download</h3> | ||
51 | +<p>{{{linkpagina}}}: <a href="{{{url}}}?temaDownload={{{tema}}}">{{{url}}}?temaDownload={{{tema}}}</a> | ||
52 | +<p>{{{map}}}: <a href="{{{mapfile}}}" target="_blank" >{{{mapfile}}}</a></p> | ||
53 | +<p>{{{sld}}}: <a href="{{{sldurl}}}" target="_blank" >{{{sldurl}}}</a> | ||
54 | +<p><a href="{{{urli3geo}}}/fontetema.php?tema={{{tema}}}" target="_blank" >Metadata</a></p> | ||
46 | <p><a target=blank href="{{{servico}}}OUTPUTFORMAT=shape-zip&bbox=<?php echo $mapext;?>&service=wfs&version=1.1.0&request=getfeature&layers={{{tema}}}&typeName={{{tema}}}{{{id_medida_variavel}}}" >{{{downwfs}}}</a> | 55 | <p><a target=blank href="{{{servico}}}OUTPUTFORMAT=shape-zip&bbox=<?php echo $mapext;?>&service=wfs&version=1.1.0&request=getfeature&layers={{{tema}}}&typeName={{{tema}}}{{{id_medida_variavel}}}" >{{{downwfs}}}</a> |
47 | <p><a target=blank href="{{{servico}}}OUTPUTFORMAT=csv&bbox=<?php echo $mapext;?>&service=wfs&version=1.1.0&request=getfeature&layers={{{tema}}}{{{id_medida_variavel}}}&typeName={{{tema}}}&ows_geomtype=AS_WKT" >{{{downCgeo}}}</a> | 56 | <p><a target=blank href="{{{servico}}}OUTPUTFORMAT=csv&bbox=<?php echo $mapext;?>&service=wfs&version=1.1.0&request=getfeature&layers={{{tema}}}{{{id_medida_variavel}}}&typeName={{{tema}}}&ows_geomtype=AS_WKT" >{{{downCgeo}}}</a> |
48 | <p><a target=blank href="{{{servico}}}OUTPUTFORMAT=csv&bbox=<?php echo $mapext;?>&service=wfs&version=1.1.0&request=getfeature&layers={{{tema}}}{{{id_medida_variavel}}}&typeName={{{tema}}}&ows_geomtype=none" >{{{downSgeo}}}</a> | 57 | <p><a target=blank href="{{{servico}}}OUTPUTFORMAT=csv&bbox=<?php echo $mapext;?>&service=wfs&version=1.1.0&request=getfeature&layers={{{tema}}}{{{id_medida_variavel}}}&typeName={{{tema}}}&ows_geomtype=none" >{{{downSgeo}}}</a> |
@@ -50,20 +59,23 @@ include "../init/head.php"; | @@ -50,20 +59,23 @@ include "../init/head.php"; | ||
50 | <p><a target=blank href="{{{servico}}}OUTPUTFORMAT=kml&bbox=<?php echo $mapext;?>&service=wfs&version=1.1.0&request=getfeature&layers={{{tema}}}{{{id_medida_variavel}}}&typeName={{{tema}}}" >{{{kml}}}</a> | 59 | <p><a target=blank href="{{{servico}}}OUTPUTFORMAT=kml&bbox=<?php echo $mapext;?>&service=wfs&version=1.1.0&request=getfeature&layers={{{tema}}}{{{id_medida_variavel}}}&typeName={{{tema}}}" >{{{kml}}}</a> |
51 | <p><a target=blank href="{{{servico}}}OUTPUTFORMAT=geojson&bbox=<?php echo $mapext;?>&service=wfs&version=1.1.0&request=getfeature&layers={{{tema}}}{{{id_medida_variavel}}}&typeName={{{tema}}}" >GeoJson</a> | 60 | <p><a target=blank href="{{{servico}}}OUTPUTFORMAT=geojson&bbox=<?php echo $mapext;?>&service=wfs&version=1.1.0&request=getfeature&layers={{{tema}}}{{{id_medida_variavel}}}&typeName={{{tema}}}" >GeoJson</a> |
52 | <p><a target=blank href="../ferramentas/recline/default.php?tema={{{tema}}}{{{id_medida_variavel}}}" >{{{explore}}}</a> | 61 | <p><a target=blank href="../ferramentas/recline/default.php?tema={{{tema}}}{{{id_medida_variavel}}}" >{{{explore}}}</a> |
62 | +<h4>Shape file</h4> | ||
63 | +{{{shp}}} | ||
53 | </script> | 64 | </script> |
54 | <script id="templateCamadas" type="x-tmpl-mustache"> | 65 | <script id="templateCamadas" type="x-tmpl-mustache"> |
55 | <div class="list-group-item"> | 66 | <div class="list-group-item"> |
56 | - <div class="bs-component btn-group-sm pull-left" data-toggle="modal" data-target="#modalCamada" onclick="mostraLinksServico('{{codigo_tema}}','{{tipo}}')"> | ||
57 | - <a class="btn btn-primary btn-fab" href="#"> | 67 | + <div class="bs-component btn-group-sm pull-left" data-toggle="modal" data-target="#modalCamada" > |
68 | + <a onclick="mostraLinksServico('{{codigo_tema}}','{{tipo}}','{{disabledogc}}')" class="btn btn-primary btn-fab {{disabledogc}}" href="#"> | ||
58 | <i class="material-icons">launch</i> | 69 | <i class="material-icons">launch</i> |
59 | </a> | 70 | </a> |
71 | + <a onclick="mostraLinksDownload('{{codigo_tema}}','{{tipo}}','{{disableddown}}')" class="btn btn-primary btn-fab {{disableddown}}" href="#"> | ||
72 | + <i class="material-icons">file_download</i> | ||
73 | + </a> | ||
60 | </div> | 74 | </div> |
61 | - <div class="row-content" style="margin-left: 10px;" > | ||
62 | - <h4 class="list-group-item-heading"> | ||
63 | - {{{nome_tema}}}{{{nome}}} | ||
64 | - <a class="{{hidden}}" href="{{link_tema}}{{link}}" target="_blank"><i class="fa fa-link"></i></a> | ||
65 | - </h4> | ||
66 | - </div> | 75 | + <h4> |
76 | + {{{nome_tema}}}{{{nome}}} | ||
77 | + <a class="{{hidden}}" href="{{link_tema}}{{link}}" target="_blank"><i class="fa fa-link"></i></a> | ||
78 | + </h4> | ||
67 | </div> | 79 | </div> |
68 | <div class="list-group-separator"></div> | 80 | <div class="list-group-separator"></div> |
69 | </script> | 81 | </script> |
@@ -207,9 +219,6 @@ include "../init/head.php"; | @@ -207,9 +219,6 @@ include "../init/head.php"; | ||
207 | <div id="modalCamada" class="modal fade" tabindex="-1" role="dialog"> | 219 | <div id="modalCamada" class="modal fade" tabindex="-1" role="dialog"> |
208 | <div class="modal-dialog"> | 220 | <div class="modal-dialog"> |
209 | <div class="modal-content"> | 221 | <div class="modal-content"> |
210 | - <div class="modal-header"> | ||
211 | - <h4 class="modal-title">OGC</h4> | ||
212 | - </div> | ||
213 | <div class="modal-body"></div> | 222 | <div class="modal-body"></div> |
214 | <div class="modal-footer" style="padding: 0px;padding-right: 15px; border: 0px; background-color: white;"> | 223 | <div class="modal-footer" style="padding: 0px;padding-right: 15px; border: 0px; background-color: white;"> |
215 | <a class="btn btn-primary" href="#" role="button" data-dismiss="modal" aria-label="Close"> | 224 | <a class="btn btn-primary" href="#" role="button" data-dismiss="modal" aria-label="Close"> |
@@ -238,6 +247,7 @@ include "../init/head.php"; | @@ -238,6 +247,7 @@ include "../init/head.php"; | ||
238 | tradLinks = i3GEO.idioma.objetoIdioma(g_traducao_ogc); | 247 | tradLinks = i3GEO.idioma.objetoIdioma(g_traducao_ogc); |
239 | tradLinks["servico"] = servico; | 248 | tradLinks["servico"] = servico; |
240 | tradLinks["url"] = window.location.href.split("?")[0]; | 249 | tradLinks["url"] = window.location.href.split("?")[0]; |
250 | + tradLinks["urli3geo"] = window.location.href.split("/ogc")[0]; | ||
241 | //traducao do menu nav | 251 | //traducao do menu nav |
242 | html = Mustache.to_html( | 252 | html = Mustache.to_html( |
243 | $("#menuTpl").html(), | 253 | $("#menuTpl").html(), |
@@ -277,6 +287,20 @@ include "../init/head.php"; | @@ -277,6 +287,20 @@ include "../init/head.php"; | ||
277 | } | 287 | } |
278 | $("#modalCamada").modal('show'); | 288 | $("#modalCamada").modal('show'); |
279 | } | 289 | } |
290 | + var temp = window.location.href.split("temaDownload="); | ||
291 | + if(temp[1]){ | ||
292 | + var temaDownload = temp[1]; | ||
293 | + temaDownload = temaDownload.split("&"); | ||
294 | + temaDownload = temaDownload[0]; | ||
295 | + //verifica se eh metaestat | ||
296 | + if(temaDownload.split("_")[0] == "metaestat"){ | ||
297 | + mostraLinksDownload(temaDownload.split("_")[1],"meta") | ||
298 | + } | ||
299 | + else{ | ||
300 | + mostraLinksDownload(temaDownload,"tema") | ||
301 | + } | ||
302 | + $("#modalCamada").modal('show'); | ||
303 | + } | ||
280 | }); | 304 | }); |
281 | </script> | 305 | </script> |
282 | </body> | 306 | </body> |