Commit 04e3336c72c7fa6a7eac4600ad15dc2ece620722
1 parent
4395057f
Exists in
master
and in
7 other branches
#280
Showing
10 changed files
with
81 additions
and
22 deletions
Show diff stats
admin/js/core.js
| ... | ... | @@ -193,7 +193,7 @@ function core_makeRequest(sUrl,callback,tipo) |
| 193 | 193 | if(arguments.length == 2) |
| 194 | 194 | {var tipo = "GET";} |
| 195 | 195 | var request = YAHOO.util.Connect.asyncRequest(tipo, sUrl, callback); |
| 196 | - YAHOO.log("Initiating request; tId: " + request.tId + ".", "info", "example"); | |
| 196 | + //YAHOO.log("Initiating request; tId: " + request.tId + ".", "info", "example"); | |
| 197 | 197 | } |
| 198 | 198 | /* |
| 199 | 199 | Function: core_carregando | ... | ... |
admin/js/editormapfile.js
| ... | ... | @@ -810,6 +810,9 @@ function montaEditorMetadados(dados) |
| 810 | 810 | titulo:"Itensdesc",id:"itensdesc",value:dados.itensdesc,tipo:"text"}, |
| 811 | 811 | {ajuda:"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],'", |
| 812 | 812 | titulo:"Itenslink",id:"itenslink",value:dados.itenslink,tipo:"text"}, |
| 813 | + {ajuda:"Template utilizado no gerador de KML para definir o conteúdo dos balões de informação. O template utiliza o caractere '%' para iniciar e fechar o nome de uma coluna. O template pode usar também elementos HTML, por exemplo: <code>'<b>Nome do municipio</b>: %NOMEMUN%'</code>. Se o template não for especificado, o i3Geo irá utilizar o metadata ITENS e ITENSDESC. Se esses não forem especificados, será utilizado o nome original da coluna.", | |
| 814 | + titulo:"KML description_template",id:"description_template",value:dados.description_template,tipo:"text"}, | |
| 815 | + | |
| 813 | 816 | {ajuda:"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 ','.", |
| 814 | 817 | titulo:"Tip",id:"tip",value:dados.tip,tipo:"text"}, |
| 815 | 818 | {ajuda:"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.", |
| ... | ... | @@ -1160,7 +1163,7 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, |
| 1160 | 1163 | {alert("Valor de escala incorreto");return;} |
| 1161 | 1164 | } |
| 1162 | 1165 | |
| 1163 | - var campos = new Array("palletefile","palletestep","arquivodownload","aplicaextensao","classestamanho","classessimbolo","classescor","classesnome","classesitem","mensagem","identifica","extensao","escondido","download","escala","tema","classe","tip","itenslink","itens","itensdesc") | |
| 1166 | + var campos = new Array("description_template","palletefile","palletestep","arquivodownload","aplicaextensao","classestamanho","classessimbolo","classescor","classesnome","classesitem","mensagem","identifica","extensao","escondido","download","escala","tema","classe","tip","itenslink","itens","itensdesc") | |
| 1164 | 1167 | var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer |
| 1165 | 1168 | var prog = "../php/editormapfile.php?funcao=alterarMetadados" |
| 1166 | 1169 | } | ... | ... |
admin/php/admin.php
admin/php/editormapfile.php
| ... | ... | @@ -532,6 +532,7 @@ function pegaMetadados() |
| 532 | 532 | $dados["arquivodownload"] = $layer->getmetadata("arquivodownload"); |
| 533 | 533 | $dados["palletefile"] = $layer->getmetadata("palletefile"); |
| 534 | 534 | $dados["palletestep"] = $layer->getmetadata("palletestep"); |
| 535 | + $dados["description_template"] = $layer->getmetadata("description_template"); | |
| 535 | 536 | $dados["codigoMap"] = $codigoMap; |
| 536 | 537 | $dados["codigoLayer"] = $codigoLayer; |
| 537 | 538 | $dados["colunas"] = implode(" ,",pegaItens($layer)); |
| ... | ... | @@ -539,7 +540,7 @@ function pegaMetadados() |
| 539 | 540 | } |
| 540 | 541 | function alterarMetadados() |
| 541 | 542 | { |
| 542 | - global $palletestep,$palletefile,$arquivodownload,$codigoMap,$codigoLayer,$locaplic,$aplicaextensao,$classestamanho,$classessimbolo,$classescor,$classesnome,$classesitem,$mensagem,$identifica,$extensao,$escondido,$download,$escala,$tema,$classe,$tip,$itenslink,$itens,$itensdesc; | |
| 543 | + global $description_template,$palletestep,$palletefile,$arquivodownload,$codigoMap,$codigoLayer,$locaplic,$aplicaextensao,$classestamanho,$classessimbolo,$classescor,$classesnome,$classesitem,$mensagem,$identifica,$extensao,$escondido,$download,$escala,$tema,$classe,$tip,$itenslink,$itens,$itensdesc; | |
| 543 | 544 | $dados = array(); |
| 544 | 545 | $mapfile = $locaplic."/temas/".$codigoMap.".map"; |
| 545 | 546 | $mapa = ms_newMapObj($mapfile); |
| ... | ... | @@ -565,6 +566,7 @@ function alterarMetadados() |
| 565 | 566 | $layer->setmetadata("arquivodownload",$arquivodownload); |
| 566 | 567 | $layer->setmetadata("palletefile",$palletefile); |
| 567 | 568 | $layer->setmetadata("palletestep",$palletestep); |
| 569 | + $layer->setmetadata("description_template",$description_template); | |
| 568 | 570 | $mapa->save($mapfile); |
| 569 | 571 | removeCabecalho($mapfile); |
| 570 | 572 | return "ok"; |
| ... | ... | @@ -894,9 +896,9 @@ function removeCabecalho($arq,$symbolset=true) |
| 894 | 896 | $linha = fgets($handle); |
| 895 | 897 | if($symbolset) |
| 896 | 898 | { |
| 897 | - if(strtoupper(trim($linha)) == "SYMBOLSET") | |
| 899 | + if(strpos(strtoupper($linha),"SYMBOLSET") !== false) | |
| 898 | 900 | {$cabeca[] = $linha;} |
| 899 | - if(strtoupper(trim($linha)) == "FONTSET") | |
| 901 | + if(strpos(strtoupper($linha),"FONTSET") !== false) | |
| 900 | 902 | {$cabeca[] = $linha;} |
| 901 | 903 | } |
| 902 | 904 | if(strtoupper(trim($linha)) == "LAYER") | ... | ... |
classesphp/pega_variaveis.php
exemplos/mashup1.htm
| ... | ... | @@ -92,6 +92,7 @@ i3GEO.configura.iniciaJanelaMensagens = false |
| 92 | 92 | i3GEO.idioma.MOSTRASELETOR = false |
| 93 | 93 | i3GEO.barraDeBotoes.COMPORTAMENTO = "laranja" |
| 94 | 94 | i3GEO.configura.mashuppar = "&mapext=-53 -26 -42 -18"; |
| 95 | +i3GEO.janela.ESTILOAGUARDE = "minima"; | |
| 95 | 96 | i3GEO.cria() |
| 96 | 97 | i3GEO.inicia(); |
| 97 | 98 | </script> | ... | ... |
menutemas/admin.db
No preview for this file type
pacotes/kmlmapserver/classes/layerserver.class.php
| ... | ... | @@ -436,7 +436,9 @@ class LayerServer { |
| 436 | 436 | // Add style class |
| 437 | 437 | $style_url =& $this->add_style($layer, $feature_folder, $style_id, $class_list[$style_id], $namecol, $shape->values); |
| 438 | 438 | $wkt = $shape->toWkt(); |
| 439 | - $description_template = false; | |
| 439 | + $description_template = $layer->getMetadata('DESCRIPTION_TEMPLATE');//false; | |
| 440 | + if($description_template == "") | |
| 441 | + {$description_template = false;} | |
| 440 | 442 | $placemark =& $this->add_feature($feature_folder, $wkt, $shape->values[$namecol], $shape->values, $description_template, $class_list[$style_id],$itens,$itensdesc); |
| 441 | 443 | |
| 442 | 444 | $placemark->addChild('styleUrl', '#'. $style_url); |
| ... | ... | @@ -575,6 +577,7 @@ class LayerServer { |
| 575 | 577 | function get_feature_description($featurename, $attributes, $description_template,$itens,$itensdesc){ |
| 576 | 578 | // Compute hyperlink |
| 577 | 579 | //var_dump($attributes);exit; |
| 580 | + //if($description_template != ""){return $description_template;} | |
| 578 | 581 | $n = ""; |
| 579 | 582 | if($itens == "") |
| 580 | 583 | { |
| ... | ... | @@ -586,9 +589,16 @@ class LayerServer { |
| 586 | 589 | { |
| 587 | 590 | $itens = explode(",",$itens); |
| 588 | 591 | $itensdesc = explode(",",$itensdesc); |
| 589 | - for($i=0;$i<count($itens);$i++) | |
| 592 | + if($description_template != "") | |
| 590 | 593 | { |
| 591 | - $n .= $itensdesc[$i]." - ".$attributes[$itens[$i]]."\n"; | |
| 594 | + for($i=0;$i<count($itens);$i++) | |
| 595 | + {$description_template = str_replace("%".$itens[$i]."%",$attributes[$itens[$i]],$description_template);} | |
| 596 | + $n = $description_template; | |
| 597 | + } | |
| 598 | + else | |
| 599 | + { | |
| 600 | + for($i=0;$i<count($itens);$i++) | |
| 601 | + {$n .= $itensdesc[$i]." - ".$attributes[$itens[$i]]."\n";} | |
| 592 | 602 | } |
| 593 | 603 | } |
| 594 | 604 | $description = mb_convert_encoding($n,"UTF-8",mb_detect_encoding($n,"UTF-8,ISO-8859-1")); |
| ... | ... | @@ -679,13 +689,13 @@ class LayerServer { |
| 679 | 689 | */ |
| 680 | 690 | function add_style(&$layer, &$folder, $style_id, &$style_data){ |
| 681 | 691 | // Calculare style URL |
| 682 | - /* | |
| 692 | + | |
| 683 | 693 | if($style_data['description_template']){ |
| 684 | 694 | $this->style_counter++; |
| 685 | 695 | $style_id .= '_'.$this->style_counter; |
| 686 | 696 | $balloon_data = $this->get_feature_description($attributes[$namecol], $attributes, $style_data['description_template']); |
| 687 | 697 | } |
| 688 | - */ | |
| 698 | + | |
| 689 | 699 | // Check if the style already exists |
| 690 | 700 | $expr = '//*[@id=\''.$style_id.'\']'; |
| 691 | 701 | if($folder->xpath($expr)) { |
| ... | ... | @@ -743,7 +753,8 @@ class LayerServer { |
| 743 | 753 | $icon =& $st->addChild('Icon'); |
| 744 | 754 | $icon->addChild('href', htmlentities($style_data['icon'])); |
| 745 | 755 | } |
| 746 | - /*/ Add the balloon style if description_template is set | |
| 756 | + // Add the balloon style if description_template is set | |
| 757 | + /* | |
| 747 | 758 | if($style_data['description_template']){ |
| 748 | 759 | $this->add_balloon_style($new_style, $balloon_data); |
| 749 | 760 | } |
| ... | ... | @@ -841,6 +852,9 @@ class LayerServer { |
| 841 | 852 | $description = $layer->getMetadata('WMS_TITLE'); |
| 842 | 853 | } |
| 843 | 854 | if(!$description){ |
| 855 | + $description = $layer->getMetadata('TEMA'); | |
| 856 | + } | |
| 857 | + if(!$description){ | |
| 844 | 858 | $description = $layer->name; |
| 845 | 859 | } |
| 846 | 860 | return $description; | ... | ... |
temas/testept.map
| 1 | -MAP | |
| 2 | -SYMBOLSET ../symbols/simbolos.sym | |
| 3 | -FONTSET "../symbols/fontes.txt" | |
| 1 | +MAP | |
| 2 | +SYMBOLSET ../symbols/simbolos.sym | |
| 3 | +FONTSET "../symbols/fontes.txt" | |
| 4 | 4 | LAYER |
| 5 | 5 | CONNECTION "" |
| 6 | - DATA "c://ms4w/Apache/htdocs/geodados/brasil/limitespol/localidades.shp" | |
| 6 | + DATA "c:\ms4w\Apache\htdocs\geodados\brasil\limitespol\localidades.shp" | |
| 7 | + GROUP "Grupo 2" | |
| 7 | 8 | METADATA |
| 9 | + "CLASSE" "SIM" | |
| 8 | 10 | "palletestep" "" |
| 11 | + "description_template" "" | |
| 12 | + "ITENSDESC" "Nome,Ano,UF" | |
| 9 | 13 | "palletefile" "" |
| 10 | 14 | "download" "SIM" |
| 15 | + "ITENS" "NOMEMUN,ANOCRIA,ESTADO" | |
| 11 | 16 | "arquivodownload" "" |
| 12 | - "ITENS" "NOMEMUN,ANOCRIA,ESTADO" | |
| 13 | - "ITENSDESC" "Nome,Ano,UF" | |
| 14 | - "TEMA" "Teste de pontos" | |
| 15 | - "CLASSE" "SIM" | |
| 17 | + "TEMA" "Teste de pontos" | |
| 16 | 18 | END |
| 17 | - GROUP "Grupo 2" | |
| 18 | 19 | NAME "testept" |
| 19 | 20 | STATUS OFF |
| 20 | 21 | TYPE POINT |
| 21 | 22 | UNITS METERS |
| 22 | 23 | CLASS |
| 23 | - NAME " " | |
| 24 | + NAME " " | |
| 24 | 25 | STYLE |
| 25 | 26 | ANGLE 360 |
| 26 | 27 | COLOR 255 0 0 | ... | ... |
| ... | ... | @@ -0,0 +1,37 @@ |
| 1 | +MAP | |
| 2 | + FONTSET "../symbols/fontes.txt" | |
| 3 | + SYMBOLSET "../symbols/simbolos.sym" | |
| 4 | + LAYER | |
| 5 | + CONNECTION "" | |
| 6 | + DATA "c:\ms4w\Apache\htdocs\geodados\brasil\limitespol\localidades.shp" | |
| 7 | + METADATA | |
| 8 | + "CLASSE" "SIM" | |
| 9 | + "palletestep" "" | |
| 10 | + "permitekmz" "sim" | |
| 11 | + "DESCRIPTION_TEMPLATE" "Teste de template para KML UF: %ESTADO% Município: %NOMEMUN%" | |
| 12 | + "palletefile" "" | |
| 13 | + "permitedownload" "sim" | |
| 14 | + "download" "SIM" | |
| 15 | + "arquivodownload" "" | |
| 16 | + "permiteogc" "sim" | |
| 17 | + "permitekml" "sim" | |
| 18 | + "TEMA" "Teste de pontos" | |
| 19 | + END | |
| 20 | + NAME "testepttemplatekml" | |
| 21 | + STATUS OFF | |
| 22 | + TYPE POINT | |
| 23 | + UNITS METERS | |
| 24 | + CLASS | |
| 25 | + NAME " " | |
| 26 | + STYLE | |
| 27 | + ANGLE 360 | |
| 28 | + COLOR 255 0 0 | |
| 29 | + OPACITY 100 | |
| 30 | + SIZE 8 | |
| 31 | + SYMBOL "marca" | |
| 32 | + END | |
| 33 | + END | |
| 34 | + END | |
| 35 | + | |
| 36 | +END | |
| 37 | + | ... | ... |