From 9d8ec701b6556fb118fada4b1d5278d36b1f1049 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Sun, 24 Sep 2017 14:45:56 -0300 Subject: [PATCH] Inclusão de variável para definir se haverá ou não registro no banco de dados quando uma camada é adicionada ao mapa --- admin/php/admin.php | 2 +- admin/php/webservices.php | 166 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ classesphp/classe_mapa.php | 72 +++++++++++++++++------------------------------------------------------- classesphp/classe_metaestatinfo.php | 2 +- classesphp/conexao.php | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ classesphp/funcoes_gerais.php | 4 ++-- classesphp/wmswfs.php | 18 +----------------- css/i3geo7.css.php | 0 ferramentas/abrefontemapfile.php | 2 +- ferramentas/editorgm/editorgm_compacto.js | 0 ferramentas/editorol/editorol.js | 520 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ferramentas/editorol/editorol_compacto.js | 2 +- init/remover.php | 46 ---------------------------------------------- js/compactados/ajuda_compacto.js | 0 js/compactados/analise_compacto.js | 0 js/compactados/arvoredecamadas_compacto.js | 0 js/compactados/arvoredetemas_compacto.js | 0 js/compactados/base64_compacto.js | 0 js/compactados/busca_compacto.js | 0 js/compactados/caixaDeFerramentas_compacto.js | 0 js/compactados/calculo_compacto.js | 0 js/compactados/catalogoDir_compacto.js | 0 js/compactados/catalogoEstrelas_compacto.js | 0 js/compactados/catalogoInde_compacto.js | 0 js/compactados/catalogoMapas_compacto.js | 0 js/compactados/catalogoMenus_compacto.js | 0 js/compactados/catalogoMetaestat_compacto.js | 0 js/compactados/catalogoOgc_compacto.js | 0 js/compactados/catalogoRegioes_compacto.js | 0 js/compactados/catalogoSistemas_compacto.js | 0 js/compactados/configura_compacto.js | 0 js/compactados/coordenadas_compacto.js | 0 js/compactados/desenho_compacto.js | 0 js/compactados/dicionario_ajuda_compacto.js | 0 js/compactados/dicionario_compacto.js | 0 js/compactados/editor_compacto.js | 0 js/compactados/eventos_compacto.js | 0 js/compactados/guias_compacto.js | 0 js/compactados/idioma_compacto.js | 0 js/compactados/ini_i3geo_compacto.js | 0 js/compactados/interface_compacto.js | 0 js/compactados/janela_compacto.js | 0 js/compactados/legenda_compacto.js | 0 js/compactados/login_compacto.js | 0 js/compactados/mapa_compacto.js | 0 js/compactados/maparef_compacto.js | 0 js/compactados/marcador_compacto.js | 0 js/compactados/mustache.js | 0 js/compactados/navega_compacto.js | 0 js/compactados/php_compacto.js | 0 js/compactados/plugini3geo_compacto.js | 0 js/compactados/proj4js.js | 0 js/compactados/social_compacto.js | 0 js/compactados/tema_compacto.js | 0 js/compactados/util_compacto.js | 0 js/compactados/wicket.js | 0 js/i3geo_tudo_compacto7.js.php | 0 kml.php | 10 +++++----- mashups/openlayersdebug.php | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------- ms_configura.php | 15 ++++++++++++--- pacotes/cpaint/cpaint2_compacto.inc.js | 0 pacotes/mobileesp/mdetect_compacto.js | 0 pacotes/yui290/build/carousel/carousel_compacto.js | 0 pacotes/yui290/build/container/container_compacto.js | 0 pacotes/yui290/build/container/container_core_compacto.js | 0 pacotes/yui290/build/resize/resize_compacto.js | 0 pacotes/yui290/build/treeview/treeview_compacto.js | 0 pacotes/yui290/build/utilities/utilities_compacto.js | 0 testainstal/index.php | 4 ++-- 69 files changed, 480 insertions(+), 529 deletions(-) create mode 100755 admin/php/webservices.php create mode 100755 classesphp/conexao.php mode change 100755 => 100644 css/i3geo7.css.php mode change 100755 => 100644 ferramentas/editorgm/editorgm_compacto.js mode change 100755 => 100644 ferramentas/editorol/editorol_compacto.js mode change 100755 => 100644 js/compactados/ajuda_compacto.js mode change 100755 => 100644 js/compactados/analise_compacto.js mode change 100755 => 100644 js/compactados/arvoredecamadas_compacto.js mode change 100755 => 100644 js/compactados/arvoredetemas_compacto.js mode change 100755 => 100644 js/compactados/base64_compacto.js mode change 100755 => 100644 js/compactados/busca_compacto.js mode change 100755 => 100644 js/compactados/caixaDeFerramentas_compacto.js mode change 100755 => 100644 js/compactados/calculo_compacto.js mode change 100755 => 100644 js/compactados/catalogoDir_compacto.js mode change 100755 => 100644 js/compactados/catalogoEstrelas_compacto.js mode change 100755 => 100644 js/compactados/catalogoInde_compacto.js mode change 100755 => 100644 js/compactados/catalogoMapas_compacto.js mode change 100755 => 100644 js/compactados/catalogoMenus_compacto.js mode change 100755 => 100644 js/compactados/catalogoMetaestat_compacto.js mode change 100755 => 100644 js/compactados/catalogoOgc_compacto.js mode change 100755 => 100644 js/compactados/catalogoRegioes_compacto.js mode change 100755 => 100644 js/compactados/catalogoSistemas_compacto.js mode change 100755 => 100644 js/compactados/configura_compacto.js mode change 100755 => 100644 js/compactados/coordenadas_compacto.js mode change 100755 => 100644 js/compactados/desenho_compacto.js mode change 100755 => 100644 js/compactados/dicionario_ajuda_compacto.js mode change 100755 => 100644 js/compactados/dicionario_compacto.js mode change 100755 => 100644 js/compactados/editor_compacto.js mode change 100755 => 100644 js/compactados/eventos_compacto.js mode change 100755 => 100644 js/compactados/guias_compacto.js mode change 100755 => 100644 js/compactados/idioma_compacto.js mode change 100755 => 100644 js/compactados/ini_i3geo_compacto.js mode change 100755 => 100644 js/compactados/interface_compacto.js mode change 100755 => 100644 js/compactados/janela_compacto.js mode change 100755 => 100644 js/compactados/legenda_compacto.js mode change 100755 => 100644 js/compactados/login_compacto.js mode change 100755 => 100644 js/compactados/mapa_compacto.js mode change 100755 => 100644 js/compactados/maparef_compacto.js mode change 100755 => 100644 js/compactados/marcador_compacto.js mode change 100755 => 100644 js/compactados/mustache.js mode change 100755 => 100644 js/compactados/navega_compacto.js mode change 100755 => 100644 js/compactados/php_compacto.js mode change 100755 => 100644 js/compactados/plugini3geo_compacto.js mode change 100755 => 100644 js/compactados/proj4js.js mode change 100755 => 100644 js/compactados/social_compacto.js mode change 100755 => 100644 js/compactados/tema_compacto.js mode change 100755 => 100644 js/compactados/util_compacto.js mode change 100755 => 100644 js/compactados/wicket.js mode change 100755 => 100644 js/i3geo_tudo_compacto7.js.php mode change 100755 => 100644 pacotes/cpaint/cpaint2_compacto.inc.js mode change 100755 => 100644 pacotes/mobileesp/mdetect_compacto.js mode change 100755 => 100644 pacotes/yui290/build/carousel/carousel_compacto.js mode change 100755 => 100644 pacotes/yui290/build/container/container_compacto.js mode change 100755 => 100644 pacotes/yui290/build/container/container_core_compacto.js mode change 100755 => 100644 pacotes/yui290/build/resize/resize_compacto.js mode change 100755 => 100644 pacotes/yui290/build/treeview/treeview_compacto.js mode change 100755 => 100644 pacotes/yui290/build/utilities/utilities_compacto.js diff --git a/admin/php/admin.php b/admin/php/admin.php index 703ba62..376ee76 100755 --- a/admin/php/admin.php +++ b/admin/php/admin.php @@ -194,7 +194,7 @@ function pegaDados($sql,$dbh="",$close=true) $resultado = array(); //is_string para efeitos de compatibilidade if($dbh == "" || is_string($dbh)){ - include(dirname(__FILE__)."/conexao.php"); + include(dirname(__FILE__)."/../adin1/php/conexao.php"); } error_reporting(0); //$dbh deve ser definido com somente leitura, mas por prevencao: diff --git a/admin/php/webservices.php b/admin/php/webservices.php new file mode 100755 index 0000000..984136a --- /dev/null +++ b/admin/php/webservices.php @@ -0,0 +1,166 @@ + \ No newline at end of file diff --git a/classesphp/classe_mapa.php b/classesphp/classe_mapa.php index 0b9e47a..bc4b8be 100755 --- a/classesphp/classe_mapa.php +++ b/classesphp/classe_mapa.php @@ -73,6 +73,7 @@ class Mapa Returns the MapServer version number (x.y.z) as an integer (x*10000 + y*100 + z). (New in v5.0) e.g. V5.4.3 would return 50403 */ public $vi; + public $i3GeoRegistraAcesso; /* Function: __construct @@ -85,7 +86,9 @@ class Mapa function __construct($map_file,$locaplic="") { include(dirname(__FILE__)."/../ms_configura.php"); - $this->postgis_mapa = $postgis_mapa; + + $this->postgis_mapa = $postgis_mapa; + $this->i3GeoRegistraAcesso = $i3GeoRegistraAcesso; if (!function_exists('ms_newMapObj')) { return false; @@ -1103,7 +1106,7 @@ class Mapa } if($incluitexto == "sim"){ if($this->vi >= 60300){ - $classe->addLabel(new labelObj()); + $classe->addLabel(new labelObj()); $label = $classe->getLabel(0); $s = "CLASS LABEL END END"; $classe->updateFromString($s); @@ -1190,7 +1193,7 @@ class Mapa $temas = explode(",",$temas); $zoomlayer = ""; foreach ($temas as $nome){ - $this->adicionaAcesso($nome,$locaplic); + $this->adicionaAcesso($nome,$locaplic,$this->i3GeoRegistraAcesso); $nomemap = ""; // //verifica se o tema é um arquivo php @@ -1209,53 +1212,7 @@ class Mapa } } if($extensao == ".gvp"){ - if (file_exists($locaplic."/temas/".$nome.".gvp")){ - $nomemap = $locaplic."/temas/".$nome.".gvp"; - } - if (file_exists($nome)){ - $nomemap = $nome; - } - if (file_exists($nome.".gvp")){ - $nomemap = $nome.".gvp"; - } - if ($nomemap != ""){ - include_once($locaplic."/pacotes/gvsig/gvsig2mapfile/class.gvsig2mapfile.php"); - $gm = new gvsig2mapfile($nomemap); - $gvsigview = $gm->getViewsNames(); - foreach($gvsigview as $gv){ - $dataView = $gm->getViewData($gv); - $adicionar = array(); - foreach($dataView["layerNames"] as $t){ - if(!in_array($t,$this->nomes)){ - $adicionar[] = $t; - } - } - $this->mapa = $gm->addLayers($this->mapa,$gv,$adicionar); - } - foreach($adicionar as $nome){ - $l = $this->mapa->getlayerbyname($nome); - //reposiciona o layer se for o caso - if ($l->group == ""){ - $ltipo = $l->type; - if (($ltipo == 2) || ($ltipo == 3)){//poligono = 2 - $indicel = $l->index; - $numlayers = $this->mapa->numlayers; - $nummove = 0; - for ($i = $numlayers-1;$i > 0;$i--){ - $layerAbaixo = $this->mapa->getlayer($i); - $tipo = $layerAbaixo->type; - if (($tipo != 2) && ($tipo != 3)){ - $nummove++; - } - } - for ($i=0;$i<($nummove);++$i){ - $indicel = $l->index; - $this->mapa->movelayerup($indicel); - } - } - } - } - } + return; } if($extensao == ".map"){ if (file_exists($locaplic."/temas/".$nome.".map")){ @@ -1538,10 +1495,12 @@ class Mapa if($versao == ""){ $versao = "1.1.1"; } - if(file_exists($this->locaplic."/classesphp/wmswfs.php")) + if(file_exists($this->locaplic."/classesphp/wmswfs.php")){ include_once($this->locaplic."/classesphp/wmswfs.php"); - else + } + else { include_once("wmswfs.php"); + } //limpa selecao if (file_exists($this->qyfile)) { @@ -2080,10 +2039,13 @@ class Mapa } return("ok"); } - function adicionaAcesso($codigo_tema,$locaplic) + function adicionaAcesso($codigo_tema,$locaplic,$i3GeoRegistraAcesso=false) { - $resultado = array(); - include("$locaplic/admin/php/conexao.php"); + if($i3GeoRegistraAcesso == false){ + return; + } + $resultado = array(); + include("$locaplic/classesphp/conexao.php"); if(!empty($esquemaadmin)){ $esquemaadmin = str_replace(".","",$esquemaadmin)."."; } diff --git a/classesphp/classe_metaestatinfo.php b/classesphp/classe_metaestatinfo.php index eccf97a..429b80d 100755 --- a/classesphp/classe_metaestatinfo.php +++ b/classesphp/classe_metaestatinfo.php @@ -35,7 +35,7 @@ class MetaestatInfo{ * Faz o include de conexao.php que por sua vez faz o include de i3geo/ms_configura.php */ function __construct(){ - include(dirname(__FILE__)."/../admin/php/conexao.php"); + include(dirname(__FILE__)."/conexao.php"); //vem do include $this->dir_tmp = $dir_tmp; $this->logTransacoes = $logTransacoes; diff --git a/classesphp/conexao.php b/classesphp/conexao.php new file mode 100755 index 0000000..9f56cc6 --- /dev/null +++ b/classesphp/conexao.php @@ -0,0 +1,74 @@ +A extensao do PHP 'PDO' nao esta instalada."; + exit; + } + if (!extension_loaded( "pdo_sqlite")){ + echo "Problema: não está instalado a pdo_sqlite
"; + exit; + } + if (!extension_loaded( "SQLite") && !extension_loaded( "sqlite3")){ + echo "Problema: não está instalado a SQLite
"; + exit; + } + try { + //para escrita + $dbhw = new PDO($conAdminw); + //para leitura + $dbh = new PDO($conAdmin); + if($i3GeoRegistraAcesso == false){ + $dbhw = $dbh; + } + } + catch (PDOException $e) { + print "Erro ao criar o objeto PDO!:
Talvez exista alguma incompatibilidade entre o PHP e o banco admin.db. Vc pode apagar o arquivo menutemas/admin.db e recria-lo com admin/php/criasqlite.php"; + die(); + } +} +else { + if(file_exists($conexaoadmin)){ + include($conexaoadmin); + if($i3GeoRegistraAcesso == false){ + $dbhw = $dbh; + } + } else { + echo "Arquivo de conexao nao existe"; + exit; + } +} +?> \ No newline at end of file diff --git a/classesphp/funcoes_gerais.php b/classesphp/funcoes_gerais.php index 78d7172..275655b 100755 --- a/classesphp/funcoes_gerais.php +++ b/classesphp/funcoes_gerais.php @@ -3034,7 +3034,7 @@ function restauraMapaAdmin($id_mapa,$dir_tmp){ if (filter_var($id_mapa, FILTER_VALIDATE_INT) === false){ exit; } - include(dirname(__FILE__)."/../admin/php/conexao.php"); + include(dirname(__FILE__)."/classesphp/conexao.php"); if(!empty($esquemaadmin)){ $esquemaadmin = str_replace(".","",$esquemaadmin)."."; } @@ -3120,7 +3120,7 @@ Array originada de fetchAll function pegaDadosAdminKey($sql,$subsEsquema){ //pegaDadosAdminKey("select codigo_tema,link_tema from __esq__i3geoadmin_temas","__esq__"); $resultado = array(); - include(dirname(__FILE__)."/../admin/php/conexao.php"); + include(dirname(__FILE__)."/classesphp/conexao.php"); $sql = str_replace($subsEsquema,$esquemaadmin,$sql); //error_reporting(0); $q = $dbh->query($sql,PDO::FETCH_ASSOC); diff --git a/classesphp/wmswfs.php b/classesphp/wmswfs.php index 412da63..d258197 100755 --- a/classesphp/wmswfs.php +++ b/classesphp/wmswfs.php @@ -359,6 +359,7 @@ function temaswms() { // Test that the capabilites file has successfully downloaded. // // $wms_service_request = "c://temp//teste.xml"; + if (file_exists ( dirname ( __FILE__ ) . "/../admin1/cadastros/servicos/exec.php" )) { include_once (dirname ( __FILE__ ) . "/../admin1/cadastros/servicos/exec.php"); } else { @@ -369,15 +370,8 @@ function temaswms() { // error_reporting(0); if ($wms_service_request == "erro") { // Cannot download the capabilities file. - // registra a tentativa de acesso - if (isset ( $id_ws )) { - adicionaAcesso ( $id_ws, false ); - } $cp->set_data ( "Erro de acesso" ); return; - } elseif (isset ( $id_ws )) { - if ($id_ws != "") - adicionaAcesso ( $id_ws, true ); } $handle = fopen ( $wms_service_request, "r" ); $wms_capabilities = fread ( $handle, filesize ( $wms_service_request ) ); @@ -508,22 +502,12 @@ function listaLayersWMS() { } // para o caso do sistema de metadados estatisticos $wms_service_request = gravaCacheWMS ( $servico ); - include_once (dirname ( __FILE__ ) . "/../admin/php/admin.php"); - include_once (dirname ( __FILE__ ) . "/../admin/php/webservices.php"); - if ($tipo_ws != "WMSMETAESTAT" && $nivel < 2) { if ($wms_service_request == "erro") { - // registra a tentativa de acesso - if (isset ( $id_ws )) { - adicionaAcesso ( $id_ws, false ); - } $cp->set_data ( "Erro de acesso" ); return; - } elseif (isset ( $id_ws )) { - adicionaAcesso ( $id_ws, true ); } } - $handle = fopen ( $wms_service_request, "r" ); $wms_capabilities = fread ( $handle, filesize ( $wms_service_request ) ); fclose ( $handle ); diff --git a/css/i3geo7.css.php b/css/i3geo7.css.php old mode 100755 new mode 100644 index c8602db..c8602db --- a/css/i3geo7.css.php +++ b/css/i3geo7.css.php diff --git a/ferramentas/abrefontemapfile.php b/ferramentas/abrefontemapfile.php index 9769e0d..0498779 100755 --- a/ferramentas/abrefontemapfile.php +++ b/ferramentas/abrefontemapfile.php @@ -57,7 +57,7 @@ body { echo "Nenhum tema definido.";exit; } $dbh = ""; - include($locaplic."/admin/php/conexao.php"); + include($locaplic."/classesphp/conexao.php"); $r = pegaDados("select link_tema from ".$esquemaadmin."i3geoadmin_temas where codigo_tema = '$tema'"); error_reporting(0); $link = $r[0]["link_tema"]; diff --git a/ferramentas/editorgm/editorgm_compacto.js b/ferramentas/editorgm/editorgm_compacto.js old mode 100755 new mode 100644 index cc66aa6..cc66aa6 --- a/ferramentas/editorgm/editorgm_compacto.js +++ b/ferramentas/editorgm/editorgm_compacto.js diff --git a/ferramentas/editorol/editorol.js b/ferramentas/editorol/editorol.js index c5d7a6f..057ddf0 100755 --- a/ferramentas/editorol/editorol.js +++ b/ferramentas/editorol/editorol.js @@ -55,8 +55,8 @@ if (!i3GEO || typeof (i3GEO) === 'undefined') { navm = true; } } -i3GEO.editorOL = -{ +i3GEO.editorOL = { + interacoes: "", MUSTACHESALVAGEOMETRIAS: "", MUSTACHEFERRAMENTAS: "", MUSTACHEPROPRIEDADES: "", @@ -84,150 +84,13 @@ i3GEO.editorOL = //map : i3geoOL, visible : false }), - e_oce : new ol.layer.Tile({ - title : "ESRI Ocean Basemap", - visible : false, - isBaseLayer : true, - name : "oce", - source : new ol.source.TileArcGISRest({ - url : "http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer", - attributions: [ - new ol.Attribution({ - html: 'Tiles © ArcGIS' - }) - ] - }) - }), - e_ims : new ol.layer.Tile({ - title : "ESRI Imagery World 2D", - visible : false, - isBaseLayer : true, - name : "ims", - source : new ol.source.TileArcGISRest({ - url : "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer", - attributions: [ - new ol.Attribution({ - html: 'Tiles © ArcGIS' - }) - ] - }) - }), - e_wsm : new ol.layer.Tile({ - title : "ESRI World Street Map", - visible : false, - isBaseLayer : true, - name : "wsm", - source : new ol.source.TileArcGISRest({ - url : "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer", - attributions: [ - new ol.Attribution({ - html: 'Tiles © ArcGIS' - }) - ] - }) - }), - ol_mma : new ol.layer.Tile({ - title : "Base carto MMA", - visible : false, - isBaseLayer : true, - name : "bra", - source : new ol.source.TileWMS({ - url : "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&", - params : { - 'layers' : "baseraster", - 'srs' : "EPSG:4326", - 'format' : "image/png" - } - }) - }), - e_tms : new ol.layer.Tile({ - title : "OSGEO", - visible : false, - isBaseLayer : true, - name : "tms", - source : new ol.source.TileWMS({ - url : "http://tilecache.osgeo.org/wms-c/Basic.py/", - params : { - 'layers' : "basic", - 'type' : "png", - 'srs' : "EPSG:4326", - 'format' : "image/png", - 'VERSION' : '1.1.1' - }, - attributions: [ - new ol.Attribution({ - html: '© 2006-2010, TileCache Contributors' - }) - ] - }) - }), - top_wms : new ol.layer.Tile({ - title : "Toponímia MMA", - visible : false, - isBaseLayer : true, - name : "bra", - source : new ol.source.TileWMS({ - url : "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&", - params : { - 'layers' : "base", - 'srs' : "EPSG:4326", - 'format' : "image/png" - } - }) - }), - est_wms : new ol.layer.Tile({ - title : "Estados do Brasil", - visible : false, - isBaseLayer : true, - name : "bra", - source : new ol.source.TileWMS({ - url : "http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&", - params : { - 'layers' : "estadosl", - 'srs' : "EPSG:4326", - 'format' : "image/png" - } - }) - }), - fundo: "e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce", + fundo: "", nomeFuncaoSalvar : "i3GEO.editorOL.salvaGeo()", kml : [], layersIniciais : [], //essa configuracao dos botoes afeta apenas o mashup //para a configuração do editor dentro de um mapa normal, veja i3GEO.editor.ativaPainel() - botoes : { - 'imprimir': false, - 'grid': false, - 'pan' : false, - 'zoombox' : false, - 'zoomtot' : false, - 'zoomin' : false, - 'zoomout' : false, - 'distancia' : false, - 'area' : false, - 'identifica' : false, - 'linha' : true, - 'ponto' : true, - 'poligono' : true, - 'texto' : true, - 'edita' : true, - 'listag' : true, - 'corta' : true, - 'apaga' : true, - 'procura' : false, - 'selecao' : true, - 'selecaotudo' : true, - 'salva' : true, - 'ajuda' : true, - 'propriedades' : true, - 'fecha' : false, - 'tools' : true, - 'undo' : false, - 'frente' : false, - 'legenda' : false, - 'rodadomouse' : true, - 'novaaba' : false - }, + botoes : {}, pontos : [], marca : "../pacotes/openlayers/img/marker-gold.png", controles : [], @@ -281,136 +144,6 @@ i3GEO.editorOL = i3GEO.Interface.openlayers.cria(); i3GEO.editorOL.mapa = i3geoOL; - - // ativabotoes e boolean - if(i3GEO.editorOL.controles.length === 0){ - i3GEO.editorOL.controles = [ - new ol.interaction.DoubleClickZoom(), - new ol.interaction.KeyboardPan(), - new ol.interaction.KeyboardZoom(), - new ol.interaction.MouseWheelZoom(), - new ol.interaction.PinchRotate(), - new ol.interaction.PinchZoom(), - new ol.interaction.DragZoom(), - new ol.interaction.DragPan(), - new ol.control.Zoom(), - new ol.control.ZoomSlider(), - new ol.control.ScaleLine() - ]; - } - var alayers = [], fundo = (i3GEO.editorOL.fundo).split(","), nfundo = fundo.length, ncontroles = - i3GEO.editorOL.controles.length, i, n, temp; - - if (i3GEO.editorOL.ativarodadomouse === "false") { - i3GEO.editorOL.ativarodadomouse = false; - } - if (i3GEO.editorOL.ativarodadomouse === "true") { - i3GEO.editorOL.ativarodadomouse = true; - } - if (i3GEO.editorOL.legendahtml === "false") { - i3GEO.editorOL.legendahtml = false; - } - if (i3GEO.editorOL.legendahtml === "true") { - i3GEO.editorOL.legendahtml = true; - } - - if (i3GEO.editorOL.incluilayergrafico === "false") { - i3GEO.editorOL.incluilayergrafico = false; - } - if (i3GEO.editorOL.incluilayergrafico === "true") { - i3GEO.editorOL.incluilayergrafico = true; - } - if (i3GEO.editorOL.incluilayergrafico === true) { - if (!i3GEO.desenho.layergrafico) { - i3GEO.editorOL.criaLayerGrafico(); - } - } else { - i3GEO.desenho.layergrafico = ""; - i3GEO.editorOL.botoes.linha = false; - i3GEO.editorOL.botoes.ponto = false; - i3GEO.editorOL.botoes.poligono = false; - i3GEO.editorOL.botoes.texto = false; - i3GEO.editorOL.botoes.edita = false; - i3GEO.editorOL.botoes.listag = false; - i3GEO.editorOL.botoes.corta = false; - i3GEO.editorOL.botoes.apaga = false; - i3GEO.editorOL.botoes.selecao = false; - i3GEO.editorOL.botoes.selecaotudo = false; - i3GEO.editorOL.botoes.salva = false; - i3GEO.editorOL.botoes.propriedades = false; - i3GEO.editorOL.botoes.fecha = false; - i3GEO.editorOL.botoes.tools = false; - i3GEO.editorOL.botoes.undo = false; - i3GEO.editorOL.botoes.frente = false; - i3GEO.editorOL.botoes.novaaba = false; - } - for (i = 0; i < ncontroles; i++) { - i3GEO.editorOL.mapa.addControl(i3GEO.editorOL.controles[i]); - } - if (i3GEO.editorOL.fundo != "") { - for (i = nfundo - 1; i >= 0; i--) { - if (fundo[i] != "" && i3GEO.editorOL[fundo[i]]) { - alayers.push(i3GEO.editorOL[fundo[i]]); - i3GEO.editorOL[fundo[i]].setVisibility(true); - } - } - } - i3GEO.editorOL.mapa.addLayers(alayers); - if (i3GEO.editorOL.layersIniciais !== "") { - n = i3GEO.editorOL.layersIniciais.length; - for (i = 0; i < n; i++) { - // singleTile deve ser definido em cada layer - // i3GEO.editorOL.layersIniciais[i].singleTile = single; - i3GEO.editorOL.mapa.addLayer(i3GEO.editorOL.layersIniciais[i]); - } - } - if (!i3GEO.desenho.layergrafico && i3GEO.editorOL.incluilayergrafico === true) { - i3GEO.editorOL.mapa.addLayers([ - i3GEO.desenho.layergrafico - ]); - } - i3GEO.editorOL.adicionaKml(); - i3GEO.editorOL.adicionaMarcas(); - - i3GEO.editorOL.coordenadas(); - //i3GEO.editorOL.criaJanelaBusca(); - i3GEO.editorOL.criaBotoes(i3GEO.editorOL.botoes); - if (i3GEO.editorOL.ativalayerswitcher === true) { - //i3GEO.editorOL.ativaLayerSwitcher(); - } - if (i3GEO.editorOL.ativarodadomouse === false) { - i3GEO.editorOL.desativaRodaDoMouse(); - } - //TODO testar numzoom - /* - if (i3GEO.editorOL.numzoom !== "") { - i3GEO.editorOL.mapa.getView().setOptions({ - minResolution : i3GEO.editorOL.minresolution, - maxResolution : - }); - } - */ - if (i3GEO.editorOL.maxext !== "") { - i3GEO.editorOL.mapa.getView().setProperties({ - extent : i3GEO.editorOL.maxext - }); - } - if (i3GEO.editorOL.mapext != "") { - var m = i3GEO.util.extGeo2OSM(i3GEO.editorOL.mapext); - i3GEO.editorOL.mapa.zoomToExtent(m); - } - //i3GEO.editorOL.sobeLayersGraficos(); - // evita que botoes de opcoes propaguem - // o mashup utiliza esse tipo de botao junto ao nome do layer - temp = i3GEO.editorOL.pegaControle("OpenLayers.Control.LayerSwitcher"); - if (temp) { - temp = temp.dataLayersDiv.getElementsByTagName("label"); - n = temp.length; - for (i = 0; i < n; i++) { - // YAHOO.util.Event.addListener(temp[i], "click", YAHOO.util.Event.stopEvent); - temp[i].onclick = ""; - } - } }, criaLayerGrafico : function() { i3GEO.desenho.openlayers.criaLayerGrafico(); @@ -1065,16 +798,9 @@ i3GEO.editorOL = } i3GEO.editorOL.removeInteracoes(); }, - //interacoes criadas ao ativar algum botao - //usado para remover as interacoes - interacoes : [], removeInteracoes: function(){ - var i, n; - n = i3GEO.editorOL.interacoes.length; - for(i = 0; i < n; i++){ - i3geoOL.removeInteraction(i3GEO.editorOL.interacoes[i]); - } - i3GEO.editorOL.interacoes = []; + i3geoOL.removeInteraction(i3GEO.editorOL.interacoes); + i3GEO.editorOL.interacoes = ""; }, botaoProcura : function(){ var temp = document.createElement("div"); @@ -1164,6 +890,40 @@ i3GEO.editorOL = }; return temp; }, + desenhaLinha: function(drawendcallback){ + i3GEO.editorOL.removeInteracoes(); + var draw = new ol.interaction.Draw({ + type : "LineString" + }); + //adiciona a interacao para poder ser removida + i3GEO.editorOL.interacoes = draw; + //desativa ol.interaction.DoubleClickZoom + i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); + draw.on("drawend", function(evt) { + evt.feature.setStyle( + new ol.style.Style({ + stroke: new ol.style.Stroke({ + color: 'rgba(' + i3GEO.editorOL.simbologia.strokeColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')', + width: i3GEO.editorOL.simbologia.strokeWidth + }), + fill: new ol.style.Fill({ + color: 'rgba(' + i3GEO.editorOL.simbologia.fillColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')' + }) + }) + ); + evt.feature.setId(i3GEO.util.uid()); + i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature); + draw.setActive(false); + draw.setActive(true); + if (document.getElementById("panellistagEditor")) { + i3GEO.editorOL.listaGeometrias(); + } + }); + if(drawendcallback){ + draw.on("drawend",drawendcallback); + } + i3geoOL.addInteraction(draw); + }, botaoLinha: function(){ var temp = document.createElement("div"); temp.className = "editorOLlinhaItemInactive olButton"; @@ -1171,88 +931,100 @@ i3GEO.editorOL = temp.onclick = function(){ i3GEO.eventos.cliquePerm.desativa(); i3GEO.editorOL.marcaBotao("editorOLlinha"); - var draw = new ol.interaction.Draw({ - type : "LineString" - }); - //adiciona a interacao para poder ser removida - i3GEO.editorOL.interacoes.push(draw); - //desativa ol.interaction.DoubleClickZoom - i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); - draw.on("drawend", function(evt) { - evt.feature.setStyle( - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'rgba(' + i3GEO.editorOL.simbologia.strokeColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')', - width: i3GEO.editorOL.simbologia.strokeWidth - }), - fill: new ol.style.Fill({ - color: 'rgba(' + i3GEO.editorOL.simbologia.fillColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')' - }) - }) - ); - evt.feature.setId(i3GEO.util.uid()); - i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature); - draw.setActive(false); - draw.setActive(true); - if (document.getElementById("panellistagEditor")) { - i3GEO.editorOL.listaGeometrias(); - } - }); - i3geoOL.addInteraction(draw); + i3GEO.editorOL.desenhaLinha(); }; return temp; }, + desenhaPonto: function(drawendcallback){ + i3GEO.editorOL.removeInteracoes(); + var draw = new ol.interaction.Draw({ + type : "Point" + }); + //adiciona a interacao para poder ser removida + i3GEO.editorOL.interacoes = draw; + i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); + draw.on("drawend", function(evt) { + var simbolo, url; + url = i3GEO.editorOL.simbologia.externalGraphic; + if(url === ""){ + simbolo = new ol.style.Circle({ + radius: i3GEO.editorOL.simbologia.pointRadius, + fill: new ol.style.Fill({ + color: 'rgba(' + i3GEO.editorOL.simbologia.fillColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')' + }), + stroke: new ol.style.Stroke({ + color: 'rgba(' + i3GEO.editorOL.simbologia.strokeColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')', + width: i3GEO.editorOL.simbologia.pointRadius / 3 + }) + }); + } + else{ + simbolo = new ol.style.Icon({ + src : url, + size : [i3GEO.editorOL.simbologia.graphicWidth,i3GEO.editorOL.simbologia.graphicHeight] + }); + } + evt.feature.setStyle( + new ol.style.Style({ + image: simbolo + }) + ); + evt.feature.setId(i3GEO.util.uid()); + i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature); + draw.setActive(false); + draw.setActive(true); + if (document.getElementById("panellistagEditor")) { + i3GEO.editorOL.listaGeometrias(); + } + }); + if(drawendcallback){ + draw.on("drawend",drawendcallback); + } + i3geoOL.addInteraction(draw); + }, botaoPonto: function(){ i3GEO.eventos.cliquePerm.desativa(); var temp = document.createElement("div"); temp.className = "editorOLpontoItemInactive olButton"; temp.title = $trad("dponto"); temp.onclick = function(){ - i3GEO.eventos.cliquePerm.desativa(); i3GEO.editorOL.marcaBotao("editorOLponto"); - var draw = new ol.interaction.Draw({ - type : "Point" - }); - //adiciona a interacao para poder ser removida - i3GEO.editorOL.interacoes.push(draw); - i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); - draw.on("drawend", function(evt) { - var simbolo, url; - url = i3GEO.editorOL.simbologia.externalGraphic; - if(url === ""){ - simbolo = new ol.style.Circle({ - radius: i3GEO.editorOL.simbologia.pointRadius, - fill: new ol.style.Fill({ - color: 'rgba(' + i3GEO.editorOL.simbologia.fillColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')' - }), + i3GEO.editorOL.desenhaPonto(); + }; + return temp; + }, + desenhaPoligono: function(drawendcallback){ + i3GEO.editorOL.removeInteracoes(); + var draw = new ol.interaction.Draw({ + type : "Polygon" + }); + //adiciona a interacao para poder ser removida + i3GEO.editorOL.interacoes = draw; + i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); + draw.on("drawend", function(evt) { + evt.feature.setStyle( + new ol.style.Style({ stroke: new ol.style.Stroke({ color: 'rgba(' + i3GEO.editorOL.simbologia.strokeColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')', - width: i3GEO.editorOL.simbologia.pointRadius / 3 - }) - }); - } - else{ - simbolo = new ol.style.Icon({ - src : url, - size : [i3GEO.editorOL.simbologia.graphicWidth,i3GEO.editorOL.simbologia.graphicHeight] - }); - } - evt.feature.setStyle( - new ol.style.Style({ - image: simbolo + width: i3GEO.editorOL.simbologia.strokeWidth + }), + fill: new ol.style.Fill({ + color: 'rgba(' + i3GEO.editorOL.simbologia.fillColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')' }) - ); - evt.feature.setId(i3GEO.util.uid()); - i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature); - draw.setActive(false); - draw.setActive(true); - if (document.getElementById("panellistagEditor")) { - i3GEO.editorOL.listaGeometrias(); - } - }); - i3geoOL.addInteraction(draw); - }; - return temp; + }) + ); + evt.feature.setId(i3GEO.util.uid()); + i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature); + draw.setActive(false); + draw.setActive(true); + if (document.getElementById("panellistagEditor")) { + i3GEO.editorOL.listaGeometrias(); + } + }); + if(drawendcallback){ + draw.on("drawend",drawendcallback); + } + i3geoOL.addInteraction(draw); }, botaoPoligono: function(){ i3GEO.eventos.cliquePerm.desativa(); @@ -1261,39 +1033,7 @@ i3GEO.editorOL = temp.title = $trad("dpol"); temp.onclick = function(){ i3GEO.editorOL.marcaBotao("editorOLpoligono"); - var draw = new ol.interaction.Draw({ - type : "Polygon" - }); - /* - snap = new ol.interaction.Snap({ - source: i3GEO.desenho.layergrafico.getSource() - }); - i3GEO.editorOL.interacoes.push(snap); - */ - //adiciona a interacao para poder ser removida - i3GEO.editorOL.interacoes.push(draw); - i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); - draw.on("drawend", function(evt) { - evt.feature.setStyle( - new ol.style.Style({ - stroke: new ol.style.Stroke({ - color: 'rgba(' + i3GEO.editorOL.simbologia.strokeColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')', - width: i3GEO.editorOL.simbologia.strokeWidth - }), - fill: new ol.style.Fill({ - color: 'rgba(' + i3GEO.editorOL.simbologia.fillColor + ',' + i3GEO.editorOL.simbologia.opacidade + ')' - }) - }) - ); - evt.feature.setId(i3GEO.util.uid()); - i3GEO.desenho.layergrafico.getSource().addFeature(evt.feature); - draw.setActive(false); - draw.setActive(true); - if (document.getElementById("panellistagEditor")) { - i3GEO.editorOL.listaGeometrias(); - } - }); - i3geoOL.addInteraction(draw); + i3GEO.editorOL.desenhaPoligono(); }; return temp; }, @@ -1304,12 +1044,13 @@ i3GEO.editorOL = temp.title = $trad("dtexto"); temp.onclick = function(){ i3GEO.eventos.cliquePerm.desativa(); + i3GEO.editorOL.removeInteracoes(); i3GEO.editorOL.marcaBotao("editorOLtexto"); var draw = new ol.interaction.Draw({ type : "Point" }); //adiciona a interacao para poder ser removida - i3GEO.editorOL.interacoes.push(draw); + i3GEO.editorOL.interacoes = draw; i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); draw.on("drawend", function(evt) { var texto = window.prompt("Texto", ""); @@ -1347,9 +1088,10 @@ i3GEO.editorOL = temp.title = $trad("d24t"); temp.onclick = function(){ i3GEO.editorOL.marcaBotao("editorOLselecao"); + i3GEO.editorOL.removeInteracoes(); var sel = new ol.interaction.Select(); //adiciona a interacao para poder ser removida - i3GEO.editorOL.interacoes.push(sel); + i3GEO.editorOL.interacoes = sel; i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); sel.on("select", function(evt) { var s,i, n, id, f; @@ -1479,6 +1221,7 @@ i3GEO.editorOL = var draw, nsel, f, c; nsel = i3GEO.editorOL.idsSelecionados.length; if(nsel == 1){ + i3GEO.editorOL.removeInteracoes(); i3GEO.editorOL.marcaBotao("editorOLedita"); f = i3GEO.desenho.layergrafico.getSource().getFeatureById(i3GEO.editorOL.idsSelecionados[nsel - 1]); i3GEO.editorOL.featuresBackup.push(f.clone()); @@ -1488,7 +1231,7 @@ i3GEO.editorOL = features: c }); //adiciona a interacao para poder ser removida - i3GEO.editorOL.interacoes.push(draw); + i3GEO.editorOL.interacoes = draw; i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); i3geoOL.addInteraction(draw); } @@ -1508,13 +1251,14 @@ i3GEO.editorOL = if (nsel != 1) { alert("Selecione primeiro um elemento para ser cortado"); } else { + i3GEO.editorOL.removeInteracoes(); i3GEO.janela.tempoMsg("Desenhe um polígono"); i3GEO.editorOL.marcaBotao("editorOLcorta"); var draw = new ol.interaction.Draw({ type : "Polygon" }); //adiciona a interacao para poder ser removida - i3GEO.editorOL.interacoes.push(draw); + i3GEO.editorOL.interacoes = draw; i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); draw.on("drawend", function(evt) { var temp, f, c, format, fwkt, cwkt; @@ -1648,16 +1392,18 @@ i3GEO.editorOL = temp.className = "editorOLidentificaItemInactive olButton"; temp.title = $trad("d7t"); temp.onclick = function(){ + if(i3GEO.editorOL.layerDefault == ""){ i3GEO.editorOL.criaJanelaAtivaTema(); } i3GEO.eventos.cliquePerm.desativa(); + i3GEO.editorOL.removeInteracoes(); i3GEO.editorOL.marcaBotao("editorOLidentifica"); var draw = new ol.interaction.Draw({ type : "Point" }); //adiciona a interacao para poder ser removida - i3GEO.editorOL.interacoes.push(draw); + i3GEO.editorOL.interacoes = draw; i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false); draw.on("drawend", function(evt) { var xy, p, retorno, url, layer, tema = $i("i3GEOOLlistaTemasAtivos"); diff --git a/ferramentas/editorol/editorol_compacto.js b/ferramentas/editorol/editorol_compacto.js old mode 100755 new mode 100644 index 60b0c01..575a5a9 --- a/ferramentas/editorol/editorol_compacto.js +++ b/ferramentas/editorol/editorol_compacto.js @@ -1 +1 @@ -if(!i3GEO||typeof(i3GEO)==='undefined'){var i3GEO={};i3GEO.Interface={};navn=false;navm=false;$i=function(id){return document.getElementById(id)};app=navigator.appName.substring(0,1);if(app==='N'){navn=true}else{navm=true}}i3GEO.editorOL={MUSTACHESALVAGEOMETRIAS:"",MUSTACHEFERRAMENTAS:"",MUSTACHEPROPRIEDADES:"",layerDefault:"",simbologia:{opacidade:0.8,texto:"",fillColor:"250,180,15",strokeWidth:5,strokeColor:"250,150,0",pointRadius:4,graphicName:"square",fontSize:"12px",fontColor:"0,0,0",externalGraphic:"",graphicHeight:25,graphicWidth:25},backup:new ol.layer.Vector({source:new ol.source.Vector({features:new ol.Collection(),useSpatialIndex:false,name:"Backup"}),visible:false}),e_oce:new ol.layer.Tile({title:"ESRI Ocean Basemap",visible:false,isBaseLayer:true,name:"oce",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer",attributions:[new ol.Attribution({html:'Tiles © ArcGIS'})]})}),e_ims:new ol.layer.Tile({title:"ESRI Imagery World 2D",visible:false,isBaseLayer:true,name:"ims",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer",attributions:[new ol.Attribution({html:'Tiles © ArcGIS'})]})}),e_wsm:new ol.layer.Tile({title:"ESRI World Street Map",visible:false,isBaseLayer:true,name:"wsm",source:new ol.source.TileArcGISRest({url:"http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer",attributions:[new ol.Attribution({html:'Tiles © ArcGIS'})]})}),ol_mma:new ol.layer.Tile({title:"Base carto MMA",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map&",params:{'layers':"baseraster",'srs':"EPSG:4326",'format':"image/png"}})}),e_tms:new ol.layer.Tile({title:"OSGEO",visible:false,isBaseLayer:true,name:"tms",source:new ol.source.TileWMS({url:"http://tilecache.osgeo.org/wms-c/Basic.py/",params:{'layers':"basic",'type':"png",'srs':"EPSG:4326",'format':"image/png",'VERSION':'1.1.1'},attributions:[new ol.Attribution({html:'© 2006-2010, TileCache Contributors'})]})}),top_wms:new ol.layer.Tile({title:"Toponímia MMA",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseref.map&",params:{'layers':"base",'srs':"EPSG:4326",'format':"image/png"}})}),est_wms:new ol.layer.Tile({title:"Estados do Brasil",visible:false,isBaseLayer:true,name:"bra",source:new ol.source.TileWMS({url:"http://mapas.mma.gov.br/i3geo/ogc.php?tema=estadosl&",params:{'layers':"estadosl",'srs':"EPSG:4326",'format':"image/png"}})}),fundo:"e_ims,e_wsm,ol_mma,ol_wms,top_wms,est_wms,e_oce",nomeFuncaoSalvar:"i3GEO.editorOL.salvaGeo()",kml:[],layersIniciais:[],botoes:{'imprimir':false,'grid':false,'pan':false,'zoombox':false,'zoomtot':false,'zoomin':false,'zoomout':false,'distancia':false,'area':false,'identifica':false,'linha':true,'ponto':true,'poligono':true,'texto':true,'edita':true,'listag':true,'corta':true,'apaga':true,'procura':false,'selecao':true,'selecaotudo':true,'salva':true,'ajuda':true,'propriedades':true,'fecha':false,'tools':true,'undo':false,'frente':false,'legenda':false,'rodadomouse':true,'novaaba':false},pontos:[],marca:"../pacotes/openlayers/img/marker-gold.png",controles:[],tiles:true,incluilayergrafico:true,ativalayerswitcher:false,ativarodadomouse:true,legendahtml:false,numzoom:12,minresolution:0.703125,maxext:"",mapext:[-76.5125927,-39.3925675209,-29.5851853,9.49014852081],mapa:"",idsSelecionados:[],featuresBackup:[],resolutions:[],matrixIds:[],inicia:function(){var projectionExtent,size,resolutions,matrixIds,z;if(i3GEO.Interface.openlayers.googleLike===true){projectionExtent=ol.proj.get('EPSG:3857').getExtent()}else{projectionExtent=ol.proj.get('EPSG:4326').getExtent()}size=ol.extent.getWidth(projectionExtent)/256;resolutions=new Array(40);matrixIds=new Array(40);for(z=0;z<40;++z){resolutions[z]=size/Math.pow(2,z);matrixIds[z]=z}i3GEO.editorOL.resolutions=resolutions;i3GEO.editorOL.matrixIds=matrixIds;i3GEO.editorOL.incluilayergrafico=true;i3GEO.Interface.openlayers.parametrosView={projection:"EPSG:4326",resolutions:resolutions,minResolution:i3GEO.editorOL.minresolution,maxResolution:resolutions[i3GEO.editorOL.numzoom]};i3GEO.Interface.openlayers.parametrosMap={target:"i3geoMapa",layers:[],controls:[]};i3GEO.Interface.openlayers.cria();i3GEO.editorOL.mapa=i3geoOL;if(i3GEO.editorOL.controles.length===0){i3GEO.editorOL.controles=[new ol.interaction.DoubleClickZoom(),new ol.interaction.KeyboardPan(),new ol.interaction.KeyboardZoom(),new ol.interaction.MouseWheelZoom(),new ol.interaction.PinchRotate(),new ol.interaction.PinchZoom(),new ol.interaction.DragZoom(),new ol.interaction.DragPan(),new ol.control.Zoom(),new ol.control.ZoomSlider(),new ol.control.ScaleLine()]}var alayers=[],fundo=(i3GEO.editorOL.fundo).split(","),nfundo=fundo.length,ncontroles=i3GEO.editorOL.controles.length,i,n,temp;if(i3GEO.editorOL.ativarodadomouse==="false"){i3GEO.editorOL.ativarodadomouse=false}if(i3GEO.editorOL.ativarodadomouse==="true"){i3GEO.editorOL.ativarodadomouse=true}if(i3GEO.editorOL.legendahtml==="false"){i3GEO.editorOL.legendahtml=false}if(i3GEO.editorOL.legendahtml==="true"){i3GEO.editorOL.legendahtml=true}if(i3GEO.editorOL.incluilayergrafico==="false"){i3GEO.editorOL.incluilayergrafico=false}if(i3GEO.editorOL.incluilayergrafico==="true"){i3GEO.editorOL.incluilayergrafico=true}if(i3GEO.editorOL.incluilayergrafico===true){if(!i3GEO.desenho.layergrafico){i3GEO.editorOL.criaLayerGrafico()}}else{i3GEO.desenho.layergrafico="";i3GEO.editorOL.botoes.linha=false;i3GEO.editorOL.botoes.ponto=false;i3GEO.editorOL.botoes.poligono=false;i3GEO.editorOL.botoes.texto=false;i3GEO.editorOL.botoes.edita=false;i3GEO.editorOL.botoes.listag=false;i3GEO.editorOL.botoes.corta=false;i3GEO.editorOL.botoes.apaga=false;i3GEO.editorOL.botoes.selecao=false;i3GEO.editorOL.botoes.selecaotudo=false;i3GEO.editorOL.botoes.salva=false;i3GEO.editorOL.botoes.propriedades=false;i3GEO.editorOL.botoes.fecha=false;i3GEO.editorOL.botoes.tools=false;i3GEO.editorOL.botoes.undo=false;i3GEO.editorOL.botoes.frente=false;i3GEO.editorOL.botoes.novaaba=false}for(i=0;i=0;i--){if(fundo[i]!=""&&i3GEO.editorOL[fundo[i]]){alayers.push(i3GEO.editorOL[fundo[i]]);i3GEO.editorOL[fundo[i]].setVisibility(true)}}}i3GEO.editorOL.mapa.addLayers(alayers);if(i3GEO.editorOL.layersIniciais!==""){n=i3GEO.editorOL.layersIniciais.length;for(i=0;i0){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.mapa.getLayersByName(camada.name)[0],false)}},coordenadas:function(){var idcoord=i3GEO.editorOL.mapa.getControlsBy("separator"," ");if(idcoord[0]){i3GEO.editorOL.mapa.events.register("mousemove",i3GEO.editorOL.mapa,function(e){var p,lonlat,d;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(p);lonlat=i3GEO.util.projOSM2Geo(lonlat);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{$i(idcoord[0].id).innerHTML="Long: "+d[0]+"
Lat: "+d[1]}catch(e){}}})}},criaJanelaBusca:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,ins,combo="";ins="
"+$trad("a7")+":
"+combo;ins+="
"+$trad("x64")+":
";ins+="
"+$trad("t23")+":
";ins+="

";ins+="
'"+$trad("result")+"':
";YAHOO.namespace("procura.container");YAHOO.procura.container.panel=new YAHOO.widget.Panel("panelprocura",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true,strings:{close:"cancel"}});YAHOO.procura.container.panel.setHeader("Encontre no mapa");YAHOO.procura.container.panel.setBody(ins);YAHOO.procura.container.panel.setFooter("");YAHOO.procura.container.panel.render(document.body);YAHOO.procura.container.panel.center();document.getElementById("i3GEOOLbotaoBusca").onclick=function(){var layer=i3GEO.editorOL.layerAtivo(),item=document.getElementById("i3GEOOLbuscaItem").value,palavra=document.getElementById("i3GEOOLpalavraBusca").value;if(item===""||palavra===""){alert("Escolha o item e o texto de busca");return}i3GEO.editorOL.busca(layer,item,palavra,"i3GEOOLcomboresultado")};document.getElementById("i3GEOOLlistaTemasBusca").onchange=function(){i3GEO.editorOL.ativaTema(this.value);document.getElementById("i3GEOOLcomboitens").innerHTML="...";i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(),"i3GEOOLcomboitens","i3GEOOLbuscaItem")}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",combo="";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo)},criaJanelaAtivaTema:function(){var temp;if(!document.getElementById("paneltemaativo")){YAHOO.namespace("temaativo.container");YAHOO.temaativo.container.panel=new YAHOO.widget.Panel("paneltemaativo",{zIndex:20000,iframe:true,width:"250px",visible:false,draggable:true,close:true,strings:{close:"cancel"}});YAHOO.temaativo.container.panel.setBody("");if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.temaativo.container.panel.setHeader("Tema ativo
")}else{YAHOO.temaativo.container.panel.setHeader($trad("tativo"))}YAHOO.temaativo.container.panel.setFooter("");YAHOO.temaativo.container.panel.render(document.body);YAHOO.temaativo.container.panel.show();YAHOO.temaativo.container.panel.center();i3GEO.editorOL.atualizaJanelaAtivaTema();YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close,"click",function(){i3GEO.editorOL.marcaBotao();if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}}temp=$i("paneltemaativo_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("paneltemaativo")}}}else{YAHOO.temaativo.container.panel.show();i3GEO.editorOL.atualizaJanelaAtivaTema()}},ativaTema:function(id){document.getElementById("i3GEOOLlistaTemasAtivos").value=id},layerAtivo:function(){if(i3GEO.editorOL.layerDefault&&i3GEO.editorOL.layerDefault!=""){return i3GEO.editorOL.layerPorParametro("LAYERS",i3GEO.editorOL.layerDefault)}else{var id=document.getElementById("i3GEOOLlistaTemasAtivos");if(id){id=id.value}else{id=i3GEO.temaAtivo}if(id==""){return[]}else{return i3GEO.editorOL.layersLigados()[id]}}},listaItens:function(layer,idonde,idobj){if(!layer){return}if(!layer.params){return}var u=layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0";u+="&typename="+layer.params.LAYERS;document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.WFSDescribeFeatureType({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),prop=gml.featureTypes[0].properties,nprop=prop.length,i,combo="";document.getElementById(idonde).innerHTML=combo},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},busca:function(layer,item,palavra,onde){document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";var u=layer.url+"&request=getfeature&service=wfs&version=1.0.0";u=u.replace("Z=${z}&X=${x}&Y=${y}","");u+="&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS;u+="&filter="+item+"*"+palavra+"*";document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";document.getElementById(onde).innerHTML="...";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),ngml=gml.length,i,ins="";document.getElementById(onde).innerHTML=ins},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},zoomPara:function(bbox){var b=new OpenLayers.Bounds.fromString(bbox);i3GEO.editorOL.mapa.zoomToExtent(b)},mostraLegenda:function(){var prop,layer,layers=i3GEO.editorOL.mapa.getLayers(),nlayers=layers.getLength(),ins="",i,icone="",url,f="",fonte="";for(i=0;ilink"}ins+=icone+prop.name+fonte+"

";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");url=url.replace("LAYERS","LAYER");var config={method:"GET",url:url,callback:f}}else if(prop.isBaseLayer===false&&prop.visible===true){url=url.replace("LAYERS","LAYER");url+="&FORMAT=image/png";ins+=prop.title+"

"}}}if(!document.getElementById("panellegendaeditorOL")){YAHOO.namespace("legendaeditorOL.container");YAHOO.legendaeditorOL.container.panel=new YAHOO.widget.Panel("panellegendaeditorOL",{zIndex:20000,iframe:true,width:"auto",visible:false,draggable:true,close:true,strings:{close:"cancel"}});YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.setHeader($trad("p3"));YAHOO.legendaeditorOL.container.panel.setFooter("");YAHOO.legendaeditorOL.container.panel.render(document.body);YAHOO.legendaeditorOL.container.panel.show();YAHOO.legendaeditorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.legendaeditorOL.container.panel.close,"click",function(){YAHOO.legendaeditorOL.container.panel.destroy()})}else{YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.show()}},captura:function(x,y,tema,idunico){var d=0.001,layer=i3geoOL.getLayersByName(tema)[0],xy=[x,y],u=layer.getSource().getUrls()[0],poligono,retorno;u+="&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename=undefined";if(i3GEO.Interface.openlayers.googleLike===true){u+="&SRS=EPSG:3857"}u=u.replace("&cache=sim","&DESLIGACACHE=sim");u=u.replace("&Z=${z}&X=${x}&Y=${y}","");u=u.replace("Z=${z}&X=${x}&Y=${y}","");xy[0]=xy[0]*1;xy[1]=xy[1]*1;poligono=(xy[0]-d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]+d);u+="&filter=Geometry"+poligono+"";retorno=function(r){var fs,c,format,f,n,i,idunico;format=new ol.format.WKT();fs=format.readFeatures(r[0]);n=fs.length;c=i3GEO.desenho.layergrafico.getSource();for(i=0;i0){if($i("panelsalvageometrias")){if(YAHOO.i3GEO){YAHOO.salvaGeometrias.container.panel=YAHOO.i3GEO.janela.manager.find("panelsalvageometrias")}YAHOO.salvaGeometrias.container.panel.show();YAHOO.salvaGeometrias.container.panel.bringToTop()}else{try{YAHOO.namespace("salvaGeometrias.container");YAHOO.salvaGeometrias.container.panel=new YAHOO.widget.Panel("panelsalvageometrias",{zIndex:2000,iframe:false,width:"350px",visible:false,draggable:true,close:true,strings:{close:"cancel"}});YAHOO.salvaGeometrias.container.panel.setHeader(""+$trad("u6")+"");YAHOO.salvaGeometrias.container.panel.setBody("");YAHOO.salvaGeometrias.container.panel.setFooter("");YAHOO.salvaGeometrias.container.panel.render(document.body);YAHOO.salvaGeometrias.container.panel.center();if(YAHOO.i3GEO&&YAHOO.i3GEO.janela){YAHOO.i3GEO.janela.manager.register(YAHOO.salvaGeometrias.container.panel)}YAHOO.salvaGeometrias.container.panel.show()}catch(e){}}var hash={"n":n,"geosel":$trad("geosel"),"listar":$trad("listar"),"nomeFuncaoSalvarHidden":"hidden","incorpoHidden":"hidden"};if(i3GEO.editorOL.nomeFuncaoSalvar&&i3GEO.editorOL.nomeFuncaoSalvar!=""){hash.nomeFuncaoSalvar=i3GEO.editorOL.nomeFuncaoSalvar;hash.sdados=$trad("sdados");hash.nomeFuncaoSalvarHidden=""}if(typeof i3geoOL!=="undefined"){hash.incorpo=$trad("incorpo");hash.ajudaEditorOlSalva=$trad("ajudaEditorOlSalva");hash.incorpoHidden=""}ins=Mustache.render(i3GEO.editorOL.MUSTACHESALVAGEOMETRIAS,hash);YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{i3GEO.janela.tempoMsg($trad("selum"))}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var n=i3GEO.editorOL.idsSelecionados.length,ins="",s=i3GEO.desenho.layergrafico.getSource(),i,w,g;for(i=0;i"+$trad("u6")+": #"+i+"
"+i3GEO.editorOL.google2wgs(g.getGeometry().getCoordinates())+"

"}w=window.open();w.document.write(ins);w.document.close()},testeSalvar:function(){alert("Funcao nao disponivel. Defina o nome da funcao em i3GEO.editorOL.nomeFuncaoSalvar ")},salvaGeo:function(){if(i3GEO.parametros.editor=="nao"){i3GEO.janela.tempoMsg($trad("meneditor3"));return}var s=i3GEO.desenho.layergrafico.getSource(),n=i3GEO.editorOL.idsSelecionados.length,funcaoOK=function(){var f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[0]),g=f.getGeometry(),tema=$i("editorOLcomboTemaEditavel").value,redesenha,p,format;g=i3GEO.editorOL.google2wgs(g);format=new ol.format.WKT();f.setGeometry(g);if(tema==""){return}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.editorOL.removeFeaturesSel();i3GEO.Interface.atualizaTema("",tema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto",$trad("adic")+"...");i3GEO.janela.AGUARDEMODAL=false;if(!f.getProperties().idUnico||f.getProperties().idUnico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+tema+"&wkt="+format.writeFeatures([f]))}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+f.getProperties().idUnico+"&tema="+tema+"&wkt="+format.writeFeatures([f]))}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto=$trad("stema")+"
";if(n!=1){i3GEO.janela.tempoMsg($trad("seluma"))}else{i3GEO.janela.confirma(texto,300,$trad("salva"),"",funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel"," ",false,true,"form-control comboTema")}},marcaBotao:function(classeBotao){if($i("i3GEObarraEdicao")){var i,n,botoes=$i("i3GEObarraEdicao").getElementsByTagName("div");n=botoes.length;for(i=0;i0){x=window.confirm($trad("excsel")+"?");if(x){i3GEO.editorOL.removeFeaturesSel();i3GEO.desenho.layergrafico.getSource().changed()}}else{i3GEO.janela.tempoMsg($trad("selum"))}};return temp},botaoFrente:function(){var temp=document.createElement("div");temp.className="editorOLfrenteItemInactive olButton";temp.title=$trad("frente");temp.onclick=function(){var nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel>0){i3GEO.editorOL.marcaBotao();i3GEO.editorOL.trazParaFrente()}else{i3GEO.janela.tempoMsg($trad("selum"))}};return temp},botaoEdita:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLeditaItemInactive olButton";temp.title=$trad("modf");temp.onclick=function(){i3GEO.editorOL.featuresBackup=[];var draw,nsel,f,c;nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel==1){i3GEO.editorOL.marcaBotao("editorOLedita");f=i3GEO.desenho.layergrafico.getSource().getFeatureById(i3GEO.editorOL.idsSelecionados[nsel-1]);i3GEO.editorOL.featuresBackup.push(f.clone());c=new ol.Collection();c.push(f);draw=new ol.interaction.Modify({features:c});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false);i3geoOL.addInteraction(draw)}else{i3GEO.janela.tempoMsg($trad("seluma"))}};return temp},botaoCorta:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLcortaItemInactive olButton";temp.title=$trad("cortaf");temp.onclick=function(){var nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel!=1){alert("Selecione primeiro um elemento para ser cortado")}else{i3GEO.janela.tempoMsg("Desenhe um polígono");i3GEO.editorOL.marcaBotao("editorOLcorta");var draw=new ol.interaction.Draw({type:"Polygon"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false);draw.on("drawend",function(evt){var temp,f,c,format,fwkt,cwkt;f=evt.feature;c=i3GEO.desenho.layergrafico.getSource().getFeatureById(i3GEO.editorOL.idsSelecionados[nsel-1]);i3GEO.editorOL.featuresBackup.push(c.clone());i3GEO.editorOL.marcaBotao();format=new ol.format.WKT();if(f&&c){fwkt=format.writeFeatures([f]);cwkt=format.writeFeatures([c]);if(fwkt&&cwkt){temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.janela.fechaAguarde("i3GEO.cortador");c.setGeometry(format.readGeometry(retorno.data));if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,cwkt+"|"+fwkt,"difference")}}});i3geoOL.addInteraction(draw)}};return temp},botaoListaGeometrias:function(){var temp=document.createElement("div");temp.className="editorOLlistagItemInactive olButton";temp.title=$trad("listag");temp.onclick=function(){i3GEO.editorOL.listaGeometrias()};return temp},botaoNovaaba:function(){var temp=document.createElement("div");temp.className="editorOLnovaabaItemInactive olButton";temp.title=$trad("novaaba");temp.onclick=function(){window.open(window.location,'_blank')};return temp},botaoAjuda:function(){var temp=document.createElement("div");temp.className="editorOLajudaItemInactive olButton";temp.title=$trad("s1");temp.onclick=function(){if(i3GEO.configura&&i3GEO.configura.locaplic){i3GEO.janela.cria("400px","200px",i3GEO.configura.locaplic+"/ferramentas/editorol/openlayers_ajuda.php?completo=none","","",""+$trad("s1")+"","editorOlAjuda")}else{window.open("openlayers_ajuda.php")}};return temp},botaoFecha:function(){var temp=document.createElement("div");temp.className="editorOLfechaItemInactive olButton";temp.title=$trad("x74");temp.onclick=function(){i3GEO.editorOL.unselTodos();i3GEO.editorOL.featuresBackup=[];i3GEO.editorOL.marcaBotao();i3GEO.eventos.cliquePerm.ativa();$i("i3GEObarraEdicao").style.display="none"};return temp},botaoTools:function(){var temp=document.createElement("div");temp.className="editorOLtoolsItemInactive olButton";temp.title=$trad("u15a");temp.onclick=function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}};return temp},botaoPropriedades:function(){var temp=document.createElement("div");temp.className="editorOLpropriedadesItemInactive olButton";temp.title=$trad("p13");temp.onclick=function(){i3GEO.editorOL.propriedades()};return temp},botaoImprimir:function(){var temp=document.createElement("div");temp.className="editorOLimprimirItemInactive olButton";temp.onclick=function(){window.print()};return temp},botaoGrid:function(){var temp=document.createElement("div");temp.className="editorOLgridItemInactive olButton";temp.onclick=function(){var p={"map":i3GEO.editorOL.mapa,"targetSize":200};if(!i3GEO.editorOL.grid){i3GEO.editorOL.grid=new ol.Graticule(p)}else{if(i3GEO.editorOL.grid.getMap()==null){i3GEO.editorOL.grid.setMap(i3GEO.editorOL.mapa)}else{i3GEO.editorOL.grid.setMap(null)}}};return temp},botaoIdentifica:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLidentificaItemInactive olButton";temp.title=$trad("d7t");temp.onclick=function(){if(i3GEO.editorOL.layerDefault==""){i3GEO.editorOL.criaJanelaAtivaTema()}i3GEO.eventos.cliquePerm.desativa();i3GEO.editorOL.marcaBotao("editorOLidentifica");var draw=new ol.interaction.Draw({type:"Point"});i3GEO.editorOL.interacoes.push(draw);i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false);draw.on("drawend",function(evt){var xy,p,retorno,url,layer,tema=$i("i3GEOOLlistaTemasAtivos");if(tema){layer=i3geoOL.getLayersByName(tema.value)[0];if(layer.getSource().getUrls){url=layer.getSource().getUrls()[0]}else{url=layer.getSource().getUrl()}xy=evt.feature.getGeometry().getFirstCoordinate();retorno=function(r){var valorunico="",camada=null,texto="",lonlattexto,xy,temp,temp1,n,i,f=[],textoN=r.split(":");if(i3GEO.arvoreDeCamadas){camada=i3GEO.arvoreDeCamadas.pegaTema(tema.value,"","name")}xy=evt.feature.getGeometry().getFirstCoordinate();i3GEO.eventos.cliquePerm.ativo=true;try{if(textoN.length>1){textoN.shift();textoN.shift();temp=textoN.join(":");temp=temp.replace(/'/g,"");temp=temp.replace(/\n/g,"|");temp=temp.replace(/_/g," ");temp=temp.split("|");n=temp.length;for(i=0;i")+""}}catch(e){}lonlattexto="edita geometria
";i3GEO.Interface.openlayers.balao("
"+lonlattexto+texto+"
","",xy[0],xy[1],false,false);i3GEO.eventos.cliquePerm.ativo=false};p=i3GEO.configura.locaplic+"/classesphp/proxy.php?"+url+"&tipoRetornoProxy=string&REQUEST=GetFeatureInfo&TIPOIMAGEM=nenhum&DESLIGACACHE=sim&STYLES=&SERVICE=WMS&VERSION=1.1.1&FEATURE_COUNT=1"+"&FORMAT=image/png&INFO_FORMAT=text/plain&SRS=EPSG:4326"+"&LAYERS="+tema.value+"&layer="+tema.value+"&QUERY_LAYERS="+tema.value+"&HEIGHT="+i3geoOL.getSize()[1]+"&WIDTH="+i3geoOL.getSize()[0]+"&BBOX="+i3geoOL.getExtent().toBBOX().split(",").join(" ")+"&X="+xy[0]+"&Y="+xy[1];cpJSON.call(p,"foo",retorno,"")}});i3geoOL.addInteraction(draw)};return temp},botaoSalva:function(){var temp=document.createElement("div");temp.className="editorOLsalvaItemInactive olButton";temp.title=$trad("salva");temp.onclick=function(){i3GEO.editorOL.salvaGeometrias()};return temp},criaBotoes:function(botoes,onde){if(onde){i3GEOpanelEditor=$i(onde)}else{if($i("i3GEObarraEdicao")){$i("i3GEObarraEdicao").style.display="block";return}i3GEOpanelEditor=document.createElement("div");i3GEOpanelEditor.id="i3GEObarraEdicao";i3GEOpanelEditor.className="olControlEditingToolbar1 noprint"}if(botoes.imprimir===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoImprimir())}if(botoes.grid===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoGrid())}if(botoes.novaaba===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoNovaaba())}if(botoes.procura===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoProcura())}if(botoes.pan===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPan())}if(botoes.zoombox===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomBox())}if(botoes.zoomtot===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomTot())}if(botoes.zoomin===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomIn())}if(botoes.zoomout===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomOut())}if(botoes.legenda===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoLegenda())}if(botoes.distancia===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoDistancia())}if(botoes.area===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoArea())}if(botoes.identifica===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoIdentifica())}if(botoes.linha===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoLinha())}if(botoes.ponto===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPonto())}if(botoes.poligono===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPoligono())}if(botoes.texto===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoTexto())}if(botoes.edita===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoEdita())}if(botoes.selecao===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSelecao())}if(botoes.selecaotudo===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSelecaoTudo())}if(botoes.apaga===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoApaga())}if(botoes.frente===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoFrente())}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoCorta())}if(botoes.edita===true&&botoes.listag===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoListaGeometrias())}if(botoes.tools===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoTools())}if(botoes.propriedades===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPropriedades())}if(botoes.salva===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSalva())}if(botoes.ajuda===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoAjuda())}if(botoes.fecha===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoFecha())}if(!onde){i3GEOpanelEditor.style.width=i3GEOpanelEditor.getElementsByTagName("div").length*33+"px";i3GEO.editorOL.mapa.getViewport().getElementsByClassName("ol-overlaycontainer-stopevent")[0].appendChild(i3GEOpanelEditor)}},removeFeaturesSel:function(){var s,i,nsel,f;nsel=i3GEO.editorOL.idsSelecionados.length;s=i3GEO.desenho.layergrafico.getSource();for(i=0;icancel"}});var ins=Mustache.render(i3GEO.editorOL.MUSTACHEPROPRIEDADES,i3GEO.editorOL.simbologia);YAHOO.editorOL.container.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.container.panel.setHeader("Propriedades")}else{YAHOO.editorOL.container.panel.setHeader("Propriedades")}YAHOO.editorOL.container.panel.setFooter("");YAHOO.editorOL.container.panel.render(document.body);YAHOO.editorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close,"click",function(){});i3GEO.util.aplicaAquarela("panelpropriedadesEditor")}YAHOO.editorOL.container.panel.show();temp=$i("panelpropriedadesEditor").getElementsByTagName("div");if(temp&&temp[2]){temp[2].style.overflow="auto"}},listaGeometrias:function(){if(!document.getElementById("panellistagEditor")){YAHOO.namespace("editorOL.listaGeometrias");YAHOO.editorOL.listaGeometrias.panel=new YAHOO.widget.Panel("panellistagEditor",{iframe:true,width:"380px",height:"300px",overflow:"auto",visible:false,draggable:true,close:true,strings:{close:"cancel"}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.listaGeometrias.panel.setHeader(""+$trad("u6")+"")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader($trad("u6"))}YAHOO.editorOL.listaGeometrias.panel.setFooter("");YAHOO.editorOL.listaGeometrias.panel.render(document.body);YAHOO.editorOL.listaGeometrias.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.listaGeometrias.panel.close,"click",function(){YAHOO.editorOL.listaGeometrias.panel.destroy()})}else{YAHOO.editorOL.listaGeometrias.panel.render(document.body)}var id,temp,geos=i3GEO.desenho.layergrafico.getSource().getFeatures(),n=geos.length,ins="";ins+='
';while(n>0){n-=1;id=geos[n].getId();if(id){ins+='
'+''+''+id+"
"}}ins+="
";if(geos.length===0){ins='
'+$trad("meneditor2")+"
"}YAHOO.editorOL.listaGeometrias.panel.setBody(ins);YAHOO.editorOL.listaGeometrias.panel.show()},ferramentas:function(){if(i3GEO.editorOL.MUSTACHEFERRAMENTAS==""){$.get(i3GEO.configura.locaplic+"/ferramentas/editorol/templateFerramentas_mst.html",function(template){i3GEO.editorOL.MUSTACHEFERRAMENTAS=template;i3GEO.editorOL.ferramentas()});return}var b,ins;if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",visible:false,draggable:true,close:true,strings:{close:"cancel"}});var hash={"opsel":$trad("opsel"),"p14":$trad("p14"),"hidden":"hidden"};if(i3GEO.php){hash.hidden=""}ins=Mustache.render(i3GEO.editorOL.MUSTACHEFERRAMENTAS,hash);YAHOO.editorOL.ferramentas.panel.setBody(ins);YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas");YAHOO.editorOL.ferramentas.panel.setFooter("");YAHOO.editorOL.ferramentas.panel.render(document.body);YAHOO.editorOL.ferramentas.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.ferramentas.panel.close,"click",function(){})}else{YAHOO.editorOL.ferramentas.panel.render(document.body)}YAHOO.editorOL.ferramentas.panel.show()},snap:function(){var target=i3GEOOLsnap.targets[0],tipos=["node","vertex","edge"],ntipos=tipos.length,i,temp,ativa=false;i3GEOOLsnap.deactivate();for(i=0;i0){temp=function(retorno){if(i3GEO.janela){i3GEO.janela.fechaAguarde("i3GEO.editorPoli");i3GEO.janela.fechaAguarde("i3GEO.editorLinhas");i3GEO.janela.fechaAguarde("i3GEO.editorPontos")}if(retorno!=""&&retorno.data&&retorno.data!=""&&operacao!="converteSHP"){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}if(operacao==="converteSHP"){i3GEO.atualiza();i3GEO.janela.minimiza("paneltemaativo")}};if(operacao==="incorporar"){polis=i3GEO.editorOL.retornaFeaturesTipo("Polygon");linhas=i3GEO.editorOL.retornaFeaturesTipo("LineString");pontos=i3GEO.editorOL.retornaFeaturesTipo("Point");if(polis.length>0){temp=i3GEO.editorOL.merge(polis)}if(linhas.length>0){temp=i3GEO.editorOL.merge(linhas)}if(pontos.length>0){temp=i3GEO.editorOL.desagrupa(pontos)}if(i3GEO.mapa){i3GEO.mapa.dialogo.wkt2layer(temp)}return}if(operacao==="union"&&!i3GEO.php){polis=i3GEO.editorOL.retornaFeaturesTipo("Polygon");linhas=i3GEO.editorOL.retornaFeaturesTipo("LineString");pontos=i3GEO.editorOL.retornaFeaturesTipo("Point");if(polis.length>0){temp=i3GEO.editorOL.uniaojts(polis);i3GEO.editorOL.substituiFeaturesSel(temp)}if(linhas.length>0){temp=i3GEO.editorOL.uniaojts(linhas);i3GEO.editorOL.substituiFeaturesSel(temp)}if(pontos.length>0){temp=i3GEO.editorOL.uniaojts(pontos);i3GEO.editorOL.substituiFeaturesSel(temp)}}else{polis=i3GEO.editorOL.retornaGeometriasTipo("Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo("LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo("Point");if(polis.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos");i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),operacao)}if(linhas.length>0){i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas");i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),operacao)}if(pontos.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos");i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao)}}i3GEO.desenho.layergrafico.getSource().changed();return}else{i3GEO.janela.tempoMsg("Selecione pelo menos dois elementos")}},desagrupa:function(geoms){var n=geoms.length,w=[],g,m,i,format=new ol.format.WKT();for(i=0;i1){for(i=1;i1){uniao=fwkt.writeFeatures([geoms[0]]);uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=fwkt.writeFeatures([geoms[i]]);uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.readFeatures(uniao)]}else{return false}},retornaGeometriasTipo:function(tipo){var n=i3GEO.editorOL.idsSelecionados.length,lista=[],i,s=i3GEO.desenho.layergrafico.getSource(),fwkt=new ol.format.WKT();for(i=0;i0){i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features)}if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},substituiFeaturesSel:function(f){i3GEO.editorOL.removeFeaturesSel();var fwkt=new ol.format.WKT();f=fwkt.readFeatures(f)[0];f.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'})}));f.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(f)},adicionaFeatureWkt:function(wkt,atributos){var f,fwkt=new OpenLayers.Format.WKT();if(atributos.externalGraphic&&atributos.externalGraphic!=""){var style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=atributos.externalGraphic;style_mark.graphicWidth=atributos.graphicWidth;style_mark.graphicHeight=atributos.graphicHeight;style_mark.fillOpacity=atributos.opacidade;f=fwkt.read(wkt);f["attributes"]=atributos;f["style"]=style_mark}else{f=fwkt.read(wkt);f["attributes"]=atributos}i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},flashFeaturesI:function(index){i3GEO.editorOL.flashFeatures([i3GEO.desenho.layergrafico.features[index]],0)},flashFeatures:function(features,index){if(!index){index=0}var current=features[index];if(current&¤t.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(features[index],"select")}var prev=features[index-1];if(prev&&prev.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(prev,"default")}++index;if(index<=features.length){window.setTimeout(function(){i3GEO.editorOL.flashFeatures(features,index)},75)}},selFeature:function(id){var s,f;s=i3GEO.desenho.layergrafico.getSource();f=s.getFeatureById(id);if(!i3GEO.util.in_array(id,i3GEO.editorOL.idsSelecionados)){i3GEO.editorOL.idsSelecionados.push(id);f.setProperties({fillColor:f.getStyle().getFill().getColor(),strokeColor:f.getStyle().getStroke().getColor(),externalGraphic:""});f.getStyle().getFill().setColor('rgba(255, 255, 255, 0.5)');f.getStyle().getStroke().setColor('blue');s.changed()}},carregajts:function(funcao){if(i3GEO.configura){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}else{i3GEO.util.scriptTag("../pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}},trazParaFrente:function(){var s,i,nsel,id,clone;s=i3GEO.desenho.layergrafico.getSource();nsel=i3GEO.editorOL.idsSelecionados.length;for(i=0;i0){i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.mapa.getLayersByName(camada.name)[0],false)}},coordenadas:function(){var idcoord=i3GEO.editorOL.mapa.getControlsBy("separator"," ");if(idcoord[0]){i3GEO.editorOL.mapa.events.register("mousemove",i3GEO.editorOL.mapa,function(e){var p,lonlat,d;if(navm){p=new OpenLayers.Pixel(e.x,e.y)}else{p=e.xy}lonlat=i3GEO.editorOL.mapa.getLonLatFromPixel(p);lonlat=i3GEO.util.projOSM2Geo(lonlat);d=i3GEO.calculo.dd2dms(lonlat.lon,lonlat.lat);try{$i(idcoord[0].id).innerHTML="Long: "+d[0]+"
Lat: "+d[1]}catch(e){}}})}},criaJanelaBusca:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,ins,combo="";ins="
"+$trad("a7")+":
"+combo;ins+="
"+$trad("x64")+":
";ins+="
"+$trad("t23")+":
";ins+="

";ins+="
'"+$trad("result")+"':
";YAHOO.namespace("procura.container");YAHOO.procura.container.panel=new YAHOO.widget.Panel("panelprocura",{zIndex:2000,iframe:false,width:"250px",visible:false,draggable:true,close:true,strings:{close:"cancel"}});YAHOO.procura.container.panel.setHeader("Encontre no mapa");YAHOO.procura.container.panel.setBody(ins);YAHOO.procura.container.panel.setFooter("");YAHOO.procura.container.panel.render(document.body);YAHOO.procura.container.panel.center();document.getElementById("i3GEOOLbotaoBusca").onclick=function(){var layer=i3GEO.editorOL.layerAtivo(),item=document.getElementById("i3GEOOLbuscaItem").value,palavra=document.getElementById("i3GEOOLpalavraBusca").value;if(item===""||palavra===""){alert("Escolha o item e o texto de busca");return}i3GEO.editorOL.busca(layer,item,palavra,"i3GEOOLcomboresultado")};document.getElementById("i3GEOOLlistaTemasBusca").onchange=function(){i3GEO.editorOL.ativaTema(this.value);document.getElementById("i3GEOOLcomboitens").innerHTML="...";i3GEO.editorOL.listaItens(i3GEO.editorOL.layerAtivo(),"i3GEOOLcomboitens","i3GEOOLbuscaItem")}},criaComboTemas:function(){var layers=i3GEO.editorOL.layersLigados(),nlayers=layers.length,i,nometema="",combo="";return combo},atualizaJanelaAtivaTema:function(){var combo=i3GEO.editorOL.criaComboTemas();YAHOO.temaativo.container.panel.setBody(combo)},criaJanelaAtivaTema:function(){var temp;if(!document.getElementById("paneltemaativo")){YAHOO.namespace("temaativo.container");YAHOO.temaativo.container.panel=new YAHOO.widget.Panel("paneltemaativo",{zIndex:20000,iframe:true,width:"250px",visible:false,draggable:true,close:true,strings:{close:"cancel"}});YAHOO.temaativo.container.panel.setBody("");if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.temaativo.container.panel.setHeader("Tema ativo
")}else{YAHOO.temaativo.container.panel.setHeader($trad("tativo"))}YAHOO.temaativo.container.panel.setFooter("");YAHOO.temaativo.container.panel.render(document.body);YAHOO.temaativo.container.panel.show();YAHOO.temaativo.container.panel.center();i3GEO.editorOL.atualizaJanelaAtivaTema();YAHOO.util.Event.addListener(YAHOO.temaativo.container.panel.close,"click",function(){i3GEO.editorOL.marcaBotao();if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){if(i3GEO.eventos){i3GEO.eventos.adicionaEventos("ATUALIZAARVORECAMADAS",["i3GEO.editorOL.atualizaJanelaAtivaTema()"])}}temp=$i("paneltemaativo_minimizaCabecalho");if(temp){temp.onclick=function(){i3GEO.janela.minimiza("paneltemaativo")}}}else{YAHOO.temaativo.container.panel.show();i3GEO.editorOL.atualizaJanelaAtivaTema()}},ativaTema:function(id){document.getElementById("i3GEOOLlistaTemasAtivos").value=id},layerAtivo:function(){if(i3GEO.editorOL.layerDefault&&i3GEO.editorOL.layerDefault!=""){return i3GEO.editorOL.layerPorParametro("LAYERS",i3GEO.editorOL.layerDefault)}else{var id=document.getElementById("i3GEOOLlistaTemasAtivos");if(id){id=id.value}else{id=i3GEO.temaAtivo}if(id==""){return[]}else{return i3GEO.editorOL.layersLigados()[id]}}},listaItens:function(layer,idonde,idobj){if(!layer){return}if(!layer.params){return}var u=layer.url+"&request=describefeaturetype&service=wfs&version=1.0.0";u+="&typename="+layer.params.LAYERS;document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.WFSDescribeFeatureType({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),prop=gml.featureTypes[0].properties,nprop=prop.length,i,combo="";document.getElementById(idonde).innerHTML=combo},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},busca:function(layer,item,palavra,onde){document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";var u=layer.url+"&request=getfeature&service=wfs&version=1.0.0";u=u.replace("Z=${z}&X=${x}&Y=${y}","");u+="&OUTPUTFORMAT=gml2&typename="+layer.params.LAYERS;u+="&filter="+item+"*"+palavra+"*";document.body.style.cursor="wait";document.getElementById("i3geoMapa").style.cursor="wait";document.getElementById(onde).innerHTML="...";OpenLayers.Request.issue({method:"GET",url:u,callback:function(retorno){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";var fromgml=new OpenLayers.Format.GML({geometryName:"msGeometry"}),gml=fromgml.read(retorno.responseText),ngml=gml.length,i,ins="";document.getElementById(onde).innerHTML=ins},failure:function(){document.body.style.cursor="default";document.getElementById("i3geoMapa").style.cursor="default";alert("Erro")}})},zoomPara:function(bbox){var b=new OpenLayers.Bounds.fromString(bbox);i3GEO.editorOL.mapa.zoomToExtent(b)},mostraLegenda:function(){var prop,layer,layers=i3GEO.editorOL.mapa.getLayers(),nlayers=layers.getLength(),ins="",i,icone="",url,f="",fonte="";for(i=0;ilink"}ins+=icone+prop.name+fonte+"

";eval("var f = function(retorno){document.getElementById('legendaL_"+i+"').innerHTML = retorno.responseText;};");url=url.replace("LAYERS","LAYER");var config={method:"GET",url:url,callback:f}}else if(prop.isBaseLayer===false&&prop.visible===true){url=url.replace("LAYERS","LAYER");url+="&FORMAT=image/png";ins+=prop.title+"

"}}}if(!document.getElementById("panellegendaeditorOL")){YAHOO.namespace("legendaeditorOL.container");YAHOO.legendaeditorOL.container.panel=new YAHOO.widget.Panel("panellegendaeditorOL",{zIndex:20000,iframe:true,width:"auto",visible:false,draggable:true,close:true,strings:{close:"cancel"}});YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.setHeader($trad("p3"));YAHOO.legendaeditorOL.container.panel.setFooter("");YAHOO.legendaeditorOL.container.panel.render(document.body);YAHOO.legendaeditorOL.container.panel.show();YAHOO.legendaeditorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.legendaeditorOL.container.panel.close,"click",function(){YAHOO.legendaeditorOL.container.panel.destroy()})}else{YAHOO.legendaeditorOL.container.panel.setBody(ins);YAHOO.legendaeditorOL.container.panel.show()}},captura:function(x,y,tema,idunico){var d=0.001,layer=i3geoOL.getLayersByName(tema)[0],xy=[x,y],u=layer.getSource().getUrls()[0],poligono,retorno;u+="&REQUEST=getfeature&service=wfs&version=1.0.0";u+="&OUTPUTFORMAT=gml2&typename=undefined";if(i3GEO.Interface.openlayers.googleLike===true){u+="&SRS=EPSG:3857"}u=u.replace("&cache=sim","&DESLIGACACHE=sim");u=u.replace("&Z=${z}&X=${x}&Y=${y}","");u=u.replace("Z=${z}&X=${x}&Y=${y}","");xy[0]=xy[0]*1;xy[1]=xy[1]*1;poligono=(xy[0]-d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]+d)+" "+(xy[0]+d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]-d)+" "+(xy[0]-d)+","+(xy[1]+d);u+="&filter=Geometry"+poligono+"";retorno=function(r){var fs,c,format,f,n,i,idunico;format=new ol.format.WKT();fs=format.readFeatures(r[0]);n=fs.length;c=i3GEO.desenho.layergrafico.getSource();for(i=0;i0){if($i("panelsalvageometrias")){if(YAHOO.i3GEO){YAHOO.salvaGeometrias.container.panel=YAHOO.i3GEO.janela.manager.find("panelsalvageometrias")}YAHOO.salvaGeometrias.container.panel.show();YAHOO.salvaGeometrias.container.panel.bringToTop()}else{try{YAHOO.namespace("salvaGeometrias.container");YAHOO.salvaGeometrias.container.panel=new YAHOO.widget.Panel("panelsalvageometrias",{zIndex:2000,iframe:false,width:"350px",visible:false,draggable:true,close:true,strings:{close:"cancel"}});YAHOO.salvaGeometrias.container.panel.setHeader(""+$trad("u6")+"");YAHOO.salvaGeometrias.container.panel.setBody("");YAHOO.salvaGeometrias.container.panel.setFooter("");YAHOO.salvaGeometrias.container.panel.render(document.body);YAHOO.salvaGeometrias.container.panel.center();if(YAHOO.i3GEO&&YAHOO.i3GEO.janela){YAHOO.i3GEO.janela.manager.register(YAHOO.salvaGeometrias.container.panel)}YAHOO.salvaGeometrias.container.panel.show()}catch(e){}}var hash={"n":n,"geosel":$trad("geosel"),"listar":$trad("listar"),"nomeFuncaoSalvarHidden":"hidden","incorpoHidden":"hidden"};if(i3GEO.editorOL.nomeFuncaoSalvar&&i3GEO.editorOL.nomeFuncaoSalvar!=""){hash.nomeFuncaoSalvar=i3GEO.editorOL.nomeFuncaoSalvar;hash.sdados=$trad("sdados");hash.nomeFuncaoSalvarHidden=""}if(typeof i3geoOL!=="undefined"){hash.incorpo=$trad("incorpo");hash.ajudaEditorOlSalva=$trad("ajudaEditorOlSalva");hash.incorpoHidden=""}ins=Mustache.render(i3GEO.editorOL.MUSTACHESALVAGEOMETRIAS,hash);YAHOO.salvaGeometrias.container.panel.setBody(ins)}else{i3GEO.janela.tempoMsg($trad("selum"))}},exportarSHP:function(){i3GEO.editorOL.processageo("converteSHP")},incorporar:function(){i3GEO.editorOL.processageo("incorporar")},listaGeometriasSel:function(){var n=i3GEO.editorOL.idsSelecionados.length,ins="",s=i3GEO.desenho.layergrafico.getSource(),i,w,g;for(i=0;i"+$trad("u6")+": #"+i+"
"+i3GEO.editorOL.google2wgs(g.getGeometry().getCoordinates())+"

"}w=window.open();w.document.write(ins);w.document.close()},testeSalvar:function(){alert("Funcao nao disponivel. Defina o nome da funcao em i3GEO.editorOL.nomeFuncaoSalvar ")},salvaGeo:function(){if(i3GEO.parametros.editor=="nao"){i3GEO.janela.tempoMsg($trad("meneditor3"));return}var s=i3GEO.desenho.layergrafico.getSource(),n=i3GEO.editorOL.idsSelecionados.length,funcaoOK=function(){var f=s.getFeatureById(i3GEO.editorOL.idsSelecionados[0]),g=f.getGeometry(),tema=$i("editorOLcomboTemaEditavel").value,redesenha,p,format;g=i3GEO.editorOL.google2wgs(g);format=new ol.format.WKT();f.setGeometry(g);if(tema==""){return}redesenha=function(retorno){i3GEO.janela.fechaAguarde("aguardeSalvaPonto");i3GEO.editorOL.removeFeaturesSel();i3GEO.Interface.atualizaTema("",tema)};i3GEO.janela.AGUARDEMODAL=true;i3GEO.janela.abreAguarde("aguardeSalvaPonto",$trad("adic")+"...");i3GEO.janela.AGUARDEMODAL=false;if(!f.getProperties().idUnico||f.getProperties().idUnico==""){p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&tema="+tema+"&wkt="+format.writeFeatures([f]))}else{p=i3GEO.configura.locaplic+"/ferramentas/editortema/exec.php?funcao=atualizaGeometria&g_sid="+i3GEO.configura.sid;cpJSON.call(p,"foo",redesenha,"&idunico="+f.getProperties().idUnico+"&tema="+tema+"&wkt="+format.writeFeatures([f]))}},funcaoCombo=function(obj){$i("editorOLondeComboTemaEditavel").innerHTML=obj.dados},texto=$trad("stema")+"
";if(n!=1){i3GEO.janela.tempoMsg($trad("seluma"))}else{i3GEO.janela.confirma(texto,300,$trad("salva"),"",funcaoOK);i3GEO.util.comboTemas("editorOLcomboTemaEditavel",funcaoCombo,"editorOLondeComboTemaEditavel","",false,"editavel"," ",false,true,"form-control comboTema")}},marcaBotao:function(classeBotao){if($i("i3GEObarraEdicao")){var i,n,botoes=$i("i3GEObarraEdicao").getElementsByTagName("div");n=botoes.length;for(i=0;i0){x=window.confirm($trad("excsel")+"?");if(x){i3GEO.editorOL.removeFeaturesSel();i3GEO.desenho.layergrafico.getSource().changed()}}else{i3GEO.janela.tempoMsg($trad("selum"))}};return temp},botaoFrente:function(){var temp=document.createElement("div");temp.className="editorOLfrenteItemInactive olButton";temp.title=$trad("frente");temp.onclick=function(){var nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel>0){i3GEO.editorOL.marcaBotao();i3GEO.editorOL.trazParaFrente()}else{i3GEO.janela.tempoMsg($trad("selum"))}};return temp},botaoEdita:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLeditaItemInactive olButton";temp.title=$trad("modf");temp.onclick=function(){i3GEO.editorOL.featuresBackup=[];var draw,nsel,f,c;nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel==1){i3GEO.editorOL.removeInteracoes();i3GEO.editorOL.marcaBotao("editorOLedita");f=i3GEO.desenho.layergrafico.getSource().getFeatureById(i3GEO.editorOL.idsSelecionados[nsel-1]);i3GEO.editorOL.featuresBackup.push(f.clone());c=new ol.Collection();c.push(f);draw=new ol.interaction.Modify({features:c});i3GEO.editorOL.interacoes=draw;i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false);i3geoOL.addInteraction(draw)}else{i3GEO.janela.tempoMsg($trad("seluma"))}};return temp},botaoCorta:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLcortaItemInactive olButton";temp.title=$trad("cortaf");temp.onclick=function(){var nsel=i3GEO.editorOL.idsSelecionados.length;if(nsel!=1){alert("Selecione primeiro um elemento para ser cortado")}else{i3GEO.editorOL.removeInteracoes();i3GEO.janela.tempoMsg("Desenhe um polígono");i3GEO.editorOL.marcaBotao("editorOLcorta");var draw=new ol.interaction.Draw({type:"Polygon"});i3GEO.editorOL.interacoes=draw;i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false);draw.on("drawend",function(evt){var temp,f,c,format,fwkt,cwkt;f=evt.feature;c=i3GEO.desenho.layergrafico.getSource().getFeatureById(i3GEO.editorOL.idsSelecionados[nsel-1]);i3GEO.editorOL.featuresBackup.push(c.clone());i3GEO.editorOL.marcaBotao();format=new ol.format.WKT();if(f&&c){fwkt=format.writeFeatures([f]);cwkt=format.writeFeatures([c]);if(fwkt&&cwkt){temp=function(retorno){i3GEO.janela.fechaAguarde("i3GEO.cortador");if(retorno!=""&&retorno.data&&retorno.data!=""){i3GEO.janela.fechaAguarde("i3GEO.cortador");c.setGeometry(format.readGeometry(retorno.data));if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}}};i3GEO.janela.abreAguarde("i3GEO.cortador","Cortando");i3GEO.php.funcoesGeometriasWkt(temp,cwkt+"|"+fwkt,"difference")}}});i3geoOL.addInteraction(draw)}};return temp},botaoListaGeometrias:function(){var temp=document.createElement("div");temp.className="editorOLlistagItemInactive olButton";temp.title=$trad("listag");temp.onclick=function(){i3GEO.editorOL.listaGeometrias()};return temp},botaoNovaaba:function(){var temp=document.createElement("div");temp.className="editorOLnovaabaItemInactive olButton";temp.title=$trad("novaaba");temp.onclick=function(){window.open(window.location,'_blank')};return temp},botaoAjuda:function(){var temp=document.createElement("div");temp.className="editorOLajudaItemInactive olButton";temp.title=$trad("s1");temp.onclick=function(){if(i3GEO.configura&&i3GEO.configura.locaplic){i3GEO.janela.cria("400px","200px",i3GEO.configura.locaplic+"/ferramentas/editorol/openlayers_ajuda.php?completo=none","","",""+$trad("s1")+"","editorOlAjuda")}else{window.open("openlayers_ajuda.php")}};return temp},botaoFecha:function(){var temp=document.createElement("div");temp.className="editorOLfechaItemInactive olButton";temp.title=$trad("x74");temp.onclick=function(){i3GEO.editorOL.unselTodos();i3GEO.editorOL.featuresBackup=[];i3GEO.editorOL.marcaBotao();i3GEO.eventos.cliquePerm.ativa();$i("i3GEObarraEdicao").style.display="none"};return temp},botaoTools:function(){var temp=document.createElement("div");temp.className="editorOLtoolsItemInactive olButton";temp.title=$trad("u15a");temp.onclick=function(){if(i3GEO.php){i3GEO.editorOL.ferramentas()}else{i3GEO.editorOL.carregajts("i3GEO.editorOL.ferramentas()")}};return temp},botaoPropriedades:function(){var temp=document.createElement("div");temp.className="editorOLpropriedadesItemInactive olButton";temp.title=$trad("p13");temp.onclick=function(){i3GEO.editorOL.propriedades()};return temp},botaoImprimir:function(){var temp=document.createElement("div");temp.className="editorOLimprimirItemInactive olButton";temp.onclick=function(){window.print()};return temp},botaoGrid:function(){var temp=document.createElement("div");temp.className="editorOLgridItemInactive olButton";temp.onclick=function(){var p={"map":i3GEO.editorOL.mapa,"targetSize":200};if(!i3GEO.editorOL.grid){i3GEO.editorOL.grid=new ol.Graticule(p)}else{if(i3GEO.editorOL.grid.getMap()==null){i3GEO.editorOL.grid.setMap(i3GEO.editorOL.mapa)}else{i3GEO.editorOL.grid.setMap(null)}}};return temp},botaoIdentifica:function(){i3GEO.eventos.cliquePerm.desativa();var temp=document.createElement("div");temp.className="editorOLidentificaItemInactive olButton";temp.title=$trad("d7t");temp.onclick=function(){if(i3GEO.editorOL.layerDefault==""){i3GEO.editorOL.criaJanelaAtivaTema()}i3GEO.eventos.cliquePerm.desativa();i3GEO.editorOL.removeInteracoes();i3GEO.editorOL.marcaBotao("editorOLidentifica");var draw=new ol.interaction.Draw({type:"Point"});i3GEO.editorOL.interacoes=draw;i3GEO.Interface.openlayers.parametrosMap.interactions[0].setActive(false);draw.on("drawend",function(evt){var xy,p,retorno,url,layer,tema=$i("i3GEOOLlistaTemasAtivos");if(tema){layer=i3geoOL.getLayersByName(tema.value)[0];if(layer.getSource().getUrls){url=layer.getSource().getUrls()[0]}else{url=layer.getSource().getUrl()}xy=evt.feature.getGeometry().getFirstCoordinate();retorno=function(r){var valorunico="",camada=null,texto="",lonlattexto,xy,temp,temp1,n,i,f=[],textoN=r.split(":");if(i3GEO.arvoreDeCamadas){camada=i3GEO.arvoreDeCamadas.pegaTema(tema.value,"","name")}xy=evt.feature.getGeometry().getFirstCoordinate();i3GEO.eventos.cliquePerm.ativo=true;try{if(textoN.length>1){textoN.shift();textoN.shift();temp=textoN.join(":");temp=temp.replace(/'/g,"");temp=temp.replace(/\n/g,"|");temp=temp.replace(/_/g," ");temp=temp.split("|");n=temp.length;for(i=0;i")+""}}catch(e){}lonlattexto="edita geometria
";i3GEO.Interface.openlayers.balao("
"+lonlattexto+texto+"
","",xy[0],xy[1],false,false);i3GEO.eventos.cliquePerm.ativo=false};p=i3GEO.configura.locaplic+"/classesphp/proxy.php?"+url+"&tipoRetornoProxy=string&REQUEST=GetFeatureInfo&TIPOIMAGEM=nenhum&DESLIGACACHE=sim&STYLES=&SERVICE=WMS&VERSION=1.1.1&FEATURE_COUNT=1"+"&FORMAT=image/png&INFO_FORMAT=text/plain&SRS=EPSG:4326"+"&LAYERS="+tema.value+"&layer="+tema.value+"&QUERY_LAYERS="+tema.value+"&HEIGHT="+i3geoOL.getSize()[1]+"&WIDTH="+i3geoOL.getSize()[0]+"&BBOX="+i3geoOL.getExtent().toBBOX().split(",").join(" ")+"&X="+xy[0]+"&Y="+xy[1];cpJSON.call(p,"foo",retorno,"")}});i3geoOL.addInteraction(draw)};return temp},botaoSalva:function(){var temp=document.createElement("div");temp.className="editorOLsalvaItemInactive olButton";temp.title=$trad("salva");temp.onclick=function(){i3GEO.editorOL.salvaGeometrias()};return temp},criaBotoes:function(botoes,onde){if(onde){i3GEOpanelEditor=$i(onde)}else{if($i("i3GEObarraEdicao")){$i("i3GEObarraEdicao").style.display="block";return}i3GEOpanelEditor=document.createElement("div");i3GEOpanelEditor.id="i3GEObarraEdicao";i3GEOpanelEditor.className="olControlEditingToolbar1 noprint"}if(botoes.imprimir===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoImprimir())}if(botoes.grid===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoGrid())}if(botoes.novaaba===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoNovaaba())}if(botoes.procura===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoProcura())}if(botoes.pan===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPan())}if(botoes.zoombox===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomBox())}if(botoes.zoomtot===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomTot())}if(botoes.zoomin===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomIn())}if(botoes.zoomout===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoZoomOut())}if(botoes.legenda===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoLegenda())}if(botoes.distancia===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoDistancia())}if(botoes.area===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoArea())}if(botoes.identifica===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoIdentifica())}if(botoes.linha===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoLinha())}if(botoes.ponto===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPonto())}if(botoes.poligono===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPoligono())}if(botoes.texto===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoTexto())}if(botoes.edita===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoEdita())}if(botoes.selecao===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSelecao())}if(botoes.selecaotudo===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSelecaoTudo())}if(botoes.apaga===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoApaga())}if(botoes.frente===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoFrente())}if(botoes.edita===true&&botoes.corta===true&&i3GEO.php){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoCorta())}if(botoes.edita===true&&botoes.listag===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoListaGeometrias())}if(botoes.tools===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoTools())}if(botoes.propriedades===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoPropriedades())}if(botoes.salva===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoSalva())}if(botoes.ajuda===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoAjuda())}if(botoes.fecha===true){i3GEOpanelEditor.appendChild(i3GEO.editorOL.botaoFecha())}if(!onde){i3GEOpanelEditor.style.width=i3GEOpanelEditor.getElementsByTagName("div").length*33+"px";i3GEO.editorOL.mapa.getViewport().getElementsByClassName("ol-overlaycontainer-stopevent")[0].appendChild(i3GEOpanelEditor)}},removeFeaturesSel:function(){var s,i,nsel,f;nsel=i3GEO.editorOL.idsSelecionados.length;s=i3GEO.desenho.layergrafico.getSource();for(i=0;icancel"}});var ins=Mustache.render(i3GEO.editorOL.MUSTACHEPROPRIEDADES,i3GEO.editorOL.simbologia);YAHOO.editorOL.container.panel.setBody(ins);if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.container.panel.setHeader("Propriedades")}else{YAHOO.editorOL.container.panel.setHeader("Propriedades")}YAHOO.editorOL.container.panel.setFooter("");YAHOO.editorOL.container.panel.render(document.body);YAHOO.editorOL.container.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.container.panel.close,"click",function(){});i3GEO.util.aplicaAquarela("panelpropriedadesEditor")}YAHOO.editorOL.container.panel.show();temp=$i("panelpropriedadesEditor").getElementsByTagName("div");if(temp&&temp[2]){temp[2].style.overflow="auto"}},listaGeometrias:function(){if(!document.getElementById("panellistagEditor")){YAHOO.namespace("editorOL.listaGeometrias");YAHOO.editorOL.listaGeometrias.panel=new YAHOO.widget.Panel("panellistagEditor",{iframe:true,width:"380px",height:"300px",overflow:"auto",visible:false,draggable:true,close:true,strings:{close:"cancel"}});if(i3GEO&&typeof i3GEO!=undefined&&i3GEO!=""){YAHOO.editorOL.listaGeometrias.panel.setHeader(""+$trad("u6")+"")}else{YAHOO.editorOL.listaGeometrias.panel.setHeader($trad("u6"))}YAHOO.editorOL.listaGeometrias.panel.setFooter("");YAHOO.editorOL.listaGeometrias.panel.render(document.body);YAHOO.editorOL.listaGeometrias.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.listaGeometrias.panel.close,"click",function(){YAHOO.editorOL.listaGeometrias.panel.destroy()})}else{YAHOO.editorOL.listaGeometrias.panel.render(document.body)}var id,temp,geos=i3GEO.desenho.layergrafico.getSource().getFeatures(),n=geos.length,ins="";ins+='
';while(n>0){n-=1;id=geos[n].getId();if(id){ins+='
'+''+''+id+"
"}}ins+="
";if(geos.length===0){ins='
'+$trad("meneditor2")+"
"}YAHOO.editorOL.listaGeometrias.panel.setBody(ins);YAHOO.editorOL.listaGeometrias.panel.show()},ferramentas:function(){if(i3GEO.editorOL.MUSTACHEFERRAMENTAS==""){$.get(i3GEO.configura.locaplic+"/ferramentas/editorol/templateFerramentas_mst.html",function(template){i3GEO.editorOL.MUSTACHEFERRAMENTAS=template;i3GEO.editorOL.ferramentas()});return}var b,ins;if(!document.getElementById("panelferramentasEditor")){YAHOO.namespace("editorOL.ferramentas");YAHOO.editorOL.ferramentas.panel=new YAHOO.widget.Panel("panelferramentasEditor",{zIndex:20000,iframe:true,width:"300px",visible:false,draggable:true,close:true,strings:{close:"cancel"}});var hash={"opsel":$trad("opsel"),"p14":$trad("p14"),"hidden":"hidden"};if(i3GEO.php){hash.hidden=""}ins=Mustache.render(i3GEO.editorOL.MUSTACHEFERRAMENTAS,hash);YAHOO.editorOL.ferramentas.panel.setBody(ins);YAHOO.editorOL.ferramentas.panel.setHeader("Ferramentas");YAHOO.editorOL.ferramentas.panel.setFooter("");YAHOO.editorOL.ferramentas.panel.render(document.body);YAHOO.editorOL.ferramentas.panel.center();YAHOO.util.Event.addListener(YAHOO.editorOL.ferramentas.panel.close,"click",function(){})}else{YAHOO.editorOL.ferramentas.panel.render(document.body)}YAHOO.editorOL.ferramentas.panel.show()},snap:function(){var target=i3GEOOLsnap.targets[0],tipos=["node","vertex","edge"],ntipos=tipos.length,i,temp,ativa=false;i3GEOOLsnap.deactivate();for(i=0;i0){temp=function(retorno){if(i3GEO.janela){i3GEO.janela.fechaAguarde("i3GEO.editorPoli");i3GEO.janela.fechaAguarde("i3GEO.editorLinhas");i3GEO.janela.fechaAguarde("i3GEO.editorPontos")}if(retorno!=""&&retorno.data&&retorno.data!=""&&operacao!="converteSHP"){i3GEO.editorOL.substituiFeaturesSel(retorno.data)}if(operacao==="converteSHP"){i3GEO.atualiza();i3GEO.janela.minimiza("paneltemaativo")}};if(operacao==="incorporar"){polis=i3GEO.editorOL.retornaFeaturesTipo("Polygon");linhas=i3GEO.editorOL.retornaFeaturesTipo("LineString");pontos=i3GEO.editorOL.retornaFeaturesTipo("Point");if(polis.length>0){temp=i3GEO.editorOL.merge(polis)}if(linhas.length>0){temp=i3GEO.editorOL.merge(linhas)}if(pontos.length>0){temp=i3GEO.editorOL.desagrupa(pontos)}if(i3GEO.mapa){i3GEO.mapa.dialogo.wkt2layer(temp)}return}if(operacao==="union"&&!i3GEO.php){polis=i3GEO.editorOL.retornaFeaturesTipo("Polygon");linhas=i3GEO.editorOL.retornaFeaturesTipo("LineString");pontos=i3GEO.editorOL.retornaFeaturesTipo("Point");if(polis.length>0){temp=i3GEO.editorOL.uniaojts(polis);i3GEO.editorOL.substituiFeaturesSel(temp)}if(linhas.length>0){temp=i3GEO.editorOL.uniaojts(linhas);i3GEO.editorOL.substituiFeaturesSel(temp)}if(pontos.length>0){temp=i3GEO.editorOL.uniaojts(pontos);i3GEO.editorOL.substituiFeaturesSel(temp)}}else{polis=i3GEO.editorOL.retornaGeometriasTipo("Polygon");linhas=i3GEO.editorOL.retornaGeometriasTipo("LineString");pontos=i3GEO.editorOL.retornaGeometriasTipo("Point");if(polis.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPoli","Poligonos");i3GEO.php.funcoesGeometriasWkt(temp,polis.join("|"),operacao)}if(linhas.length>0){i3GEO.janela.abreAguarde("i3GEO.editorLinhas","Linhas");i3GEO.php.funcoesGeometriasWkt(temp,linhas.join("|"),operacao)}if(pontos.length>0){i3GEO.janela.abreAguarde("i3GEO.editorPontos","Pontos");i3GEO.php.funcoesGeometriasWkt(temp,pontos.join("|"),operacao)}}i3GEO.desenho.layergrafico.getSource().changed();return}else{i3GEO.janela.tempoMsg("Selecione pelo menos dois elementos")}},desagrupa:function(geoms){var n=geoms.length,w=[],g,m,i,format=new ol.format.WKT();for(i=0;i1){for(i=1;i1){uniao=fwkt.writeFeatures([geoms[0]]);uniao=rwkt.read(uniao);for(i=1;i<=n;i++){g=fwkt.writeFeatures([geoms[i]]);uniao=uniao.union(rwkt.read(g))}uniao=wwkt.write(uniao);return[fwkt.readFeatures(uniao)]}else{return false}},retornaGeometriasTipo:function(tipo){var n=i3GEO.editorOL.idsSelecionados.length,lista=[],i,s=i3GEO.desenho.layergrafico.getSource(),fwkt=new ol.format.WKT();for(i=0;i0){i3GEO.desenho.layergrafico.removeFeatures(i3GEO.desenho.layergrafico.features);i3GEO.desenho.layergrafico.addFeatures(i3GEO.editorOL.backup.features)}if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},substituiFeaturesSel:function(f){i3GEO.editorOL.removeFeaturesSel();var fwkt=new ol.format.WKT();f=fwkt.readFeatures(f)[0];f.setStyle(new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba('+i3GEO.editorOL.simbologia.strokeColor+','+i3GEO.editorOL.simbologia.opacidade+')',width:i3GEO.editorOL.simbologia.strokeWidth}),fill:new ol.style.Fill({color:'rgba('+i3GEO.editorOL.simbologia.fillColor+','+i3GEO.editorOL.simbologia.opacidade+')'})}));f.setId(i3GEO.util.uid());i3GEO.desenho.layergrafico.getSource().addFeature(f)},adicionaFeatureWkt:function(wkt,atributos){var f,fwkt=new OpenLayers.Format.WKT();if(atributos.externalGraphic&&atributos.externalGraphic!=""){var style_mark=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style['default']);style_mark.externalGraphic=atributos.externalGraphic;style_mark.graphicWidth=atributos.graphicWidth;style_mark.graphicHeight=atributos.graphicHeight;style_mark.fillOpacity=atributos.opacidade;f=fwkt.read(wkt);f["attributes"]=atributos;f["style"]=style_mark}else{f=fwkt.read(wkt);f["attributes"]=atributos}i3GEO.desenho.layergrafico.addFeatures([f]);if(document.getElementById("panellistagEditor")){i3GEO.editorOL.listaGeometrias()}},flashFeaturesI:function(index){i3GEO.editorOL.flashFeatures([i3GEO.desenho.layergrafico.features[index]],0)},flashFeatures:function(features,index){if(!index){index=0}var current=features[index];if(current&¤t.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(features[index],"select")}var prev=features[index-1];if(prev&&prev.layer===i3GEO.desenho.layergrafico){i3GEO.desenho.layergrafico.drawFeature(prev,"default")}++index;if(index<=features.length){window.setTimeout(function(){i3GEO.editorOL.flashFeatures(features,index)},75)}},selFeature:function(id){var s,f;s=i3GEO.desenho.layergrafico.getSource();f=s.getFeatureById(id);if(!i3GEO.util.in_array(id,i3GEO.editorOL.idsSelecionados)){i3GEO.editorOL.idsSelecionados.push(id);f.setProperties({fillColor:f.getStyle().getFill().getColor(),strokeColor:f.getStyle().getStroke().getColor(),externalGraphic:""});f.getStyle().getFill().setColor('rgba(255, 255, 255, 0.5)');f.getStyle().getStroke().setColor('blue');s.changed()}},carregajts:function(funcao){if(i3GEO.configura){i3GEO.util.scriptTag(i3GEO.configura.locaplic+"/pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}else{i3GEO.util.scriptTag("../pacotes/jsts/lib/jsts.js",funcao,"i3GEOjts",true)}},trazParaFrente:function(){var s,i,nsel,id,clone;s=i3GEO.desenho.layergrafico.getSource();nsel=i3GEO.editorOL.idsSelecionados.length;for(i=0;i - - - - - - - -
 
-
-Remove a tela inicial de apresentação do i3Geo substituindo-a pela iniciallização direta do mapa. -Após remover, a tela inicial pode ser vista utilizando-se o endereço i3geo/init. Para definir qual a interface que -será utilizada como default ao abrir o i3Geo edite o arquivo i3geo/ms_configura.php.

-Usuário não registrado em i3geo/ms_configura.php na variável i3geomaster"; - exit; - } -} -//error_reporting(0); -unlink("../index.htm"); -unlink("../index.html"); -if(file_exists("../index.htm") || file_exists("../index.html")){ - echo " Sem permissao do sistema opercaional para excluir arquivo"; - exit; -} -copy("_index.htm","../index.htm"); -copy("_index.html","../index.html"); -chmod("../index.htm",0777); -chmod("../index.html",0777); -echo "
OK. Removido. Voce pode utilizar o init digitando i3geo/init no navegador"; -?> -
- - diff --git a/js/compactados/ajuda_compacto.js b/js/compactados/ajuda_compacto.js old mode 100755 new mode 100644 index 8e4086f..8e4086f --- a/js/compactados/ajuda_compacto.js +++ b/js/compactados/ajuda_compacto.js diff --git a/js/compactados/analise_compacto.js b/js/compactados/analise_compacto.js old mode 100755 new mode 100644 index 91868c6..91868c6 --- a/js/compactados/analise_compacto.js +++ b/js/compactados/analise_compacto.js diff --git a/js/compactados/arvoredecamadas_compacto.js b/js/compactados/arvoredecamadas_compacto.js old mode 100755 new mode 100644 index b6ef2c7..b6ef2c7 --- a/js/compactados/arvoredecamadas_compacto.js +++ b/js/compactados/arvoredecamadas_compacto.js diff --git a/js/compactados/arvoredetemas_compacto.js b/js/compactados/arvoredetemas_compacto.js old mode 100755 new mode 100644 index 192e851..192e851 --- a/js/compactados/arvoredetemas_compacto.js +++ b/js/compactados/arvoredetemas_compacto.js diff --git a/js/compactados/base64_compacto.js b/js/compactados/base64_compacto.js old mode 100755 new mode 100644 index 9ff1f1a..9ff1f1a --- a/js/compactados/base64_compacto.js +++ b/js/compactados/base64_compacto.js diff --git a/js/compactados/busca_compacto.js b/js/compactados/busca_compacto.js old mode 100755 new mode 100644 index 380c4a5..380c4a5 --- a/js/compactados/busca_compacto.js +++ b/js/compactados/busca_compacto.js diff --git a/js/compactados/caixaDeFerramentas_compacto.js b/js/compactados/caixaDeFerramentas_compacto.js old mode 100755 new mode 100644 index 33f12c4..33f12c4 --- a/js/compactados/caixaDeFerramentas_compacto.js +++ b/js/compactados/caixaDeFerramentas_compacto.js diff --git a/js/compactados/calculo_compacto.js b/js/compactados/calculo_compacto.js old mode 100755 new mode 100644 index 32b90de..32b90de --- a/js/compactados/calculo_compacto.js +++ b/js/compactados/calculo_compacto.js diff --git a/js/compactados/catalogoDir_compacto.js b/js/compactados/catalogoDir_compacto.js old mode 100755 new mode 100644 index f414552..f414552 --- a/js/compactados/catalogoDir_compacto.js +++ b/js/compactados/catalogoDir_compacto.js diff --git a/js/compactados/catalogoEstrelas_compacto.js b/js/compactados/catalogoEstrelas_compacto.js old mode 100755 new mode 100644 index 7d8e059..7d8e059 --- a/js/compactados/catalogoEstrelas_compacto.js +++ b/js/compactados/catalogoEstrelas_compacto.js diff --git a/js/compactados/catalogoInde_compacto.js b/js/compactados/catalogoInde_compacto.js old mode 100755 new mode 100644 index 5ee129b..5ee129b --- a/js/compactados/catalogoInde_compacto.js +++ b/js/compactados/catalogoInde_compacto.js diff --git a/js/compactados/catalogoMapas_compacto.js b/js/compactados/catalogoMapas_compacto.js old mode 100755 new mode 100644 index 670e4ce..670e4ce --- a/js/compactados/catalogoMapas_compacto.js +++ b/js/compactados/catalogoMapas_compacto.js diff --git a/js/compactados/catalogoMenus_compacto.js b/js/compactados/catalogoMenus_compacto.js old mode 100755 new mode 100644 index 5edb91a..5edb91a --- a/js/compactados/catalogoMenus_compacto.js +++ b/js/compactados/catalogoMenus_compacto.js diff --git a/js/compactados/catalogoMetaestat_compacto.js b/js/compactados/catalogoMetaestat_compacto.js old mode 100755 new mode 100644 index 179aa3e..179aa3e --- a/js/compactados/catalogoMetaestat_compacto.js +++ b/js/compactados/catalogoMetaestat_compacto.js diff --git a/js/compactados/catalogoOgc_compacto.js b/js/compactados/catalogoOgc_compacto.js old mode 100755 new mode 100644 index ffce5a9..ffce5a9 --- a/js/compactados/catalogoOgc_compacto.js +++ b/js/compactados/catalogoOgc_compacto.js diff --git a/js/compactados/catalogoRegioes_compacto.js b/js/compactados/catalogoRegioes_compacto.js old mode 100755 new mode 100644 index 404db8e..404db8e --- a/js/compactados/catalogoRegioes_compacto.js +++ b/js/compactados/catalogoRegioes_compacto.js diff --git a/js/compactados/catalogoSistemas_compacto.js b/js/compactados/catalogoSistemas_compacto.js old mode 100755 new mode 100644 index 9245cfc..9245cfc --- a/js/compactados/catalogoSistemas_compacto.js +++ b/js/compactados/catalogoSistemas_compacto.js diff --git a/js/compactados/configura_compacto.js b/js/compactados/configura_compacto.js old mode 100755 new mode 100644 index e3d6fe5..e3d6fe5 --- a/js/compactados/configura_compacto.js +++ b/js/compactados/configura_compacto.js diff --git a/js/compactados/coordenadas_compacto.js b/js/compactados/coordenadas_compacto.js old mode 100755 new mode 100644 index 404bf09..404bf09 --- a/js/compactados/coordenadas_compacto.js +++ b/js/compactados/coordenadas_compacto.js diff --git a/js/compactados/desenho_compacto.js b/js/compactados/desenho_compacto.js old mode 100755 new mode 100644 index 0906ae5..0906ae5 --- a/js/compactados/desenho_compacto.js +++ b/js/compactados/desenho_compacto.js diff --git a/js/compactados/dicionario_ajuda_compacto.js b/js/compactados/dicionario_ajuda_compacto.js old mode 100755 new mode 100644 index e69de29..e69de29 --- a/js/compactados/dicionario_ajuda_compacto.js +++ b/js/compactados/dicionario_ajuda_compacto.js diff --git a/js/compactados/dicionario_compacto.js b/js/compactados/dicionario_compacto.js old mode 100755 new mode 100644 index 46fdd78..46fdd78 --- a/js/compactados/dicionario_compacto.js +++ b/js/compactados/dicionario_compacto.js diff --git a/js/compactados/editor_compacto.js b/js/compactados/editor_compacto.js old mode 100755 new mode 100644 index d9a8662..d9a8662 --- a/js/compactados/editor_compacto.js +++ b/js/compactados/editor_compacto.js diff --git a/js/compactados/eventos_compacto.js b/js/compactados/eventos_compacto.js old mode 100755 new mode 100644 index cda2a72..cda2a72 --- a/js/compactados/eventos_compacto.js +++ b/js/compactados/eventos_compacto.js diff --git a/js/compactados/guias_compacto.js b/js/compactados/guias_compacto.js old mode 100755 new mode 100644 index d0c1361..d0c1361 --- a/js/compactados/guias_compacto.js +++ b/js/compactados/guias_compacto.js diff --git a/js/compactados/idioma_compacto.js b/js/compactados/idioma_compacto.js old mode 100755 new mode 100644 index 50f94a7..50f94a7 --- a/js/compactados/idioma_compacto.js +++ b/js/compactados/idioma_compacto.js diff --git a/js/compactados/ini_i3geo_compacto.js b/js/compactados/ini_i3geo_compacto.js old mode 100755 new mode 100644 index 4b24671..4b24671 --- a/js/compactados/ini_i3geo_compacto.js +++ b/js/compactados/ini_i3geo_compacto.js diff --git a/js/compactados/interface_compacto.js b/js/compactados/interface_compacto.js old mode 100755 new mode 100644 index 71ace7d..71ace7d --- a/js/compactados/interface_compacto.js +++ b/js/compactados/interface_compacto.js diff --git a/js/compactados/janela_compacto.js b/js/compactados/janela_compacto.js old mode 100755 new mode 100644 index 6235310..6235310 --- a/js/compactados/janela_compacto.js +++ b/js/compactados/janela_compacto.js diff --git a/js/compactados/legenda_compacto.js b/js/compactados/legenda_compacto.js old mode 100755 new mode 100644 index 864b4a9..864b4a9 --- a/js/compactados/legenda_compacto.js +++ b/js/compactados/legenda_compacto.js diff --git a/js/compactados/login_compacto.js b/js/compactados/login_compacto.js old mode 100755 new mode 100644 index 6d4d052..6d4d052 --- a/js/compactados/login_compacto.js +++ b/js/compactados/login_compacto.js diff --git a/js/compactados/mapa_compacto.js b/js/compactados/mapa_compacto.js old mode 100755 new mode 100644 index 3e572c5..3e572c5 --- a/js/compactados/mapa_compacto.js +++ b/js/compactados/mapa_compacto.js diff --git a/js/compactados/maparef_compacto.js b/js/compactados/maparef_compacto.js old mode 100755 new mode 100644 index bbb4533..bbb4533 --- a/js/compactados/maparef_compacto.js +++ b/js/compactados/maparef_compacto.js diff --git a/js/compactados/marcador_compacto.js b/js/compactados/marcador_compacto.js old mode 100755 new mode 100644 index 06123bb..06123bb --- a/js/compactados/marcador_compacto.js +++ b/js/compactados/marcador_compacto.js diff --git a/js/compactados/mustache.js b/js/compactados/mustache.js old mode 100755 new mode 100644 index 7473a81..7473a81 --- a/js/compactados/mustache.js +++ b/js/compactados/mustache.js diff --git a/js/compactados/navega_compacto.js b/js/compactados/navega_compacto.js old mode 100755 new mode 100644 index 222b2f9..222b2f9 --- a/js/compactados/navega_compacto.js +++ b/js/compactados/navega_compacto.js diff --git a/js/compactados/php_compacto.js b/js/compactados/php_compacto.js old mode 100755 new mode 100644 index 58ebcf5..58ebcf5 --- a/js/compactados/php_compacto.js +++ b/js/compactados/php_compacto.js diff --git a/js/compactados/plugini3geo_compacto.js b/js/compactados/plugini3geo_compacto.js old mode 100755 new mode 100644 index 85e2916..85e2916 --- a/js/compactados/plugini3geo_compacto.js +++ b/js/compactados/plugini3geo_compacto.js diff --git a/js/compactados/proj4js.js b/js/compactados/proj4js.js old mode 100755 new mode 100644 index 9bdc4ce..9bdc4ce --- a/js/compactados/proj4js.js +++ b/js/compactados/proj4js.js diff --git a/js/compactados/social_compacto.js b/js/compactados/social_compacto.js old mode 100755 new mode 100644 index 8aa672a..8aa672a --- a/js/compactados/social_compacto.js +++ b/js/compactados/social_compacto.js diff --git a/js/compactados/tema_compacto.js b/js/compactados/tema_compacto.js old mode 100755 new mode 100644 index 464e123..464e123 --- a/js/compactados/tema_compacto.js +++ b/js/compactados/tema_compacto.js diff --git a/js/compactados/util_compacto.js b/js/compactados/util_compacto.js old mode 100755 new mode 100644 index faeb51f..faeb51f --- a/js/compactados/util_compacto.js +++ b/js/compactados/util_compacto.js diff --git a/js/compactados/wicket.js b/js/compactados/wicket.js old mode 100755 new mode 100644 index e0e5f3b..e0e5f3b --- a/js/compactados/wicket.js +++ b/js/compactados/wicket.js diff --git a/js/i3geo_tudo_compacto7.js.php b/js/i3geo_tudo_compacto7.js.php old mode 100755 new mode 100644 index 7e2475f..7e2475f --- a/js/i3geo_tudo_compacto7.js.php +++ b/js/i3geo_tudo_compacto7.js.php diff --git a/kml.php b/kml.php index a27023b..e6eb0c0 100755 --- a/kml.php +++ b/kml.php @@ -42,7 +42,7 @@ idioma - pt|en|es include_once ("classesphp/carrega_ext.php"); include_once ("classesphp/classe_menutemas.php"); include_once ("ms_configura.php"); -include_once ("admin/php/conexao.php"); +include_once ("classesphp/conexao.php"); $encoding = "ISO-8859-1"; if($convUTF == true){ $encoding = "UTF-8"; @@ -94,7 +94,7 @@ foreach($menus as $menu){ else{ $coluna = $idioma; } - + $sql = "select id_raiz,i3geoadmin_raiz.id_tema,$coluna as nome_tema,tipoa_tema,codigo_tema,kmz_tema FROM ".$esquemaadmin."i3geoadmin_raiz LEFT JOIN ".$esquemaadmin."i3geoadmin_temas ON i3geoadmin_temas.id_tema = i3geoadmin_raiz.id_tema where (lower(i3geoadmin_temas.tipoa_tema) != 'wms' or i3geoadmin_temas.tipoa_tema is null) and (lower(i3geoadmin_temas.kml_tema) != 'nao' or i3geoadmin_temas.kml_tema isnull) and i3geoadmin_temas.tipoa_tema != 'WMS' and i3geoadmin_temas.kml_tema != 'nao' and i3geoadmin_raiz.id_menu='$id_menu' and i3geoadmin_raiz.nivel = 0 and i3geoadmin_raiz.id_nivel = 0 order by ordem"; $temas = pegaDados($sql); if(count($temas) > 0){ @@ -102,14 +102,14 @@ foreach($menus as $menu){ $xml .= kml_tema_bd($tema); } } - + if($idioma == "pt"){ $coluna = "nome_grupo"; } else{ $coluna = $idioma; } - + $grupos = pegaDados("SELECT $coluna as nome_grupo,n1.id_n1,n1.id_grupo,gr.desc_grupo from ".$esquemaadmin."i3geoadmin_n1 as n1,".$esquemaadmin."i3geoadmin_grupos as gr where (lower(n1.publicado) != 'nao' or n1.publicado is null) and n1.id_menu = '$id_menu' and n1.id_grupo = gr.id_grupo order by gr.nome_grupo"); foreach($grupos as $grupo){ $xml .= kml_cabecalho($grupo["nome_grupo"],$grupo["desc_grupo"]); @@ -203,7 +203,7 @@ function kml_tema_bd($tema){ $legenda = "Legenda "; $urlLegenda = $urli3geo."/ogc.php?tema=$id&layer=$id&request=getlegendgraphic&service=wms&format=image/jpeg"; $href = "$urli3geo/ogc.php?tema=$id&width=800&height=800&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&STYLES=&BGCOLOR=0xFFFFFF&FORMAT=image/png&TRANSPARENT=TRUE&layers=$id"; - + $xml .= kml_servico($nome,$fonte,$legenda,$desc,$href,$urlLegenda); if(strtolower($tema["kmz_tema"]) == "sim"){ diff --git a/mashups/openlayersdebug.php b/mashups/openlayersdebug.php index 24389b4..dd43517 100755 --- a/mashups/openlayersdebug.php +++ b/mashups/openlayersdebug.php @@ -11,6 +11,11 @@ include_once (dirname(__FILE__) . "/../classesphp/funcoes_gerais.php"); // error_reporting(0); // variaveis utilizadas $parurl = array_merge($_GET, $_POST); +if(count($parurl) == 0){ + ajuda(); + exit; +} + if (isset($parurl["opacidade"])) { $opacidade = $parurl["opacidade"] * 1; } else { @@ -36,6 +41,18 @@ if(!isset($parurl["visiveis"])){ } $visiveis = explode(",", str_replace(" ", ",", $parurl["visiveis"])); $off = array_diff($temas, $visiveis); +//filtros +$filtros = array(); +foreach($temas as $tema){ + if(isset($parurl["map_layer_".$tema."_filter"])){ + $filtros[] = array( + "layer"=>$tema, + "expression"=>$parurl["map_layer_".$tema."_filter"] + ); + } +} +$filtros = json_encode($filtros); + $estilo = ""; if (isset($parurl["altura"])) { $estilo .= ";height:" . $parurl["altura"] . "px"; @@ -69,6 +86,11 @@ if (isset($controles)) { if (in_array("overviewmap", $controles)) { $objControles[] = "new ol.control.OverviewMap()"; } +} else { + $objControles[] = "new ol.control.Zoom()"; + $objControles[] = "new ol.control.ZoomSlider()"; + $objControles[] = "new ol.control.ScaleLine()"; + $objControles[] = "new ol.control.MousePosition({coordinateFormat : function(c){return ol.coordinate.toStringHDMS(c);}})"; } $botoes = $parurl["botoes"]; // @@ -214,7 +236,36 @@ if (isset($botoes)) { } $botoes = "{" . implode(",", $objBotoes) . "}"; } else { - $botoes = "{}"; + $objBotoes[] = "'imprimir':true"; + $objBotoesHtml["zoombox"] = ""; + $objBotoesHtml["analise"] = ""; + $objBotoesHtml["camadas"] = ""; + $objBotoesHtml["catalogo"] = ""; + $objBotoesHtml["legenda"] = ""; + $objBotoesHtml["procura"] = ""; + $objBotoesHtml["identifica"] = ""; + $objBotoesHtml["zoomtot"] = ""; + $objBotoesHtml["zoomanterior"] = ""; + $objBotoesHtml["zoomproximo"] = ""; + $objBotoesHtml["grid"] = ""; + $objBotoesHtml["marcador"] = ""; + $objBotoes[] = "'distancia':true"; + $objBotoes[] = "'area':true"; + $objBotoes[] = "'linha':true"; + $objBotoes[] = "'ponto':true"; + $objBotoes[] = "'poligono':true"; + $objBotoes[] = "'edita':true"; + $objBotoes[] = "'listag':true"; + $objBotoes[] = "'corta':true"; + $objBotoes[] = "'apaga':true"; + $objBotoes[] = "'salva':true"; + $objBotoes[] = "'tools':true"; + $objBotoes[] = "'undo':true"; + $objBotoes[] = "'propriedades':true"; + $objBotoes[] = "'frente':true"; + + $botoes = "{" . implode(",", $objBotoes) . "}"; + } if (isset($parurl["kml"])) { $kml = $parurl["kml"]; @@ -255,11 +306,11 @@ if(isset($parurl["tiles"])){ else{ $tiles = "true"; } -if(isset($parurl["ativarodadomouse"]) && $parurl["ativarodadomouse"] == "true"){ - $ativarodadomouse = "new ol.interaction.MouseWheelZoom(),"; +if(isset($parurl["ativarodadomouse"]) && $parurl["ativarodadomouse"] == "false"){ + $ativarodadomouse = ""; } else{ - $ativarodadomouse = ""; + $ativarodadomouse = "new ol.interaction.MouseWheelZoom(),"; } $legendahtml = $parurl["legendahtml"]; $layerDefault = $parurl["layerDefault"]; @@ -435,6 +486,13 @@ function ajuda() width: auto; max-width: 70px; } + +.ol-mouse-position { + left: 10px; + position: absolute; + bottom: 5px; + top: auto; +}