Commit fcc17c052620a108443fea3f6f69d5d89495dc83
1 parent
709b3e2a
Exists in
master
and in
7 other branches
Inclusão de uma nova variável em ms_configura.php para controlar a forma como é …
…feito o envio das imagens (tiles do mapa) ao navegador. Inclusão de opção de envio baseado em x-sendfile
Showing
6 changed files
with
151 additions
and
90 deletions
Show diff stats
admin/admin.db
No preview for this file type
classesphp/mapa_googlemaps.php
@@ -92,6 +92,7 @@ if(!isset($_SESSION["map_file"])){ | @@ -92,6 +92,7 @@ if(!isset($_SESSION["map_file"])){ | ||
92 | $map_fileX = $_SESSION["map_file"]; | 92 | $map_fileX = $_SESSION["map_file"]; |
93 | $postgis_mapa = $_SESSION["postgis_mapa"]; | 93 | $postgis_mapa = $_SESSION["postgis_mapa"]; |
94 | $cachedir = $_SESSION["cachedir"]; | 94 | $cachedir = $_SESSION["cachedir"]; |
95 | +$i3georendermode = $_SESSION["i3georendermode"]; | ||
95 | // | 96 | // |
96 | //converte a requisição do tile em coordenadas geo | 97 | //converte a requisição do tile em coordenadas geo |
97 | //http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#tile_numbers_to_lon.2Flat_2 | 98 | //http://wiki.openstreetmap.org/wiki/Slippy_map_tilenames#tile_numbers_to_lon.2Flat_2 |
@@ -104,7 +105,7 @@ $qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; | @@ -104,7 +105,7 @@ $qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; | ||
104 | $qy = file_exists($qyfile); | 105 | $qy = file_exists($qyfile); |
105 | 106 | ||
106 | if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ | 107 | if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ |
107 | - carregaCacheImagem($_SESSION["cachedir"],$_SESSION["map_file"],$_GET["tms"]); | 108 | + carregaCacheImagem(); |
108 | } | 109 | } |
109 | 110 | ||
110 | $n = pow(2,$z); | 111 | $n = pow(2,$z); |
@@ -297,17 +298,46 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum"){ | @@ -297,17 +298,46 @@ if(trim($_GET["TIPOIMAGEM"]) != "" && trim($_GET["TIPOIMAGEM"]) != "nenhum"){ | ||
297 | else{ | 298 | else{ |
298 | if($cache == true){ | 299 | if($cache == true){ |
299 | $nomer = salvaCacheImagem(); | 300 | $nomer = salvaCacheImagem(); |
300 | - header('Content-Length: '.filesize($nomer)); | ||
301 | - header('Content-Type: image/png'); | ||
302 | - header('Cache-Control: max-age=3600, must-revalidate'); | ||
303 | - header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); | ||
304 | - header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nomer)).' GMT', true, 200); | ||
305 | - fpassthru(fopen($nomer, 'rb')); | 301 | + if($_SESSION["i3georendermode"] == 2){ |
302 | + ob_clean(); | ||
303 | + header("X-Sendfile: $nomer"); | ||
304 | + header("Content-type: image/png"); | ||
305 | + } | ||
306 | + else{ | ||
307 | + ob_clean(); | ||
308 | + header('Content-Length: '.filesize($nomer)); | ||
309 | + header('Content-Type: image/png'); | ||
310 | + header('Cache-Control: max-age=3600, must-revalidate'); | ||
311 | + header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); | ||
312 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nomer)).' GMT', true, 200); | ||
313 | + fpassthru(fopen($nomer, 'rb')); | ||
314 | + } | ||
306 | } | 315 | } |
307 | else{ | 316 | else{ |
308 | - //se der erro aqui veja em mapa_googlemaps_alternativo.php | ||
309 | - header('Content-Type: image/png'); | ||
310 | - $img->saveImage(); | 317 | + if($_SESSION["i3georendermode"] == 0){ |
318 | + $nomer = ($img->imagepath)."temp".nomeRand().".png"; | ||
319 | + $img->saveImage($nomer); | ||
320 | + $img = imagecreatefrompng($nomer); | ||
321 | + imagealphablending($img, false); | ||
322 | + imagesavealpha($img, true); | ||
323 | + ob_clean(); | ||
324 | + echo header("Content-type: image/png \n\n"); | ||
325 | + imagepng($img); | ||
326 | + imagedestroy($img); | ||
327 | + exit; | ||
328 | + } | ||
329 | + if($_SESSION["i3georendermode"] == 1){ | ||
330 | + ob_clean(); | ||
331 | + header('Content-Type: image/png'); | ||
332 | + $img->saveImage(); | ||
333 | + } | ||
334 | + if($_SESSION["i3georendermode"] == 2){ | ||
335 | + $nomer = ($img->imagepath)."temp".nomeRand().".png"; | ||
336 | + $img->saveImage($nomer); | ||
337 | + ob_clean(); | ||
338 | + header("X-Sendfile: $nomer"); | ||
339 | + header("Content-type: image/png"); | ||
340 | + } | ||
311 | } | 341 | } |
312 | exit; | 342 | exit; |
313 | } | 343 | } |
@@ -330,7 +360,7 @@ function salvaCacheImagem(){ | @@ -330,7 +360,7 @@ function salvaCacheImagem(){ | ||
330 | return $nome; | 360 | return $nome; |
331 | } | 361 | } |
332 | function carregaCacheImagem(){ | 362 | function carregaCacheImagem(){ |
333 | - global $img,$cachedir,$x,$y,$z,$map_fileX; | 363 | + global $img,$cachedir,$x,$y,$z,$map_fileX,$i3georendermode; |
334 | $layer = $_GET["layer"]; | 364 | $layer = $_GET["layer"]; |
335 | if($layer == "") | 365 | if($layer == "") |
336 | {$layer = "fundo";} | 366 | {$layer = "fundo";} |
@@ -338,50 +368,20 @@ function carregaCacheImagem(){ | @@ -338,50 +368,20 @@ function carregaCacheImagem(){ | ||
338 | $cachedir = dirname(dirname($map_fileX))."/cache"; | 368 | $cachedir = dirname(dirname($map_fileX))."/cache"; |
339 | } | 369 | } |
340 | $c = $cachedir."/googlemaps/$layer/$z/$x"; | 370 | $c = $cachedir."/googlemaps/$layer/$z/$x"; |
341 | - if(file_exists($c."/$y.png")){ | ||
342 | - header('Content-Length: '.filesize($c."/$y.png")); | ||
343 | - header('Content-Type: image/png'); | ||
344 | - fpassthru(fopen($c."/$y.png", 'rb')); | ||
345 | - exit; | ||
346 | - } | ||
347 | -} | ||
348 | -/* | ||
349 | -function salvaCacheImagem($cachedir,$bbox,$layer,$map,$w,$h){ | ||
350 | - global $img,$map_size; | ||
351 | - //layers que são sempre iguais | ||
352 | - //error_reporting(0); | ||
353 | - if($layer == "copyright" || $layer == "") | ||
354 | - {$bbox = "";} | ||
355 | - if($layer == "") | ||
356 | - {$layer = "fundo";} | ||
357 | - if($cachedir == "") | ||
358 | - {$cachedir = dirname(dirname($map))."/cache/googlemaps/".$layer;} | ||
359 | - else | ||
360 | - {$cachedir = $cachedir."/googlemaps/".$layer;} | ||
361 | - @mkdir($cachedir,0777); | ||
362 | - $nome = $cachedir."/".$w.$h.$bbox.".png"; | ||
363 | - if(!file_exists($nome)) | ||
364 | - {$img->saveImage($nome);} | ||
365 | - return $nome; | ||
366 | -} | ||
367 | -function carregaCacheImagem($cachedir,$bbox,$layer,$map,$w,$h){ | ||
368 | - if($layer == "copyright" || $layer == "") | ||
369 | - {$bbox = "";} | ||
370 | - if($layer == "") | ||
371 | - {$layer = "fundo";} | ||
372 | - $nome = $w.$h.$bbox.".png"; | ||
373 | - if($cachedir == "") | ||
374 | - {$nome = dirname(dirname($map))."/cache/googlemaps/".$layer."/".$nome;} | ||
375 | - else | ||
376 | - {$nome = $cachedir."/googlemaps/".$layer."/".$nome;} | 371 | + $nome = $c."/$y.png"; |
377 | if(file_exists($nome)){ | 372 | if(file_exists($nome)){ |
378 | - header('Content-Length: '.filesize($nome)); | ||
379 | - header('Content-Type: image/png'); | ||
380 | - fpassthru(fopen($nome, 'rb')); | 373 | + if($i3georendermode = 0 || $i3georendermode = 1 || empty($i3georendermode)){ |
374 | + header('Content-Length: '.filesize($nome)); | ||
375 | + header('Content-Type: image/png'); | ||
376 | + fpassthru(fopen($nome, 'rb')); | ||
377 | + } | ||
378 | + else{ | ||
379 | + header("X-Sendfile: $nome"); | ||
380 | + header("Content-type: image/png"); | ||
381 | + } | ||
381 | exit; | 382 | exit; |
382 | } | 383 | } |
383 | } | 384 | } |
384 | -*/ | ||
385 | function nomeRand($n=10) | 385 | function nomeRand($n=10) |
386 | { | 386 | { |
387 | $nomes = ""; | 387 | $nomes = ""; |
classesphp/mapa_openlayers.php
@@ -5,11 +5,12 @@ Title: mapa_openlayers.php | @@ -5,11 +5,12 @@ Title: mapa_openlayers.php | ||
5 | Faz o processamento de um mapfile segundo as necessidades do i3geo, como por exemplo, fazendo a substituição | 5 | Faz o processamento de um mapfile segundo as necessidades do i3geo, como por exemplo, fazendo a substituição |
6 | das variáveis de conexão com banco e outras operações específicas do i3Geo. | 6 | das variáveis de conexão com banco e outras operações específicas do i3Geo. |
7 | 7 | ||
8 | -É utilizado especificamente nas interfaces que utilizam a biblioteca OpenLayers em LAYERS do tipo WMS. | 8 | +É utilizado especificamente nas interfaces que utilizam a biblioteca OpenLayers. |
9 | 9 | ||
10 | -Precisa do codigo da "section" PHP aberta pelo i3Geo ou o codigo para acesso especial indicado no parâmetro telaR | 10 | +Precisa do codigo da "section" PHP aberta pelo i3Geo (veja ms_criamapa.php) ou o codigo para acesso especial indicado no parâmetro telaR |
11 | (veja a ferramenta TELAREMOTA). | 11 | (veja a ferramenta TELAREMOTA). |
12 | 12 | ||
13 | + | ||
13 | Parametros: | 14 | Parametros: |
14 | 15 | ||
15 | g_sid {string} - código da "section" PHP | 16 | g_sid {string} - código da "section" PHP |
@@ -93,7 +94,7 @@ $qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; | @@ -93,7 +94,7 @@ $qyfile = dirname($map_fileX)."/".$_GET["layer"].".php"; | ||
93 | $qy = file_exists($qyfile); | 94 | $qy = file_exists($qyfile); |
94 | 95 | ||
95 | if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ | 96 | if($qy == false && $_GET["cache"] == "sim" && $_GET["DESLIGACACHE"] != "sim"){ |
96 | - carregaCacheImagem($_SESSION["cachedir"],$_SESSION["map_file"],$_GET["tms"]); | 97 | + carregaCacheImagem($_SESSION["cachedir"],$_SESSION["map_file"],$_GET["tms"],$_SESSION["i3georendermode"]); |
97 | } | 98 | } |
98 | // | 99 | // |
99 | //map_fileX e para o caso register_globals = On no PHP.INI | 100 | //map_fileX e para o caso register_globals = On no PHP.INI |
@@ -259,13 +260,14 @@ else{ | @@ -259,13 +260,14 @@ else{ | ||
259 | $status = $l->whichShapes($mapa->extent); | 260 | $status = $l->whichShapes($mapa->extent); |
260 | while ($shape = $l->nextShape()) | 261 | while ($shape = $l->nextShape()) |
261 | { | 262 | { |
262 | - if(in_array($shape->index,$shp)) | ||
263 | - $shape->draw($mapa,$l,$img); | 263 | + if(in_array($shape->index,$shp)) |
264 | + $shape->draw($mapa,$l,$img); | ||
264 | } | 265 | } |
265 | $l->close(); | 266 | $l->close(); |
266 | } | 267 | } |
267 | $cache = false; | 268 | $cache = false; |
268 | } | 269 | } |
270 | +//nao usa o cache pois e necessario processar a imagem com alguma rotina de filtro | ||
269 | if($_GET["TIPOIMAGEM"] != "" && $_GET["TIPOIMAGEM"] != "nenhum"){ | 271 | if($_GET["TIPOIMAGEM"] != "" && $_GET["TIPOIMAGEM"] != "nenhum"){ |
270 | if($img->imagepath == "") | 272 | if($img->imagepath == "") |
271 | {echo "Erro IMAGEPATH vazio";exit;} | 273 | {echo "Erro IMAGEPATH vazio";exit;} |
@@ -282,21 +284,51 @@ if($_GET["TIPOIMAGEM"] != "" && $_GET["TIPOIMAGEM"] != "nenhum"){ | @@ -282,21 +284,51 @@ if($_GET["TIPOIMAGEM"] != "" && $_GET["TIPOIMAGEM"] != "nenhum"){ | ||
282 | } | 284 | } |
283 | else{ | 285 | else{ |
284 | if($cache == true && $_GET["cache"] != "nao"){ | 286 | if($cache == true && $_GET["cache"] != "nao"){ |
285 | - //$nomer = salvaCacheImagem($cachedir,$_GET["BBOX"],$nomecache,$map_fileX,$_GET["WIDTH"],$_GET["HEIGHT"]); | 287 | + //cache ativo. Salva a imagem em cache |
286 | $nomer = salvaCacheImagem($cachedir,$map_fileX,$_GET["tms"]); | 288 | $nomer = salvaCacheImagem($cachedir,$map_fileX,$_GET["tms"]); |
287 | - header('Content-Length: '.filesize($nomer)); | ||
288 | - header('Content-Type: image/png'); | ||
289 | - header('Cache-Control: max-age=3600, must-revalidate'); | ||
290 | - header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); | ||
291 | - header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nomer)).' GMT', true, 200); | ||
292 | - fpassthru(fopen($nomer, 'rb')); | 289 | + if($_SESSION["i3georendermode"] == 2){ |
290 | + ob_clean(); | ||
291 | + header("X-Sendfile: $nomer"); | ||
292 | + header("Content-type: image/png"); | ||
293 | + } | ||
294 | + else{ | ||
295 | + ob_clean(); | ||
296 | + header('Content-Length: '.filesize($nomer)); | ||
297 | + header('Content-Type: image/png'); | ||
298 | + header('Cache-Control: max-age=3600, must-revalidate'); | ||
299 | + header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); | ||
300 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nomer)).' GMT', true, 200); | ||
301 | + fpassthru(fopen($nomer, 'rb')); | ||
302 | + } | ||
293 | } | 303 | } |
294 | else{ | 304 | else{ |
305 | + //cache inativo | ||
295 | if($img->imagepath == "") | 306 | if($img->imagepath == "") |
296 | {echo "Erro IMAGEPATH vazio";exit;} | 307 | {echo "Erro IMAGEPATH vazio";exit;} |
297 | - //se der erro aqui veja em mapa_openlayers_alternativo.php | ||
298 | - header('Content-Type: image/png'); | ||
299 | - $img->saveImage(); | 308 | + if($_SESSION["i3georendermode"] == 0){ |
309 | + $nomer = ($img->imagepath)."temp".nomeRand().".png"; | ||
310 | + $img->saveImage($nomer); | ||
311 | + $img = imagecreatefrompng($nomer); | ||
312 | + imagealphablending($img, false); | ||
313 | + imagesavealpha($img, true); | ||
314 | + ob_clean(); | ||
315 | + echo header("Content-type: image/png \n\n"); | ||
316 | + imagepng($img); | ||
317 | + imagedestroy($img); | ||
318 | + exit; | ||
319 | + } | ||
320 | + if($_SESSION["i3georendermode"] == 1){ | ||
321 | + ob_clean(); | ||
322 | + header('Content-Type: image/png'); | ||
323 | + $img->saveImage(); | ||
324 | + } | ||
325 | + if($_SESSION["i3georendermode"] == 2){ | ||
326 | + $nomer = ($img->imagepath)."temp".nomeRand().".png"; | ||
327 | + $img->saveImage($nomer); | ||
328 | + ob_clean(); | ||
329 | + header("X-Sendfile: $nomer"); | ||
330 | + header("Content-type: image/png"); | ||
331 | + } | ||
300 | } | 332 | } |
301 | } | 333 | } |
302 | function salvaCacheImagem($cachedir,$map,$tms){ | 334 | function salvaCacheImagem($cachedir,$map,$tms){ |
@@ -315,7 +347,7 @@ function salvaCacheImagem($cachedir,$map,$tms){ | @@ -315,7 +347,7 @@ function salvaCacheImagem($cachedir,$map,$tms){ | ||
315 | } | 347 | } |
316 | return $nome; | 348 | return $nome; |
317 | } | 349 | } |
318 | -function carregaCacheImagem($cachedir,$map,$tms){ | 350 | +function carregaCacheImagem($cachedir,$map,$tms,$i3georendermode=0){ |
319 | if($cachedir == ""){ | 351 | if($cachedir == ""){ |
320 | $nome = dirname(dirname($map))."/cache".$tms; | 352 | $nome = dirname(dirname($map))."/cache".$tms; |
321 | } | 353 | } |
@@ -323,14 +355,18 @@ function carregaCacheImagem($cachedir,$map,$tms){ | @@ -323,14 +355,18 @@ function carregaCacheImagem($cachedir,$map,$tms){ | ||
323 | $nome = $cachedir.$tms; | 355 | $nome = $cachedir.$tms; |
324 | } | 356 | } |
325 | if(file_exists($nome)){ | 357 | if(file_exists($nome)){ |
326 | - header('Content-Length: '.filesize($nome)); | ||
327 | - header('Content-Type: image/png'); | ||
328 | - header('Cache-Control: max-age=3600, must-revalidate'); | ||
329 | - header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); | ||
330 | - header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nome)).' GMT', true, 200); | ||
331 | - $etag = md5_file($nome); | ||
332 | - header('Etag: '.$etag); | ||
333 | - fpassthru(fopen($nome, 'rb')); | 358 | + if($i3georendermode = 0 || $i3georendermode = 1 || empty($i3georendermode)){ |
359 | + header('Content-Length: '.filesize($nome)); | ||
360 | + header('Content-Type: image/png'); | ||
361 | + header('Cache-Control: max-age=3600, must-revalidate'); | ||
362 | + header('Expires: ' . gmdate('D, d M Y H:i:s', time()+24*60*60) . ' GMT'); | ||
363 | + header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($nome)).' GMT', true, 200); | ||
364 | + fpassthru(fopen($nome, 'rb')); | ||
365 | + } | ||
366 | + else{ | ||
367 | + header("X-Sendfile: $nome"); | ||
368 | + header("Content-type: image/png"); | ||
369 | + } | ||
334 | exit; | 370 | exit; |
335 | } | 371 | } |
336 | } | 372 | } |
classesphp/mapa_openlayers_alternativo.php
@@ -59,6 +59,10 @@ i3geo/classesphp/mapa_openlayers.php | @@ -59,6 +59,10 @@ i3geo/classesphp/mapa_openlayers.php | ||
59 | 59 | ||
60 | */ | 60 | */ |
61 | error_reporting(0); | 61 | error_reporting(0); |
62 | +//para efeitos de compatibilidade | ||
63 | +if (!function_exists('ms_GetVersion')){ | ||
64 | + include_once ("carrega_ext.php"); | ||
65 | +} | ||
62 | //carrega dados da seção, verifica segurança | 66 | //carrega dados da seção, verifica segurança |
63 | inicializa(); | 67 | inicializa(); |
64 | // | 68 | // |
@@ -255,8 +259,8 @@ else{ | @@ -255,8 +259,8 @@ else{ | ||
255 | $status = $l->whichShapes($mapa->extent); | 259 | $status = $l->whichShapes($mapa->extent); |
256 | while ($shape = $l->nextShape()) | 260 | while ($shape = $l->nextShape()) |
257 | { | 261 | { |
258 | - if(in_array($shape->index,$shp)) | ||
259 | - $shape->draw($mapa,$l,$img); | 262 | + if(in_array($shape->index,$shp)) |
263 | + $shape->draw($mapa,$l,$img); | ||
260 | } | 264 | } |
261 | $l->close(); | 265 | $l->close(); |
262 | } | 266 | } |
ms_configura.php
@@ -63,6 +63,17 @@ $i3geomaster = array( | @@ -63,6 +63,17 @@ $i3geomaster = array( | ||
63 | array("usuario"=>"admin", "senha"=>"admin") | 63 | array("usuario"=>"admin", "senha"=>"admin") |
64 | ); | 64 | ); |
65 | /* | 65 | /* |
66 | + Variable: i3georendermode | ||
67 | + | ||
68 | + Opcoes que definem a rotina que sera utilizada para enviar ao navegador as imagens geradas de cada camada | ||
69 | + | ||
70 | + 0 - modo default. Utiliza a funcao imagepng() do PHP para enviar a imagem ao navegador | ||
71 | + 1 - utiliza a funcao do Mapserver saveImage() para enviar a imagem ao navegador (e mais rapida, mas nao funciona em algumas versoes do Mapserver) | ||
72 | + 2 - utiliza X-Sendfile (mais rapido que as outras opcoes) mas exige modificacoes na instalacao do Apache. Veja em: https://tn123.org/mod_xsendfile/ e http://edmarmoretti.blogspot.com.br/ | ||
73 | + */ | ||
74 | +//@TODO documentar no manual de administracao | ||
75 | +$i3georendermode = 0; | ||
76 | +/* | ||
66 | Variavel: linkedinoauth (ainda não implementado) | 77 | Variavel: linkedinoauth (ainda não implementado) |
67 | 78 | ||
68 | Parâmetros registrados no Linkedin para permitir que o i3Geo faça autenticação com base na conta do usuário | 79 | Parâmetros registrados no Linkedin para permitir que o i3Geo faça autenticação com base na conta do usuário |
ms_criamapa.php
@@ -145,7 +145,7 @@ else | @@ -145,7 +145,7 @@ else | ||
145 | if(!isset($funcao)) | 145 | if(!isset($funcao)) |
146 | {ob_end_clean();} | 146 | {ob_end_clean();} |
147 | /* | 147 | /* |
148 | - Carrega as extensões PHP | 148 | +Carrega as extensões PHP |
149 | 149 | ||
150 | Carrega as extensões utilizadas no programa de inicialização. | 150 | Carrega as extensões utilizadas no programa de inicialização. |
151 | A carga das extensões geralmente é necessária nas instalações windows (ms4w) ou quando as mesmas não são carregadas pela própria inicialização do PHP. | 151 | A carga das extensões geralmente é necessária nas instalações windows (ms4w) ou quando as mesmas não são carregadas pela própria inicialização do PHP. |
@@ -232,7 +232,7 @@ criaIndex(); | @@ -232,7 +232,7 @@ criaIndex(); | ||
232 | $tmpfname = $diretorios[0]; | 232 | $tmpfname = $diretorios[0]; |
233 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); | 233 | $protocolo = explode("/",$_SERVER['SERVER_PROTOCOL']); |
234 | /* | 234 | /* |
235 | - Prepara as variáveis que serão incluidas na seção | 235 | +Prepara as variáveis que serão incluidas na seção |
236 | 236 | ||
237 | As variáveis vêm do arquivo ms_configura.php e são armazenadas em uma seção com nome específico para o i3geo. | 237 | As variáveis vêm do arquivo ms_configura.php e são armazenadas em uma seção com nome específico para o i3geo. |
238 | */ | 238 | */ |
@@ -262,24 +262,33 @@ $expoeMapfile_ = $expoeMapfile; | @@ -262,24 +262,33 @@ $expoeMapfile_ = $expoeMapfile; | ||
262 | $googleApiKey_ = $googleApiKey; | 262 | $googleApiKey_ = $googleApiKey; |
263 | $mensagemInicia_ = $mensagemInicia; | 263 | $mensagemInicia_ = $mensagemInicia; |
264 | $interfacePadrao_ = $interfacePadrao; | 264 | $interfacePadrao_ = $interfacePadrao; |
265 | -if(isset($interface)){$interface_ = $interface;} | 265 | +if(isset($interface)) |
266 | +{$interface_ = $interface;} | ||
266 | else{$interface_ = $interfacePadrao;} | 267 | else{$interface_ = $interfacePadrao;} |
267 | -if(isset($kmlurl)){$kmlurl_ = $kmlurl;} | 268 | +if(isset($kmlurl)) |
269 | +{$kmlurl_ = $kmlurl;} | ||
268 | // | 270 | // |
269 | //se houver string de conexão para substituição | 271 | //se houver string de conexão para substituição |
270 | //o modo cgi não irá funcionar | 272 | //o modo cgi não irá funcionar |
271 | // | 273 | // |
272 | if($postgis_mapa != "") | 274 | if($postgis_mapa != "") |
273 | {$utilizacgi = "nao";} | 275 | {$utilizacgi = "nao";} |
274 | -if(!isset($perfil)){$perfil="";} | 276 | +if(!isset($perfil)) |
277 | +{$perfil="";} | ||
275 | $perfil_ = $perfil; | 278 | $perfil_ = $perfil; |
276 | $utilizacgi_ = $utilizacgi; | 279 | $utilizacgi_ = $utilizacgi; |
277 | if ((isset($navegadoresLocais)) && ($navegadoresLocais != "")) | 280 | if ((isset($navegadoresLocais)) && ($navegadoresLocais != "")) |
278 | -$navegadoresLocais_ = "sim"; | 281 | +{$navegadoresLocais_ = "sim";} |
279 | else | 282 | else |
280 | -$navegadoresLocais_ = "nao"; | 283 | +{$navegadoresLocais_ = "nao";} |
284 | +if(empty($i3georendermode)){ | ||
285 | + $i3georendermode_ = 0; | ||
286 | +} | ||
287 | +else{ | ||
288 | + $i3georendermode_ = $i3georendermode; | ||
289 | +} | ||
281 | /* | 290 | /* |
282 | - Inicia a seção | 291 | +Inicia a seção |
283 | 292 | ||
284 | O i3geo inicia uma seção específica no servidor, denominada i3GeoPHP. | 293 | O i3geo inicia uma seção específica no servidor, denominada i3GeoPHP. |
285 | Se já houver uma seção aberta, em função de outro browser estar ativo, cria uma nova. Faz a cópia das variáveis definidas para itens da seção. | 294 | Se já houver uma seção aberta, em função de outro browser estar ativo, cria uma nova. Faz a cópia das variáveis definidas para itens da seção. |
@@ -291,7 +300,7 @@ if (!isset($g_sid)){$g_sid="";} | @@ -291,7 +300,7 @@ if (!isset($g_sid)){$g_sid="";} | ||
291 | if(isset($_SESSION["map_file"]) || $g_sid != "" || $g_sid == "undefined") | 300 | if(isset($_SESSION["map_file"]) || $g_sid != "" || $g_sid == "undefined") |
292 | {session_regenerate_id();$_SESSION = array();} | 301 | {session_regenerate_id();$_SESSION = array();} |
293 | /* | 302 | /* |
294 | - Aguarde | 303 | +Aguarde |
295 | 304 | ||
296 | Monta a apresentação do aguarde. | 305 | Monta a apresentação do aguarde. |
297 | 306 | ||
@@ -330,6 +339,7 @@ $_SESSION['fingerprint'] = md5($fingerprint . session_id()); | @@ -330,6 +339,7 @@ $_SESSION['fingerprint'] = md5($fingerprint . session_id()); | ||
330 | $_SESSION["mapdir"] = $diretorios[1]; | 339 | $_SESSION["mapdir"] = $diretorios[1]; |
331 | $_SESSION["imgdir"] = $diretorios[2]; | 340 | $_SESSION["imgdir"] = $diretorios[2]; |
332 | $_SESSION["contadorsalva"] = 0;//essa variavel e utilizada pela ferramenta telaremota. Toda vez que o mapa e salvo, acrescenta 1 (veja classesphp/mapa_controle.php) | 341 | $_SESSION["contadorsalva"] = 0;//essa variavel e utilizada pela ferramenta telaremota. Toda vez que o mapa e salvo, acrescenta 1 (veja classesphp/mapa_controle.php) |
342 | +$_SESSION["i3georendermode"] = $i3georendermode_; | ||
333 | // | 343 | // |
334 | //pega todas as variáveis da sessão, mesmo as que foram definidas anteriormente | 344 | //pega todas as variáveis da sessão, mesmo as que foram definidas anteriormente |
335 | // | 345 | // |
@@ -338,7 +348,7 @@ foreach(array_keys($_SESSION) as $k) | @@ -338,7 +348,7 @@ foreach(array_keys($_SESSION) as $k) | ||
338 | {eval("\$".$k."='".$_SESSION[$k]."';");} | 348 | {eval("\$".$k."='".$_SESSION[$k]."';");} |
339 | $postgis_mapa = $postgis_mapa_; | 349 | $postgis_mapa = $postgis_mapa_; |
340 | /* | 350 | /* |
341 | - Define os arquivos .map | 351 | +Define os arquivos .map |
342 | 352 | ||
343 | Seleciona os arquivos mapfile que serão carregados como base conforme o tipo de sistema operacional. | 353 | Seleciona os arquivos mapfile que serão carregados como base conforme o tipo de sistema operacional. |
344 | 354 | ||
@@ -372,7 +382,7 @@ if(!isset($base) || $base == "") | @@ -372,7 +382,7 @@ if(!isset($base) || $base == "") | ||
372 | //if(!isset($estadosl)) | 382 | //if(!isset($estadosl)) |
373 | //{$estadosl = "estadosl";} | 383 | //{$estadosl = "estadosl";} |
374 | /* | 384 | /* |
375 | - Cria os objetos map que serão processados | 385 | +Cria os objetos map que serão processados |
376 | 386 | ||
377 | O arquivo definido em $base é lido como um objeto map. Esse objeto será processado para incluir novos layers e alterar outros parâmetros definidos pelo usuário. | 387 | O arquivo definido em $base é lido como um objeto map. Esse objeto será processado para incluir novos layers e alterar outros parâmetros definidos pelo usuário. |
378 | */ | 388 | */ |
@@ -394,7 +404,7 @@ if(!empty($gvsiggvp)){ | @@ -394,7 +404,7 @@ if(!empty($gvsiggvp)){ | ||
394 | incluiMapaGvsig($gvsiggvp,$gvsigview); | 404 | incluiMapaGvsig($gvsiggvp,$gvsigview); |
395 | } | 405 | } |
396 | /* | 406 | /* |
397 | - Parâmetros adicionais. | 407 | +Parâmetros adicionais. |
398 | 408 | ||
399 | Processa os parâmetros para a inicialização verificando se foram passados pela URL ou não. | 409 | Processa os parâmetros para a inicialização verificando se foram passados pela URL ou não. |
400 | */ | 410 | */ |
@@ -1141,7 +1151,7 @@ function incluiTemaWms() | @@ -1141,7 +1151,7 @@ function incluiTemaWms() | ||
1141 | else | 1151 | else |
1142 | $nome = $nome_wms; | 1152 | $nome = $nome_wms; |
1143 | $m = new Mapa($tmpfname); | 1153 | $m = new Mapa($tmpfname); |
1144 | - $m->adicionatemawms($layer_wms,$url_wms,$style_wms,$srs_wms,$image_wms,$locaplic,"",$versao_wms,$nome,"","","","","nao","text/plain",""); | 1154 | + $m->adicionatemawms($layer_wms,$url_wms,$style_wms,$srs_wms,$image_wms,$locaplic,"",$versao_wms,$nome,"","","","","nao","text/plain",""); |
1145 | $salvo = $m->salva($tmpfname); | 1155 | $salvo = $m->salva($tmpfname); |
1146 | //echo $tmpfname;exit; | 1156 | //echo $tmpfname;exit; |
1147 | erroCriacao(); | 1157 | erroCriacao(); |