diff --git a/admin/admin.db b/admin/admin.db index ae63605..79d31fe 100644 Binary files a/admin/admin.db and b/admin/admin.db differ diff --git a/classesjs/classe_interface.js b/classesjs/classe_interface.js index b86a845..4046f43 100644 --- a/classesjs/classe_interface.js +++ b/classesjs/classe_interface.js @@ -1142,7 +1142,8 @@ i3GEO.Interface = { // verifica se a camada contem um plugin do i3geo // caso tenha, direciona para a classe_i3geoplugin if (camada.plugini3geo != "") { - i3GEO.pluginI3geo.inicia(camada.plugini3geo.tipo,camada.plugini3geo.parametros); + i3GEO.pluginI3geo.inicia(camada); + continue; } else { if (camada.cache) { urllayer = url + "&cache=" + camada.cache @@ -1250,10 +1251,12 @@ i3GEO.Interface = { } catch (e) { } } - if (camada.escondido.toLowerCase() === "sim") { - layer.transitionEffect = "null"; + if (layer && layer != "") { + if (camada.escondido.toLowerCase() === "sim") { + layer.transitionEffect = "null"; + } + i3geoOL.addLayer(layer); } - i3geoOL.addLayer(layer); } else { layer = i3geoOL.getLayersByName(camada.name)[0]; } diff --git a/classesjs/classe_plugini3geo.js b/classesjs/classe_plugini3geo.js index e8ac67f..9712319 100644 --- a/classesjs/classe_plugini3geo.js +++ b/classesjs/classe_plugini3geo.js @@ -1,11 +1,144 @@ +/** + * Title: pluginI3geo + * + * i3GEO.pluginI3geo + * + * Implementam os plugins do i3Geo que adicionam camadas especiais ao mapa, + * normalmente dados vetoriais. + * + * Arquivo: + * + * i3geo/classesjs/classe_plugini3geo.js + * + * Licença: + * + * GPL2 + * + * i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet + * + * Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente + * Brasil Desenvolvedor: Edmar Moretti edmar.moretti@gmail.com + * + * Este programa é software livre; você pode redistribuí-lo + * e/ou modificá-lo sob os termos da Licença Pública Geral + * GNU conforme publicada pela Free Software Foundation; + * + * Este programa é distribuído na expectativa de que seja + * útil, porém, SEM NENHUMA GARANTIA; nem mesmo a garantia + * implícita de COMERCIABILIDADE OU ADEQUACÃO A UMA FINALIDADE + * ESPECÍFICA. Consulte a Licença Pública Geral do GNU para + * mais detalhes. Você deve ter recebido uma cópia da + * Licença Pública Geral do GNU junto com este programa; se + * não, escreva para a Free Software Foundation, Inc., no endereço + * 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. + */ + if (typeof (i3GEO) === 'undefined') { var i3GEO = {}; } i3GEO.pluginI3geo = { - inicia : function(tipo, parametros) { - i3GEO.pluginI3geo[tipo](parametros); + /** + * Inicia a execucao de um plugin + * + * Camada e um objeto gerado pelo i3Geo quando uma camada e adicionada ao + * mapa O objeto i3GEO.arvoreDeCamadas.CAMADAS guarda todas as camadas + * adicionadas ao mapa Ao adicionar uma camada pelo catalogo, o i3Geo + * verifica se a camada possui plugin e direciona para ca Os plugins sao + * definidos como metadados em cada mapfile de cada tema + * + * Veja em i3geo/classesphp/classe_mapa.php funcao parametrostemas + */ + inicia : function(camada) { + i3GEO.janela.AGUARDEMODAL = true; + i3GEO.janela.abreAguarde("aguardePlugin","Calculando..."); + i3GEO.janela.AGUARDEMODAL = false; + // chama a funcao conforme o tipo de plugin e a interface atual + // para cada plugin deve haver um objeto com as funcoes especificas para + // cada interface + i3GEO.pluginI3geo[camada.plugini3geo.plugin][i3GEO.Interface.ATUAL] + .call(null, camada); }, - heatmap : function(parametros) { - alert(parametros.coluna); + /** + * Function: heatmap + * + * Mapa de calor + * + * Gera um layer do tipo mapa de calor e adiciona ao mapa + * + * As dependências em javascript sao carregadas via script tag por + * meio de ferramentas/heatmap/openlayers_js.php + * + * Esse programa também obtém os dados necessários ao + * plugin + * + * O layer existente no mapfile deve conter um metadata chamado PLUGINI3GEO + * + * Esse matadado deve conter uma string que será transformada em um + * objeto javascript para uso no plugin + * + * Exemplo: + * + * "PLUGINI3GEO" '{"plugin":"heatmap","parametros":{"coluna":"teste"}}' + * + * Coluna é a que contém os dados numéricos que definem + * a quantidade de uma medida em cada ponto e é usada para gerar a + * representação. Se for vazia, considera-se o valor como 1 + * + * As cores das classes existentes no LAYER serão utilizadas para + * calcular as cores do mapa de calor. Se não existirem classes, + * será usado o default. + * + */ + heatmap : { + openlayers : function(camada) { + var p = i3GEO.configura.locaplic + + "/ferramentas/heatmap/openlayers_js.php", carregaJs = "nao", crialayer; + criaLayer = function() { + var heatmap, g, datalen = heatmap_dados.length, features = []; + if (i3GEO.Interface.openlayers.googleLike === true) { + var sphericalMercatorProj = new OpenLayers.Projection( + 'EPSG:900913'), geographicProj = new OpenLayers.Projection( + 'EPSG:4326'); + } + while (datalen--) { + g = new OpenLayers.Geometry.Point(parseInt( + heatmap_dados[datalen].lng, 10), parseInt( + heatmap_dados[datalen].lat, 10)); + if(geographicProj){ + g.transform(geographicProj, sphericalMercatorProj); + } + features.push(new OpenLayers.Feature.Vector(g, { + count : parseInt(heatmap_dados[datalen].count, 10) + })); + } + + // create our vectorial layer using heatmap renderer + heatmap = new OpenLayers.Layer.Vector(camada.name, { + opacity : 0.3, + renderers : [ 'Heatmap' ], + rendererOptions : { + weight : 'count', + heatmapConfig : { + radius : 10 + } + } + }); + heatmap.addFeatures(features); + i3geoOL.addLayer(heatmap); + heatmap_dados = null; + i3GEO.janela.fechaAguarde("aguardePlugin"); + }; + if (typeof (HeatmapOverlay) === 'undefined') { + carregaJs = "sim"; + } + p += "?carregajs=" + carregaJs + "&layer=" + camada.name + + "&coluna=" + camada.plugini3geo.parametros.coluna + + "&g_sid=" + i3GEO.configura.sid + + "&nomevariavel=heatmap_dados"; + + i3GEO.util.scriptTag(p, criaLayer, + "i3GEO.pluginI3geo.heatmap_script"); + + } } } \ No newline at end of file diff --git a/classesphp/classe_atributos.php b/classesphp/classe_atributos.php index 8e81197..21d7939 100644 --- a/classesphp/classe_atributos.php +++ b/classesphp/classe_atributos.php @@ -24,7 +24,7 @@ Este programa é distribuído na expectativa de que seja útil porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral do GNU para mais detalhes. -Você deve ter recebido uma c�pia da Licença Pública Geral do +Você deve ter recebido uma copia da Licença Pública Geral do GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. @@ -360,7 +360,7 @@ class Atributos parameters: - $itemtema - Tema que será processado. + $itemtema - (opcional) se for definido, apenas um item sera retornado $tipo - Tipo de abrangência espacial (brasil ou mapa). @@ -563,6 +563,84 @@ class Atributos return($resultadoFinal); } /* + function: listaRegistrosXY + + Pega o XY de cada registro e valores de itens especificos + + parameters: + + $items - lista de itens separado por "," + + $tipo - Tipo de abrangência espacial (brasil ou mapa). + + $tipolista - Indica se serão mostrados todos os registros ou apenas os selecionados (tudo|selecionados) + + */ + function listaRegistrosXY($items,$tipo,$tipolista) + { + error_reporting(0); + if(!$this->layer){ + return "erro"; + } + $resultadoFinal = array(); + if ((!isset($tipolista)) || ($tipolista=="")){ + $tipolista = "tudo"; + } + //se tipo for igual a brasil, define a extensão geográfica total + if ($tipo == "brasil"){ + $this->mapa = extPadrao($this->mapa); + } + $this->layer->set("template","none.htm"); + $this->layer->setfilter(""); + if ($this->layer->data == ""){ + return "erro. O tema não tem tabela"; + } + $items = str_replace(" ",",",$items); + $items = explode(",",$items); + $registros = array(); + if ($tipolista == "selecionados"){ + $shapes = retornaShapesSelecionados($this->layer,$this->arquivo,$this->mapa); + $res_count = count($shapes); + for ($i = 0; $i < $res_count; ++$i){ + $valitem = array(); + $shape = $shapes[$i]; + $indx = $shape->index; + foreach ($items as $item){ + $valori = trim($shape->values[$item]); + $valitem[] = array("item"=>$item,"valor"=>$valori); + } + $c = $shape->getCentroid(); + $registros[] = array("indice"=>$indx,"valores"=>$valitem,"x"=>$c->x,"y"=>$c->y); + } + } + if ($tipolista == "tudo"){ + if (@$this->layer->queryByrect($this->mapa->extent) == MS_SUCCESS){ + $res_count = $this->layer->getNumresults(); + $sopen = $this->layer->open(); + for ($i = 0; $i < $res_count; ++$i){ + $valitem = array(); + if($this->v == 6){ + $shape = $this->layer->getShape($this->layer->getResult($i)); + $indx = $shape->index; + } + else{ + $result = $this->layer->getResult($i); + $indx = $result->shapeindex; + $shape = $this->layer->getfeature($indx,-1); + } + foreach ($items as $item){ + $valori = trim($shape->values[$item]); + $valitem[] = array("item"=>$item,"valor"=>$valori); + } + $c = $shape->getCentroid(); + $registros[] = array("indice"=>$indx,"valores"=>$valitem,"x"=>$c->x,"y"=>$c->y); + } + $this->layer->close(); + } + } + return($registros); + } + /* function: buscaRegistros Procura valores em uma tabela que aderem a uma palavra de busca. diff --git a/classesphp/classe_mapa.php b/classesphp/classe_mapa.php index a16deda..08b3e4d 100644 --- a/classesphp/classe_mapa.php +++ b/classesphp/classe_mapa.php @@ -407,7 +407,8 @@ class Mapa $tiles = ""; $plugini3geo = ""; if($oLayer->getmetadata("PLUGINI3GEO") != ""){ - $plugini3geo = base64_encode($oLayer->getmetadata("PLUGINI3GEO")); + $plugini3geo = $oLayer->getmetadata("PLUGINI3GEO"); + $plugini3geo = json_decode($plugini3geo); } //formatacao antiga, antes da versao 6.0 /* diff --git a/documentacao/files/classesjs/classe_editorgm-js.html b/documentacao/files/classesjs/classe_editorgm-js.html new file mode 100755 index 0000000..7b760e6 --- /dev/null +++ b/documentacao/files/classesjs/classe_editorgm-js.html @@ -0,0 +1,22 @@ +i3GEO.editorGM - i3Geo + + + + + + + + + +

i3GEO.editorGM

Funções de edição vetorial utilizadas pelo editor de regiões do sistema METAESTAT

+ +
+ + + + + + + \ No newline at end of file diff --git a/documentacao/index/Constants.html b/documentacao/index/Constants.html new file mode 100755 index 0000000..f3be96a --- /dev/null +++ b/documentacao/index/Constants.html @@ -0,0 +1,33 @@ + + +i3Geo - Constant Index + + + + + + + + + + + + +
Constant Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
A
 ARVORE
F
 FATORESTRELA
I
 IDHTML
+ +
Objeto com a árvore criada com YAHOO.widget.TreeView Pode ser usado para receber métodos da API do YAHOO
+ + + +
Valor que sera utilizado para dividir o valor bruto do numero de acessos de cada tema.
+ + + +
Armazena o ID do elemento DOM onde a árvore foi inserida.
+ +
+ + + \ No newline at end of file diff --git a/documentacao/index/Files.html b/documentacao/index/Files.html new file mode 100755 index 0000000..7e4bc9d --- /dev/null +++ b/documentacao/index/Files.html @@ -0,0 +1,25 @@ + + +i3Geo - File Index + + + + + + + + + + + + +
File Index
$#! · 0-9 · A · B · C · D · E · F · G · H · I · J · K · L · M · N · O · P · Q · R · S · T · U · V · W · X · Y · Z
C
 classe_desenho.js
+ + + +
+ + + \ No newline at end of file diff --git a/documentacao/search/ConstantsA.html b/documentacao/search/ConstantsA.html new file mode 100755 index 0000000..5165635 --- /dev/null +++ b/documentacao/search/ConstantsA.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + +
Search Results
Loading...
Searching...
No Matches
+ + + \ No newline at end of file diff --git a/documentacao/search/ConstantsI.html b/documentacao/search/ConstantsI.html new file mode 100755 index 0000000..4f02b67 --- /dev/null +++ b/documentacao/search/ConstantsI.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + +
Search Results
Loading...
Searching...
No Matches
+ + + \ No newline at end of file diff --git a/documentacao/search/FilesC.html b/documentacao/search/FilesC.html new file mode 100755 index 0000000..6edb962 --- /dev/null +++ b/documentacao/search/FilesC.html @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + +
Search Results
Loading...
Searching...
No Matches
+ + + \ No newline at end of file diff --git a/ferramentas/heatmap/openlayers_js.php b/ferramentas/heatmap/openlayers_js.php new file mode 100644 index 0000000..7df3549 --- /dev/null +++ b/ferramentas/heatmap/openlayers_js.php @@ -0,0 +1,53 @@ +listaRegistrosXY($coluna, "brasil", "tudo"); +$n = count($registros); +$resultado = array(); +if(empty($coluna)){ + foreach($registros as $r){ + $resultado[] = '{"lat":"'.$r["y"].'","lng":"'.$r["x"].'","count":"1"}'; + } +} +else{ + foreach($registros as $r){ + $resultado[] = '{"lat":"'.$r["y"].'","lng":"'.$r["x"].'","count":"'.$r[$coluna].'"}'; + } +} +if (!connection_aborted()){ + if(isset($map_file) && isset($postgis_mapa) && $map_file != "") + restauraCon($map_file,$postgis_mapa); +} + +echo $nomevariavel.' = ['.implode(",",$resultado).'];'; +if($carregajs === "sim"){ + include_once($dir."/../../pacotes/heatmap/src/heatmap.js"); + include_once($dir."/../../pacotes/heatmap/src/heatmap-openlayers-renderer.js"); +} + +?> \ No newline at end of file diff --git a/temas/_lmapadecalor.map b/temas/_lmapadecalor.map index 0bf4fcf..0a7725a 100644 --- a/temas/_lmapadecalor.map +++ b/temas/_lmapadecalor.map @@ -8,7 +8,7 @@ MAP "TIP" "TIPO,ANOCRIA,NOMELOC" "CLASSE" "SIM" "TEMA" "Localidades (usar com mapa de calor)" - "PLUGINI3GEO" '{plugin:"heatmap",parametros:{coluna:"",valor:1}}' + "PLUGINI3GEO" '{"plugin":"heatmap","parametros":{"coluna":""}}' #se coluna for vazio, assume valor 1 END # METADATA NAME "_lmapadecalor" STATUS OFF -- libgit2 0.21.2