Commit 50159d0b0240c38bb9bae950d2341a4c62241291
1 parent
fd5c4716
Exists in
master
and in
7 other branches
Modificações nos códigos que usam definição de projeção para que passem a usar a…
… variável de configuração de projeção do ms_configura.php
Showing
20 changed files
with
50 additions
and
39 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/classe_atributos.php
| @@ -127,7 +127,7 @@ class Atributos | @@ -127,7 +127,7 @@ class Atributos | ||
| 127 | } | 127 | } |
| 128 | if($this->mapa->getmetadata("interface") == "googlemaps"){ | 128 | if($this->mapa->getmetadata("interface") == "googlemaps"){ |
| 129 | $this->projO = $this->mapa->getProjection(); | 129 | $this->projO = $this->mapa->getProjection(); |
| 130 | - $this->mapa->setProjection("init=epsg:4618,a=6378137,b=6378137"); | 130 | + $this->mapa->setProjection(pegaProjecaoDefault("proj4")); |
| 131 | } | 131 | } |
| 132 | } | 132 | } |
| 133 | } | 133 | } |
| @@ -2382,7 +2382,7 @@ class Atributos | @@ -2382,7 +2382,7 @@ class Atributos | ||
| 2382 | } | 2382 | } |
| 2383 | $conta = $conta + 1; | 2383 | $conta = $conta + 1; |
| 2384 | } | 2384 | } |
| 2385 | - | 2385 | + |
| 2386 | if($wkt == "sim"){ | 2386 | if($wkt == "sim"){ |
| 2387 | $arraytemp = array( | 2387 | $arraytemp = array( |
| 2388 | "alias"=>"wkt", | 2388 | "alias"=>"wkt", |
classesphp/classe_mapa.php
| @@ -2214,10 +2214,10 @@ class Mapa | @@ -2214,10 +2214,10 @@ class Mapa | ||
| 2214 | function converteInterfacePara($interface){ | 2214 | function converteInterfacePara($interface){ |
| 2215 | if($interface == "openlayers"){ | 2215 | if($interface == "openlayers"){ |
| 2216 | $prefixo = "ol"; | 2216 | $prefixo = "ol"; |
| 2217 | - $this->mapa->setProjection("+proj=longlat +ellps=GRS67 +no_defs"); | 2217 | + $this->mapa->setProjection(pegaProjecaoDefault("proj4")); |
| 2218 | } | 2218 | } |
| 2219 | - else | ||
| 2220 | - {$prefixo = "gm"; | 2219 | + else{ |
| 2220 | + $prefixo = "gm"; | ||
| 2221 | } | 2221 | } |
| 2222 | foreach($this->layers as $l){ | 2222 | foreach($this->layers as $l){ |
| 2223 | $opacidadeM = $l->getmetadata($prefixo."opacity"); | 2223 | $opacidadeM = $l->getmetadata($prefixo."opacity"); |
classesphp/classe_selecao.php
| @@ -124,7 +124,7 @@ $ext - extensão geográfica do mapa | @@ -124,7 +124,7 @@ $ext - extensão geográfica do mapa | ||
| 124 | } | 124 | } |
| 125 | if($this->mapa->getmetadata("interface") == "googlemaps"){ | 125 | if($this->mapa->getmetadata("interface") == "googlemaps"){ |
| 126 | $this->projO = $this->mapa->getProjection(); | 126 | $this->projO = $this->mapa->getProjection(); |
| 127 | - $this->mapa->setProjection("init=epsg:4618,a=6378137,b=6378137"); | 127 | + $this->mapa->setProjection(pegaProjecaoDefault("proj4")); |
| 128 | } | 128 | } |
| 129 | } | 129 | } |
| 130 | /* | 130 | /* |
classesphp/classe_temas.php
| @@ -425,7 +425,7 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa | @@ -425,7 +425,7 @@ Calcula a extensão geográfica de um tema e ajusta o mapa para essa | ||
| 425 | if(!$this->layer){return "erro";} | 425 | if(!$this->layer){return "erro";} |
| 426 | if($this->mapa->getmetadata("interface") == "googlemaps"){ | 426 | if($this->mapa->getmetadata("interface") == "googlemaps"){ |
| 427 | $projO = $this->mapa->getProjection(); | 427 | $projO = $this->mapa->getProjection(); |
| 428 | - $this->mapa->setProjection("init=epsg:4618,a=6378137,b=6378137"); | 428 | + $this->mapa->setProjection(pegaProjecaoDefault("proj4")); |
| 429 | } | 429 | } |
| 430 | $prjMapa = ""; | 430 | $prjMapa = ""; |
| 431 | $prjTema = ""; | 431 | $prjTema = ""; |
| @@ -829,7 +829,7 @@ $wkt - boolean indicando se $xy e um WKT | @@ -829,7 +829,7 @@ $wkt - boolean indicando se $xy e um WKT | ||
| 829 | $c = $shp->getCentroid(); | 829 | $c = $shp->getCentroid(); |
| 830 | $c = $c->x; | 830 | $c = $c->x; |
| 831 | if($c > -181 && $c < 181){ | 831 | if($c > -181 && $c < 181){ |
| 832 | - $pinlayer->setprojection("proj=latlong,a=6378137,b=6378137"); | 832 | + $pinlayer->setprojection(pegaProjecaoDefault("proj4")); |
| 833 | } | 833 | } |
| 834 | else{ | 834 | else{ |
| 835 | $pinlayer->setprojection($this->mapa->getProjection()); | 835 | $pinlayer->setprojection($this->mapa->getProjection()); |
classesphp/funcoes_gerais.php
| @@ -716,7 +716,7 @@ function retornaReferenciaDinamica($ext="",$w="",$h="") | @@ -716,7 +716,7 @@ function retornaReferenciaDinamica($ext="",$w="",$h="") | ||
| 716 | $i = $interface; | 716 | $i = $interface; |
| 717 | } | 717 | } |
| 718 | if($i == "googlemaps"){ | 718 | if($i == "googlemaps"){ |
| 719 | - $objMapa->setProjection("init=epsg:4618,a=6378137,b=6378137"); | 719 | + $objMapa->setProjection(pegaProjecaoDefault("proj4")); |
| 720 | } | 720 | } |
| 721 | if($ext && $ext != ""){ | 721 | if($ext && $ext != ""){ |
| 722 | $e = explode(" ",$ext); | 722 | $e = explode(" ",$ext); |
| @@ -769,7 +769,7 @@ function retornaReferenciaDinamica($ext="",$w="",$h="") | @@ -769,7 +769,7 @@ function retornaReferenciaDinamica($ext="",$w="",$h="") | ||
| 769 | $s = "var refimagem='".$nomer."';var refwidth=".$w.";var refheight=".$h.";var refpath='".$objImagem->imagepath."';var refurl='".$objImagem->imageurl."'"; | 769 | $s = "var refimagem='".$nomer."';var refwidth=".$w.";var refheight=".$h.";var refpath='".$objImagem->imagepath."';var refurl='".$objImagem->imageurl."'"; |
| 770 | $mapa = ms_newMapObj($map_file); | 770 | $mapa = ms_newMapObj($map_file); |
| 771 | if($i == "googlemaps"){ | 771 | if($i == "googlemaps"){ |
| 772 | - $mapa->setProjection("init=epsg:4618,a=6378137,b=6378137"); | 772 | + $mapa->setProjection(pegaProjecaoDefault("proj4")); |
| 773 | } | 773 | } |
| 774 | $ref = $mapa->reference; | 774 | $ref = $mapa->reference; |
| 775 | $r = $ref->extent; | 775 | $r = $ref->extent; |
| @@ -2873,7 +2873,7 @@ Se essa variavel nao existir, retorna o valor default baseado em EPSG:4326 | @@ -2873,7 +2873,7 @@ Se essa variavel nao existir, retorna o valor default baseado em EPSG:4326 | ||
| 2873 | 2873 | ||
| 2874 | Parametros: | 2874 | Parametros: |
| 2875 | 2875 | ||
| 2876 | -tipo {string} - se for vazio retorna todos os elementos do array. Se nao for vazio, usa $tipo como | 2876 | +tipo {string} - se for vazio retorna todos os elementos do array. Se nao for vazio, usa $tipo como |
| 2877 | chave para retornar apenas o indice desejado (proj4, epsg, prj) | 2877 | chave para retornar apenas o indice desejado (proj4, epsg, prj) |
| 2878 | 2878 | ||
| 2879 | Retorno: | 2879 | Retorno: |
ferramentas/buscarapida/gadget.php
| 1 | <?php | 1 | <?php |
| 2 | include_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | 2 | include_once(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); |
| 3 | -if(!isset($palavra)) | ||
| 4 | -{echo "Parâmetro &palavra= não foi definido. 'palavra' é a palavra que será buscada";} | ||
| 5 | -if(!isset($locaplic)) | ||
| 6 | -{echo "<br>Parâmetro &locaplic= não foi definido. 'locaplic' indica onde o i3geo está instalado";} | 3 | +include_once(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
| 4 | +$projecao = pegaProjecaoDefault("epsg"); | ||
| 5 | +if(!isset($palavra)){ | ||
| 6 | + echo "Parâmetro &palavra= não foi definido. 'palavra' é a palavra que será buscada"; | ||
| 7 | +} | ||
| 8 | +if(!isset($locaplic)){ | ||
| 9 | + echo "<br>Parâmetro &locaplic= não foi definido. 'locaplic' indica onde o i3geo está instalado"; | ||
| 10 | +} | ||
| 7 | ?> | 11 | ?> |
| 8 | <html xmlns="http://www.w3.org/1999/xhtml"> | 12 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 9 | <head> | 13 | <head> |
| @@ -22,7 +26,7 @@ i3GEObuscaRapida.idresultado | @@ -22,7 +26,7 @@ i3GEObuscaRapida.idresultado | ||
| 22 | var mapaLugar = function(wkt,layer,gid,nm) | 26 | var mapaLugar = function(wkt,layer,gid,nm) |
| 23 | { | 27 | { |
| 24 | var ext = i3GEO.util.wkt2ext(wkt,"polygon"); | 28 | var ext = i3GEO.util.wkt2ext(wkt,"polygon"); |
| 25 | - var url = "<?php echo $locaplic;?>/ms_criamapa.php?srs_wms=epsg:4618&image_wms=image/png&versao_wms=1.1.1" | 29 | + var url = "<?php echo $locaplic;?>/ms_criamapa.php?srs_wms=epsg:<?php echo $projecao;?>&image_wms=image/png&versao_wms=1.1.1" |
| 26 | url += "&url_wms=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&"; | 30 | url += "&url_wms=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&"; |
| 27 | url += "&layer_wms="+layer+"&style_wms=default" | 31 | url += "&layer_wms="+layer+"&style_wms=default" |
| 28 | url += "&nome_wms="+nm+" - "+layer | 32 | url += "&nome_wms="+nm+" - "+layer |
ferramentas/congelamapa/openlayers.php
| @@ -17,7 +17,7 @@ $novo_mapfile = $dir."/".nomeRandomico(5).$base; | @@ -17,7 +17,7 @@ $novo_mapfile = $dir."/".nomeRandomico(5).$base; | ||
| 17 | copy($map_file,$novo_mapfile); | 17 | copy($map_file,$novo_mapfile); |
| 18 | chmod($novo_mapfile,0777); | 18 | chmod($novo_mapfile,0777); |
| 19 | $mapa = ms_newMapObj($novo_mapfile); | 19 | $mapa = ms_newMapObj($novo_mapfile); |
| 20 | -$mapa->setProjection("+proj=longlat +ellps=GRS67 +no_defs"); | 20 | +$mapa->setProjection(pegaProjecaoDefault("proj4")); |
| 21 | $numlayers = $mapa->numlayers; | 21 | $numlayers = $mapa->numlayers; |
| 22 | $layers = array(); | 22 | $layers = array(); |
| 23 | for($i = 0;$i < $numlayers;++$i){ | 23 | for($i = 0;$i < $numlayers;++$i){ |
ferramentas/congelamapa/openlayers3.php
| @@ -17,7 +17,7 @@ $novo_mapfile = $dir."/".nomeRandomico(5).$base; | @@ -17,7 +17,7 @@ $novo_mapfile = $dir."/".nomeRandomico(5).$base; | ||
| 17 | copy($map_file,$novo_mapfile); | 17 | copy($map_file,$novo_mapfile); |
| 18 | chmod($novo_mapfile,0777); | 18 | chmod($novo_mapfile,0777); |
| 19 | $mapa = ms_newMapObj($novo_mapfile); | 19 | $mapa = ms_newMapObj($novo_mapfile); |
| 20 | -$mapa->setProjection("+proj=longlat +ellps=GRS67 +no_defs"); | 20 | +$mapa->setProjection(pegaProjecaoDefault("proj4")); |
| 21 | $numlayers = $mapa->numlayers; | 21 | $numlayers = $mapa->numlayers; |
| 22 | $layers = array(); | 22 | $layers = array(); |
| 23 | for($i = 0;$i < $numlayers;++$i){ | 23 | for($i = 0;$i < $numlayers;++$i){ |
ferramentas/imprimir/a4lpaisagempdf.php
| @@ -42,9 +42,9 @@ $map->save($temp); | @@ -42,9 +42,9 @@ $map->save($temp); | ||
| 42 | substituiCon($temp,$postgis_mapa); | 42 | substituiCon($temp,$postgis_mapa); |
| 43 | $map = ms_newMapObj($temp); | 43 | $map = ms_newMapObj($temp); |
| 44 | 44 | ||
| 45 | -if($map->getmetadata("interface") == "googlemaps") | ||
| 46 | -{ | ||
| 47 | - $map->setProjection("init=epsg:4618,a=6378137,b=6378137"); | 45 | +if($map->getmetadata("interface") == "googlemaps"){ |
| 46 | + $proj4 = pegaProjecaoDefault("proj4"); | ||
| 47 | + $map->setProjection($proj4); | ||
| 48 | $map->set("units",MS_METERS); | 48 | $map->set("units",MS_METERS); |
| 49 | $map->preparequery(); | 49 | $map->preparequery(); |
| 50 | $map->set("scaledenom",$map->scaledenom * 100000); | 50 | $map->set("scaledenom",$map->scaledenom * 100000); |
ferramentas/imprimir/aggpng.php
| @@ -72,7 +72,8 @@ $of->set("imagemode","RGB"); | @@ -72,7 +72,8 @@ $of->set("imagemode","RGB"); | ||
| 72 | $map = ms_newMapObj($temp); | 72 | $map = ms_newMapObj($temp); |
| 73 | if($map->getmetadata("interface") == "googlemaps") | 73 | if($map->getmetadata("interface") == "googlemaps") |
| 74 | { | 74 | { |
| 75 | - $map->setProjection("init=epsg:4618,a=6378137,b=6378137"); | 75 | + $proj4 = pegaProjecaoDefault("proj4"); |
| 76 | + $map->setProjection($proj4); | ||
| 76 | $map->set("units",MS_METERS); | 77 | $map->set("units",MS_METERS); |
| 77 | $map->preparequery(); | 78 | $map->preparequery(); |
| 78 | $map->set("scaledenom",$map->scaledenom * 100000); | 79 | $map->set("scaledenom",$map->scaledenom * 100000); |
ferramentas/imprimir/geotif.php
| @@ -71,7 +71,8 @@ $of->set("imagemode","RGB"); | @@ -71,7 +71,8 @@ $of->set("imagemode","RGB"); | ||
| 71 | $map = ms_newMapObj($temp); | 71 | $map = ms_newMapObj($temp); |
| 72 | if($map->getmetadata("interface") == "googlemaps") | 72 | if($map->getmetadata("interface") == "googlemaps") |
| 73 | { | 73 | { |
| 74 | - $map->setProjection("init=epsg:4618,a=6378137,b=6378137"); | 74 | + $proj4 = pegaProjecaoDefault("proj4"); |
| 75 | + $map->setProjection($proj4); | ||
| 75 | $map->set("units",MS_METERS); | 76 | $map->set("units",MS_METERS); |
| 76 | $map->preparequery(); | 77 | $map->preparequery(); |
| 77 | $map->set("scaledenom",$map->scaledenom * 100000); | 78 | $map->set("scaledenom",$map->scaledenom * 100000); |
ferramentas/imprimir/jpeg.php
| @@ -74,7 +74,8 @@ $of->set("mimetype","image/jpeg"); | @@ -74,7 +74,8 @@ $of->set("mimetype","image/jpeg"); | ||
| 74 | $of->set("extension","jpg"); | 74 | $of->set("extension","jpg"); |
| 75 | if($map->getmetadata("interface") == "googlemaps") | 75 | if($map->getmetadata("interface") == "googlemaps") |
| 76 | { | 76 | { |
| 77 | - $map->setProjection("init=epsg:4618,a=6378137,b=6378137"); | 77 | + $proj4 = pegaProjecaoDefault("proj4"); |
| 78 | + $map->setProjection($proj4); | ||
| 78 | $map->set("units",MS_METERS); | 79 | $map->set("units",MS_METERS); |
| 79 | $map->preparequery(); | 80 | $map->preparequery(); |
| 80 | $map->set("scaledenom",$map->scaledenom * 100000); | 81 | $map->set("scaledenom",$map->scaledenom * 100000); |
ferramentas/imprimir/svg.php
| @@ -69,7 +69,8 @@ substituiCon($temp,$postgis_mapa); | @@ -69,7 +69,8 @@ substituiCon($temp,$postgis_mapa); | ||
| 69 | $map = ms_newMapObj($temp); | 69 | $map = ms_newMapObj($temp); |
| 70 | if($map->getmetadata("interface") == "googlemaps") | 70 | if($map->getmetadata("interface") == "googlemaps") |
| 71 | { | 71 | { |
| 72 | - $map->setProjection("init=epsg:4618,a=6378137,b=6378137"); | 72 | + $proj4 = pegaProjecaoDefault("proj4"); |
| 73 | + $map->setProjection($proj4); | ||
| 73 | $map->set("units",MS_METERS); | 74 | $map->set("units",MS_METERS); |
| 74 | $map->preparequery(); | 75 | $map->preparequery(); |
| 75 | $map->set("scaledenom",$map->scaledenom * 100000); | 76 | $map->set("scaledenom",$map->scaledenom * 100000); |
ferramentas/parametrossql/ogc.php
| @@ -12,6 +12,8 @@ require_once(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); | @@ -12,6 +12,8 @@ require_once(dirname(__FILE__)."/../../classesphp/carrega_ext.php"); | ||
| 12 | include(dirname(__FILE__)."/../../ms_configura.php"); | 12 | include(dirname(__FILE__)."/../../ms_configura.php"); |
| 13 | include(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); | 13 | include(dirname(__FILE__)."/../../classesphp/pega_variaveis.php"); |
| 14 | include(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); | 14 | include(dirname(__FILE__)."/../../classesphp/funcoes_gerais.php"); |
| 15 | +$projDefault = pegaProjecaoDefault(); | ||
| 16 | + | ||
| 15 | $temas = $tema; | 17 | $temas = $tema; |
| 16 | if(isset($_GET["sld"]) || isset($_GET["filter"])){ | 18 | if(isset($_GET["sld"]) || isset($_GET["filter"])){ |
| 17 | $cache = false; | 19 | $cache = false; |
| @@ -40,7 +42,7 @@ if($_GET["SRS"] == "EPSG:900913"){ | @@ -40,7 +42,7 @@ if($_GET["SRS"] == "EPSG:900913"){ | ||
| 40 | $req = ms_newowsrequestobj(); | 42 | $req = ms_newowsrequestobj(); |
| 41 | $_GET = array_merge($_GET,$_POST); | 43 | $_GET = array_merge($_GET,$_POST); |
| 42 | if(!isset($_GET["srs"]) && !isset($_GET["SRS"])){ | 44 | if(!isset($_GET["srs"]) && !isset($_GET["SRS"])){ |
| 43 | - $_GET["srs"] = "EPSG:4326"; | 45 | + $_GET["srs"] = "EPSG:".$projDefault["epsg"]; |
| 44 | } | 46 | } |
| 45 | foreach ($_GET as $k=>$v){ | 47 | foreach ($_GET as $k=>$v){ |
| 46 | $req->setParameter(strtoupper($k), $v); | 48 | $req->setParameter(strtoupper($k), $v); |
| @@ -97,7 +99,7 @@ else{ | @@ -97,7 +99,7 @@ else{ | ||
| 97 | $oMap->setmetadata("ows_enable_request","*"); | 99 | $oMap->setmetadata("ows_enable_request","*"); |
| 98 | //parametro mandatario | 100 | //parametro mandatario |
| 99 | if($oMap->getmetadata("wms_srs") == ""){ | 101 | if($oMap->getmetadata("wms_srs") == ""){ |
| 100 | - $oMap->setmetadata("wms_srs","EPSG:4326"); | 102 | + $oMap->setmetadata("wms_srs","EPSG:".$projDefault["epsg"]); |
| 101 | } | 103 | } |
| 102 | 104 | ||
| 103 | $e = $oMap->extent; | 105 | $e = $oMap->extent; |
| @@ -310,7 +312,7 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | @@ -310,7 +312,7 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | ||
| 310 | $x--; | 312 | $x--; |
| 311 | $y--; | 313 | $y--; |
| 312 | 314 | ||
| 313 | - $projInObj = ms_newprojectionobj("proj=latlong,a=6378137,b=6378137"); | 315 | + $projInObj = ms_newprojectionobj($projDefault["proj4"]); |
| 314 | $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"); | 316 | $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"); |
| 315 | 317 | ||
| 316 | $poPoint1 = ms_newpointobj(); | 318 | $poPoint1 = ms_newpointobj(); |
| @@ -324,7 +326,7 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | @@ -324,7 +326,7 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | ||
| 324 | 326 | ||
| 325 | $oMap->getlayer(0)->set("status",MS_DEFAULT); | 327 | $oMap->getlayer(0)->set("status",MS_DEFAULT); |
| 326 | $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"); | 328 | $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"); |
| 327 | - $layer0->setProjection("proj=latlong,a=6378137,b=6378137"); | 329 | + $layer0->setProjection($projDefault["proj4"]); |
| 328 | // | 330 | // |
| 329 | //se o layer foi marcado para corte altera os parametros para ampliar o mapa | 331 | //se o layer foi marcado para corte altera os parametros para ampliar o mapa |
| 330 | //antes de gerar a imagem | 332 | //antes de gerar a imagem |
| @@ -401,7 +403,7 @@ if(strtolower($req->getValueByName("REQUEST")) == "getfeature"){ | @@ -401,7 +403,7 @@ if(strtolower($req->getValueByName("REQUEST")) == "getfeature"){ | ||
| 401 | $req->setParameter("TYPENAME",$l->name); | 403 | $req->setParameter("TYPENAME",$l->name); |
| 402 | } | 404 | } |
| 403 | if($l->getProjection() == "" ){ | 405 | if($l->getProjection() == "" ){ |
| 404 | - $l->setProjection("proj=latlong,a=6378137,b=6378137"); | 406 | + $l->setProjection($projDefault["proj4"]); |
| 405 | } | 407 | } |
| 406 | if(strtolower($req->getValueByName("SRS")) == "epsg:900913"){ | 408 | if(strtolower($req->getValueByName("SRS")) == "epsg:900913"){ |
| 407 | $req->setParameter("SRS","EPSG:3857"); | 409 | $req->setParameter("SRS","EPSG:3857"); |
ferramentas/telaremota/openlayers1.php
| @@ -119,7 +119,7 @@ function inicia(){ | @@ -119,7 +119,7 @@ function inicia(){ | ||
| 119 | OpenLayers.ImgPath = "../../pacotes/openlayers/img/" | 119 | OpenLayers.ImgPath = "../../pacotes/openlayers/img/" |
| 120 | OpenLayers.Lang.setCode("pt-BR"); | 120 | OpenLayers.Lang.setCode("pt-BR"); |
| 121 | var urlLayer = "../../classesphp/mapa_openlayers.php?DESLIGACACHE=sim&g_sid=<?php echo $g_sid;?>&telaR=<?php echo $telaR;?>"; | 121 | var urlLayer = "../../classesphp/mapa_openlayers.php?DESLIGACACHE=sim&g_sid=<?php echo $g_sid;?>&telaR=<?php echo $telaR;?>"; |
| 122 | - | 122 | + |
| 123 | var remoto = new OpenLayers.Layer.WMS( | 123 | var remoto = new OpenLayers.Layer.WMS( |
| 124 | "Remoto", | 124 | "Remoto", |
| 125 | urlLayer, | 125 | urlLayer, |
| @@ -168,7 +168,7 @@ function inicia(){ | @@ -168,7 +168,7 @@ function inicia(){ | ||
| 168 | "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map", | 168 | "http://mapas.mma.gov.br/cgi-bin/mapserv?map=/opt/www/html/webservices/baseraster.map", |
| 169 | { | 169 | { |
| 170 | layers : "baseraster", | 170 | layers : "baseraster", |
| 171 | - srs : "EPSG:4618", | 171 | + srs : "EPSG:4326", |
| 172 | format : "image/png", | 172 | format : "image/png", |
| 173 | isBaseLayer : false | 173 | isBaseLayer : false |
| 174 | }, { | 174 | }, { |
ferramentas/wkt2layer/exec.php
| @@ -45,7 +45,7 @@ Insere elementos no mapa como um layer do tipo feature baseado em wkt | @@ -45,7 +45,7 @@ Insere elementos no mapa como um layer do tipo feature baseado em wkt | ||
| 45 | $c = $shp->getCentroid(); | 45 | $c = $shp->getCentroid(); |
| 46 | $c = $c->x; | 46 | $c = $c->x; |
| 47 | if($c > -181 && $c < 181){ | 47 | if($c > -181 && $c < 181){ |
| 48 | - $l->setprojection("proj=latlong,a=6378137,b=6378137"); | 48 | + $l->setprojection(pegaProjecaoDefault("proj4")); |
| 49 | } | 49 | } |
| 50 | else{ | 50 | else{ |
| 51 | $l->setprojection($this->mapa->getProjection()); | 51 | $l->setprojection($this->mapa->getProjection()); |
ogc.htm
| @@ -199,6 +199,8 @@ A:hover { | @@ -199,6 +199,8 @@ A:hover { | ||
| 199 | ins += | 199 | ins += |
| 200 | "<p><a target=blank href='"+servico+"SRS=EPSG:4618&WIDTH=500&HEIGHT=500&BBOX=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&FORMAT=image/png&service=wms&version=1.1.0&request=getmap&layers="+tema+"' />testar getmap</a>"; | 200 | "<p><a target=blank href='"+servico+"SRS=EPSG:4618&WIDTH=500&HEIGHT=500&BBOX=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&FORMAT=image/png&service=wms&version=1.1.0&request=getmap&layers="+tema+"' />testar getmap</a>"; |
| 201 | ins += | 201 | ins += |
| 202 | + "<p><a target=blank href='"+servico+"SRS=EPSG:4618&WIDTH=500&HEIGHT=500&BBOX=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&FORMAT=image/png&service=wms&version=1.1.0&request=getlegendgraphic&layers="+tema+"' />testar getLegendGraphic</a>"; | ||
| 203 | + ins += | ||
| 202 | "<p><a target=blank href='"+servico+"format=application/openlayers&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&layers="+tema+"' />visualizar com openLayers</a>"; | 204 | "<p><a target=blank href='"+servico+"format=application/openlayers&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&layers="+tema+"' />visualizar com openLayers</a>"; |
| 203 | ins += | 205 | ins += |
| 204 | "<p><a target=blank href='"+servico+"OUTPUTFORMAT=shape-zip&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&service=wfs&version=1.1.0&request=getfeature&layers="+tema+"&typeName="+tema+"' />download shapefile via WFS</a>"; | 206 | "<p><a target=blank href='"+servico+"OUTPUTFORMAT=shape-zip&bbox=-76.5125927,-39.3925675209,-29.5851853,9.49014852081&service=wfs&version=1.1.0&request=getfeature&layers="+tema+"&typeName="+tema+"' />download shapefile via WFS</a>"; |
ogc.php
| @@ -212,7 +212,7 @@ if(!empty($restauramapa)){ | @@ -212,7 +212,7 @@ if(!empty($restauramapa)){ | ||
| 212 | //para operar como o Geoserver, abre o openlayers | 212 | //para operar como o Geoserver, abre o openlayers |
| 213 | // | 213 | // |
| 214 | if(isset($format) && strtolower($format) == "application/openlayers"){ | 214 | if(isset($format) && strtolower($format) == "application/openlayers"){ |
| 215 | - $urln = dirname($_SERVER["PHP_SELF"])."/mashups/openlayers.php?layers=".$layers."&mapext=".$bbox."&botoes=pan,zoombox,zoomtot,identifica"; | 215 | + $urln = dirname($_SERVER["PHP_SELF"])."/mashups/openlayers.php?layers=".$layers."&mapext=".$bbox."&botoes=pan,zoombox,zoomtot,identifica,legenda"; |
| 216 | //echo $urln;exit; | 216 | //echo $urln;exit; |
| 217 | if(!headers_sent()){ | 217 | if(!headers_sent()){ |
| 218 | header("Location:".$urln); | 218 | header("Location:".$urln); |
| @@ -752,11 +752,11 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | @@ -752,11 +752,11 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | ||
| 752 | $x = $_GET["X"]; | 752 | $x = $_GET["X"]; |
| 753 | $y = $_GET["Y"]; | 753 | $y = $_GET["Y"]; |
| 754 | $z = $_GET["Z"]; | 754 | $z = $_GET["Z"]; |
| 755 | - | 755 | + $proj4 = pegaProjecaoDefault("proj4"); |
| 756 | if(file_exists($tema)){ | 756 | if(file_exists($tema)){ |
| 757 | $layer0 = $oMap->getlayer(0); | 757 | $layer0 = $oMap->getlayer(0); |
| 758 | $layer0->set("status",MS_DEFAULT); | 758 | $layer0->set("status",MS_DEFAULT); |
| 759 | - $layer0->setProjection("proj=latlong,a=6378137,b=6378137"); | 759 | + $layer0->setProjection($proj4); |
| 760 | } | 760 | } |
| 761 | else{ | 761 | else{ |
| 762 | //pode ter mais de um tema | 762 | //pode ter mais de um tema |
| @@ -764,7 +764,7 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | @@ -764,7 +764,7 @@ if(isset($_GET["Z"]) && isset($_GET["X"])){ | ||
| 764 | foreach($lista as $nomeLayer){ | 764 | foreach($lista as $nomeLayer){ |
| 765 | $layer0 = $oMap->getlayerbyname($nomeLayer); | 765 | $layer0 = $oMap->getlayerbyname($nomeLayer); |
| 766 | $layer0->set("status",MS_DEFAULT); | 766 | $layer0->set("status",MS_DEFAULT); |
| 767 | - $layer0->setProjection("proj=latlong,a=6378137,b=6378137"); | 767 | + $layer0->setProjection($proj4); |
| 768 | } | 768 | } |
| 769 | } | 769 | } |
| 770 | // | 770 | // |
| @@ -880,7 +880,7 @@ if(strtolower($req->getValueByName("REQUEST")) == "getfeature"){ | @@ -880,7 +880,7 @@ if(strtolower($req->getValueByName("REQUEST")) == "getfeature"){ | ||
| 880 | $req->setParameter("TYPENAME",$l->name); | 880 | $req->setParameter("TYPENAME",$l->name); |
| 881 | } | 881 | } |
| 882 | if($l->getProjection() == "" ){ | 882 | if($l->getProjection() == "" ){ |
| 883 | - $l->setProjection("proj=latlong,a=6378137,b=6378137"); | 883 | + $l->setProjection(pegaProjecaoDefault("proj4")); |
| 884 | } | 884 | } |
| 885 | if(strtolower($req->getValueByName("SRS")) == "epsg:900913"){ | 885 | if(strtolower($req->getValueByName("SRS")) == "epsg:900913"){ |
| 886 | $req->setParameter("SRS","EPSG:3857"); | 886 | $req->setParameter("SRS","EPSG:3857"); |
pacotes/kmlmapserver/classes/layerserver.class.php
| @@ -157,7 +157,6 @@ class LayerServer { | @@ -157,7 +157,6 @@ class LayerServer { | ||
| 157 | } else { | 157 | } else { |
| 158 | $this->_networklink = false; | 158 | $this->_networklink = false; |
| 159 | } | 159 | } |
| 160 | - | ||
| 161 | $imageObj = $this->map_object->drawlegend(); | 160 | $imageObj = $this->map_object->drawlegend(); |
| 162 | $url = $imageObj->saveWebImage(); | 161 | $url = $imageObj->saveWebImage(); |
| 163 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | 162 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); |