Commit c6f036e7f41f2807ffaf188b340bc544080ba67b
1 parent
df91d95e
Exists in
master
and in
7 other branches
Inclusão de opção de entrada de pontos por direção e distância
Showing
4 changed files
with
96 additions
and
16 deletions
Show diff stats
classesphp/classe_analise.php
@@ -915,12 +915,13 @@ $locaplic - Localização do I3geo. | @@ -915,12 +915,13 @@ $locaplic - Localização do I3geo. | ||
915 | if ($layerPt->getNumresults() > 0){$existesel = "sim";} | 915 | if ($layerPt->getNumresults() > 0){$existesel = "sim";} |
916 | if ($existesel == "nao") | 916 | if ($existesel == "nao") |
917 | { | 917 | { |
918 | - $qstring = "/.*/"; | ||
919 | - if($layerPt->connectiontype == MS_POSTGIS) | ||
920 | - {$layerPt->queryByrect($this->mapa->extent);} | 918 | + $layerPt->queryByrect($this->mapa->extent); |
919 | + //$qstring = "/.*/"; | ||
920 | + //if($layerPt->connectiontype == MS_POSTGIS) | ||
921 | + //{$layerPt->queryByrect($this->mapa->extent);} | ||
921 | //$qstring = $itemspt[0].' ~* \'^.\' '; | 922 | //$qstring = $itemspt[0].' ~* \'^.\' '; |
922 | - else | ||
923 | - {$layerPt->queryByAttributes($itemspt[0], $qstring, 1);} | 923 | + //else |
924 | + //{$layerPt->queryByAttributes($itemspt[0], $qstring, 1);} | ||
924 | } | 925 | } |
925 | $res_count = $layerPt->getNumresults(); | 926 | $res_count = $layerPt->getNumresults(); |
926 | $pontos = array(); | 927 | $pontos = array(); |
classesphp/mapa_controle.php
@@ -1434,6 +1434,20 @@ Include: | @@ -1434,6 +1434,20 @@ Include: | ||
1434 | redesenhaMapa(); | 1434 | redesenhaMapa(); |
1435 | break; | 1435 | break; |
1436 | /* | 1436 | /* |
1437 | +Property: insereSHPdd | ||
1438 | + | ||
1439 | +Insere um ponto em um shape file tendo como referência o último ponto existente no tema, a direção e a distância. | ||
1440 | + | ||
1441 | +Include: | ||
1442 | +<classe_shp.php> | ||
1443 | +*/ | ||
1444 | + case "pegaxyUltimoPonto": | ||
1445 | + include_once("classe_shp.php"); | ||
1446 | + $m = new SHP($map_file,$tema); | ||
1447 | + $cp->set_data($m->ultimoXY()); | ||
1448 | + break; | ||
1449 | + | ||
1450 | +/* | ||
1437 | Property: insereSHPgrafico | 1451 | Property: insereSHPgrafico |
1438 | 1452 | ||
1439 | Cria um gráfico e insere no mapa em um local clicado no mapa. | 1453 | Cria um gráfico e insere no mapa em um local clicado no mapa. |
ferramentas/inserexy2/index.htm
@@ -9,10 +9,11 @@ | @@ -9,10 +9,11 @@ | ||
9 | <body class="yui-skin-sam" > | 9 | <body class="yui-skin-sam" > |
10 | <div class=verdeescuro style="top:0px;cursor:pointer;left:0px;"> | 10 | <div class=verdeescuro style="top:0px;cursor:pointer;left:0px;"> |
11 | <div id=guia1 >Tema</div> | 11 | <div id=guia1 >Tema</div> |
12 | - <div id=guia2 >Digitar</div> | ||
13 | - <div id=guia3 >Colar</div> | ||
14 | - <div id=guia4 >Conversor</div> | ||
15 | - <div id=guia5 >Coordenadas</div> | 12 | + <div id=guia2 >Direc/dist</div> |
13 | + <div id=guia3 >Digitar</div> | ||
14 | + <div id=guia4 >Colar</div> | ||
15 | + <div id=guia5 >Conversor</div> | ||
16 | + <div id=guia6 >Coordenadas</div> | ||
16 | </div> | 17 | </div> |
17 | <div id=geral style="left:0px;top:0px;"> | 18 | <div id=geral style="left:0px;top:0px;"> |
18 | <div id=projecao style='left:0px;display:none'> | 19 | <div id=projecao style='left:0px;display:none'> |
@@ -38,6 +39,25 @@ | @@ -38,6 +39,25 @@ | ||
38 | </div> | 39 | </div> |
39 | </div> | 40 | </div> |
40 | <div class=guiaobj id="guia2obj" style="display:none;;left:1px" > | 41 | <div class=guiaobj id="guia2obj" style="display:none;;left:1px" > |
42 | + <div> | ||
43 | + Direção:<br> | ||
44 | + <input class=digitar id='xgdd' title='grau' type=text size=3 value='00'/> | ||
45 | + <input class=digitar id='xmdd' title='minuto' type=text size=3 value='00'/> | ||
46 | + <input class=digitar id='xsdd' title='segundo' type=text size=3 value='0.0'/><br><br> | ||
47 | + Distância em Km:<br> | ||
48 | + <input class=digitar id='distdd' title='km' type=text size=5 value='0.0'/> | ||
49 | + </div> | ||
50 | + <div id=opcdd style="display:block;top:15px;left:0px"> | ||
51 | + <div style=top:0px;left:0px;text-align:left onclick='inserirdd()' > | ||
52 | + <input id=botaodd type='button' size=14 value='Insere' /> | ||
53 | + </div> | ||
54 | + </div> | ||
55 | + <div id=mendd style="display:block;position:relative;left:0px;top:20px"> | ||
56 | + O próximo ponto será incluído em relação ao último ponto existente no tema, considerando-se apenas os pontos visíveis na extensão do mapa atual. | ||
57 | + <br>Digite o ângulo em relação ao Norte e a distância em Km. | ||
58 | + </div> | ||
59 | + </div> | ||
60 | + <div class=guiaobj id="guia3obj" style="display:none;;left:1px" > | ||
41 | <div id=tipodig style="display:block;top:5px;left:0px"> | 61 | <div id=tipodig style="display:block;top:5px;left:0px"> |
42 | Tipo de entrada: | 62 | Tipo de entrada: |
43 | <table summary="Tipo de entrada" class=lista > | 63 | <table summary="Tipo de entrada" class=lista > |
@@ -74,7 +94,7 @@ | @@ -74,7 +94,7 @@ | ||
74 | <br>O valor correspondente ao Grau deve receber o sinal de negativo("-") nos casos de longitude oeste (todo o Brasil está nesse caso) e nos casos de latitude Sul.<br><br><br> | 94 | <br>O valor correspondente ao Grau deve receber o sinal de negativo("-") nos casos de longitude oeste (todo o Brasil está nesse caso) e nos casos de latitude Sul.<br><br><br> |
75 | </div> | 95 | </div> |
76 | </div> | 96 | </div> |
77 | - <div class=guiaobj id="guia3obj" style="display:none;left:1px;top:5px" > | 97 | + <div class=guiaobj id="guia4obj" style="display:none;left:1px;top:5px" > |
78 | 98 | ||
79 | <div id=opc3 style="top:0px;left:0px;text-align:left;"> | 99 | <div id=opc3 style="top:0px;left:0px;text-align:left;"> |
80 | Cole ou digite a lista de coordenadas: | 100 | Cole ou digite a lista de coordenadas: |
@@ -87,7 +107,7 @@ | @@ -87,7 +107,7 @@ | ||
87 | Cole os valores de X e Y, em décimos de grau, com sinal de negativo para oeste e sul, exemplo:<br> -54.23 -12.5 -50 -5.33<br> | 107 | Cole os valores de X e Y, em décimos de grau, com sinal de negativo para oeste e sul, exemplo:<br> -54.23 -12.5 -50 -5.33<br> |
88 | </div> | 108 | </div> |
89 | </div> | 109 | </div> |
90 | - <div class=guiaobj id="guia4obj" style="display:none;left:1px;top:5px" > | 110 | + <div class=guiaobj id="guia5obj" style="display:none;left:1px;top:5px" > |
91 | <div id=opc4 style="top:0px;left:0px"> | 111 | <div id=opc4 style="top:0px;left:0px"> |
92 | <div style=top:0px;left:0px;text-align:left onclick='wkt()'> | 112 | <div style=top:0px;left:0px;text-align:left onclick='wkt()'> |
93 | <input id=botao3 type='button' size=25 value='Lista wkt' /><br><br> | 113 | <input id=botao3 type='button' size=25 value='Lista wkt' /><br><br> |
@@ -102,7 +122,7 @@ | @@ -102,7 +122,7 @@ | ||
102 | <div id=wktres style="display:block;position:relative;top:5px;left:0px"> | 122 | <div id=wktres style="display:block;position:relative;top:5px;left:0px"> |
103 | </div> | 123 | </div> |
104 | </div> | 124 | </div> |
105 | - <div class=guiaobj id="guia5obj" style="display:none;left:1px;top:5px" > | 125 | + <div class=guiaobj id="guia6obj" style="display:none;left:1px;top:5px" > |
106 | <div id="resultado" style="display:block;position:relative;top:10px;left:0px;font-size:12px"></div> | 126 | <div id="resultado" style="display:block;position:relative;top:10px;left:0px;font-size:12px"></div> |
107 | </div> | 127 | </div> |
108 | </div> | 128 | </div> |
ferramentas/inserexy2/index.js
@@ -28,18 +28,21 @@ mostraGuia("guia1") | @@ -28,18 +28,21 @@ mostraGuia("guia1") | ||
28 | $i("guia1").onclick = function() | 28 | $i("guia1").onclick = function() |
29 | {mostraGuia("guia1");$i("projecao").style.display="none";} | 29 | {mostraGuia("guia1");$i("projecao").style.display="none";} |
30 | $i("guia2").onclick = function() | 30 | $i("guia2").onclick = function() |
31 | -{mostraGuia("guia2");$i("projecao").style.display="block";} | 31 | +{mostraGuia("guia2");$i("projecao").style.display="none";} |
32 | $i("guia3").onclick = function() | 32 | $i("guia3").onclick = function() |
33 | {mostraGuia("guia3");$i("projecao").style.display="block";} | 33 | {mostraGuia("guia3");$i("projecao").style.display="block";} |
34 | $i("guia4").onclick = function() | 34 | $i("guia4").onclick = function() |
35 | -{mostraGuia("guia4");$i("projecao").style.display="none";} | 35 | +{mostraGuia("guia4");$i("projecao").style.display="block";} |
36 | $i("guia5").onclick = function() | 36 | $i("guia5").onclick = function() |
37 | {mostraGuia("guia5");$i("projecao").style.display="none";} | 37 | {mostraGuia("guia5");$i("projecao").style.display="none";} |
38 | +$i("guia6").onclick = function() | ||
39 | +{mostraGuia("guia6");$i("projecao").style.display="none";} | ||
38 | 40 | ||
39 | window.parent.g_nomepin = "" | 41 | window.parent.g_nomepin = "" |
40 | mensagemAjuda("men1",$i("men1").innerHTML) | 42 | mensagemAjuda("men1",$i("men1").innerHTML) |
41 | mensagemAjuda("men2",$i("men2").innerHTML) | 43 | mensagemAjuda("men2",$i("men2").innerHTML) |
42 | mensagemAjuda("men3",$i("men3").innerHTML) | 44 | mensagemAjuda("men3",$i("men3").innerHTML) |
45 | +mensagemAjuda("mendd",$i("mendd").innerHTML) | ||
43 | 46 | ||
44 | radioepsg | 47 | radioepsg |
45 | ( | 48 | ( |
@@ -73,6 +76,7 @@ function montaComboLocal() | @@ -73,6 +76,7 @@ function montaComboLocal() | ||
73 | new YAHOO.widget.Button("botao4"); | 76 | new YAHOO.widget.Button("botao4"); |
74 | new YAHOO.widget.Button("botao5"); | 77 | new YAHOO.widget.Button("botao5"); |
75 | new YAHOO.widget.Button("botao6"); | 78 | new YAHOO.widget.Button("botao6"); |
79 | + new YAHOO.widget.Button("botaodd"); | ||
76 | } | 80 | } |
77 | YAHOO.util.Event.onContentReady("botao1", onPushButtonsMarkupReady); | 81 | YAHOO.util.Event.onContentReady("botao1", onPushButtonsMarkupReady); |
78 | }() | 82 | }() |
@@ -271,7 +275,7 @@ function inserir() | @@ -271,7 +275,7 @@ function inserir() | ||
271 | {var projecao = inputs[i].value} | 275 | {var projecao = inputs[i].value} |
272 | } | 276 | } |
273 | var projecao = pegaProj() | 277 | var projecao = pegaProj() |
274 | - var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&"+g_sid+"&funcao=insereSHP&tema="+window.parent.g_nomepin+"&xy="+xxx+" "+yyy+"&projecao="+projecao; | 278 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&"+g_sid+"&funcao=insereSHP&tema="+window.parent.g_nomepin+"&xy="+xxx+" "+yyy+"&projecao="+projecao+"&item="+$i("itemtema").value+"&valor="+$i("valorItem").value; |
275 | var cp = new cpaint(); | 279 | var cp = new cpaint(); |
276 | //cp.set_debug(2) | 280 | //cp.set_debug(2) |
277 | cp.set_response_type("JSON"); | 281 | cp.set_response_type("JSON"); |
@@ -279,6 +283,47 @@ function inserir() | @@ -279,6 +283,47 @@ function inserir() | ||
279 | $i("longitude").value = "" | 283 | $i("longitude").value = "" |
280 | $i("latitude").value = "" | 284 | $i("latitude").value = "" |
281 | } | 285 | } |
286 | +//insere um ponto com base no ângulo e distância | ||
287 | +function inserirdd() | ||
288 | +{ | ||
289 | + aguarde("block") | ||
290 | + var reg = new RegExp("w|W|l|L|o|O|'|G|r", "g"); | ||
291 | + var regv = new RegExp(",", "g"); | ||
292 | + var xgv = $i("xgdd").value; | ||
293 | + var xmv = $i("xmdd").value; | ||
294 | + var xsv = $i("xsdd").value; | ||
295 | + var xsv = xsv.replace(regv,"."); | ||
296 | + | ||
297 | + var direcao = window.parent.i3GEO.calculo.dms2dd(xgv,xmv,xsv); | ||
298 | + | ||
299 | + var redesenha = function() | ||
300 | + {aguarde("none");window.parent.i3GEO.atualiza("");} | ||
301 | + | ||
302 | + var inserePT = function(retorno){ | ||
303 | + try{ | ||
304 | + var x = retorno.data.mapprj.x | ||
305 | + var y = retorno.data.mapprj.y | ||
306 | + | ||
307 | + var xy = window.parent.i3GEO.calculo.destinoDD(x,y,$i("distdd").value,direcao) | ||
308 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=insereSHP&tema="+window.parent.g_nomepin+"&xy="+xy[0]+" "+xy[1]+"&item="+$i("itemtema").value+"&valor="+$i("valorItem").value; | ||
309 | + var cp = new cpaint(); | ||
310 | + //cp.set_debug(2) | ||
311 | + cp.set_response_type("JSON"); | ||
312 | + cp.call(p,"insereSHP",redesenha); | ||
313 | + var ins = $i("resultado").innerHTML | ||
314 | + ins = ins + "<div style='display:block;position:relative;top:5px;left:0px;font-size:12px' >" + x +" " + y + "</div><br>" | ||
315 | + $i("resultado").innerHTML = ins | ||
316 | + } | ||
317 | + catch(e){alert(e)} | ||
318 | + } | ||
319 | + | ||
320 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=pegaxyUltimoPonto&tema="+window.parent.g_nomepin; | ||
321 | + var cp = new cpaint(); | ||
322 | + //cp.set_debug(2) | ||
323 | + cp.set_response_type("JSON"); | ||
324 | + cp.call(p,"pegaxyUltimoPonto",inserePT); | ||
325 | +} | ||
326 | + | ||
282 | function verificaproj() | 327 | function verificaproj() |
283 | { | 328 | { |
284 | var p = pegaProj() | 329 | var p = pegaProj() |
@@ -304,7 +349,7 @@ function colar() | @@ -304,7 +349,7 @@ function colar() | ||
304 | var regv = new RegExp(",", "g"); | 349 | var regv = new RegExp(",", "g"); |
305 | $i("colar").value = $i("colar").value.replace(regv,".") | 350 | $i("colar").value = $i("colar").value.replace(regv,".") |
306 | var xys = $i("colar").value.split(" ") | 351 | var xys = $i("colar").value.split(" ") |
307 | - var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=insereSHP&tema="+window.parent.g_nomepin+"&xy="+$i("colar").value; | 352 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=insereSHP&tema="+window.parent.g_nomepin+"&xy="+$i("colar").value+"&item="+$i("itemtema").value+"&valor="+$i("valorItem").value; |
308 | var cp = new cpaint(); | 353 | var cp = new cpaint(); |
309 | //cp.set_debug(2) | 354 | //cp.set_debug(2) |
310 | cp.set_response_type("JSON"); | 355 | cp.set_response_type("JSON"); |