Commit e6e24cdd75936d796f3c0af6689be74bb44d9dff

Authored by Edmar Moretti
1 parent 3c400206

Opções para controlar a escala dos símbolos

admin/admin.db
No preview for this file type
classesphp/classe_legenda.php
... ... @@ -44,7 +44,7 @@ class Legenda
44 44  
45 45 Objeto mapa
46 46 */
47   - protected $mapa;
  47 + public $mapa;
48 48 /*
49 49 Variavel: $arquivo
50 50  
... ... @@ -56,7 +56,7 @@ class Legenda
56 56  
57 57 Objeto layer
58 58 */
59   - protected $layer;
  59 + public $layer;
60 60 /*
61 61 Variavel: $nome
62 62  
... ... @@ -600,7 +600,8 @@ parameters:
600 600 $classe - Índice da classe.
601 601  
602 602 return:
603   -string com o tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size|
  603 +string com o
  604 +tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size,symbolscaledenom,maxsize,minsize|
604 605 */
605 606 function pegaParametros($classe)
606 607 {
... ... @@ -629,9 +630,12 @@ string com o tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbo
629 630 $linha[] = "";
630 631 $linha[] = "";
631 632 }
  633 + $linha[] = $this->layer->symbolscaledenom;
  634 + $linha[] = $estilo->minsize;
  635 + $linha[] = $estilo->maxsize;
632 636 $linhas[] = $tipoLayer."#".implode("#",$linha);
633 637 }
634   - //retorna tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size
  638 + //retorna tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size,symbolscaledenom
635 639 return implode("|",$linhas);
636 640 }
637 641 /*
... ... @@ -657,7 +661,7 @@ $size - Tamanho que será aplicado ao símbolo.
657 661  
658 662 $opacidade - Opacidade
659 663 */
660   - function aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade,$width,$pattern,$angle)
  664 + function aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade,$width,$pattern,$angle,$minsize=0,$maxsize=500)
661 665 {
662 666 if(!$this->layer){return "erro";}
663 667 if(!empty($pattern))
... ... @@ -708,6 +712,8 @@ $opacidade - Opacidade
708 712 {
709 713 $estilo->set("angle",$angle);
710 714 }
  715 + $estilo->set("minsize",$minsize);
  716 + $estilo->set("maxsize",$maxsize);
711 717 if ($this->layer->getmetadata("sld") != "")
712 718 {
713 719 $sld = $this->layer->getmetadata("sld");
... ...
classesphp/mapa_controle.php
... ... @@ -2163,7 +2163,10 @@ switch (strtoupper($funcao))
2163 2163 }
2164 2164 if ($opcao == "aplica")
2165 2165 {
2166   - $retorno = $m->aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade,$width,$pattern,$angle);
  2166 + $retorno = $m->aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade,$width,$pattern,$angle,$minsize,$maxsize);
  2167 + if(!empty($symbolscale)){
  2168 + $m->layer->set("symbolscaledenom",$symbolscale);
  2169 + }
2167 2170 $m->salva();
2168 2171 }
2169 2172 if ($opcao == "listaSimbolos"){
... ...
classesphp/mapa_googlemaps.php
... ... @@ -164,6 +164,7 @@ if(!isset($_GET["telaR"])){
164 164 //corrige um bug do mapserver que nao calcula a escala direito
165 165 $l->set("maxscaledenom",$l->maxscaledenom * 100000);
166 166 $l->set("minscaledenom",$l->minscaledenom * 100000);
  167 + $l->set("symbolscaledenom",$l->symbolscaledenom * 100000);
167 168 if ($l->getmetadata("classesnome") != ""){
168 169 if(!function_exists("autoClasses")){
169 170 include_once("funcoes_gerais.php");
... ...
css/i3geo6.css
... ... @@ -2207,6 +2207,10 @@ width: 16px;
2207 2207 height: 16px;
2208 2208 float: left;
2209 2209 }
  2210 +.i3GEOiconeXis {
  2211 +background-image: url("../imagens/oxygen/16x16/edit-delete.png");
  2212 +cursor: pointer;
  2213 +}
2210 2214 .i3GEOiconemmscale{
2211 2215 background-image: URL('../imagens/oxygen/16x16/graphics-viewer-document.png');
2212 2216 }
... ...
css/i3geo6.css.php
... ... @@ -2207,6 +2207,10 @@ width: 16px;
2207 2207 height: 16px;
2208 2208 float: left;
2209 2209 }
  2210 +.i3GEOiconeXis {
  2211 +background-image: url("../imagens/oxygen/16x16/edit-delete.png");
  2212 +cursor: pointer;
  2213 +}
2210 2214 .i3GEOiconemmscale{
2211 2215 background-image: URL('../imagens/oxygen/16x16/graphics-viewer-document.png');
2212 2216 }
... ...
ferramentas/atalhoscamada/index.js
... ... @@ -4,7 +4,7 @@ if (typeof (i3GEOF) === 'undefined') {
4 4 /*
5 5 * Classe: i3GEOF.atalhoscamada
6 6 */
7   -//TODO verificar se o parametro cache esta funcionando
  7 +//XODO construir links com base no menu suspenso
8 8 i3GEOF.atalhoscamada =
9 9 {
10 10 /**
... ...
ferramentas/legenda/dicionario.js
... ... @@ -509,5 +509,20 @@ i3GEOF.legenda.dicionario = {
509 509 pt : "aplicar",
510 510 en : "",
511 511 es : ""
  512 + } ],
  513 + 'symbolscale' : [ {
  514 + pt : "Denominador da escala na qual o símbolo será apresentado com o tamanho definido. Esse parâmetro funciona em conjunto com MAXSCALE e MINSCALE e é válido para a camada como um todo e não para cada estilo (afeta pontos)",
  515 + en : "",
  516 + es : ""
  517 + } ],
  518 + 'minsize' : [ {
  519 + pt : "Menor tamanho (pixels), que os símbolos serão desenhados, quando a escala de desenho de símbolos estiver ativo",
  520 + en : "",
  521 + es : ""
  522 + } ],
  523 + 'maxsize' : [ {
  524 + pt : "Maior tamanho (pixels), que os símbolos serão desenhados, quando a escala de desenho de símbolos estiver ativo",
  525 + en : "",
  526 + es : ""
512 527 } ]
513 528 };
... ...
ferramentas/legenda/index.js
... ... @@ -41,8 +41,6 @@ if (typeof (i3GEOF) === 'undefined') {
41 41 * Classe: i3GEOF.legenda
42 42 */
43 43 //XODO incluir um construtor de expressao na legenda
44   -//XODO incluir SYMBOLSCALEDENOM
45   -//XODO incluir link para ferramenta de definicao da escala
46 44 i3GEOF.legenda =
47 45 {
48 46 /*
... ... @@ -1532,6 +1530,39 @@ i3GEOF.legenda =
1532 1530 + linha[10]
1533 1531 + "' id='i3GEOlegendaangulo' />"
1534 1532 + "</form></div>"
  1533 +
  1534 + + "<br><img style='float:left;' src='"+i3GEO.configura.locaplic+"/imagens/branco.gif' />"
  1535 + + "<p class='paragrafo'>"
  1536 + + $trad('symbolscale', i3GEOF.legenda.dicionario)
  1537 + + ":</p>"
  1538 + + "<div class='i3geoForm i3geoFormIconeEdita' >"
  1539 + + "<form onsubmit='i3GEOF.legenda.aplicaEstilo();return false;'>"
  1540 + + "<input type=text value='"
  1541 + + linha[11]
  1542 + + "' id='i3GEOlegendasymbolscale' />"
  1543 + + "</form></div>"
  1544 +
  1545 + + "<br><img style='float:left;' onclick='i3GEOF.legenda.aplicaTodasClasses(\"angle\",\"i3GEOlegendaangulo\")' title='"+$trad('aplicatodos', i3GEOF.legenda.dicionario)+"' src='"+i3GEO.configura.locaplic+"/imagens/oxygen/16x16/tools-wizard.png' />"
  1546 + + "<p class='paragrafo'>"
  1547 + + $trad('minsize', i3GEOF.legenda.dicionario)
  1548 + + ":</p>"
  1549 + + "<div class='i3geoForm i3geoFormIconeEdita' >"
  1550 + + "<form onsubmit='i3GEOF.legenda.aplicaEstilo();return false;'>"
  1551 + + "<input type=text value='"
  1552 + + linha[12]
  1553 + + "' id='i3GEOlegendaminsize' />"
  1554 + + "</form></div>"
  1555 +
  1556 + + "<br><img style='float:left;' onclick='i3GEOF.legenda.aplicaTodasClasses(\"angle\",\"i3GEOlegendaangulo\")' title='"+$trad('aplicatodos', i3GEOF.legenda.dicionario)+"' src='"+i3GEO.configura.locaplic+"/imagens/oxygen/16x16/tools-wizard.png' />"
  1557 + + "<p class='paragrafo'>"
  1558 + + $trad('maxsize', i3GEOF.legenda.dicionario)
  1559 + + ":</p>"
  1560 + + "<div class='i3geoForm i3geoFormIconeEdita' >"
  1561 + + "<form onsubmit='i3GEOF.legenda.aplicaEstilo();return false;'>"
  1562 + + "<input type=text value='"
  1563 + + linha[13]
  1564 + + "' id='i3GEOlegendamaxsize' />"
  1565 + + "</form></div>"
1535 1566  
1536 1567 + "<br><img style='float:left;' onclick='i3GEOF.legenda.aplicaTodasClasses(\"symbolname\",\"i3GEOlegendasymbolname\")' title='"+$trad('aplicatodos', i3GEOF.legenda.dicionario)+"' src='"+i3GEO.configura.locaplic+"/imagens/oxygen/16x16/tools-wizard.png' />"
1537 1568 + "<p class='paragrafo'>"
... ... @@ -1602,11 +1633,28 @@ i3GEOF.legenda =
1602 1633 return;
1603 1634 }
1604 1635 i3GEOF.legenda.aguarde.visibility = "visible";
1605   - var outlinecolor = $i("i3GEOlegendaoutlinecolor").value, backgroundcolor = $i("i3GEOlegendabackgroundcolor").value, color =
1606   - $i("i3GEOlegendacolor").value, symbolname = $i("i3GEOlegendasymbolname").value, simbolos =
1607   - $i("i3GEOlegendasimbolos").getElementsByTagName("img"), valido = "nao", n = simbolos.length, size =
1608   - $i("i3GEOlegendasizes").value, width = $i("i3GEOlegendawidth").value, pattern = $i("i3GEOlegendapattern").value, opacidade =
1609   - $i("i3GEOlegendaopacidade").value, angle = $i("i3GEOlegendaangulo").value, i, p, cp, fim;
  1636 + var i, p, cp, fim,
  1637 + outlinecolor = $i("i3GEOlegendaoutlinecolor").value,
  1638 + backgroundcolor = $i("i3GEOlegendabackgroundcolor").value,
  1639 + color = $i("i3GEOlegendacolor").value,
  1640 + symbolname = $i("i3GEOlegendasymbolname").value,
  1641 + simbolos = $i("i3GEOlegendasimbolos").getElementsByTagName("img"),
  1642 + valido = "nao",
  1643 + n = simbolos.length,
  1644 + size = $i("i3GEOlegendasizes").value,
  1645 + width = $i("i3GEOlegendawidth").value,
  1646 + pattern = $i("i3GEOlegendapattern").value,
  1647 + opacidade = $i("i3GEOlegendaopacidade").value,
  1648 + angle = $i("i3GEOlegendaangulo").value,
  1649 + symbolscale = $i("i3GEOlegendasymbolscale").value,
  1650 + minsize = $i("i3GEOlegendaminsize").value,
  1651 + maxsize = $i("i3GEOlegendamaxsize").value;
  1652 + if(symbolscale != ""){
  1653 + symbolscale = parseInt(symbolscale,10);
  1654 + }
  1655 + else{
  1656 + symbolscale = -1;
  1657 + }
1610 1658 for (i = 0; i < n; i++) {
1611 1659 if (simbolos[i].title == symbolname || symbolname == i) {
1612 1660 valido = "sim";
... ... @@ -1619,10 +1667,21 @@ i3GEOF.legenda =
1619 1667 }
1620 1668 p =
1621 1669 i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid
1622   - + "&funcao=editasimbolo&opcao=aplica&tema=" + i3GEOF.legenda.tema + "&classe=" + i3GEOF.legenda.classe + "&estilo="
1623   - + i3GEOF.legenda.estilo + "&outlinecolor=" + outlinecolor + "&backgroundcolor=" + backgroundcolor + "&color="
1624   - + color + "&symbolname=" + symbolname + "&width=" + width + "&pattern=" + pattern + "&size=" + size + "&opacidade="
1625   - + opacidade + "&angle=" + angle;
  1670 + + "&funcao=editasimbolo&opcao=aplica&tema=" + i3GEOF.legenda.tema
  1671 + + "&classe=" + i3GEOF.legenda.classe
  1672 + + "&estilo=" + i3GEOF.legenda.estilo
  1673 + + "&outlinecolor=" + outlinecolor
  1674 + + "&backgroundcolor=" + backgroundcolor
  1675 + + "&color=" + color
  1676 + + "&symbolname=" + symbolname
  1677 + + "&width=" + width
  1678 + + "&pattern=" + pattern
  1679 + + "&size=" + size
  1680 + + "&opacidade=" + opacidade
  1681 + + "&angle=" + angle
  1682 + + "&symbolscale=" + symbolscale
  1683 + + "&minsize=" + minsize
  1684 + + "&maxsize=" + maxsize;
1626 1685 cp = new cpaint();
1627 1686 fim = function() {
1628 1687 i3GEOF.legenda.aposAlterarLegenda();
... ...