Commit d80bc604afc111ade59aa32ef2ae202a77b6a59a
1 parent
fbeb4059
Exists in
master
and in
7 other branches
suporte a TMS em ogc.php
Showing
5 changed files
with
52 additions
and
6 deletions
Show diff stats
exemplos/index.html
| @@ -240,6 +240,9 @@ body,td { | @@ -240,6 +240,9 @@ body,td { | ||
| 240 | <a href="googlemapssanfona.phtml" target="_blank">Guias do tipo | 240 | <a href="googlemapssanfona.phtml" target="_blank">Guias do tipo |
| 241 | sanfona</a> | 241 | sanfona</a> |
| 242 | </p> | 242 | </p> |
| 243 | + <p> | ||
| 244 | + <a href="googlemapscomogc.php" target="_blank">Como adicionar uma camada WMS do i3Geo em um mapa normal do Google Maps</a> | ||
| 245 | + </p> | ||
| 243 | </fieldset> | 246 | </fieldset> |
| 244 | <h2>Configuração de janelas, árvores de | 247 | <h2>Configuração de janelas, árvores de |
| 245 | camadas e adição de temas</h2> | 248 | camadas e adição de temas</h2> |
interface/googlemapsdebug.phtml
| @@ -179,6 +179,8 @@ i3GEO.eventos.MOUSECLIQUEPERM = [i3GEO.configura.funcaoTip]; | @@ -179,6 +179,8 @@ i3GEO.eventos.MOUSECLIQUEPERM = [i3GEO.configura.funcaoTip]; | ||
| 179 | //alternativo (janela de identificacao | 179 | //alternativo (janela de identificacao |
| 180 | //i3GEO.eventos.MOUSECLIQUEPERM = [i3GEO.configura.funcaoIdentifica]; | 180 | //i3GEO.eventos.MOUSECLIQUEPERM = [i3GEO.configura.funcaoIdentifica]; |
| 181 | // | 181 | // |
| 182 | +i3GEO.finalizaAPI = function(){ | ||
| 183 | +}; | ||
| 182 | 184 | ||
| 183 | i3GEO.inicia(); | 185 | i3GEO.inicia(); |
| 184 | </script> | 186 | </script> |
ogc.php
| @@ -76,7 +76,7 @@ if(isset($id_medida_variavel)){ | @@ -76,7 +76,7 @@ if(isset($id_medida_variavel)){ | ||
| 76 | } | 76 | } |
| 77 | if(!isset($temas) && isset($tema)){ | 77 | if(!isset($temas) && isset($tema)){ |
| 78 | $temas = $tema; | 78 | $temas = $tema; |
| 79 | -} | 79 | +} |
| 80 | // | 80 | // |
| 81 | //para operar como o Geoserver | 81 | //para operar como o Geoserver |
| 82 | // | 82 | // |
| @@ -124,7 +124,7 @@ if(isset($lista) && $lista == "temaswfs"){ | @@ -124,7 +124,7 @@ if(isset($lista) && $lista == "temaswfs"){ | ||
| 124 | } | 124 | } |
| 125 | // | 125 | // |
| 126 | //cria o web service | 126 | //cria o web service |
| 127 | -// | 127 | +// |
| 128 | include(dirname(__FILE__)."/classesphp/funcoes_gerais.php"); | 128 | include(dirname(__FILE__)."/classesphp/funcoes_gerais.php"); |
| 129 | error_reporting(0); | 129 | error_reporting(0); |
| 130 | $versao = versao(); | 130 | $versao = versao(); |
| @@ -474,7 +474,7 @@ else{ | @@ -474,7 +474,7 @@ else{ | ||
| 474 | } | 474 | } |
| 475 | $oMap->setSymbolSet($locaplic."/symbols/".basename($oMap->symbolsetfilename)); | 475 | $oMap->setSymbolSet($locaplic."/symbols/".basename($oMap->symbolsetfilename)); |
| 476 | $oMap->setFontSet($locaplic."/symbols/".basename($oMap->fontsetfilename)); | 476 | $oMap->setFontSet($locaplic."/symbols/".basename($oMap->fontsetfilename)); |
| 477 | - $oMap->save($nomeMapfileTmp); | 477 | + $oMap->save($nomeMapfileTmp); |
| 478 | $oMap = ms_newMapobj($nomeMapfileTmp); | 478 | $oMap = ms_newMapobj($nomeMapfileTmp); |
| 479 | if(ob_get_contents ()){ | 479 | if(ob_get_contents ()){ |
| 480 | ob_end_clean(); | 480 | ob_end_clean(); |
| @@ -488,7 +488,7 @@ else{ | @@ -488,7 +488,7 @@ else{ | ||
| 488 | //quando for do tipo tms $_GET["tms"] contem os parametros do tile | 488 | //quando for do tipo tms $_GET["tms"] contem os parametros do tile |
| 489 | //essa rotina faz um exit ao final | 489 | //essa rotina faz um exit ao final |
| 490 | //o cache tms so fucniona se houver apenas uma camada no mapa | 490 | //o cache tms so fucniona se houver apenas uma camada no mapa |
| 491 | -//tms e usado basicamente por mashup | 491 | +//tms e usado basicamente por mashup ou openlayers |
| 492 | // | 492 | // |
| 493 | if(isset($_GET["tms"])){ | 493 | if(isset($_GET["tms"])){ |
| 494 | $temp = explode("/",$_GET["tms"]); | 494 | $temp = explode("/",$_GET["tms"]); |
| @@ -514,6 +514,47 @@ if(isset($_GET["tms"])){ | @@ -514,6 +514,47 @@ if(isset($_GET["tms"])){ | ||
| 514 | } | 514 | } |
| 515 | salvaCacheImagem($cachedir,$nomeMapfileTmp,$_GET["tms"]); | 515 | salvaCacheImagem($cachedir,$nomeMapfileTmp,$_GET["tms"]); |
| 516 | } | 516 | } |
| 517 | +// | ||
| 518 | +//verifica se a chamada do servico e do tipo TILE no padrao do Google | ||
| 519 | +// | ||
| 520 | +if(isset($_GET["Z"]) && isset($_GET["X"])){ | ||
| 521 | + $x = $_GET["X"]; | ||
| 522 | + $y = $_GET["Y"]; | ||
| 523 | + $z = $_GET["Z"]; | ||
| 524 | + if($_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ | ||
| 525 | + //carregaCacheImagem(); | ||
| 526 | + } | ||
| 527 | + $n = pow(2,$z); | ||
| 528 | + $lon1 = $x / $n * 360.0 - 180.0; | ||
| 529 | + $lat2 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); | ||
| 530 | + $x++; | ||
| 531 | + $y++; | ||
| 532 | + $lon2 = $x / $n * 360.0 - 180.0; | ||
| 533 | + $lat1 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); | ||
| 534 | + $x--; | ||
| 535 | + $y--; | ||
| 536 | + | ||
| 537 | + $projInObj = ms_newprojectionobj("proj=latlong,a=6378137,b=6378137"); | ||
| 538 | + $projOutObj = ms_newprojectionobj("proj=merc,a=6378137,b=6378137,lat_ts=0.0,lon_0=0.0,x_0=0.0,y_0=0,k=1.0,units=m"); | ||
| 539 | + | ||
| 540 | + $poPoint1 = ms_newpointobj(); | ||
| 541 | + $poPoint1->setXY($lon1, $lat1); | ||
| 542 | + $poPoint1->project($projInObj, $projOutObj); | ||
| 543 | + $poPoint2 = ms_newpointobj(); | ||
| 544 | + $poPoint2->setXY($lon2, $lat2); | ||
| 545 | + $poPoint2->project($projInObj, $projOutObj); | ||
| 546 | + $oMap->setExtent($poPoint1->x,$poPoint1->y,$poPoint2->x,$poPoint2->y); | ||
| 547 | + $oMap->setsize(256,256); | ||
| 548 | + $oMap->getlayer(0)->set("status",MS_DEFAULT); | ||
| 549 | + $oMap->setProjection("proj=merc,a=6378137,b=6378137,lat_ts=0.0,lon_0=0.0,x_0=0.0,y_0=0,k=1.0,units=m"); | ||
| 550 | + $oMap->getlayer(0)->setProjection("proj=latlong,a=6378137,b=6378137"); | ||
| 551 | + $oMap->save($nomeMapfileTmp); | ||
| 552 | + $img = $oMap->draw(); | ||
| 553 | + if($img->imagepath == ""){ | ||
| 554 | + exit; | ||
| 555 | + } | ||
| 556 | + salvaCacheImagem($cachedir,$nomeMapfileTmp,$_GET["tms"]); | ||
| 557 | +} | ||
| 517 | if(strtolower($req->getValueByName("REQUEST")) == "getlegendgraphic"){ | 558 | if(strtolower($req->getValueByName("REQUEST")) == "getlegendgraphic"){ |
| 518 | $l = $oMap->getlayer(0); | 559 | $l = $oMap->getlayer(0); |
| 519 | if($req->getValueByName("LAYER") == ""){ | 560 | if($req->getValueByName("LAYER") == ""){ |
temas/_lbiomashp.map
| @@ -21,7 +21,7 @@ MAP | @@ -21,7 +21,7 @@ MAP | ||
| 21 | PROCESSING "ITEMS=CD_LEGENDA" | 21 | PROCESSING "ITEMS=CD_LEGENDA" |
| 22 | STATUS OFF | 22 | STATUS OFF |
| 23 | TEMPLATE "none.htm" | 23 | TEMPLATE "none.htm" |
| 24 | - MAXSCALEDENOM 5000000 | 24 | + #MAXSCALEDENOM 5000000 |
| 25 | TILEITEM "location" | 25 | TILEITEM "location" |
| 26 | OPACITY 50 | 26 | OPACITY 50 |
| 27 | TYPE POLYGON | 27 | TYPE POLYGON |
temas/_llocali.map
| @@ -4,7 +4,7 @@ MAP | @@ -4,7 +4,7 @@ MAP | ||
| 4 | LAYER | 4 | LAYER |
| 5 | CONNECTION "" | 5 | CONNECTION "" |
| 6 | DATA "/var/www/i3geo/aplicmap/dados/locali.shp" | 6 | DATA "/var/www/i3geo/aplicmap/dados/locali.shp" |
| 7 | - FILTER (('[ESTADO]' = 'GO')) | 7 | + #FILTER (('[ESTADO]' = 'GO')) |
| 8 | METADATA | 8 | METADATA |
| 9 | "METAESTAT_ID_MEDIDA_VARIAVEL" "" | 9 | "METAESTAT_ID_MEDIDA_VARIAVEL" "" |
| 10 | "cache" "nao" | 10 | "cache" "nao" |