Commit 71b56833efd16eab1369d15c12a51d9635005527

Authored by Edmar Moretti
1 parent 736d8d6b

Atualização da documentação e correções em funções do editor de mapfiles

admin/admin.db
No preview for this file type
admin/js/editormapfile.js
... ... @@ -315,7 +315,7 @@ Monta as opções de edição básicas de um LAYER
315 315 */
316 316 function montaRaizTema(no,dados)
317 317 {
318   - var tempNodeR = "";
  318 + var tempNode = "",tempNodeR = "";
319 319 //no que permite listar os grupos de usuarios registrados para o mapfile
320 320 if(!tree.getNodeByProperty("etiquetaGrupousrTema",no.data.codigoMap))
321 321 {
... ... @@ -324,7 +324,7 @@ function montaRaizTema(no,dados)
324 324 tempNodeR.isLeaf = false;
325 325 var conteudo = "<span style=\"cursor:pointer;\" onclick=\"editorGrupousr('"+no.data.id_tema+"','"+no.data.codigoMap+"')\" ><img style='position:relative;top:2px' src=\"../imagens/05.png\" /><i>Adicionar um novo</i></span>";
326 326 var d = {html:conteudo};
327   - var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
  327 + tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
328 328 tempNode.isLeaf = true;
329 329 }
330 330 //adiciona a lista de grupos de usuarios no no
... ... @@ -450,10 +450,11 @@ function montaParametrosTemas(no,dados,redesenha)
450 450 }
451 451 if(!tree.getNodeByProperty("etiquetaClasses",id))
452 452 {
453   - var d = {id:id,codigoMap:codigoMap,codigoLayer:codigoLayer,tipo:"etiquetaClasses",etiquetaClasses:id,html:"<i>&nbsp;Classes</i>"};
  453 + var d = {id:id,codigoLayer:codigoLayer,tipo:"etiquetaClasses",etiquetaClasses:id,html:"<i>&nbsp;Classes</i>"};
454 454 tempNodeR = new YAHOO.widget.HTMLNode(d, no, false,true);
455 455 tempNodeR.isLeaf = false;
456 456  
  457 +
457 458 conteudo = "<span style='cursor:pointer;' onclick=\"adicionaNovaClasse('"+codigoMap+"','"+codigoLayer+"')\" ><img style='position:relative;top:2px' src=\"../imagens/05.png\" /> Adicionar uma classe</span>";
458 459 var d = {html:conteudo};
459 460 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
... ... @@ -468,7 +469,9 @@ function montaParametrosTemas(no,dados,redesenha)
468 469 var d = {html:conteudo};
469 470 var tempNode = new YAHOO.widget.HTMLNode(d, tempNodeR, false,true);
470 471 tempNode.isLeaf = true;
  472 +
471 473 }
  474 +
472 475 for (var i=0, j=dados.length; i<j; i++)
473 476 {
474 477 var d = conteudoNoClasse(no.data.codigoMap,codigoLayer,dados[i].indice,dados[i].nome);
... ... @@ -476,6 +479,7 @@ function montaParametrosTemas(no,dados,redesenha)
476 479 tempNode.setDynamicLoad(loadClasseData, iconMode);
477 480 tempNode.isLeaf = false;
478 481 }
  482 +
479 483 tree.draw();
480 484 }
481 485 function loadClasseData(node, fnLoadComplete)
... ... @@ -1453,7 +1457,6 @@ function montaEditorDados(dados)
1453 1457 "linhas":[
1454 1458 {ajuda:"Indica se as defini&ccedil;&otilde;es da camada est&atilde;o relacionadas ao sistema de metadados estat&iacute;sticos. Se estiver, alguns par&acirc;metros s&atilde;o obtidos de forma autom&aacute;tica, como a conex&atilde;o e o SQL de acesso aos dados.",
1455 1459 titulo:"Esse mapfile est&aacute; integrado ao sistema de metadados estat&iacute;sticos?",id:"",value:dados.metaestat,tipo:"text",div:"<div id=cMetaestat ></div>"},
1456   - //TODO colocar icone para escolher o id
1457 1460 {ajuda:"ID da medida da vari&aacute;vel que relaciona a camada ao sistema de metadados estat&iacute;sticos. S&oacute; deve ser definido se o mapfile for integrado a esse sistema.",
1458 1461 titulo:"ID da variável no sistema de metadados estatísticos <img onclick='selIdMedidaVariavel(\"metaestat_id_medida_variavel\",\"metaestat_id_medida_variavel\")' src='"+limg+"' style='cursor:pointer;position :relative;top:2px'/>",id:"metaestat_id_medida_variavel",value:dados.metaestat_id_medida_variavel,tipo:"text",div:""},
1459 1462 {ajuda:"Type of connection. Default is local.",
... ...
admin/php/editormapfile.php
... ... @@ -109,21 +109,7 @@ switch (strtoupper($funcao))
109 109 retornaJSON(criarNovoMap());
110 110 exit;
111 111 break;
112   - /*
113   - Valor: EDITASIMBOLO
114   -
115   - Lista os s&iacute;mbolos de um determinado tipo
116   -
117   - Parametros:
118   -
119   - tipo {string} - tipo de layer
120 112  
121   - onclick {string} - fun&ccedil;&atilde;o javascript que ser&aacute; executada ao se clicar no s&iacute;mbilo
122   -
123   - Retorno:
124   -
125   - {JSON}
126   - */
127 113 case "DOWNLOADGVP":
128 114 if(file_exists($locaplic."/temas/".$codigoMap.".gvp")){
129 115 ob_end_clean();
... ... @@ -136,9 +122,26 @@ switch (strtoupper($funcao))
136 122 }
137 123 exit;
138 124 break;
  125 + /*
  126 + Valor: EDITASIMBOLO
  127 +
  128 + Lista os s&iacute;mbolos de um determinado tipo
  129 +
  130 + Parametros:
  131 +
  132 + tipo {string} - tipo de layer
  133 +
  134 + onclick {string} - fun&ccedil;&atilde;o javascript que ser&aacute; executada ao se clicar no s&iacute;mbilo
  135 +
  136 + Retorno:
  137 +
  138 + {JSON}
  139 + */
139 140 case "EDITASIMBOLO":
140   - include_once("$locaplic/classesphp/classe_legenda.php");
141   - if($base == "" or !isset($base)){
  141 + include_once(__DIR__."/../../classesphp/classe_legenda.php");
  142 + $versao = versao();
  143 + $versao = $versao["principal"];
  144 + if($base == "" || !isset($base)){
142 145 $base = "";
143 146 if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN'))
144 147 {
... ... @@ -168,7 +171,7 @@ switch (strtoupper($funcao))
168 171 }
169 172 }
170 173 $m = new Legenda($base,$locaplic);
171   - retornaJSON($m->listaSimbolos($tipo,$dir_tmp,"",$onclick));
  174 + retornaJSON($m->listaSimbolos($tipo,$dir_tmp,"",$onclick,8,1,true));
172 175 exit;
173 176 break;
174 177 /*
... ... @@ -1270,6 +1273,10 @@ function criarNovaClasse()
1270 1273 $mapfile = $locaplic."/temas/".$codigoMap.".map";
1271 1274 $mapa = ms_newMapObj($mapfile);
1272 1275 $nl = $mapa->getlayerbyname($codigoLayer);
  1276 + $dados = array();
  1277 + if(strtoupper($nl->getmetadata("metaestat")) === "SIM"){
  1278 + return "erro";
  1279 + }
1273 1280 $nclasses = $nl->numclasses;
1274 1281 $classe = ms_newClassObj($nl);
1275 1282 $mapa->save($mapfile);
... ... @@ -1359,6 +1366,9 @@ function listaClasses()
1359 1366 $mapfile = $locaplic."/temas/".$codigoMap.".map";
1360 1367 $mapa = ms_newMapObj($mapfile);
1361 1368 $layer = $mapa->getlayerbyname($codigoLayer);
  1369 + if(strtoupper($layer->getmetadata("metaestat")) === "SIM"){
  1370 + return $dados;
  1371 + }
1362 1372 $nclasses = $layer->numclasses;
1363 1373 for($i=0;$i<$nclasses;++$i)
1364 1374 {
... ... @@ -1374,6 +1384,9 @@ function listaEstilos()
1374 1384 $mapfile = $locaplic."/temas/".$codigoMap.".map";
1375 1385 $mapa = ms_newMapObj($mapfile);
1376 1386 $layer = $mapa->getlayerbyname($codigoLayer);
  1387 + if(strtoupper($layer->getmetadata("metaestat")) === "SIM"){
  1388 + return $dados;
  1389 + }
1377 1390 $classe = $layer->getclass($indiceClasse);
1378 1391 $numestilos = $classe->numstyles;
1379 1392 for($i=0;$i<$numestilos;++$i)
... ... @@ -1492,7 +1505,6 @@ function alterarComport()
1492 1505 removeCabecalho($mapfile);
1493 1506 return "ok";
1494 1507 }
1495   -
1496 1508 function pegaTitulo()
1497 1509 {
1498 1510 global $codigoMap,$codigoLayer,$locaplic,$postgis_mapa;
... ... @@ -1742,6 +1754,9 @@ function alterarMetadados()
1742 1754 $mapfile = $locaplic."/temas/".$codigoMap.".map";
1743 1755 $mapa = ms_newMapObj($mapfile);
1744 1756 $layer = $mapa->getlayerbyname($codigoLayer);
  1757 + if(strtoupper($layer->getmetadata("metaestat")) === "SIM"){
  1758 + return "erro. Layer METAESTAT";
  1759 + }
1745 1760 $layer->setmetadata("itens",$itens);
1746 1761 $layer->setmetadata("itensdesc",$itensdesc);
1747 1762 $layer->setmetadata("itenslink",$itenslink);
... ... @@ -1849,6 +1864,9 @@ function alterarClasseGeral()
1849 1864 $mapfile = $locaplic."/temas/".$codigoMap.".map";
1850 1865 $mapa = ms_newMapObj($mapfile);
1851 1866 $layer = $mapa->getlayerbyname($codigoLayer);
  1867 + if(strtoupper($layer->getmetadata("metaestat")) === "SIM"){
  1868 + return "erro. Layer METAESTAT";
  1869 + }
1852 1870 $classe = $layer->getclass($indiceClasse);
1853 1871 $classe->set("name",$name);
1854 1872 $classe->set("title",$title);
... ... @@ -1925,6 +1943,9 @@ function alterarClasseLabel()
1925 1943 $mapfile = $locaplic."/temas/".$codigoMap.".map";
1926 1944 $mapa = ms_newMapObj($mapfile);
1927 1945 $layer = $mapa->getlayerbyname($codigoLayer);
  1946 + if(strtoupper($layer->getmetadata("metaestat")) === "SIM"){
  1947 + return "erro. Layer METAESTAT";
  1948 + }
1928 1949 $classe = $layer->getclass($indiceClasse);
1929 1950 $label = $classe->label;
1930 1951 if ($label != "")
... ... @@ -2002,6 +2023,9 @@ function alterarEstilo()
2002 2023 $mapfile = $locaplic."/temas/".$codigoMap.".map";
2003 2024 $mapa = ms_newMapObj($mapfile);
2004 2025 $layer = $mapa->getlayerbyname($codigoLayer);
  2026 + if(strtoupper($layer->getmetadata("metaestat")) === "SIM"){
  2027 + return "erro. Layer METAESTAT";
  2028 + }
2005 2029 $nclasses = $layer->numclasses;
2006 2030 $classe = $layer->getclass($indiceClasse);
2007 2031 $estilo = $classe->getstyle($indiceEstilo);
... ...
documentacao/manual-admin-i3geo-4_7-pt.odt
No preview for this file type
documentacao/manual-admin-i3geo-4_7-pt.pdf
No preview for this file type
temas/acidmap.map
... ... @@ -33,8 +33,13 @@ MAP
33 33 NAME "acidmap"
34 34 OFFSITE 255 255 255
35 35 STATUS OFF
  36 + TILEITEM "location"
36 37 TYPE RASTER
37 38 UNITS METERS
  39 + CLASS
  40 + END # CLASS
  41 + CLASS
  42 + END # CLASS
38 43 END # LAYER
39 44  
40 45 END # MAP
... ...
temas/bairros.map
... ... @@ -11,12 +11,13 @@ MAP
11 11 "CLASSE" "SIM"
12 12 "METAESTAT_CODIGO_TIPO_REGIAO" ""
13 13 "metaestat" "NAO"
14   - "convcaracter" ""
15 14 "TEMA" "Bairros IBGE"
  15 + "convcaracter" ""
16 16 END # METADATA
17 17 NAME "bairros"
18 18 STATUS DEFAULT
19 19 TEMPLATE "none.htm"
  20 + TILEITEM "location"
20 21 TYPE POLYGON
21 22 UNITS METERS
22 23 CLASS
... ... @@ -25,6 +26,7 @@ MAP
25 26 ANGLE 0
26 27 OFFSET 0 0
27 28 OUTLINECOLOR 255 0 0
  29 + SYMBOL "p0"
28 30 END # STYLE
29 31 STYLE
30 32 ANGLE 0
... ...