Commit 1f85152fab2b12788e2564f973ca22daafadcabb
1 parent
41f53b94
Exists in
master
and in
7 other branches
--no commit message
Showing
2 changed files
with
57 additions
and
38 deletions
Show diff stats
ferramentas/cesium/kml3d.php
| @@ -4,45 +4,55 @@ include("../../classesphp/pega_variaveis.php"); | @@ -4,45 +4,55 @@ include("../../classesphp/pega_variaveis.php"); | ||
| 4 | include("../../classesphp/funcoes_gerais.php"); | 4 | include("../../classesphp/funcoes_gerais.php"); |
| 5 | //define o centro, pegando as coordenadas do mapa de inicializacao | 5 | //define o centro, pegando as coordenadas do mapa de inicializacao |
| 6 | $versao = versao(); | 6 | $versao = versao(); |
| 7 | -$versao = $versao["principal"]; | ||
| 8 | -if(isset($base) && $base != ""){ | ||
| 9 | - if(file_exists($base)){ | ||
| 10 | - $f = $base; | ||
| 11 | - } | ||
| 12 | - else{ | ||
| 13 | - $f = $locaplic."/aplicmap/".$base.".map"; | ||
| 14 | - } | ||
| 15 | -} | ||
| 16 | -else | ||
| 17 | -{ | ||
| 18 | - $f = ""; | ||
| 19 | - if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ | ||
| 20 | - $f = $locaplic."/aplicmap/geral1windowsv".$versao.".map"; | ||
| 21 | - } | ||
| 22 | - else{ | ||
| 23 | - if($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){ | ||
| 24 | - $f = "/var/www/i3geo/aplicmap/geral1debianv".$versao.".map"; | 7 | +$versao = $versao["principal"]; |
| 8 | +$centroX = -55; | ||
| 9 | +$centroY = -13; | ||
| 10 | +$extensao = "-180,-90,180,90"; | ||
| 11 | +if(!isset($mapext)){ | ||
| 12 | + if(isset($base) && $base != ""){ | ||
| 13 | + if(file_exists($base)){ | ||
| 14 | + $f = $base; | ||
| 25 | } | 15 | } |
| 26 | - if($f == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ | ||
| 27 | - $f = "/var/www/html/i3geo/aplicmap/geral1fedorav".$versao.".map"; | 16 | + else{ |
| 17 | + $f = $locaplic."/aplicmap/".$base.".map"; | ||
| 28 | } | 18 | } |
| 29 | - if($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ | ||
| 30 | - $f = "/opt/www/html/i3geo/aplicmap/geral1v".$versao.".map"; | 19 | + } |
| 20 | + else | ||
| 21 | + { | ||
| 22 | + $f = ""; | ||
| 23 | + if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')){ | ||
| 24 | + $f = $locaplic."/aplicmap/geral1windowsv".$versao.".map"; | ||
| 31 | } | 25 | } |
| 32 | - if($f == "") | ||
| 33 | - { | ||
| 34 | - $f = $locaplic."/aplicmap/geral1v".$versao.".map"; | 26 | + else{ |
| 27 | + if($f == "" && file_exists('/var/www/i3geo/aplicmap/geral1debianv'.$versao.'.map')){ | ||
| 28 | + $f = "/var/www/i3geo/aplicmap/geral1debianv".$versao.".map"; | ||
| 29 | + } | ||
| 30 | + if($f == "" && file_exists('/var/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ | ||
| 31 | + $f = "/var/www/html/i3geo/aplicmap/geral1fedorav".$versao.".map"; | ||
| 32 | + } | ||
| 33 | + if($f == "" && file_exists('/opt/www/html/i3geo/aplicmap/geral1fedorav'.$versao.'.map')){ | ||
| 34 | + $f = "/opt/www/html/i3geo/aplicmap/geral1v".$versao.".map"; | ||
| 35 | + } | ||
| 36 | + if($f == "") | ||
| 37 | + { | ||
| 38 | + $f = $locaplic."/aplicmap/geral1v".$versao.".map"; | ||
| 39 | + } | ||
| 35 | } | 40 | } |
| 36 | - } | ||
| 37 | -} | ||
| 38 | -$centroX = -55; | ||
| 39 | -$centroY = -13; | ||
| 40 | -if(@ms_newMapObj($f)){ | ||
| 41 | - $mapa = ms_newMapObj($f); | 41 | + } |
| 42 | 42 | ||
| 43 | - $c = $mapa->extent; | ||
| 44 | - $centroX = $c->maxx - ($c->maxx - $c->minx) / 2; | ||
| 45 | - $centroY = $c->maxy - ($c->maxy - $c->miny) / 2; | 43 | + if(@ms_newMapObj($f)){ |
| 44 | + $mapa = ms_newMapObj($f); | ||
| 45 | + $c = $mapa->extent; | ||
| 46 | + $centroX = $c->maxx - ($c->maxx - $c->minx) / 2; | ||
| 47 | + $centroY = $c->maxy - ($c->maxy - $c->miny) / 2; | ||
| 48 | + $extensao = $c->minx.",".$c->miny.",".$c->maxx.",".$c->maxy; | ||
| 49 | + } | ||
| 50 | +} | ||
| 51 | +else{ | ||
| 52 | + $c = explode(" ",$mapext); | ||
| 53 | + $centroX = $c[2] - ($c[2] - $c[0]) / 2; | ||
| 54 | + $centroY = $c[3] - ($c[3] - $c[1]) / 2; | ||
| 55 | + $extensao = $c[0].",".$c[1].",".$c[2].",".$c[3]; | ||
| 46 | } | 56 | } |
| 47 | ?> | 57 | ?> |
| 48 | <!DOCTYPE html> | 58 | <!DOCTYPE html> |
| @@ -101,6 +111,10 @@ body { | @@ -101,6 +111,10 @@ body { | ||
| 101 | <img src='<?php echo strip_tags($legenda);?>' /> | 111 | <img src='<?php echo strip_tags($legenda);?>' /> |
| 102 | </div> | 112 | </div> |
| 103 | <script> | 113 | <script> |
| 114 | + var extent = Cesium.Rectangle.fromDegrees(<?php echo $extensao;?>); | ||
| 115 | + | ||
| 116 | + Cesium.Camera.DEFAULT_VIEW_RECTANGLE = extent; | ||
| 117 | + Cesium.Camera.DEFAULT_VIEW_FACTOR = 0; | ||
| 104 | var viewer = new Cesium.Viewer( | 118 | var viewer = new Cesium.Viewer( |
| 105 | 'cesiumContainer', | 119 | 'cesiumContainer', |
| 106 | { | 120 | { |
| @@ -113,11 +127,13 @@ body { | @@ -113,11 +127,13 @@ body { | ||
| 113 | if('<?php echo $kmlurl;?>' != ''){ | 127 | if('<?php echo $kmlurl;?>' != ''){ |
| 114 | viewer.dataSources.add(Cesium.KmlDataSource.load('<?php echo strip_tags($kmlurl);?>')) | 128 | viewer.dataSources.add(Cesium.KmlDataSource.load('<?php echo strip_tags($kmlurl);?>')) |
| 115 | } | 129 | } |
| 130 | + /* | ||
| 116 | var center = Cesium.Cartesian3.fromDegrees(<?php echo $centroX.",".$centroY;?>); | 131 | var center = Cesium.Cartesian3.fromDegrees(<?php echo $centroX.",".$centroY;?>); |
| 117 | var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center); | 132 | var transform = Cesium.Transforms.eastNorthUpToFixedFrame(center); |
| 118 | var camera = viewer.camera; | 133 | var camera = viewer.camera; |
| 119 | camera.constrainedAxis = Cesium.Cartesian3.UNIT_Z; | 134 | camera.constrainedAxis = Cesium.Cartesian3.UNIT_Z; |
| 120 | - camera.lookAtTransform(transform, new Cesium.Cartesian3(-120000.0, -120000.0, 120000.0)); | 135 | + camera.lookAtTransform(transform, new Cesium.Cartesian3(0,0, 12000000.0)); |
| 136 | + */ | ||
| 121 | </script> | 137 | </script> |
| 122 | </body> | 138 | </body> |
| 123 | </html> | 139 | </html> |
ferramentas/tme/index.js
| @@ -422,13 +422,15 @@ i3GEOF.tme = | @@ -422,13 +422,15 @@ i3GEOF.tme = | ||
| 422 | temp = | 422 | temp = |
| 423 | function(retorno) { | 423 | function(retorno) { |
| 424 | i3GEOF.tme.aguarde.visibility = "hidden"; | 424 | i3GEOF.tme.aguarde.visibility = "hidden"; |
| 425 | - var url, ins = | 425 | + var ext, url, ins = |
| 426 | "<p class=paragrafo >" + $trad('arquivoDownload', i3GEOF.tme.dicionario) | 426 | "<p class=paragrafo >" + $trad('arquivoDownload', i3GEOF.tme.dicionario) |
| 427 | + "<br><a href='" | 427 | + "<br><a href='" |
| 428 | + retorno.data.url | 428 | + retorno.data.url |
| 429 | + "' target=new >" | 429 | + "' target=new >" |
| 430 | + retorno.data.url | 430 | + retorno.data.url |
| 431 | + "</a><br>"; | 431 | + "</a><br>"; |
| 432 | + ext = i3GEO.parametros.mapexten; | ||
| 433 | + ext = i3GEO.util.extOSM2Geo(ext); | ||
| 432 | url = i3GEO.configura.locaplic + "/ms_criamapa.php?interface=googleearth.phtml&kmlurl=" + retorno.data.url; | 434 | url = i3GEO.configura.locaplic + "/ms_criamapa.php?interface=googleearth.phtml&kmlurl=" + retorno.data.url; |
| 433 | ins += | 435 | ins += |
| 434 | "<br>" + $trad('abreNoI3geo', i3GEOF.tme.dicionario) | 436 | "<br>" + $trad('abreNoI3geo', i3GEOF.tme.dicionario) |
| @@ -441,7 +443,8 @@ i3GEOF.tme = | @@ -441,7 +443,8 @@ i3GEOF.tme = | ||
| 441 | i3GEO.configura.locaplic + "/ferramentas/cesium/kml3d.php?kmlurl=" | 443 | i3GEO.configura.locaplic + "/ferramentas/cesium/kml3d.php?kmlurl=" |
| 442 | + retorno.data.url | 444 | + retorno.data.url |
| 443 | + "&legenda=" | 445 | + "&legenda=" |
| 444 | - + retorno.data.legenda; | 446 | + + retorno.data.legenda |
| 447 | + + "&mapext=" + ext; | ||
| 445 | ins += | 448 | ins += |
| 446 | "<br>" + $trad('abreNoCesium', i3GEOF.tme.dicionario) | 449 | "<br>" + $trad('abreNoCesium', i3GEOF.tme.dicionario) |
| 447 | + "<br><a href='" | 450 | + "<br><a href='" |
| @@ -482,4 +485,4 @@ i3GEOF.tme = | @@ -482,4 +485,4 @@ i3GEOF.tme = | ||
| 482 | i3GEOF.tme.aguarde.visibility = "hidden"; | 485 | i3GEOF.tme.aguarde.visibility = "hidden"; |
| 483 | } | 486 | } |
| 484 | } | 487 | } |
| 485 | - }; | ||
| 486 | \ No newline at end of file | 488 | \ No newline at end of file |
| 489 | + }; |