From c232d61cc305875c8ccfaeab9576e2dff64a9386 Mon Sep 17 00:00:00 2001 From: Edmar Moretti Date: Mon, 3 Dec 2007 15:26:15 +0000 Subject: [PATCH] Versão mobile funcionando --- .project | 11 +++++++++++ aplicmap/geral.htm | 1 - imagens/banner_amazonia.png | Bin 43567 -> 0 bytes imagens/banner_biodiversidade.png | Bin 11090 -> 0 bytes imagens/banner_cprm.png | Bin 16341 -> 0 bytes imagens/banner_estados.png | Bin 0 -> 6303 bytes imagens/banner_limites.png | Bin 6553 -> 0 bytes imagens/banner_probio.png | Bin 23370 -> 0 bytes imagens/banner_probio2.png | Bin 22208 -> 0 bytes mobile/desligar.php | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ mobile/in.png | Bin 763 -> 0 bytes mobile/index.htm | 2 +- mobile/index.html | 2 +- mobile/index.php | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ mobile/inicia.php | 17 +++++++++++++++++ mobile/l.png | Bin 535 -> 0 bytes mobile/ligar.php | 75 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ mobile/mobile.php | 403 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- mobile/n.png | Bin 520 -> 0 bytes mobile/o.png | Bin 513 -> 0 bytes mobile/out.png | Bin 747 -> 0 bytes mobile/s.png | Bin 556 -> 0 bytes ms_criamapa.php | 10 ++++++---- 23 files changed, 394 insertions(+), 255 deletions(-) create mode 100644 .project create mode 100644 imagens/banner_estados.png create mode 100644 mobile/desligar.php create mode 100644 mobile/index.php create mode 100644 mobile/inicia.php create mode 100644 mobile/ligar.php diff --git a/.project b/.project new file mode 100644 index 0000000..b82c93b --- /dev/null +++ b/.project @@ -0,0 +1,11 @@ + + + i3geo_svn + + + + + + + + diff --git a/aplicmap/geral.htm b/aplicmap/geral.htm index 9a803a4..ce91a92 100644 --- a/aplicmap/geral.htm +++ b/aplicmap/geral.htm @@ -250,7 +250,6 @@ g_localimg = "http://"+window.location.host+"/i3geo/imagens"; g_diminuixN = 20; */ - /* Variable: g_diminuiyM diff --git a/imagens/banner_amazonia.png b/imagens/banner_amazonia.png index ca2d859..4625963 100644 Binary files a/imagens/banner_amazonia.png and b/imagens/banner_amazonia.png differ diff --git a/imagens/banner_biodiversidade.png b/imagens/banner_biodiversidade.png index a439b8d..eb7908a 100644 Binary files a/imagens/banner_biodiversidade.png and b/imagens/banner_biodiversidade.png differ diff --git a/imagens/banner_cprm.png b/imagens/banner_cprm.png index 2f1d68d..45ca047 100644 Binary files a/imagens/banner_cprm.png and b/imagens/banner_cprm.png differ diff --git a/imagens/banner_estados.png b/imagens/banner_estados.png new file mode 100644 index 0000000..a9b4636 Binary files /dev/null and b/imagens/banner_estados.png differ diff --git a/imagens/banner_limites.png b/imagens/banner_limites.png index 3f96af9..280e4cb 100644 Binary files a/imagens/banner_limites.png and b/imagens/banner_limites.png differ diff --git a/imagens/banner_probio.png b/imagens/banner_probio.png index 4ab8064..f28e3b9 100644 Binary files a/imagens/banner_probio.png and b/imagens/banner_probio.png differ diff --git a/imagens/banner_probio2.png b/imagens/banner_probio2.png index ceaa4e7..5a39aa1 100644 Binary files a/imagens/banner_probio2.png and b/imagens/banner_probio2.png differ diff --git a/mobile/desligar.php b/mobile/desligar.php new file mode 100644 index 0000000..edc70dd --- /dev/null +++ b/mobile/desligar.php @@ -0,0 +1,75 @@ + + + + +
+ + + +
+ligaDesligaTemas("","$tema"); + $m->salva(); +} +$m = New Mapa($tmpfname); +$par = $m->parametrosTemas(); +$par = mb_convert_encoding($par,"ISO-8859-1","UTF-8"); +$par = explode("'",$par); +$par = explode(";",$par[1]); +echo "Escolha o tema que vc não quer ver no mapa:

"; +$existe = false; +foreach($par as $p) +{ + $p = explode("*",$p); + if($p[1] == 2) + { + $existe=true; + echo "".$p[2]."
"; + } +} +if (!$existe) +echo "Nenhum tema disponível.
"; +?> +
+ + + + diff --git a/mobile/in.png b/mobile/in.png index c496f2f..b796802 100644 Binary files a/mobile/in.png and b/mobile/in.png differ diff --git a/mobile/index.htm b/mobile/index.htm index 67e3bfb..29a6b25 100644 --- a/mobile/index.htm +++ b/mobile/index.htm @@ -7,5 +7,5 @@ Redireciona o navegador para o ms_criamapa.php File: index.htm */ -window.location="../ms_criamapa.php?interface=mobile/mobile.php" +window.location="index.php" \ No newline at end of file diff --git a/mobile/index.html b/mobile/index.html index d980332..09124b3 100644 --- a/mobile/index.html +++ b/mobile/index.html @@ -20,6 +20,6 @@ Redireciona o navegador para o ms_criamapa.php File: index.html */ -window.location="../ms_criamapa.php?interface=mobile/mobile.php" +window.location="index.php" \ No newline at end of file diff --git a/mobile/index.php b/mobile/index.php new file mode 100644 index 0000000..64bf61d --- /dev/null +++ b/mobile/index.php @@ -0,0 +1,53 @@ + + + +
+ +pegaListaDeMapas($locmapas); +foreach($mapas["mapas"] as $obj) +{ + echo "".$obj["NOME"]."

"; +} +?> +
+ + + +
+
+

O i3Geo é um software livre desenvolvido pelo Ministério do Meio Ambiente. Veja: +http://mapas.mma.gov.br

+ + + \ No newline at end of file diff --git a/mobile/inicia.php b/mobile/inicia.php new file mode 100644 index 0000000..57df940 --- /dev/null +++ b/mobile/inicia.php @@ -0,0 +1,17 @@ +setsize($wmobile,$hmobile); + $mapa->save($tmpfname); + $tipo = "inicia"; + include("mobile.php"); + exit; +} +?> \ No newline at end of file diff --git a/mobile/l.png b/mobile/l.png index b0d3314..fa02b86 100644 Binary files a/mobile/l.png and b/mobile/l.png differ diff --git a/mobile/ligar.php b/mobile/ligar.php new file mode 100644 index 0000000..b2b1cb8 --- /dev/null +++ b/mobile/ligar.php @@ -0,0 +1,75 @@ + + + + +
+ + + +
+ligaDesligaTemas($tema,""); + $m->salva(); +} +$m = New Mapa($tmpfname); +$par = $m->parametrosTemas(); +$par = mb_convert_encoding($par,"ISO-8859-1","UTF-8"); +$par = explode("'",$par); +$par = explode(";",$par[1]); +echo "Escolha o tema que vc quer ver no mapa:

"; +$existe = false; +foreach($par as $p) +{ + $p = explode("*",$p); + if($p[1] != 2) + { + $existe=true; + echo "".$p[2]."
"; + } +} +if (!$existe) +echo "Nenhum tema disponível.
"; +?> +
+ + + + diff --git a/mobile/mobile.php b/mobile/mobile.php index 7638237..93723cb 100644 --- a/mobile/mobile.php +++ b/mobile/mobile.php @@ -1,253 +1,160 @@ -pegaListaDeMapas($locmapas); - echo - " - -
- -
- "; - foreach($mapas["mapas"] as $obj) - { - echo "
".$obj["NOME"]."

"; - $i = $obj["IMAGEM"]; - echo "
"; - } - echo " -
- - - - - -
- - - "; -} -else -{ - include("../ms_configura.php"); - if (isset($opcoes) && $opcoes != "") - { - echo "ok"; - exit; - } - if (isset($ligar)) - { - $temasa = $ligar; - incluiTemasIniciais2(); - } - $mapa = ms_newMapObj($tmpfname); - if ($tipo=="") - { - $mapa->setsize($w-5,$h-5); - $mapa->save($tmpfname); - } - if ($tipo=="zoommais") - { - include("../classesphp/classe_navegacao.php"); - $m = new Navegacao($tmpfname); - $m->aproxima(2); - $m->salva(); - } - if ($tipo=="zoommenos") - { - include("../classesphp/classe_navegacao.php"); - $m = new Navegacao($tmpfname); - $m->afasta(2); - $m->salva(); - } - if ($tipo=="norte") - { - include("../classesphp/classe_navegacao.php"); - $m = new Navegacao($tmpfname); - $x = $mapa->width; - $x = $x/2; - $y = 0; - $m->pan($x,$y,"",""); - $m->salva(); - } - if ($tipo=="sul") - { - include("../classesphp/classe_navegacao.php"); - $m = new Navegacao($tmpfname); - $x = $mapa->width; - $x = $x/2; - $y = $mapa->height; - $m->pan($x,$y,"",""); - $m->salva(); - } - if ($tipo=="leste") - { - include("../classesphp/classe_navegacao.php"); - $m = new Navegacao($tmpfname); - $x = $mapa->width; - $y = $mapa->height/2; - $m->pan($x,$y,"",""); - $m->salva(); - } - if ($tipo=="oeste") - { - include("../classesphp/classe_navegacao.php"); - $m = new Navegacao($tmpfname); - $x = 0; - $y = $mapa->height/2; - $m->pan($x,$y,"",""); - $m->salva(); - } - $nomeimagem = desenhaImagem(); - retornaMapa(); + + + -function retornaMapa() -{ - global $nomeimagem,$tmpfname,$tipo; - echo - " - -
-   -   -   -   -   -   - -
- -
- - - -
+ - - - "; -} -function desenhaImagem() -{ - global $tmpfname; - $mapa = ms_newMapObj($tmpfname); - $imgo = $mapa->draw(); - $nome = ($imgo->imagepath).nomeRandomico().".png"; - $imgo->saveImage($nome); - $nome = ($imgo->imageurl).basename($nome); - $imgo->free(); - return $nome; -} -function incluiTemasIniciais2() -{ - global $temasa,$temasaplic,$temasdir,$tmpfname; - $mapa = ms_newMapObj($tmpfname); - $estadosl = "estadosl"; - if (!isset($temasa)){$temasa = $estadosl;} - $temasa = str_replace(','," ",$temasa); - $alayers = explode(" ",$temasa); - foreach ($alayers as $arqt) - { - $arqtemp = ""; - $arqt = trim($arqt); - if ($arqt == "") - {continue;} - if (file_exists($arqt)) - {$arqtemp = $arqt;} - if ((strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) && (file_exists($temasaplic."\\".$arqt.".map"))) - {$arqtemp = $temasaplic."\\".$arqt.".map";} - elseif (file_exists($temasaplic."/".$arqt.".map")) - {$arqtemp = $temasaplic."/".$arqt.".map";} - if ((strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) && (file_exists($temasdir."\\".$arqt.".map"))) - {$arqtemp = $temasdir."\\".$arqt.".map";} - elseif (file_exists($temasdir."/".$arqt.".map")) - {$arqtemp = $temasdir."/".$arqt.".map";} - if (($arqtemp != "") && (file_exists($arqtemp))) - { - $maptemp = @ms_newMapObj($arqtemp); - for($i=0;$i<($maptemp->numlayers);$i++) - { - $layern = $maptemp->getLayer($i); - $layern->setmetadata("NOMEORIGINAL",$layern->name); - if ($layern->name == "estadosl") - {$layern->set("data",$temasaplic."/dados/estados.shp");} - $layern->set("status",MS_DEFAULT); - ms_newLayerObj($mapa, $layern); - } - } - } - $mapa->save($tmpfname); +include_once ("../classesphp/pega_variaveis.php"); +include_once("../classesphp/carrega_ext.php"); +require_once("../classesphp/funcoes_gerais.php"); +include("../ms_configura.php"); +if ($tipo=="zoommais") +{ + include("../classesphp/classe_navegacao.php"); + $m = new Navegacao($tmpfname); + $m->aproxima(3); + $m->salva(); +} +if ($tipo=="zoommenos") +{ + include("../classesphp/classe_navegacao.php"); + $m = new Navegacao($tmpfname); + $m->afasta(3); + $m->salva(); +} +if ($tipo=="norte") +{ + include("../classesphp/classe_navegacao.php"); + $m = new Navegacao($tmpfname); + $x = $m->mapa->width; + $x = $x/2; + $y = 0; + $m->pan($x,$y,"",""); + $m->salva(); +} +if ($tipo=="sul") +{ + include("../classesphp/classe_navegacao.php"); + $m = new Navegacao($tmpfname); + $x = $m->mapa->width; + $x = $x/2; + $y = $m->mapa->height; + $m->pan($x,$y,"",""); + $m->salva(); +} +if ($tipo=="leste") +{ + include("../classesphp/classe_navegacao.php"); + $m = new Navegacao($tmpfname); + $x = $m->mapa->width; + $y = $m->mapa->height/2; + $m->pan($x,$y,"",""); + $m->salva(); +} +if ($tipo=="oeste") +{ + include("../classesphp/classe_navegacao.php"); + $m = new Navegacao($tmpfname); + $x = 0; + $y = $m->mapa->height/2; + $m->pan($x,$y,"",""); + $m->salva(); } +if ($tipo=="ligar") +{ + include("ligar.php"); + exit; +} +if ($tipo=="desligar") +{ + include("desligar.php"); + exit; +} +$mapa = ms_newMapObj($tmpfname); +$w = $mapa->width; +$h = $mapa->height; -?> \ No newline at end of file +$imgo = $mapa->draw(); +$nome = ($imgo->imagepath).nomeRandomico().".png"; +$imgo->saveImage($nome); +$nomeimagem = ($imgo->imageurl).basename($nome); +?> +
+ + + + + + + +
+
+ + +
+ + + + diff --git a/mobile/n.png b/mobile/n.png index 5a9fab9..abe4940 100644 Binary files a/mobile/n.png and b/mobile/n.png differ diff --git a/mobile/o.png b/mobile/o.png index 47b2d17..371010c 100644 Binary files a/mobile/o.png and b/mobile/o.png differ diff --git a/mobile/out.png b/mobile/out.png index 203f299..27193b4 100644 Binary files a/mobile/out.png and b/mobile/out.png differ diff --git a/mobile/s.png b/mobile/s.png index 4b33e26..8398a56 100644 Binary files a/mobile/s.png and b/mobile/s.png differ diff --git a/ms_criamapa.php b/ms_criamapa.php index 1708053..910715a 100644 --- a/ms_criamapa.php +++ b/ms_criamapa.php @@ -78,6 +78,11 @@ require_once ($caminho."classesphp/pega_variaveis.php"); require_once ($caminho."classesphp/funcoes_gerais.php"); require_once ($caminho."ms_configura.php"); // +//monta a apresentação do aguarde +// +if (!isset($executa)) +{mostraAguarde();} +// //define a variável $mapext que define a extensão geográfica do mapa // if (!isset($mapext)){$mapext="";} @@ -143,10 +148,7 @@ $_SESSION["utilizacgi"] = $utilizacgi_; // foreach(array_keys($_SESSION) as $k) {eval("\$".$k."='".$_SESSION[$k]."';");} -// -//monta a apresentação do aguarde -// -mostraAguarde(); + // //define os arquivos .map conforme o tipo de sistema operacional // -- libgit2 0.21.2