From 1f85152fab2b12788e2564f973ca22daafadcabb Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Tue, 7 Jul 2015 15:54:04 +0000 Subject: [PATCH] --- ferramentas/cesium/kml3d.php | 86 +++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------- ferramentas/tme/index.js | 9 ++++++--- 2 files changed, 57 insertions(+), 38 deletions(-) diff --git a/ferramentas/cesium/kml3d.php b/ferramentas/cesium/kml3d.php index 2caedc9..e67eff7 100755 --- a/ferramentas/cesium/kml3d.php +++ b/ferramentas/cesium/kml3d.php @@ -4,45 +4,55 @@ include("../../classesphp/pega_variaveis.php"); include("../../classesphp/funcoes_gerais.php"); //define o centro, pegando as coordenadas do mapa de inicializacao $versao = versao(); -$versao = $versao["principal"]; -if(isset($base) && $base != ""){ - if(file_exists($base)){ - $f = $base; - } - else{ - $f = $locaplic."/aplicmap/".$base.".map"; - } -} -else -{ - $f = ""; - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ - $f = $locaplic."/aplicmap/geral1windowsv".$versao.".map"; - } - else{ - if($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){ - $f = "/var/www/i3geo/aplicmap/geral1debianv".$versao.".map"; +$versao = $versao["principal"]; +$centroX = -55; +$centroY = -13; +$extensao = "-180,-90,180,90"; +if(!isset($mapext)){ + if(isset($base) && $base != ""){ + if(file_exists($base)){ + $f = $base; } - if($f == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ - $f = "/var/www/html/i3geo/aplicmap/geral1fedorav".$versao.".map"; + else{ + $f = $locaplic."/aplicmap/".$base.".map"; } - if($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ - $f = "/opt/www/html/i3geo/aplicmap/geral1v".$versao.".map"; + } + else + { + $f = ""; + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ + $f = $locaplic."/aplicmap/geral1windowsv".$versao.".map"; } - if($f == "") - { - $f = $locaplic."/aplicmap/geral1v".$versao.".map"; + else{ + if($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){ + $f = "/var/www/i3geo/aplicmap/geral1debianv".$versao.".map"; + } + if($f == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ + $f = "/var/www/html/i3geo/aplicmap/geral1fedorav".$versao.".map"; + } + if($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ + $f = "/opt/www/html/i3geo/aplicmap/geral1v".$versao.".map"; + } + if($f == "") + { + $f = $locaplic."/aplicmap/geral1v".$versao.".map"; + } } - } -} -$centroX = -55; -$centroY = -13; -if(@ms_newMapObj($f)){ - $mapa = ms_newMapObj($f); + } - $c = $mapa->extent; - $centroX = $c->maxx - ($c->maxx - $c->minx) / 2; - $centroY = $c->maxy - ($c->maxy - $c->miny) / 2; + if(@ms_newMapObj($f)){ + $mapa = ms_newMapObj($f); + $c = $mapa->extent; + $centroX = $c->maxx - ($c->maxx - $c->minx) / 2; + $centroY = $c->maxy - ($c->maxy - $c->miny) / 2; + $extensao = $c->minx.",".$c->miny.",".$c->maxx.",".$c->maxy; + } +} +else{ + $c = explode(" ",$mapext); + $centroX = $c[2] - ($c[2] - $c[0]) / 2; + $centroY = $c[3] - ($c[3] - $c[1]) / 2; + $extensao = $c[0].",".$c[1].",".$c[2].",".$c[3]; } ?> @@ -101,6 +111,10 @@ body { diff --git a/ferramentas/tme/index.js b/ferramentas/tme/index.js index 2eb8655..ba0b42c 100644 --- a/ferramentas/tme/index.js +++ b/ferramentas/tme/index.js @@ -422,13 +422,15 @@ i3GEOF.tme = temp = function(retorno) { i3GEOF.tme.aguarde.visibility = "hidden"; - var url, ins = + var ext, url, ins = "

" + $trad('arquivoDownload', i3GEOF.tme.dicionario) + "
" + retorno.data.url + "
"; + ext = i3GEO.parametros.mapexten; + ext = i3GEO.util.extOSM2Geo(ext); url = i3GEO.configura.locaplic + "/ms_criamapa.php?interface=googleearth.phtml&kmlurl=" + retorno.data.url; ins += "
" + $trad('abreNoI3geo', i3GEOF.tme.dicionario) @@ -441,7 +443,8 @@ i3GEOF.tme = i3GEO.configura.locaplic + "/ferramentas/cesium/kml3d.php?kmlurl=" + retorno.data.url + "&legenda=" - + retorno.data.legenda; + + retorno.data.legenda + + "&mapext=" + ext; ins += "
" + $trad('abreNoCesium', i3GEOF.tme.dicionario) + "