Commit 2bfaea027b0c3b2385b243471c8a8ec1d8ef2d7c

Authored by Edmar Moretti
1 parent 57073bd2

Metadata legendaimg

admin/admin.db
No preview for this file type
admin/html/editormapfile.html
@@ -46,6 +46,8 @@ @@ -46,6 +46,8 @@
46 <br><br> 46 <br><br>
47 Além de criar os mapfiles, é necessário definir as características de cada LAYER nas opções abaixo. 47 Além de criar os mapfiles, é necessário definir as características de cada LAYER nas opções abaixo.
48 <br> 48 <br>
  49 +Para incluir o tema nos menus, <a href='arvore.html' >edite a árvore de temas </a>
  50 +<br>
49 <div id="letras" ></div> 51 <div id="letras" ></div>
50 <p>Mapfiles (arquivos .map existentes no diretório i3geo/temas):</p> 52 <p>Mapfiles (arquivos .map existentes no diretório i3geo/temas):</p>
51 <div id="tabela" style="left:-5px;"></div> 53 <div id="tabela" style="left:-5px;"></div>
admin/js/editormapfile.js
@@ -1175,6 +1175,8 @@ function montaEditorMetadados(dados) @@ -1175,6 +1175,8 @@ function montaEditorMetadados(dados)
1175 titulo:"Permite comentar (PERMITECOMENTARIO)",id:"",value:dados.permitecomentario,tipo:"text",div:"<div id=cPermitecomentario ></div>"}, 1175 titulo:"Permite comentar (PERMITECOMENTARIO)",id:"",value:dados.permitecomentario,tipo:"text",div:"<div id=cPermitecomentario ></div>"},
1176 {ajuda:"Indica se as classes serão mostradas ou não na legenda. Por padrão é SIM. ", 1176 {ajuda:"Indica se as classes serão mostradas ou não na legenda. Por padrão é SIM. ",
1177 titulo:"Classe (CLASSE)",id:"",value:dados.classe,tipo:"text",div:"<div id=cClasse ></div>"}, 1177 titulo:"Classe (CLASSE)",id:"",value:dados.classe,tipo:"text",div:"<div id=cClasse ></div>"},
  1178 + {ajuda:"URL de uma imagem que será utilizada em substituição à geração normal da legenda ",
  1179 + titulo:"URL da legenda (opcional) (LEGENDAIMG)",id:"legendaimg",value:dados.legendaimg,tipo:"text"},
1178 {ajuda:"Indica se o tema é mostrado no mapa mas não nas listas da legenda e na guia 'temas'", 1180 {ajuda:"Indica se o tema é mostrado no mapa mas não nas listas da legenda e na guia 'temas'",
1179 titulo:"Escondido (ESCONDIDO)",id:"",value:dados.escondido,tipo:"text",div:"<div id=cEscondido ></div>"}, 1181 titulo:"Escondido (ESCONDIDO)",id:"",value:dados.escondido,tipo:"text",div:"<div id=cEscondido ></div>"},
1180 {ajuda:"Indica se o tema irá ser mostrado na ferramenta de identificação", 1182 {ajuda:"Indica se o tema irá ser mostrado na ferramenta de identificação",
@@ -1656,7 +1658,7 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, @@ -1656,7 +1658,7 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo,
1656 else 1658 else
1657 {alert("Valor de escala incorreto");return;} 1659 {alert("Valor de escala incorreto");return;}
1658 } 1660 }
1659 - var campos = new Array("wms_srs","wms_name","wms_server_version","wms_format","wms_auth_username","wms_auth_password","wms_auth_type","wms_connectiontimeout","wms_latlonboundingbox","wms_proxy_auth_type","wms_proxy_host","wms_proxy_port","wms_proxy_type","wms_proxy_username","wms_proxy_password","wms_sld_body","wms_sld_url","wms_style","wms_bgcolor","wms_transparent","wms_time","permitecomentario","cache","iconetema","ltempoformatodata","ltempoiteminicio","ltempoitemfim","ltempoitemtitulo","ltempoitemdescricao","ltempoitemtip","ltempoitemimagem","ltempoitemicone","ltempoitemlink","editorsql","description_template","palletefile","palletestep","arquivodownload","aplicaextensao","classestamanho","classessimbolo","classescor","classesnome","classesitem","mensagem","identifica","transitioneffect","extensao","escondido","download","escala","tema","classe","tip","itenslink","itens","itensdesc") 1661 + var campos = new Array("legendaimg","wms_srs","wms_name","wms_server_version","wms_format","wms_auth_username","wms_auth_password","wms_auth_type","wms_connectiontimeout","wms_latlonboundingbox","wms_proxy_auth_type","wms_proxy_host","wms_proxy_port","wms_proxy_type","wms_proxy_username","wms_proxy_password","wms_sld_body","wms_sld_url","wms_style","wms_bgcolor","wms_transparent","wms_time","permitecomentario","cache","iconetema","ltempoformatodata","ltempoiteminicio","ltempoitemfim","ltempoitemtitulo","ltempoitemdescricao","ltempoitemtip","ltempoitemimagem","ltempoitemicone","ltempoitemlink","editorsql","description_template","palletefile","palletestep","arquivodownload","aplicaextensao","classestamanho","classessimbolo","classescor","classesnome","classesitem","mensagem","identifica","transitioneffect","extensao","escondido","download","escala","tema","classe","tip","itenslink","itens","itensdesc")
1660 var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer 1662 var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer
1661 var prog = "../php/editormapfile.php?funcao=alterarMetadados" 1663 var prog = "../php/editormapfile.php?funcao=alterarMetadados"
1662 } 1664 }
admin/php/editormapfile.php
@@ -1339,6 +1339,7 @@ function pegaMetadados() @@ -1339,6 +1339,7 @@ function pegaMetadados()
1339 $dados["ltempoitemlink"] = $layer->getmetadata("ltempoitemlink"); 1339 $dados["ltempoitemlink"] = $layer->getmetadata("ltempoitemlink");
1340 $dados["iconetema"] = $layer->getmetadata("iconetema"); 1340 $dados["iconetema"] = $layer->getmetadata("iconetema");
1341 $dados["permitecomentario"] = $layer->getmetadata("permitecomentario"); 1341 $dados["permitecomentario"] = $layer->getmetadata("permitecomentario");
  1342 + $dados["legendaimg"] = $layer->getmetadata("legendaimg");
1342 if($layer->connectiontype == 7 || $layer->connectiontype== 9){ 1343 if($layer->connectiontype == 7 || $layer->connectiontype== 9){
1343 $dados["wms_srs"] = $layer->getmetadata("wms_srs"); 1344 $dados["wms_srs"] = $layer->getmetadata("wms_srs");
1344 $dados["wms_name"] = $layer->getmetadata("wms_name"); 1345 $dados["wms_name"] = $layer->getmetadata("wms_name");
@@ -1366,7 +1367,7 @@ function pegaMetadados() @@ -1366,7 +1367,7 @@ function pegaMetadados()
1366 } 1367 }
1367 function alterarMetadados() 1368 function alterarMetadados()
1368 { 1369 {
1369 - global $wms_srs,$wms_name,$wms_server_version,$wms_format,$wms_auth_username,$wms_auth_password,$wms_auth_type,$wms_connectiontimeout,$wms_latlonboundingbox,$wms_proxy_auth_type,$wms_proxy_host,$wms_proxy_port,$wms_proxy_type,$wms_proxy_username,$wms_proxy_password,$wms_sld_body,$wms_sld_url,$wms_style,$wms_bgcolor,$wms_transparent,$wms_time,$permitecomentario,$iconetema,$ltempoformatodata,$ltempoiteminicio,$ltempoitemfim,$ltempoitemtitulo,$ltempoitemdescricao,$ltempoitemtip,$ltempoitemimagem,$ltempoitemicone,$ltempoitemlink,$description_template,$palletestep,$palletefile,$arquivodownload,$codigoMap,$codigoLayer,$locaplic,$aplicaextensao,$classestamanho,$classessimbolo,$classescor,$classesnome,$classesitem,$mensagem,$identifica,$transitioneffect,$extensao,$escondido,$download,$escala,$tema,$classe,$tip,$itenslink,$itens,$itensdesc,$editorsql,$cache; 1370 + global $legendaimg,$wms_srs,$wms_name,$wms_server_version,$wms_format,$wms_auth_username,$wms_auth_password,$wms_auth_type,$wms_connectiontimeout,$wms_latlonboundingbox,$wms_proxy_auth_type,$wms_proxy_host,$wms_proxy_port,$wms_proxy_type,$wms_proxy_username,$wms_proxy_password,$wms_sld_body,$wms_sld_url,$wms_style,$wms_bgcolor,$wms_transparent,$wms_time,$permitecomentario,$iconetema,$ltempoformatodata,$ltempoiteminicio,$ltempoitemfim,$ltempoitemtitulo,$ltempoitemdescricao,$ltempoitemtip,$ltempoitemimagem,$ltempoitemicone,$ltempoitemlink,$description_template,$palletestep,$palletefile,$arquivodownload,$codigoMap,$codigoLayer,$locaplic,$aplicaextensao,$classestamanho,$classessimbolo,$classescor,$classesnome,$classesitem,$mensagem,$identifica,$transitioneffect,$extensao,$escondido,$download,$escala,$tema,$classe,$tip,$itenslink,$itens,$itensdesc,$editorsql,$cache;
1370 $dados = array(); 1371 $dados = array();
1371 $mapfile = $locaplic."/temas/".$codigoMap.".map"; 1372 $mapfile = $locaplic."/temas/".$codigoMap.".map";
1372 $mapa = ms_newMapObj($mapfile); 1373 $mapa = ms_newMapObj($mapfile);
@@ -1408,6 +1409,7 @@ function alterarMetadados() @@ -1408,6 +1409,7 @@ function alterarMetadados()
1408 $layer->setmetadata("ltempoitemlink",$ltempoitemlink); 1409 $layer->setmetadata("ltempoitemlink",$ltempoitemlink);
1409 $layer->setmetadata("iconetema",$iconetema); 1410 $layer->setmetadata("iconetema",$iconetema);
1410 $layer->setmetadata("permitecomentario",$permitecomentario); 1411 $layer->setmetadata("permitecomentario",$permitecomentario);
  1412 + $layer->setmetadata("legendaimg",$legendaimg);
1411 if($layer->connectiontype == 7 || $layer->connectiontype== 9){ 1413 if($layer->connectiontype == 7 || $layer->connectiontype== 9){
1412 $layer->setmetadata("wms_srs",$wms_srs); 1414 $layer->setmetadata("wms_srs",$wms_srs);
1413 $layer->setmetadata("wms_name",$wms_name); 1415 $layer->setmetadata("wms_name",$wms_name);
aplicmap/legenda.htm
1 -[leg_layer_html opt_flag=1]<table class=legendatemas cellspacing=0 width=248 >[if name=TEMA oper=neq value=NAO]<table [if name=CLASSE oper=eq value=NAO] style=display:none; [/if] ><tr><td style=text-align:left ><b><span class=legendaTema ><input value="[leg_layer_name]" name="layer" onclick="i3GEO.mapa.legendaHTML.ativaDesativaTema(this)" type=checkbox checked class=inputsb style=cursor:pointer >&nbsp;[metadata name=TEMA]</span></b><br> </td></tr>[if name=legendawms oper=isset ]<tr><td style=text-align:left ><img src='[metadata name=legendawms]' /></td></tr>[/if]</table>[/if][/leg_layer_html][leg_class_html][if name=CLASSE oper=neq value=NAO]<table ><tr><td colspan=2 width=22 >&nbsp;<img src=[leg_icon width=16 height=16 ] /></td><td width=210 style=text-align:left; ><span style=font-size:9px >[leg_class_name]</span></td></tr></table>[/if]</table>[/leg_class_html]  
2 \ No newline at end of file 1 \ No newline at end of file
  2 +[leg_layer_html opt_flag=1]<table class=legendatemas cellspacing=0 width=248 >[if name=TEMA oper=neq value=NAO]<table [if name=CLASSE oper=eq value=NAO] style=display:none; [/if] ><tr><td style=text-align:left ><b><span class=legendaTema ><input value="[leg_layer_name]" name="layer" onclick="i3GEO.mapa.legendaHTML.ativaDesativaTema(this)" type=checkbox checked class=inputsb style=cursor:pointer >&nbsp;[metadata name=TEMA]</span></b><br> </td></tr>[if name=legendawms oper=isset ]<tr><td style=text-align:left ><img src='[metadata name=legendawms]' /></td></tr>[/if][if name=legendaimg oper=isset ]<tr><td style=text-align:left ><img src='[metadata name=legendaimg]' /></td></tr>[/if]</table>[/if][/leg_layer_html][leg_class_html][if name=CLASSE oper=neq value=NAO]<table ><tr><td colspan=2 width=22 >&nbsp;<img src=[leg_icon width=16 height=16 ] /></td><td width=210 style=text-align:left; ><span style=font-size:9px >[leg_class_name]</span></td></tr></table>[/if]</table>[/leg_class_html]
3 \ No newline at end of file 3 \ No newline at end of file
classesphp/classe_legenda.php
@@ -172,6 +172,8 @@ function: criaLegenda @@ -172,6 +172,8 @@ function: criaLegenda
172 172
173 Gera a legenda processando o template HTML definido na construção da classe. 173 Gera a legenda processando o template HTML definido na construção da classe.
174 174
  175 +Se o tema for um WMS ou se o metadata legendaimg estiver definido, executa $this->tabelaLegenda
  176 +
175 Return: 177 Return:
176 178
177 string com a legenda HTML 179 string com a legenda HTML
@@ -182,9 +184,9 @@ string com a legenda HTML @@ -182,9 +184,9 @@ string com a legenda HTML
182 $numlayers = $this->mapa->numlayers; 184 $numlayers = $this->mapa->numlayers;
183 if($this->nome != "") 185 if($this->nome != "")
184 { 186 {
185 - //verifica se é wms 187 + //verifica se é wms ou se o metadata legendaimg está definido
186 $c = $this->layer->connectiontype; 188 $c = $this->layer->connectiontype;
187 - if (($c == 7)) 189 + if ($c == 7 || $this->layer->getmetadata("legendaimg") != "")
188 { 190 {
189 return($this->tabelaLegenda()); 191 return($this->tabelaLegenda());
190 } 192 }
@@ -281,17 +283,22 @@ array @@ -281,17 +283,22 @@ array
281 //verifica se é wms ou wfs 283 //verifica se é wms ou wfs
282 $c = $layer->connectiontype; 284 $c = $layer->connectiontype;
283 $s = $layer->getmetadata("wms_sld_url"); 285 $s = $layer->getmetadata("wms_sld_url");
284 - if (($c == 7)) 286 + $im = $layer->getmetadata("legendaimg");
  287 + if ($c == 7 || $im != "")
285 { 288 {
286 - $con = $layer->connection;  
287 - $ver = $layer->getmetadata("wms_server_version");  
288 - $lwms = $layer->getmetadata("wms_name");  
289 - $f = $layer->getmetadata("wms_formatlist");  
290 - $f = explode(",",$f);  
291 - $f = $f[0];  
292 - $imgLeg = $con."&request=GetLegendGraphic&version=".$ver."&service=wms&layer=".$lwms."&format=".$f."&SLD=".$s;  
293 - if ($layer->getmetadata("legendawms") != "")  
294 - {$imgLeg = $layer->getmetadata("legendawms");} 289 + if($c == 7){
  290 + $con = $layer->connection;
  291 + $ver = $layer->getmetadata("wms_server_version");
  292 + $lwms = $layer->getmetadata("wms_name");
  293 + $f = $layer->getmetadata("wms_formatlist");
  294 + $f = explode(",",$f);
  295 + $f = $f[0];
  296 + $imgLeg = $con."&request=GetLegendGraphic&version=".$ver."&service=wms&layer=".$lwms."&format=".$f."&SLD=".$s;
  297 + if ($layer->getmetadata("legendawms") != "")
  298 + {$imgLeg = $layer->getmetadata("legendawms");}
  299 + }
  300 + else
  301 + {$imgLeg = $im;}
295 $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","expressao"=>"","imagem"=>$imgLeg); 302 $linhas[] = array("tema"=>$l,"idclasse"=>"","nomeclasse"=>"","expressao"=>"","expressao"=>"","imagem"=>$imgLeg);
296 } 303 }
297 else 304 else
interface/openlayers.htm
@@ -145,7 +145,7 @@ @@ -145,7 +145,7 @@
145 </td> 145 </td>
146 </tr> 146 </tr>
147 </table> 147 </table>
148 -<script src="../classesjs/i3geo.js"></script> 148 +<script src="../classesjs/i3geonaocompacto.js"></script>
149 <script src="../pacotes/openlayers/OpenLayers29.js.php"></script> 149 <script src="../pacotes/openlayers/OpenLayers29.js.php"></script>
150 <!-- estilo necessário para a ferramenta de edição --> 150 <!-- estilo necessário para a ferramenta de edição -->
151 <style> 151 <style>
temas/povoado.map 0 → 100644
@@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
  1 +MAP
  2 + FONTSET "../symbols/fontes.txt"
  3 + SYMBOLSET "../symbols/simbolos.sym"
  4 + LAYER
  5 + CONNECTION ""
  6 + DATA "c:\ms4w\apache\htdocs\i3geo\aplicmap\dados\sc22\povoado.shp"
  7 + METADATA
  8 + "ltempoitemimagem" ""
  9 + "cache" ""
  10 + "ltempoitemdescricao" ""
  11 + "CLASSE" "SIM"
  12 + "ltempoiteminicio" ""
  13 + "palletestep" ""
  14 + "ltempoitemtip" ""
  15 + "iconetema" ""
  16 + "ltempoitemtitulo" ""
  17 + "description_template" ""
  18 + "ltempoitemlink" ""
  19 + "palletefile" ""
  20 + "ltempoformatodata" ""
  21 + "permitecomentario" ""
  22 + "ltempoitemicone" ""
  23 + "arquivodownload" ""
  24 + "TEMA" "Povoado"
  25 + "editorsql" ""
  26 + "legendaimg" "http://www.rockingsmileys.com/wp-content/uploads/2011/03/Happy_eyebrowes_smileys-150x150.png"
  27 + "ltempoitemfim" ""
  28 + END
  29 + NAME "povoado"
  30 + STATUS OFF
  31 + TYPE POINT
  32 + UNITS METERS
  33 + CLASS
  34 + NAME ""
  35 + STYLE
  36 + ANGLE 360
  37 + COLOR 0 0 0
  38 + SIZE 5
  39 + SYMBOL "ponto"
  40 + WIDTH 1
  41 + END
  42 + END
  43 + END
  44 +
  45 +END
  46 +