Commit caa8e1e4699bc2678efdca47efa65c184a939ea3

Authored by Edmar Moretti
1 parent b2625cea

Opção para filtrar a lista de mapfiles no editor de mapfiles

admin/admin.db
No preview for this file type
admin/html/editormapfile.html
... ... @@ -107,22 +107,43 @@ i3geo/admin/html/editormapfile.html
107 107 </script>
108 108  
109 109 <script>
110   -YAHOO.util.Event.addListener(window, "load", initMenu);
  110 +
111 111 var letras = "Todos A B C D E F G H I J K L M N O P Q R S T U V X Y Z _ 1 2 3 4 5 6 7 8 9".split(" "),
112 112 nletras = letras.length,
  113 + letraAtual = "Todos",
113 114 i,
114   - ins = "<p>";
  115 + ins = "";
  116 +
  117 +ins += "<br>Filtrar: " +
  118 + "<select id='selFiltro' onchange='filtraLetra(\""+letraAtual+"\")' >" +
  119 + "<option value='' >----</option>"+
  120 + "<option value='link_tema,=,' >Sem fonte</option>"+
  121 + "<option value='download_tema,=,nao' >Não permite download</option>"+
  122 + "<option value='download_tema,=,sim' >Permite download</option>"+
  123 + "<option value='download_tema,=,nao' >Não permite download</option>"+
  124 + "<option value='ogc_tema,=,sim' >Permite WMS</option>"+
  125 + "<option value='ogc_tema,=,nao' >Não permite WMS</option>"+
  126 + "<option value='kml_tema,=,sim' >Permite KML</option>"+
  127 + "<option value='kml_tema,=,nao' >Não permite KML</option>"+
  128 + "<option value='kmz_tema,=,sim' >Permite KMZ</option>"+
  129 + "<option value='kmz_tema,=,nao' >Não permite KMZ</option>"+
  130 + "</select>";
  131 +ins += "<br><input onclick='filtraLetra(\""+letraAtual+"\")' type=checkbox id=mostraMini />Mostra a miniatura se houver"
  132 +
  133 +ins += "<p>";
115 134 for(i=0;i<nletras;i++){
116 135 ins += "<span onclick='filtraLetra(\""+letras[i]+"\")' style='color:blue;cursor:pointer'>"+letras[i]+" </span>";
117   -}
118   -document.getElementById("letras").innerHTML = ins+ " <input onclick='filtraLetra(\"\")' type=checkbox id=mostraMini />Mostra a miniatura se houver";
  136 +}
  137 +document.getElementById("letras").innerHTML = ins;
119 138  
120 139 function filtraLetra(letra){
  140 + letraAtual = letra;
121 141 document.getElementById("tabela").innerHTML = "<span style=color:red >Aguarde...</span>";
122 142 if(letra == "Todos")
123 143 {letra = "";}
124   - core_pegaMapfiles("montaArvore()",letra)
  144 + core_pegaMapfiles("montaArvore()",letra,document.getElementById("selFiltro").value);
125 145 }
126 146 cabecalhoGeral("cabecalhoPrincipal","editormapfile");
  147 +YAHOO.util.Event.addListener(window, "load", initMenu);
127 148 </script>
128 149 </body>
... ...
admin/js/core.js
... ... @@ -423,17 +423,24 @@ Parameters:
423 423 funcao - (opcional) nome da funcao que será executada ao terminar a busca pelos dados
424 424  
425 425 letra - (opcional) letra inicial utilizada para filtrar a lista
  426 +
  427 +filtro - (opcional) string com o filtro, por exemplo, "'download_tema' = 'SIM'"
426 428 */
427   -function core_pegaMapfiles(funcaoM,letra)
  429 +function core_pegaMapfiles(funcaoM,letra,filtro)
428 430 {
429 431 if(arguments.length == 0){
430 432 var funcao = "";
431 433 var letra = "";
  434 + var filtro = "";
432 435 }
433 436 if(arguments.length == 1){
434 437 var letra = "";
  438 + var filtro = "";
  439 + }
  440 + if(arguments.length == 2){
  441 + var filtro = "";
435 442 }
436   - var sUrl = "../php/menutemas.php?funcao=listaMapsTemas&letra="+letra;
  443 + var sUrl = "../php/menutemas.php?funcao=listaMapsTemas&letra="+letra+"&filtro="+filtro;
437 444 var callbackM =
438 445 {
439 446 success:function(o)
... ...
admin/php/menutemas.php
... ... @@ -1094,7 +1094,7 @@ Retorna a lista de mapfiles do diretorio i3geo/temas
1094 1094 */
1095 1095 function listaMapsTemas()
1096 1096 {
1097   - global $cp,$locaplic,$letra;
  1097 + global $cp,$locaplic,$letra,$filtro;
1098 1098 $arquivos = array();
1099 1099 if (is_dir($locaplic."/temas"))
1100 1100 {
... ... @@ -1122,14 +1122,24 @@ function listaMapsTemas()
1122 1122 //
1123 1123 //pega o nome de cada tema
1124 1124 //
1125   - $sql = "select nome_tema,codigo_tema from i3geoadmin_temas ";
  1125 + $sql = "select * from i3geoadmin_temas ";
  1126 + if(isset($filtro) && $filtro != "")
  1127 + {
  1128 + $filtro = explode(",",$filtro);
  1129 + $filtro = $filtro[0]." ".$filtro[1]." '".$filtro[2]."' or ".$filtro[0]." ".$filtro[1]." '".strtoupper($filtro[2])."'";
  1130 + $sql .= "where $filtro";
  1131 + }
  1132 +
1126 1133 $dbh = "";
1127 1134 include($locaplic."/admin/php/conexao.php");
1128 1135 $q = $dbh->query($sql,PDO::FETCH_ASSOC);
1129 1136 $regs = $q->fetchAll();
  1137 + //echo $sql;exit;
1130 1138 $nomes = array();
1131   - foreach($regs as $reg)
1132   - {$nomes[$reg["codigo_tema"]] = $reg["nome_tema"];}
  1139 + foreach($regs as $reg){
  1140 + $nomes[$reg["codigo_tema"]] = $reg["nome_tema"];
  1141 + //$outros[$reg["codigo_tema"]] = array("kmz"=>$reg["kmz_tema"],"kml"=>$reg["kml_tema"],"ogc"=>$reg["ogc_tema"],"download"=>$reg["download_tema"],"link"=>$reg["link_tema"]);
  1142 + }
1133 1143 $lista = array();
1134 1144 foreach($arquivos as $arq)
1135 1145 {
... ... @@ -1140,7 +1150,10 @@ function listaMapsTemas()
1140 1150 $imagem = "";
1141 1151 if(file_exists($locaplic."/temas/miniaturas/".$arq.".map.mini.png"))
1142 1152 {$imagem = $arq.".map.mini.png";}
1143   - $lista[] = array("nome"=>$n,"codigo"=>$arq,"imagem"=>$imagem);
  1153 + if(isset($filtro) && $filtro != "" && $n != "")
  1154 + {$lista[] = array("nome"=>$n,"codigo"=>$arq,"imagem"=>$imagem);}
  1155 + if(!isset($filtro) || $filtro == "")
  1156 + {$lista[] = array("nome"=>$n,"codigo"=>$arq,"imagem"=>$imagem);}
1144 1157 }
1145 1158 return $lista;
1146 1159 }
... ...
temas/acidmap.map
... ... @@ -5,22 +5,22 @@ MAP
5 5 CONNECTION "http://localhost:8080/geoserver/wms?VALUE_COLUMN=VALOR&SERVICE=AMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&FORMAT=image/png&EXCEPTIONS=application/vnd.ogc.se_inimage&TILED=true&TRANSPARENT=FALSE&VALUE_COLUMN=value&SIMPLIFY_METHOD=1&SIMPLIFY_SIZE=400&INTERVALS[]=10,20,45,70,100&INTERVALS_COLORS[]=0xffffff00,0xffb2,0xff00b2,0xffff00b2,0xff0000b2&RENDERER_TYPE=2&INTERPOLATION_STRATEGY=2&RADIUS=32"
6 6 CONNECTIONTYPE WMS
7 7 METADATA
8   - "tipooriginal" ""
9 8 "wms_srs" "EPSG:4326"
  9 + "tipooriginal" ""
10 10 "wms_exceptions_format" "application/vnd.ogc.se_xml"
11 11 "CLASSE" "SIM"
12   - "permitekmz" "nao"
13 12 "wfs" "nao"
14   - "TEXTO" "NAO"
  13 + "permitekmz" "nao"
15 14 "wms_force_separate_request" "1"
16   - "wms_name" "i3geo:locali"
  15 + "TEXTO" "NAO"
17 16 "formatosinfo" "text/plain,application/vnd.ogc.gml,text/html"
  17 + "wms_name" "i3geo:locali"
18 18 "nomeoriginal" "i3geo:locali"
19 19 "permitedownload" "sim"
20   - "wms_formatlist" "image/png,application/atom xml,application/atom xml,application/openlayers,application/pdf,application/rss xml,application/rss xml,application/vnd.google-earth.kml,application/vnd.google-earth.kml xml,application/vnd.google-earth.kml xml,application/vnd.google-earth.kmz,application/vnd.google-earth.kmz xml,application/vnd.google-earth.kmz xml,atom,image/geotiff,image/geotiff8,image/gif,image/jpeg,image/png8,image/svg,image/svg xml,image/svg xml,image/tiff,image/tiff8,kml,kmz,openlayers,rss"
21 20 "wms_format" "image/png"
22   - "permitekml" "sim"
  21 + "wms_formatlist" "image/png,application/atom xml,application/atom xml,application/openlayers,application/pdf,application/rss xml,application/rss xml,application/vnd.google-earth.kml,application/vnd.google-earth.kml xml,application/vnd.google-earth.kml xml,application/vnd.google-earth.kmz,application/vnd.google-earth.kmz xml,application/vnd.google-earth.kmz xml,atom,image/geotiff,image/geotiff8,image/gif,image/jpeg,image/png8,image/svg,image/svg xml,image/svg xml,image/tiff,image/tiff8,kml,kmz,openlayers,rss"
23 22 "permiteogc" "sim"
  23 + "permitekml" "sim"
24 24 "tema" "Acid Maps"
25 25 "wms_server_version" "1.1.1"
26 26 "wms_style" ""
... ...
temas/geopr_ana_federais.map
... ... @@ -3,55 +3,55 @@ MAP
3 3 CONNECTION "http://200.140.135.184/cgi-bin/mapserv?map=/usr/local/www/apache22/data/hidro/wshidro.map"
4 4 CONNECTIONTYPE WMS
5 5 METADATA
6   - "wms_proxy_password" ""
7 6 "wms_srs" "EPSG:4291"
  7 + "wms_proxy_password" ""
8 8 "wms_exceptions_format" "application/vnd.ogc.se_xml"
9   - "wms_auth_type" ""
10   - "ltempoitemimagem" ""
11 9 "cache" ""
12   - "ltempoitemdescricao" ""
  10 + "ltempoitemimagem" ""
  11 + "wms_auth_type" ""
13 12 "CLASSE" "SIM"
  13 + "ltempoitemdescricao" ""
14 14 "wms_latlonboundingbox" ""
15   - "ltempoiteminicio" ""
16 15 "palletestep" ""
17   - "ltempoitemtip" ""
18   - "permitekmz" "nao"
  16 + "ltempoiteminicio" ""
19 17 "wfs" "nao"
20   - "iconetema" ""
21   - "ltempoitemtitulo" ""
  18 + "permitekmz" "nao"
  19 + "ltempoitemtip" ""
22 20 "description_template" ""
  21 + "ltempoitemtitulo" ""
  22 + "iconetema" ""
23 23 "ltempoitemlink" ""
24   - "wms_transparent" ""
25   - "wms_force_separate_request" "1"
26 24 "TEXTO" "NAO"
27   - "wms_sld_url" ""
28   - "legendawms" "http://200.140.135.184/cgi-bin/mapserv?map=/usr/local/www/apache22/data/hidro/wshidro.map&service=wms&request=getlegendgraphic&version=1.1.1&service=wms&layer=rios_federais&format=image/png"
29   - "formatosinfo" "text/plain,application/vnd.ogc.gml"
  25 + "wms_force_separate_request" "1"
  26 + "wms_transparent" ""
30 27 "wms_name" "rios_federais"
  28 + "formatosinfo" "text/plain,application/vnd.ogc.gml"
  29 + "legendawms" "http://200.140.135.184/cgi-bin/mapserv?map=/usr/local/www/apache22/data/hidro/wshidro.map&service=wms&request=getlegendgraphic&version=1.1.1&service=wms&layer=rios_federais&format=image/png"
  30 + "wms_sld_url" ""
31 31 "palletefile" ""
  32 + "permitedownload" "nao"
32 33 "ltempoformatodata" ""
33   - "permitedownload" "sim"
34   - "wms_time" ""
35   - "permitecomentario" ""
36 34 "ltempoitemicone" ""
37   - "wms_proxy_username" ""
  35 + "permitecomentario" ""
  36 + "wms_time" ""
38 37 "wms_auth_username" ""
39   - "wms_format" "image/png"
  38 + "wms_proxy_username" ""
40 39 "wms_formatlist" "image/gif,image/png,image/png; mode=24bit,image/jpeg,image/wbmp,image/tiff"
  40 + "wms_format" "image/png"
41 41 "wms_proxy_auth_type" ""
42   - "wms_sld_body" ""
43 42 "wms_proxy_host" ""
44   - "wms_proxy_type" ""
45   - "arquivodownload" ""
  43 + "wms_sld_body" ""
46 44 "wms_connectiontimeout" "30"
47   - "permitekml" "sim"
  45 + "arquivodownload" ""
  46 + "wms_proxy_type" ""
48 47 "permiteogc" "sim"
49   - "wms_bgcolor" ""
  48 + "permitekml" "sim"
  49 + "TEMA" "geopr_ana_federais"
50 50 "wms_proxy_port" ""
51   - "TEMA" "Rios Federais"
52   - "wms_auth_password" ""
53   - "editorsql" ""
  51 + "wms_bgcolor" ""
54 52 "wms_server_version" "1.1.1"
  53 + "editorsql" ""
  54 + "wms_auth_password" ""
55 55 "ltempoitemfim" ""
56 56 "wms_style" "default"
57 57 END
... ...
temas/geopr_aneel_termeletricas.map
1   -MAP
2   -
3   -
4   -SYMBOLSET ../symbols/simbolos.sym
5   -FONTSET "../symbols/fontes.txt"
6   -LAYER
  1 +MAP
  2 + FONTSET "../symbols/fontes.txt"
  3 + SYMBOLSET "../symbols/simbolos.sym"
  4 + LAYER
7 5 CONNECTION "http://sigel.aneel.gov.br/wmsconnector/com.esri.wms.Esrimap/gsiwms?"
8 6 CONNECTIONTYPE WMS
9 7 DATA ""
10   - METADATA
11   - "wms_srs" "EPSG:4326"
12   - "wms_exceptions_format" "application/vnd.ogc.se_xml"
13   - "CLASSE" "SIM"
14   - "wfs" "nao"
15   - "TEXTO" "NAO"
16   - "wms_force_separate_request" "1"
17   - "wms_name" "6"
18   - "formatosinfo" "application/vnd.ogc.wms_xml,text/xml,text/html,text/plain"
19   - "legendawms" "http://sigel.aneel.gov.br/wmsconnector/com.esri.wms.Esrimap/gsiwms?&service=wms&request=getlegendgraphic&version=1.1.1&service=wms&layer=6&format=image/png"
20   - "wms_formatlist" "image/png,image/jpeg"
21   - "wms_format" "image/png"
22   - "wms_connectiontimeout" "30"
23   - "TEMA" "Usinas termelétricas"
24   - "wms_server_version" "1.1.1"
25   - "wms_style" "default"
26   - END
  8 + METADATA
  9 + "wms_srs" "EPSG:4326"
  10 + "wms_exceptions_format" "application/vnd.ogc.se_xml"
  11 + "CLASSE" "SIM"
  12 + "permitekmz" ""
  13 + "wfs" "nao"
  14 + "wms_force_separate_request" "1"
  15 + "TEXTO" "NAO"
  16 + "legendawms" "http://sigel.aneel.gov.br/wmsconnector/com.esri.wms.Esrimap/gsiwms?&service=wms&request=getlegendgraphic&version=1.1.1&service=wms&layer=6&format=image/png"
  17 + "formatosinfo" "application/vnd.ogc.wms_xml,text/xml,text/html,text/plain"
  18 + "wms_name" "6"
  19 + "permitedownload" "nao"
  20 + "wms_format" "image/png"
  21 + "wms_formatlist" "image/png,image/jpeg"
  22 + "wms_connectiontimeout" "30"
  23 + "permitekml" ""
  24 + "permiteogc" ""
  25 + "TEMA" "Usinas termelétricas"
  26 + "wms_server_version" "1.1.1"
  27 + "wms_style" "default"
  28 + END
27 29 NAME "geopr_aneel_termeletricas"
28 30 OFFSITE 255 255 255
29   - SIZEUNITS PIXELS
30 31 STATUS DEFAULT
31 32 TOLERANCE 0
32   - TOLERANCEUNITS PIXELS
33 33 TYPE RASTER
34 34 UNITS METERS
35 35 CLASS
36 36 NAME " "
37   - METADATA
38   - END
39 37 END
40 38 END
  39 +
41 40 END
  41 +
... ...