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,7 +193,7 @@ function core_makeRequest(sUrl,callback,tipo) | ||
193 | if(arguments.length == 2) | 193 | if(arguments.length == 2) |
194 | {var tipo = "GET";} | 194 | {var tipo = "GET";} |
195 | var request = YAHOO.util.Connect.asyncRequest(tipo, sUrl, callback); | 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 | Function: core_carregando | 199 | Function: core_carregando |
admin/js/editormapfile.js
@@ -810,6 +810,9 @@ function montaEditorMetadados(dados) | @@ -810,6 +810,9 @@ function montaEditorMetadados(dados) | ||
810 | titulo:"Itensdesc",id:"itensdesc",value:dados.itensdesc,tipo:"text"}, | 810 | titulo:"Itensdesc",id:"itensdesc",value:dados.itensdesc,tipo:"text"}, |
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],'", | 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 | titulo:"Itenslink",id:"itenslink",value:dados.itenslink,tipo:"text"}, | 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 | {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 ','.", | 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 | titulo:"Tip",id:"tip",value:dados.tip,tipo:"text"}, | 817 | titulo:"Tip",id:"tip",value:dados.tip,tipo:"text"}, |
815 | {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.", | 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,7 +1163,7 @@ function salvarDadosEditor(tipo,codigoMap,codigoLayer,indiceClasse,indiceEstilo, | ||
1160 | {alert("Valor de escala incorreto");return;} | 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 | var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer | 1167 | var par = "&codigoMap="+codigoMap+"&codigoLayer="+codigoLayer |
1165 | var prog = "../php/editormapfile.php?funcao=alterarMetadados" | 1168 | var prog = "../php/editormapfile.php?funcao=alterarMetadados" |
1166 | } | 1169 | } |
admin/php/admin.php
@@ -46,6 +46,7 @@ if(!isset($locaplic)) | @@ -46,6 +46,7 @@ if(!isset($locaplic)) | ||
46 | } | 46 | } |
47 | } | 47 | } |
48 | include_once($locaplic."/classesphp/pega_variaveis.php"); | 48 | include_once($locaplic."/classesphp/pega_variaveis.php"); |
49 | + | ||
49 | error_reporting(0); | 50 | error_reporting(0); |
50 | // | 51 | // |
51 | //carrega o phpmapscript | 52 | //carrega o phpmapscript |
admin/php/editormapfile.php
@@ -532,6 +532,7 @@ function pegaMetadados() | @@ -532,6 +532,7 @@ function pegaMetadados() | ||
532 | $dados["arquivodownload"] = $layer->getmetadata("arquivodownload"); | 532 | $dados["arquivodownload"] = $layer->getmetadata("arquivodownload"); |
533 | $dados["palletefile"] = $layer->getmetadata("palletefile"); | 533 | $dados["palletefile"] = $layer->getmetadata("palletefile"); |
534 | $dados["palletestep"] = $layer->getmetadata("palletestep"); | 534 | $dados["palletestep"] = $layer->getmetadata("palletestep"); |
535 | + $dados["description_template"] = $layer->getmetadata("description_template"); | ||
535 | $dados["codigoMap"] = $codigoMap; | 536 | $dados["codigoMap"] = $codigoMap; |
536 | $dados["codigoLayer"] = $codigoLayer; | 537 | $dados["codigoLayer"] = $codigoLayer; |
537 | $dados["colunas"] = implode(" ,",pegaItens($layer)); | 538 | $dados["colunas"] = implode(" ,",pegaItens($layer)); |
@@ -539,7 +540,7 @@ function pegaMetadados() | @@ -539,7 +540,7 @@ function pegaMetadados() | ||
539 | } | 540 | } |
540 | function alterarMetadados() | 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 | $dados = array(); | 544 | $dados = array(); |
544 | $mapfile = $locaplic."/temas/".$codigoMap.".map"; | 545 | $mapfile = $locaplic."/temas/".$codigoMap.".map"; |
545 | $mapa = ms_newMapObj($mapfile); | 546 | $mapa = ms_newMapObj($mapfile); |
@@ -565,6 +566,7 @@ function alterarMetadados() | @@ -565,6 +566,7 @@ function alterarMetadados() | ||
565 | $layer->setmetadata("arquivodownload",$arquivodownload); | 566 | $layer->setmetadata("arquivodownload",$arquivodownload); |
566 | $layer->setmetadata("palletefile",$palletefile); | 567 | $layer->setmetadata("palletefile",$palletefile); |
567 | $layer->setmetadata("palletestep",$palletestep); | 568 | $layer->setmetadata("palletestep",$palletestep); |
569 | + $layer->setmetadata("description_template",$description_template); | ||
568 | $mapa->save($mapfile); | 570 | $mapa->save($mapfile); |
569 | removeCabecalho($mapfile); | 571 | removeCabecalho($mapfile); |
570 | return "ok"; | 572 | return "ok"; |
@@ -894,9 +896,9 @@ function removeCabecalho($arq,$symbolset=true) | @@ -894,9 +896,9 @@ function removeCabecalho($arq,$symbolset=true) | ||
894 | $linha = fgets($handle); | 896 | $linha = fgets($handle); |
895 | if($symbolset) | 897 | if($symbolset) |
896 | { | 898 | { |
897 | - if(strtoupper(trim($linha)) == "SYMBOLSET") | 899 | + if(strpos(strtoupper($linha),"SYMBOLSET") !== false) |
898 | {$cabeca[] = $linha;} | 900 | {$cabeca[] = $linha;} |
899 | - if(strtoupper(trim($linha)) == "FONTSET") | 901 | + if(strpos(strtoupper($linha),"FONTSET") !== false) |
900 | {$cabeca[] = $linha;} | 902 | {$cabeca[] = $linha;} |
901 | } | 903 | } |
902 | if(strtoupper(trim($linha)) == "LAYER") | 904 | if(strtoupper(trim($linha)) == "LAYER") |
classesphp/pega_variaveis.php
@@ -54,7 +54,7 @@ if (isset($_GET)) | @@ -54,7 +54,7 @@ if (isset($_GET)) | ||
54 | eval("\$".$k."='".(strip_tags($_GET[$k]))."';"); | 54 | eval("\$".$k."='".(strip_tags($_GET[$k]))."';"); |
55 | } | 55 | } |
56 | } | 56 | } |
57 | -//var_dump($_POST);exit; | 57 | +//var_dump($_GET);exit; |
58 | if (isset($_POST)) | 58 | if (isset($_POST)) |
59 | { | 59 | { |
60 | //var_dump($_POST);exit; | 60 | //var_dump($_POST);exit; |
exemplos/mashup1.htm
@@ -92,6 +92,7 @@ i3GEO.configura.iniciaJanelaMensagens = false | @@ -92,6 +92,7 @@ i3GEO.configura.iniciaJanelaMensagens = false | ||
92 | i3GEO.idioma.MOSTRASELETOR = false | 92 | i3GEO.idioma.MOSTRASELETOR = false |
93 | i3GEO.barraDeBotoes.COMPORTAMENTO = "laranja" | 93 | i3GEO.barraDeBotoes.COMPORTAMENTO = "laranja" |
94 | i3GEO.configura.mashuppar = "&mapext=-53 -26 -42 -18"; | 94 | i3GEO.configura.mashuppar = "&mapext=-53 -26 -42 -18"; |
95 | +i3GEO.janela.ESTILOAGUARDE = "minima"; | ||
95 | i3GEO.cria() | 96 | i3GEO.cria() |
96 | i3GEO.inicia(); | 97 | i3GEO.inicia(); |
97 | </script> | 98 | </script> |
menutemas/admin.db
No preview for this file type
pacotes/kmlmapserver/classes/layerserver.class.php
@@ -436,7 +436,9 @@ class LayerServer { | @@ -436,7 +436,9 @@ class LayerServer { | ||
436 | // Add style class | 436 | // Add style class |
437 | $style_url =& $this->add_style($layer, $feature_folder, $style_id, $class_list[$style_id], $namecol, $shape->values); | 437 | $style_url =& $this->add_style($layer, $feature_folder, $style_id, $class_list[$style_id], $namecol, $shape->values); |
438 | $wkt = $shape->toWkt(); | 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 | $placemark =& $this->add_feature($feature_folder, $wkt, $shape->values[$namecol], $shape->values, $description_template, $class_list[$style_id],$itens,$itensdesc); | 442 | $placemark =& $this->add_feature($feature_folder, $wkt, $shape->values[$namecol], $shape->values, $description_template, $class_list[$style_id],$itens,$itensdesc); |
441 | 443 | ||
442 | $placemark->addChild('styleUrl', '#'. $style_url); | 444 | $placemark->addChild('styleUrl', '#'. $style_url); |
@@ -575,6 +577,7 @@ class LayerServer { | @@ -575,6 +577,7 @@ class LayerServer { | ||
575 | function get_feature_description($featurename, $attributes, $description_template,$itens,$itensdesc){ | 577 | function get_feature_description($featurename, $attributes, $description_template,$itens,$itensdesc){ |
576 | // Compute hyperlink | 578 | // Compute hyperlink |
577 | //var_dump($attributes);exit; | 579 | //var_dump($attributes);exit; |
580 | + //if($description_template != ""){return $description_template;} | ||
578 | $n = ""; | 581 | $n = ""; |
579 | if($itens == "") | 582 | if($itens == "") |
580 | { | 583 | { |
@@ -586,9 +589,16 @@ class LayerServer { | @@ -586,9 +589,16 @@ class LayerServer { | ||
586 | { | 589 | { |
587 | $itens = explode(",",$itens); | 590 | $itens = explode(",",$itens); |
588 | $itensdesc = explode(",",$itensdesc); | 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 | $description = mb_convert_encoding($n,"UTF-8",mb_detect_encoding($n,"UTF-8,ISO-8859-1")); | 604 | $description = mb_convert_encoding($n,"UTF-8",mb_detect_encoding($n,"UTF-8,ISO-8859-1")); |
@@ -679,13 +689,13 @@ class LayerServer { | @@ -679,13 +689,13 @@ class LayerServer { | ||
679 | */ | 689 | */ |
680 | function add_style(&$layer, &$folder, $style_id, &$style_data){ | 690 | function add_style(&$layer, &$folder, $style_id, &$style_data){ |
681 | // Calculare style URL | 691 | // Calculare style URL |
682 | - /* | 692 | + |
683 | if($style_data['description_template']){ | 693 | if($style_data['description_template']){ |
684 | $this->style_counter++; | 694 | $this->style_counter++; |
685 | $style_id .= '_'.$this->style_counter; | 695 | $style_id .= '_'.$this->style_counter; |
686 | $balloon_data = $this->get_feature_description($attributes[$namecol], $attributes, $style_data['description_template']); | 696 | $balloon_data = $this->get_feature_description($attributes[$namecol], $attributes, $style_data['description_template']); |
687 | } | 697 | } |
688 | - */ | 698 | + |
689 | // Check if the style already exists | 699 | // Check if the style already exists |
690 | $expr = '//*[@id=\''.$style_id.'\']'; | 700 | $expr = '//*[@id=\''.$style_id.'\']'; |
691 | if($folder->xpath($expr)) { | 701 | if($folder->xpath($expr)) { |
@@ -743,7 +753,8 @@ class LayerServer { | @@ -743,7 +753,8 @@ class LayerServer { | ||
743 | $icon =& $st->addChild('Icon'); | 753 | $icon =& $st->addChild('Icon'); |
744 | $icon->addChild('href', htmlentities($style_data['icon'])); | 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 | if($style_data['description_template']){ | 758 | if($style_data['description_template']){ |
748 | $this->add_balloon_style($new_style, $balloon_data); | 759 | $this->add_balloon_style($new_style, $balloon_data); |
749 | } | 760 | } |
@@ -841,6 +852,9 @@ class LayerServer { | @@ -841,6 +852,9 @@ class LayerServer { | ||
841 | $description = $layer->getMetadata('WMS_TITLE'); | 852 | $description = $layer->getMetadata('WMS_TITLE'); |
842 | } | 853 | } |
843 | if(!$description){ | 854 | if(!$description){ |
855 | + $description = $layer->getMetadata('TEMA'); | ||
856 | + } | ||
857 | + if(!$description){ | ||
844 | $description = $layer->name; | 858 | $description = $layer->name; |
845 | } | 859 | } |
846 | return $description; | 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 | LAYER | 4 | LAYER |
5 | CONNECTION "" | 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 | METADATA | 8 | METADATA |
9 | + "CLASSE" "SIM" | ||
8 | "palletestep" "" | 10 | "palletestep" "" |
11 | + "description_template" "" | ||
12 | + "ITENSDESC" "Nome,Ano,UF" | ||
9 | "palletefile" "" | 13 | "palletefile" "" |
10 | "download" "SIM" | 14 | "download" "SIM" |
15 | + "ITENS" "NOMEMUN,ANOCRIA,ESTADO" | ||
11 | "arquivodownload" "" | 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 | END | 18 | END |
17 | - GROUP "Grupo 2" | ||
18 | NAME "testept" | 19 | NAME "testept" |
19 | STATUS OFF | 20 | STATUS OFF |
20 | TYPE POINT | 21 | TYPE POINT |
21 | UNITS METERS | 22 | UNITS METERS |
22 | CLASS | 23 | CLASS |
23 | - NAME " " | 24 | + NAME " " |
24 | STYLE | 25 | STYLE |
25 | ANGLE 360 | 26 | ANGLE 360 |
26 | COLOR 255 0 0 | 27 | COLOR 255 0 0 |
@@ -0,0 +1,37 @@ | @@ -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 | + |