Commit 4b02f7e396a1c71d1636ef48f8ad59e69bdefed2
1 parent
354ca372
Exists in
master
and in
7 other branches
Inclusão de opção opção para testar camada no editor de atlas do sistema de administração
Showing
7 changed files
with
48 additions
and
23 deletions
Show diff stats
admin/js/atlas.js
... | ... | @@ -136,6 +136,10 @@ function montaArvore(dados) |
136 | 136 | adicionaNosAtlas(dados) |
137 | 137 | tree.draw(); |
138 | 138 | } |
139 | +function testarMapfile(codigoMap) | |
140 | +{ | |
141 | + window.open("../../testamapfile.php?map="+codigoMap+".map") | |
142 | +} | |
139 | 143 | function adicionaNosTemas(no,dados,redesenha) |
140 | 144 | { |
141 | 145 | if(!redesenha) |
... | ... | @@ -150,6 +154,7 @@ function adicionaNosTemas(no,dados,redesenha) |
150 | 154 | var conteudo = " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('sobe','tema','"+dados[i].id_tema+"')\" title=sobe src=\"../imagens/34.png\" />" |
151 | 155 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"sobeDesce('desce','tema','"+dados[i].id_tema+"')\" title=desce src=\"../imagens/33.png\" />" |
152 | 156 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"excluir('tema','"+dados[i].id_tema+"')\" title=excluir width='10px' heigth='10px' src=\"../imagens/01.png\" />" |
157 | + conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"testarMapfile('"+dados[i].codigo_tema+"')\" title=testar width='10px' heigth='10px' src=\"../imagens/41.png\" />" | |
153 | 158 | conteudo += " <img style=\"position:relative;cursor:pointer;top:0px\" onclick=\"editar('tema','"+dados[i].id_tema+"')\" title=editar width='10px' heigth='10px' src=\"../imagens/06.png\" /> <span>"+dados[i].codigo_tema+"</span>" |
154 | 159 | var d = {html:conteudo,id_tema:dados[i].id_tema,tipo:"tema"} |
155 | 160 | var tempNode = new YAHOO.widget.HTMLNode(d, no, false,true); | ... | ... |
admin/php/editormapfile.php
... | ... | @@ -1198,7 +1198,7 @@ function listaClasses() |
1198 | 1198 | for($i=0;$i<$nclasses;++$i) |
1199 | 1199 | { |
1200 | 1200 | $classe = $layer->getclass($i); |
1201 | - $dados[] = array("indice"=>$i,"nome"=>($classe->name)); | |
1201 | + $dados[] = array("indice"=>$i,"nome"=>(mb_convert_encoding($classe->name,"UTF-8","ISO-8859-1"))); | |
1202 | 1202 | } |
1203 | 1203 | return $dados; |
1204 | 1204 | } |
... | ... | @@ -1314,10 +1314,10 @@ function pegaMetadados() |
1314 | 1314 | $dados["type"] = $layer->type; |
1315 | 1315 | $dados["connectiontype"] = $layer->connectiontype; |
1316 | 1316 | $dados["itens"] = $layer->getmetadata("itens"); |
1317 | - $dados["itensdesc"] = $layer->getmetadata("itensdesc"); | |
1317 | + $dados["itensdesc"] = mb_convert_encoding($layer->getmetadata("itensdesc"),"UTF-8","ISO-8859-1"); //$layer->getmetadata("itensdesc"); | |
1318 | 1318 | $dados["itenslink"] = $layer->getmetadata("itenslink"); |
1319 | 1319 | $dados["tip"] = $layer->getmetadata("tip"); |
1320 | - $dados["tema"] = $layer->getmetadata("tema"); | |
1320 | + $dados["tema"] = mb_convert_encoding($layer->getmetadata("tema"),"UTF-8","ISO-8859-1");//$layer->getmetadata("tema"); | |
1321 | 1321 | $dados["classe"] = $layer->getmetadata("classe"); |
1322 | 1322 | $dados["escala"] = $layer->getmetadata("escala"); |
1323 | 1323 | $dados["download"] = $layer->getmetadata("download"); |
... | ... | @@ -1325,7 +1325,7 @@ function pegaMetadados() |
1325 | 1325 | $dados["extensao"] = $layer->getmetadata("extensao"); |
1326 | 1326 | $dados["identifica"] = $layer->getmetadata("identifica"); |
1327 | 1327 | $dados["transitioneffect"] = $layer->getmetadata("transitioneffect"); |
1328 | - $dados["mensagem"] = $layer->getmetadata("mensagem"); | |
1328 | + $dados["mensagem"] = mb_convert_encoding($layer->getmetadata("mensagem"),"UTF-8","ISO-8859-1");//$layer->getmetadata("mensagem"); | |
1329 | 1329 | $dados["classesitem"] = $layer->getmetadata("classesitem"); |
1330 | 1330 | $dados["classesnome"] = $layer->getmetadata("classesnome"); |
1331 | 1331 | $dados["classescor"] = $layer->getmetadata("classescor"); | ... | ... |
classesjs/classe_interface.js
... | ... | @@ -1534,6 +1534,7 @@ i3GEO.Interface = { |
1534 | 1534 | }, |
1535 | 1535 | criaImageMap: function(nomeLayer){ |
1536 | 1536 | var i3GEOTileO,s; |
1537 | + | |
1537 | 1538 | s = "i3GEOTileO = new google.maps.ImageMapType({ "+ |
1538 | 1539 | "getTileUrl: function(coord, zoom) {" + |
1539 | 1540 | " var url = '" + i3GEO.configura.locaplic +"/classesphp/mapa_googlemaps.php?g_sid=" + i3GEO.configura.sid + |
... | ... | @@ -1544,6 +1545,20 @@ i3GEO.Interface = { |
1544 | 1545 | "isPng: true," + |
1545 | 1546 | "name: '" + nomeLayer + "'" + |
1546 | 1547 | "});"; |
1548 | + | |
1549 | +/* | |
1550 | + s = "i3GEOTileO = new google.maps.ImageMapType({ "+ | |
1551 | + "getTileUrl: function(coord, zoom) {" + | |
1552 | + " var url = '" + i3GEO.configura.locaplic +"/classesphp/mapa_googlemaps.php?g_sid=" + i3GEO.configura.sid + | |
1553 | + "&WIDTH=512&HEIGHT=512&BBOX=' + i3GEO.Interface.googlemaps.bbox() + '"+ | |
1554 | + "&Z=' + zoom + '&X=' + (coord.x) + '&Y=' + (coord.y) + '&layer=" + nomeLayer + i3GEO.Interface.googlemaps.PARAMETROSLAYER + '&r='+Math.random()+"';" + | |
1555 | + " return url+'&nd='+i3GEO.Interface.googlemaps.posfixo; " + | |
1556 | + "}, "+ | |
1557 | + "tileSize: new google.maps.Size(512,512)," + | |
1558 | + "isPng: true," + | |
1559 | + "name: '" + nomeLayer + "'" + | |
1560 | + "});"; | |
1561 | +*/ | |
1547 | 1562 | eval(s); |
1548 | 1563 | return i3GEOTileO; |
1549 | 1564 | }, | ... | ... |
classesphp/mapa_googlemaps.php
... | ... | @@ -88,31 +88,33 @@ $postgis_mapa = $_SESSION["postgis_mapa"]; |
88 | 88 | //converte a requisição do tile em coordenadas geo |
89 | 89 | //http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#tile_numbers_to_lon.2Flat_2 |
90 | 90 | // |
91 | -$x = $_GET["X"]; | |
92 | -$y = $_GET["Y"]; | |
93 | -$n = pow(2, $_GET["Z"]); | |
94 | -$lon1 = $x / $n * 360.0 - 180.0; | |
95 | -$lat2 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); | |
96 | -$x++; | |
97 | -$y++; | |
98 | -$lon2 = $x / $n * 360.0 - 180.0; | |
99 | -$lat1 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); | |
91 | + $x = $_GET["X"]; | |
92 | + $y = $_GET["Y"]; | |
93 | + $n = pow(2, $_GET["Z"]); | |
94 | + $lon1 = $x / $n * 360.0 - 180.0; | |
95 | + $lat2 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); | |
96 | + $x++; | |
97 | + $y++; | |
98 | + $lon2 = $x / $n * 360.0 - 180.0; | |
99 | + $lat1 = rad2deg(atan(sinh(pi() * (1 - 2 * $y / $n)))); | |
100 | 100 | |
101 | 101 | $projInObj = ms_newprojectionobj("proj=latlong"); |
102 | 102 | $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"); |
103 | + | |
103 | 104 | $poPoint1 = ms_newpointobj(); |
104 | 105 | $poPoint1->setXY($lon1, $lat1); |
105 | 106 | $poPoint1->project($projInObj, $projOutObj); |
106 | 107 | $poPoint2 = ms_newpointobj(); |
107 | 108 | $poPoint2->setXY($lon2, $lat2); |
108 | 109 | $poPoint2->project($projInObj, $projOutObj); |
109 | - | |
110 | 110 | $_GET["BBOX"] = $poPoint1->x." ".$poPoint1->y." ".$poPoint2->x." ".$poPoint2->y; |
111 | - | |
112 | 111 | $_GET["mapext"] = str_replace(","," ",$_GET["BBOX"]); |
113 | -$_GET["map_size"] = "256 256"; | |
114 | -$_GET["WIDTH"] = "256"; | |
115 | -$_GET["HEIGHT"] = "256"; | |
112 | + | |
113 | +if(!isset($_GET["WIDTH"])) | |
114 | +{$_GET["WIDTH"] = "256";} | |
115 | +if(!isset($_GET["HEIGHT"])) | |
116 | +{$_GET["HEIGHT"] = "256";} | |
117 | +$_GET["map_size"] = $_GET["WIDTH"]." ".$_GET["HEIGHT"]; | |
116 | 118 | |
117 | 119 | $mapa = ms_newMapObj($map_file); |
118 | 120 | /* | ... | ... |
classesphp/mapa_openlayers.php
... | ... | @@ -58,7 +58,6 @@ Arquivo: |
58 | 58 | i3geo/classesphp/mapa_openlayers.php |
59 | 59 | |
60 | 60 | */ |
61 | -//error_reporting(E_ALL); | |
62 | 61 | if (!function_exists('ms_GetVersion')) |
63 | 62 | { |
64 | 63 | $s = PHP_SHLIB_SUFFIX; |
... | ... | @@ -72,6 +71,7 @@ if(@$_GET["g_sid"]) |
72 | 71 | else |
73 | 72 | {ilegal();} |
74 | 73 | session_start(); |
74 | + | |
75 | 75 | if(@$_SESSION["fingerprint"]) |
76 | 76 | { |
77 | 77 | $f = explode(",",$_SESSION["fingerprint"]); |
... | ... | @@ -83,7 +83,7 @@ else |
83 | 83 | // |
84 | 84 | $map_file = $_SESSION["map_file"]; |
85 | 85 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
86 | -if($_GET["tipolayer"] == "fundo") | |
86 | +if(isset($_GET["tipolayer"]) && $_GET["tipolayer"] == "fundo") | |
87 | 87 | {$map_file = str_replace(".map","fundo.map",$map_file);} |
88 | 88 | if(isset($_GET["BBOX"])) |
89 | 89 | { |
... | ... | @@ -233,7 +233,6 @@ if (!function_exists('imagepng')) |
233 | 233 | if (!function_exists('imagepng')) |
234 | 234 | {$_GET["TIPOIMAGEM"] = "";} |
235 | 235 | } |
236 | - | |
237 | 236 | if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum") |
238 | 237 | { |
239 | 238 | $nomer = ($img->imagepath)."filtroimgtemp".nomeRandomico(); |
... | ... | @@ -256,8 +255,10 @@ else{ |
256 | 255 | imagealphablending($img, false); |
257 | 256 | imagesavealpha($img, true); |
258 | 257 | ob_clean(); |
258 | + | |
259 | 259 | echo header("Content-type: image/png \n\n"); |
260 | 260 | imagepng($img); |
261 | + | |
261 | 262 | } |
262 | 263 | function salvaCacheImagem($bbox,$layer,$map,$w,$h){ |
263 | 264 | global $img,$map_size; | ... | ... |
interface/googlemaps.phtml
... | ... | @@ -105,7 +105,7 @@ include_once("../ms_configura.php"); |
105 | 105 | </tr> |
106 | 106 | </table> |
107 | 107 | <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> |
108 | -<script type="text/javascript" src="../classesjs/i3geo.js"></script> | |
108 | +<script type="text/javascript" src="../classesjs/i3geonaocompacto.js"></script> | |
109 | 109 | <script type="text/javascript"> |
110 | 110 | /* |
111 | 111 | Title: Google Maps | ... | ... |
ms_criamapa.php
... | ... | @@ -155,6 +155,7 @@ Include dos arquivos PHP. |
155 | 155 | |
156 | 156 | Inclui os programas php com funções utilizadas pelo ms_criamapa.php |
157 | 157 | */ |
158 | + | |
158 | 159 | include_once ($caminho."classesphp/pega_variaveis.php"); |
159 | 160 | include_once ($caminho."classesphp/funcoes_gerais.php"); |
160 | 161 | if(!isset($dir_tmp)) |
... | ... | @@ -465,8 +466,9 @@ Redireciona para o HTML definido em $interface, abrindo o mapa |
465 | 466 | */ |
466 | 467 | function abreInterface(){ |
467 | 468 | global $interface,$caminho,$tempo; |
469 | + | |
468 | 470 | $nomeInterface = explode(".",basename($interface)); |
469 | - $_SESSION["interface"] = $nomeInterface[0]; | |
471 | + //$_SESSION["interface"] = $nomeInterface[0]; | |
470 | 472 | if (count(explode(".php",$interface)) > 1) |
471 | 473 | { |
472 | 474 | if(file_exists($caminho."interface/".$interface)) | ... | ... |