From e6e24cdd75936d796f3c0af6689be74bb44d9dff Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 23 Feb 2015 21:22:02 +0000 Subject: [PATCH] Opções para controlar a escala dos símbolos --- admin/admin.db | Bin 278528 -> 0 bytes classesphp/classe_legenda.php | 16 +++++++++++----- classesphp/mapa_controle.php | 5 ++++- classesphp/mapa_googlemaps.php | 1 + css/i3geo6.css | 4 ++++ css/i3geo6.css.php | 4 ++++ ferramentas/atalhoscamada/index.js | 2 +- ferramentas/legenda/dicionario.js | 15 +++++++++++++++ ferramentas/legenda/index.js | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------- 9 files changed, 110 insertions(+), 18 deletions(-) diff --git a/admin/admin.db b/admin/admin.db index 862b01d..b453626 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/classesphp/classe_legenda.php b/classesphp/classe_legenda.php index 09cd062..73448a2 100644 --- a/classesphp/classe_legenda.php +++ b/classesphp/classe_legenda.php @@ -44,7 +44,7 @@ class Legenda Objeto mapa */ - protected $mapa; + public $mapa; /* Variavel: $arquivo @@ -56,7 +56,7 @@ class Legenda Objeto layer */ - protected $layer; + public $layer; /* Variavel: $nome @@ -600,7 +600,8 @@ parameters: $classe - Índice da classe. return: -string com o tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size| +string com o +tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size,symbolscaledenom,maxsize,minsize| */ function pegaParametros($classe) { @@ -629,9 +630,12 @@ string com o tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbo $linha[] = ""; $linha[] = ""; } + $linha[] = $this->layer->symbolscaledenom; + $linha[] = $estilo->minsize; + $linha[] = $estilo->maxsize; $linhas[] = $tipoLayer."#".implode("#",$linha); } - //retorna tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size + //retorna tipo do layer,id do estilo,outlinecolor,backgroundcolor,color,symbolname,size,symbolscaledenom return implode("|",$linhas); } /* @@ -657,7 +661,7 @@ $size - Tamanho que será aplicado ao símbolo. $opacidade - Opacidade */ - function aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade,$width,$pattern,$angle) + function aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade,$width,$pattern,$angle,$minsize=0,$maxsize=500) { if(!$this->layer){return "erro";} if(!empty($pattern)) @@ -708,6 +712,8 @@ $opacidade - Opacidade { $estilo->set("angle",$angle); } + $estilo->set("minsize",$minsize); + $estilo->set("maxsize",$maxsize); if ($this->layer->getmetadata("sld") != "") { $sld = $this->layer->getmetadata("sld"); diff --git a/classesphp/mapa_controle.php b/classesphp/mapa_controle.php index e663c25..d911008 100644 --- a/classesphp/mapa_controle.php +++ b/classesphp/mapa_controle.php @@ -2163,7 +2163,10 @@ switch (strtoupper($funcao)) } if ($opcao == "aplica") { - $retorno = $m->aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade,$width,$pattern,$angle); + $retorno = $m->aplicaParametro($classe,$estilo,$outlinecolor,$backgroundcolor,$color,$symbolname,$size,$opacidade,$width,$pattern,$angle,$minsize,$maxsize); + if(!empty($symbolscale)){ + $m->layer->set("symbolscaledenom",$symbolscale); + } $m->salva(); } if ($opcao == "listaSimbolos"){ diff --git a/classesphp/mapa_googlemaps.php b/classesphp/mapa_googlemaps.php index f30fc79..c670b36 100644 --- a/classesphp/mapa_googlemaps.php +++ b/classesphp/mapa_googlemaps.php @@ -164,6 +164,7 @@ if(!isset($_GET["telaR"])){ //corrige um bug do mapserver que nao calcula a escala direito $l->set("maxscaledenom",$l->maxscaledenom * 100000); $l->set("minscaledenom",$l->minscaledenom * 100000); + $l->set("symbolscaledenom",$l->symbolscaledenom * 100000); if ($l->getmetadata("classesnome") != ""){ if(!function_exists("autoClasses")){ include_once("funcoes_gerais.php"); diff --git a/css/i3geo6.css b/css/i3geo6.css index c8f2bbc..174bae2 100755 --- a/css/i3geo6.css +++ b/css/i3geo6.css @@ -2207,6 +2207,10 @@ width: 16px; height: 16px; float: left; } +.i3GEOiconeXis { +background-image: url("../imagens/oxygen/16x16/edit-delete.png"); +cursor: pointer; +} .i3GEOiconemmscale{ background-image: URL('../imagens/oxygen/16x16/graphics-viewer-document.png'); } diff --git a/css/i3geo6.css.php b/css/i3geo6.css.php index 24ca2bb..c168d92 100755 --- a/css/i3geo6.css.php +++ b/css/i3geo6.css.php @@ -2207,6 +2207,10 @@ width: 16px; height: 16px; float: left; } +.i3GEOiconeXis { +background-image: url("../imagens/oxygen/16x16/edit-delete.png"); +cursor: pointer; +} .i3GEOiconemmscale{ background-image: URL('../imagens/oxygen/16x16/graphics-viewer-document.png'); } diff --git a/ferramentas/atalhoscamada/index.js b/ferramentas/atalhoscamada/index.js index 847e1c2..0e2d7ca 100755 --- a/ferramentas/atalhoscamada/index.js +++ b/ferramentas/atalhoscamada/index.js @@ -4,7 +4,7 @@ if (typeof (i3GEOF) === 'undefined') { /* * Classe: i3GEOF.atalhoscamada */ -//TODO verificar se o parametro cache esta funcionando +//XODO construir links com base no menu suspenso i3GEOF.atalhoscamada = { /** diff --git a/ferramentas/legenda/dicionario.js b/ferramentas/legenda/dicionario.js index 6ea41ea..a246955 100644 --- a/ferramentas/legenda/dicionario.js +++ b/ferramentas/legenda/dicionario.js @@ -509,5 +509,20 @@ i3GEOF.legenda.dicionario = { pt : "aplicar", en : "", es : "" + } ], + 'symbolscale' : [ { + 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)", + en : "", + es : "" + } ], + 'minsize' : [ { + pt : "Menor tamanho (pixels), que os símbolos serão desenhados, quando a escala de desenho de símbolos estiver ativo", + en : "", + es : "" + } ], + 'maxsize' : [ { + pt : "Maior tamanho (pixels), que os símbolos serão desenhados, quando a escala de desenho de símbolos estiver ativo", + en : "", + es : "" } ] }; diff --git a/ferramentas/legenda/index.js b/ferramentas/legenda/index.js index 2c8b0d7..8ae97f3 100644 --- a/ferramentas/legenda/index.js +++ b/ferramentas/legenda/index.js @@ -41,8 +41,6 @@ if (typeof (i3GEOF) === 'undefined') { * Classe: i3GEOF.legenda */ //XODO incluir um construtor de expressao na legenda -//XODO incluir SYMBOLSCALEDENOM -//XODO incluir link para ferramenta de definicao da escala i3GEOF.legenda = { /* @@ -1532,6 +1530,39 @@ i3GEOF.legenda = + linha[10] + "' id='i3GEOlegendaangulo' />" + "" + + + "
" + + "

" + + $trad('symbolscale', i3GEOF.legenda.dicionario) + + ":

" + + "
" + + "
" + + "" + + "
" + + + "
" + + "

" + + $trad('minsize', i3GEOF.legenda.dicionario) + + ":

" + + "
" + + "
" + + "" + + "
" + + + "
" + + "

" + + $trad('maxsize', i3GEOF.legenda.dicionario) + + ":

" + + "
" + + "
" + + "" + + "
" + "
" + "

" @@ -1602,11 +1633,28 @@ i3GEOF.legenda = return; } i3GEOF.legenda.aguarde.visibility = "visible"; - var outlinecolor = $i("i3GEOlegendaoutlinecolor").value, backgroundcolor = $i("i3GEOlegendabackgroundcolor").value, color = - $i("i3GEOlegendacolor").value, symbolname = $i("i3GEOlegendasymbolname").value, simbolos = - $i("i3GEOlegendasimbolos").getElementsByTagName("img"), valido = "nao", n = simbolos.length, size = - $i("i3GEOlegendasizes").value, width = $i("i3GEOlegendawidth").value, pattern = $i("i3GEOlegendapattern").value, opacidade = - $i("i3GEOlegendaopacidade").value, angle = $i("i3GEOlegendaangulo").value, i, p, cp, fim; + var i, p, cp, fim, + outlinecolor = $i("i3GEOlegendaoutlinecolor").value, + backgroundcolor = $i("i3GEOlegendabackgroundcolor").value, + color = $i("i3GEOlegendacolor").value, + symbolname = $i("i3GEOlegendasymbolname").value, + simbolos = $i("i3GEOlegendasimbolos").getElementsByTagName("img"), + valido = "nao", + n = simbolos.length, + size = $i("i3GEOlegendasizes").value, + width = $i("i3GEOlegendawidth").value, + pattern = $i("i3GEOlegendapattern").value, + opacidade = $i("i3GEOlegendaopacidade").value, + angle = $i("i3GEOlegendaangulo").value, + symbolscale = $i("i3GEOlegendasymbolscale").value, + minsize = $i("i3GEOlegendaminsize").value, + maxsize = $i("i3GEOlegendamaxsize").value; + if(symbolscale != ""){ + symbolscale = parseInt(symbolscale,10); + } + else{ + symbolscale = -1; + } for (i = 0; i < n; i++) { if (simbolos[i].title == symbolname || symbolname == i) { valido = "sim"; @@ -1619,10 +1667,21 @@ i3GEOF.legenda = } p = i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?g_sid=" + i3GEO.configura.sid - + "&funcao=editasimbolo&opcao=aplica&tema=" + i3GEOF.legenda.tema + "&classe=" + i3GEOF.legenda.classe + "&estilo=" - + i3GEOF.legenda.estilo + "&outlinecolor=" + outlinecolor + "&backgroundcolor=" + backgroundcolor + "&color=" - + color + "&symbolname=" + symbolname + "&width=" + width + "&pattern=" + pattern + "&size=" + size + "&opacidade=" - + opacidade + "&angle=" + angle; + + "&funcao=editasimbolo&opcao=aplica&tema=" + i3GEOF.legenda.tema + + "&classe=" + i3GEOF.legenda.classe + + "&estilo=" + i3GEOF.legenda.estilo + + "&outlinecolor=" + outlinecolor + + "&backgroundcolor=" + backgroundcolor + + "&color=" + color + + "&symbolname=" + symbolname + + "&width=" + width + + "&pattern=" + pattern + + "&size=" + size + + "&opacidade=" + opacidade + + "&angle=" + angle + + "&symbolscale=" + symbolscale + + "&minsize=" + minsize + + "&maxsize=" + maxsize; cp = new cpaint(); fim = function() { i3GEOF.legenda.aposAlterarLegenda(); -- libgit2 0.21.2