Commit bb1ff43cead6641c51a6942ac2a04347b3c83a66
1 parent
0af3c6aa
Exists in
master
and in
7 other branches
adicionada busca no i3geo mobile
Showing
6 changed files
with
283 additions
and
12 deletions
Show diff stats
mobile/desligar.php
| ... | ... | @@ -0,0 +1,48 @@ |
| 1 | +<?php | |
| 2 | +require_once("../classesphp/funcoes_gerais.php"); | |
| 3 | +include_once ("../classesphp/pega_variaveis.php"); | |
| 4 | +include_once("../classesphp/carrega_ext.php"); | |
| 5 | +include("../classesphp/classe_escala.php"); | |
| 6 | +?> | |
| 7 | +<html> | |
| 8 | +<style> | |
| 9 | +body | |
| 10 | +{ | |
| 11 | + font:14pt arial,helvetica,clean,sans-serif; | |
| 12 | + color:rgb(100,100,100); | |
| 13 | +} | |
| 14 | +p | |
| 15 | +{ | |
| 16 | + font:12pt arial,helvetica,clean,sans-serif; | |
| 17 | + color:black; | |
| 18 | +} | |
| 19 | +input | |
| 20 | +{ | |
| 21 | + font:14pt arial,helvetica,clean,sans-serif; | |
| 22 | + color:black; | |
| 23 | + cursor:pointer; | |
| 24 | + background-color:white; | |
| 25 | +} | |
| 26 | +</style> | |
| 27 | +<body> | |
| 28 | +<form id='f' action='mobile.php?' method='get'> | |
| 29 | + <input type='hidden' name='tmpfname' value='<?php echo $tmpfname; ?>' /> | |
| 30 | + <input id='tipo' type=hidden name='tipo' value='retorno' /> | |
| 31 | + <input id='tema' type=hidden name='tema' value='' /> | |
| 32 | +</form> | |
| 33 | +<input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /> | |
| 34 | +</body> | |
| 35 | +<script> | |
| 36 | +function retorno() | |
| 37 | +{ | |
| 38 | + document.getElementById('tipo').value='retorno'; | |
| 39 | + document.getElementById('f').action = 'mobile.php'; | |
| 40 | + document.getElementById('f').submit(); | |
| 41 | +} | |
| 42 | +</script> | |
| 43 | +</html> | |
| 44 | +<?php | |
| 45 | +$m = new Escala($tmpfname); | |
| 46 | +$escala = explode("'",$m->retornaBarraEscala()); | |
| 47 | +echo "<br><br><img src='$escala[1]' />"; | |
| 48 | +?> | |
| 0 | 49 | \ No newline at end of file | ... | ... |
| ... | ... | @@ -0,0 +1,51 @@ |
| 1 | +<?php | |
| 2 | +require_once("../classesphp/funcoes_gerais.php"); | |
| 3 | +include_once ("../classesphp/pega_variaveis.php"); | |
| 4 | +include_once("../classesphp/carrega_ext.php"); | |
| 5 | +include("../classesphp/classe_legenda.php"); | |
| 6 | +include("../ms_configura.php"); | |
| 7 | +?> | |
| 8 | +<html> | |
| 9 | +<style> | |
| 10 | +body | |
| 11 | +{ | |
| 12 | + font:14pt arial,helvetica,clean,sans-serif; | |
| 13 | + color:rgb(100,100,100); | |
| 14 | +} | |
| 15 | +p | |
| 16 | +{ | |
| 17 | + font:12pt arial,helvetica,clean,sans-serif; | |
| 18 | + color:black; | |
| 19 | +} | |
| 20 | +input | |
| 21 | +{ | |
| 22 | + font:14pt arial,helvetica,clean,sans-serif; | |
| 23 | + color:black; | |
| 24 | + cursor:pointer; | |
| 25 | + background-color:white; | |
| 26 | +} | |
| 27 | +</style> | |
| 28 | +<body> | |
| 29 | +<form id='f' action='mobile.php?' method='get'> | |
| 30 | + <input type='hidden' name='tmpfname' value='<?php echo $tmpfname; ?>' /> | |
| 31 | + <input id='tipo' type=hidden name='tipo' value='retorno' /> | |
| 32 | + <input id='tema' type=hidden name='tema' value='' /> | |
| 33 | +</form> | |
| 34 | +<input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /> | |
| 35 | +<?php | |
| 36 | +$m = new Legenda($tmpfname,$locaplic,"",$template); | |
| 37 | +$r = $m->criaLegenda(); | |
| 38 | +if(!$r){$r = "erro. Legenda nao disponivel";} | |
| 39 | +$r = mb_convert_encoding($r,"ISO-8859-1","UTF-8"); | |
| 40 | +echo $r; | |
| 41 | +?> | |
| 42 | +</body> | |
| 43 | +<script> | |
| 44 | +function retorno() | |
| 45 | +{ | |
| 46 | + document.getElementById('tipo').value='retorno'; | |
| 47 | + document.getElementById('f').action = 'mobile.php'; | |
| 48 | + document.getElementById('f').submit(); | |
| 49 | +} | |
| 50 | +</script> | |
| 51 | +</html> | |
| 0 | 52 | \ No newline at end of file | ... | ... |
mobile/ligar.php
| ... | ... | @@ -0,0 +1,167 @@ |
| 1 | +<?php | |
| 2 | +error_reporting(0); | |
| 3 | +require_once("../classesphp/funcoes_gerais.php"); | |
| 4 | +include_once ("../classesphp/pega_variaveis.php"); | |
| 5 | +include_once("../classesphp/carrega_ext.php"); | |
| 6 | +include_once("../classesphp/funcoes_gerais.php"); | |
| 7 | +include_once("../classesphp/classe_mapa.php"); | |
| 8 | +include_once("../ms_configura.php"); | |
| 9 | +if (!isset($texto)) | |
| 10 | +{$texto = "digite o texto";} | |
| 11 | +?> | |
| 12 | +<html> | |
| 13 | +<style> | |
| 14 | +body | |
| 15 | +{ | |
| 16 | + font:14pt arial,helvetica,clean,sans-serif; | |
| 17 | + color:rgb(100,100,100); | |
| 18 | +} | |
| 19 | +p | |
| 20 | +{ | |
| 21 | + font:12pt arial,helvetica,clean,sans-serif; | |
| 22 | + color:black; | |
| 23 | +} | |
| 24 | +input | |
| 25 | +{ | |
| 26 | + font:14pt arial,helvetica,clean,sans-serif; | |
| 27 | + color:black; | |
| 28 | + cursor:pointer; | |
| 29 | + background-color:white; | |
| 30 | +} | |
| 31 | +</style> | |
| 32 | +<body> | |
| 33 | +<input type='button' value='retorna' style='cursor:pointer;' onclick='retorno()' /><br><br> | |
| 34 | +<form id='f' action='localizar.php?' method='get'> | |
| 35 | + <input type='hidden' id='wkt' name='wkt' value='' /> | |
| 36 | + <input type='hidden' id='layer' name='layer' value='' /> | |
| 37 | + <input type='hidden' id='gid' name='gid' value='' /> | |
| 38 | + <input type='hidden' id='nome' name='nome' value='' /> | |
| 39 | + <input type='hidden' name='tmpfname' value='<?php echo $tmpfname; ?>' /> | |
| 40 | + <input id='tipo' type=hidden name='tipo' value='retorno' /> | |
| 41 | + <input type='text' name='texto' value='<?php echo $texto;?>' style='cursor:text;' /><br> | |
| 42 | +</form> | |
| 43 | +<input type='button' id='localizar' value='localizar' style='cursor:pointer;' onclick='localizar()' /><br><br> | |
| 44 | + | |
| 45 | +<?php | |
| 46 | +if ($tipo == 'executa') | |
| 47 | +{ | |
| 48 | + $r = buscaRapida("http://mapas.mma.gov.br/webservices/geonames.php",$texto); | |
| 49 | + | |
| 50 | + foreach($r["geonames"] as $linha) | |
| 51 | + { | |
| 52 | + $lugares = $linha["lugares"]; | |
| 53 | + echo $linha["tema"]."<br>"; | |
| 54 | + $layer = $linha["layer"]; | |
| 55 | + foreach ($lugares as $lugar) | |
| 56 | + { | |
| 57 | + $wkt = $lugar["limite"]; | |
| 58 | + $wkt = str_replace("POLYGON","",$wkt); | |
| 59 | + $wkt = explode("(",$wkt); | |
| 60 | + $wkt = explode(")",$wkt[2]); | |
| 61 | + $wkt = explode(",",$wkt[0]); | |
| 62 | + for($w=0;$w<count($wkt); $w++) | |
| 63 | + { | |
| 64 | + $temp = explode(" ",$wkt[$w]); | |
| 65 | + $x[] = $temp[0]; | |
| 66 | + $y[] = $temp[1]; | |
| 67 | + } | |
| 68 | + $xMin = min($x); | |
| 69 | + $xMax = max($x); | |
| 70 | + $yMin = min($y); | |
| 71 | + $yMax = max($y); | |
| 72 | + $wkt = $xMin.",".$yMin.",".$xMax.",".$yMax; | |
| 73 | + $gid = $lugar["gid"]; | |
| 74 | + $nome = mb_convert_encoding($lugar["nome"],"ISO-8859-1","UTF-8"); | |
| 75 | + echo "<input type='radio' onclick=\"zoom('".$wkt."','".$layer."','".$gid."','".$nome."')\" />".$nome."<br>"; | |
| 76 | + } | |
| 77 | + | |
| 78 | + } | |
| 79 | +} | |
| 80 | +if($tipo == "zoom") | |
| 81 | +{ | |
| 82 | + $mapa = ms_newMapObj($tmpfname); | |
| 83 | + $ext = $mapa->extent; | |
| 84 | + $wkt = explode(",",$wkt); | |
| 85 | + $ext->setextent($wkt[0],$wkt[1],$wkt[2],$wkt[3]); | |
| 86 | + $mapa->save($tmpfname); | |
| 87 | + $servico = "http://mapas.mma.gov.br/webservices/geonameswms.php?gid=".$gid; | |
| 88 | + $nomecamada = $nome." - ".$layer; | |
| 89 | + $nome = "default"; | |
| 90 | + $proj = "EPSG:4291"; | |
| 91 | + $formato = "image/png"; | |
| 92 | + $suportasld = "nao"; | |
| 93 | + $versao = "1.1.0"; | |
| 94 | + $m = new Mapa($tmpfname); | |
| 95 | + $m->adicionatemawms($layer,$servico,$nome,$proj,$formato,$locaplic,$tipo,$versao,$nomecamada,$dir_tmp,$imgdir,$imgurl,$tiporep,$suportasld,$formatosinfo); | |
| 96 | + $m->salva(); | |
| 97 | + //echo $tmpfname;exit; | |
| 98 | + $urln = "mobile.php?tmpfname=".$tmpfname; | |
| 99 | + echo "<meta http-equiv='refresh' content='0;url=$urln'>"; | |
| 100 | + | |
| 101 | +/* | |
| 102 | + var re = new RegExp("POLYGON", "g") | |
| 103 | + wkt = wkt.replace(re,"") | |
| 104 | + wkt = wkt.split("(")[2].split(")")[0] | |
| 105 | + wkt = wkt.split(","); | |
| 106 | + x = new Array(); | |
| 107 | + y = new Array(); | |
| 108 | + for (w=0;w<wkt.length; w++) | |
| 109 | + { | |
| 110 | + temp = wkt[w].split(" "); | |
| 111 | + x.push(temp[0]) | |
| 112 | + y.push(temp[1]) | |
| 113 | + } | |
| 114 | + x.sort(sortNumber) | |
| 115 | + xMin = x[0] | |
| 116 | + xMax = x[(x.length)-1] | |
| 117 | + y.sort(sortNumber) | |
| 118 | + yMin = y[0] | |
| 119 | + yMax = y[(y.length)-1] | |
| 120 | + var ext = xMin+" "+yMin+" "+xMax+" "+yMax | |
| 121 | + window.parent.objaguarde.abre("ajaxredesenha","Aguarde..."); | |
| 122 | + var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=mudaext&ext="+ext+"&g_sid="+g_sid; | |
| 123 | + var cp = new cpaint(); | |
| 124 | + //cp.set_debug(2) | |
| 125 | + cp.set_response_type("JSON"); | |
| 126 | + cp.call(p,"mudaExtensao",adicionaCamada(layer,gid,nm)); | |
| 127 | + var adicionaCamada = function(layer,gid,nm) | |
| 128 | + { | |
| 129 | + var s = "&tema="+layer | |
| 130 | + s += "&servico=http://mapas.mma.gov.br/webservices/geonameswms.php?gid="+gid+"&"; | |
| 131 | + s += "&nome=default" | |
| 132 | + s += "&proj=EPSG:4291&formato=image/png&nomecamada="+nm+" - "+layer | |
| 133 | + s += "&suportasld=nao&versao=1.1.0" | |
| 134 | + var p = g_locaplic+"/classesphp/mapa_controle.php?funcao=adicionatemawms&g_sid="+g_sid+s; | |
| 135 | + var cp = new cpaint(); | |
| 136 | + //cp.set_debug(2) | |
| 137 | + cp.set_response_type("JSON"); | |
| 138 | + cp.call(p,"mudaExtensao",window.parent.ajaxredesenha); | |
| 139 | + } | |
| 140 | +*/ | |
| 141 | +} | |
| 142 | +?> | |
| 143 | +</body> | |
| 144 | +<script> | |
| 145 | +function retorno() | |
| 146 | +{ | |
| 147 | + document.getElementById('tipo').value='retorno'; | |
| 148 | + document.getElementById('f').action = 'mobile.php'; | |
| 149 | + document.getElementById('f').submit(); | |
| 150 | +} | |
| 151 | +function localizar() | |
| 152 | +{ | |
| 153 | + document.getElementById('tipo').value='executa'; | |
| 154 | + document.getElementById('f').submit(); | |
| 155 | +} | |
| 156 | +function zoom(wkt,layer,gid,nome) | |
| 157 | +{ | |
| 158 | + document.getElementById('tipo').value='zoom'; | |
| 159 | + document.getElementById('wkt').value=wkt; | |
| 160 | + document.getElementById('layer').value=layer; | |
| 161 | + document.getElementById('gid').value=gid; | |
| 162 | + document.getElementById('nome').value=nome; | |
| 163 | + document.getElementById('f').submit(); | |
| 164 | +} | |
| 165 | + | |
| 166 | +</script> | |
| 167 | +</html> | |
| 0 | 168 | \ No newline at end of file | ... | ... |
mobile/mobile.php
| ... | ... | @@ -79,16 +79,6 @@ if ($tipo=="oeste") |
| 79 | 79 | $m->pan($x,$y,"",""); |
| 80 | 80 | $m->salva(); |
| 81 | 81 | } |
| 82 | -if ($tipo=="ligar") | |
| 83 | -{ | |
| 84 | - include("ligar.php"); | |
| 85 | - exit; | |
| 86 | -} | |
| 87 | -if ($tipo=="desligar") | |
| 88 | -{ | |
| 89 | - include("desligar.php"); | |
| 90 | - exit; | |
| 91 | -} | |
| 92 | 82 | $mapa = ms_newMapObj($tmpfname); |
| 93 | 83 | $w = $mapa->width; |
| 94 | 84 | $h = $mapa->height; |
| ... | ... | @@ -102,7 +92,7 @@ else |
| 102 | 92 | $nomeimagem = ($imgo->imageurl).basename($nome); |
| 103 | 93 | } |
| 104 | 94 | ?> |
| 105 | -<div id='botoes' > | |
| 95 | +<div id='botoes' style="position:relative;top:1px;left:1px" > | |
| 106 | 96 | <input type='button' value='+' onclick='zoommais()' /> |
| 107 | 97 | <input type='button' value='-' onclick='zoommenos()' /> |
| 108 | 98 | <input type='button' value='N' onclick='norte()' /> |
| ... | ... | @@ -113,13 +103,16 @@ else |
| 113 | 103 | <option value=''>Opções</option> |
| 114 | 104 | <option value='ligar'>ligar</option> |
| 115 | 105 | <option value='desligar'>desligar</option> |
| 106 | + <option value='legenda'>legenda</option> | |
| 107 | + <option value='escala'>escala</option> | |
| 108 | + <option value='localizar'>localizar</option> | |
| 116 | 109 | </select> |
| 117 | 110 | </div> |
| 118 | 111 | <form id='f' action='mobile.php?' method='get'> |
| 119 | 112 | <input type='hidden' name='tmpfname' value='<?php echo $tmpfname;?>' /> |
| 120 | 113 | <input id='tipo' type=hidden name='tipo' value='' /> |
| 121 | 114 | </form> |
| 122 | -<img id='mapa' src='<?php echo $nomeimagem; ?>' /> | |
| 115 | +<img id='mapa' style="position:relative;top:1px;left:1px" src='<?php echo $nomeimagem; ?>' /> | |
| 123 | 116 | </body> |
| 124 | 117 | <script> |
| 125 | 118 | var app = navigator.appName.substring(0,1); |
| ... | ... | @@ -158,6 +151,16 @@ function oeste() |
| 158 | 151 | function op(valor) |
| 159 | 152 | { |
| 160 | 153 | document.getElementById('tipo').value = valor; |
| 154 | + if (valor=="escala") | |
| 155 | + {document.getElementById('f').action = "escala.php?"} | |
| 156 | + if (valor=="ligar") | |
| 157 | + {document.getElementById('f').action = "ligar.php?"} | |
| 158 | + if (valor=="desligar") | |
| 159 | + {document.getElementById('f').action = "desligar.php?"} | |
| 160 | + if (valor=="legenda") | |
| 161 | + {document.getElementById('f').action = "legenda.php?"} | |
| 162 | + if (valor=="localizar") | |
| 163 | + {document.getElementById('f').action = "localizar.php?"} | |
| 161 | 164 | document.getElementById('f').submit(); |
| 162 | 165 | } |
| 163 | 166 | </script> | ... | ... |