Commit 733985a20705fc07c05236483c782e9480d6663c
1 parent
9f2c67ca
Exists in
master
and in
7 other branches
Movido inserexy para a pasta depreciados
Showing
4 changed files
with
188 additions
and
3 deletions
Show diff stats
... | ... | @@ -0,0 +1,58 @@ |
1 | +<html> | |
2 | +<head> | |
3 | +<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> | |
4 | +<link rel="stylesheet" type="text/css" href="../../css/ferramentas.css"> | |
5 | +</head> | |
6 | +<body name="ancora" class="yui-skin-sam"> | |
7 | +<div id=fundo > | |
8 | + <div class="guias"> | |
9 | + <div class=guia id=guia1 > Pegar </div> | |
10 | + <div class=guia id=guia2 > Digitar </div> | |
11 | + <div class=guia id=guia3 > Colar </div> | |
12 | + <div class=guia id=guia4 > WKT </div> | |
13 | + </div> | |
14 | + <span id=geral > | |
15 | + <div style="text-align:center;display:block;position:relative;top:5px;left:0px"> | |
16 | + Inserir os pontos no mapa como: | |
17 | + <input class=executar type="buttom" size=9 value="Pontos" onclick="aplicar('ponto')"/> | |
18 | + <input class=executar type="buttom" size=8 value="Linha" onclick="aplicar('linha')" /> | |
19 | + <input class=executar type="buttom" size=11 value="Polígono" onclick="aplicar('poligono')" /> | |
20 | + </div> | |
21 | + <div class=guiaobj id="guia1obj" style="display:block;" > | |
22 | + <div style="display:block;position:relative;top:5px;left:0px"> | |
23 | + Clique no mapa para inserir um novo ponto. Clique no ponto (abaixo) para remover.<br> | |
24 | + </div> | |
25 | + </div> | |
26 | + <div class=guiaobj id="guia2obj" style="display:none;" > | |
27 | + <div style="display:block;position:relative;top:10px;left:0px"> | |
28 | + X:<input class=digitar id='xg' title='grau' type=text size=3 value='-00'/> | |
29 | + <input class=digitar id='xm' title='minuto' type=text size=3 value='00'/> | |
30 | + <input class=digitar id='xs' title='segundo' type=text size=3 value='0.0'/><br> | |
31 | + Y:<input class=digitar id='yg' title='grau' type=text size=3 value='-00'/> | |
32 | + <input class=digitar id='ym' title='minuto' type=text size=3 value='00'/> | |
33 | + <input class=digitar id='ys' title='segundo' type=text size=3 value='0.0'/> | |
34 | + <img style="cursor:pointer" title='inserir' onclick='inserir()' src='../../imagens/tic.png' id=procurarxy /> | |
35 | + </div> | |
36 | + </div> | |
37 | + <div class=guiaobj id="guia3obj" style="display:none;" > | |
38 | + <div style="display:block;position:relative;top:5px;left:0px"> | |
39 | + Cole aqui 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> | |
40 | + <input class=digitar id='colar' title='pares' type=text size=30 value=''/> | |
41 | + <img style="cursor:pointer" title='inserir' onclick='colar()' src='../../imagens/tic.png' id=procurarxy /> | |
42 | + </div> | |
43 | + </div> | |
44 | + <div class=guiaobj id="guia4obj" style="display:none;" > | |
45 | + <div id=wktres style="display:block;position:relative;top:5px;left:0px"> | |
46 | + </div> | |
47 | + </div> | |
48 | + <div id="resultado" style="display:block;position:relative;top:10px;left:0px;"></div> | |
49 | + </span> | |
50 | + <div id="aguarde"> | |
51 | + <img alt="" src="../../imagens/aguarde.gif" />Aguarde... | |
52 | + </div> | |
53 | +</div> | |
54 | +</body> | |
55 | +<script language="JavaScript" type="text/javascript" src="../funcoes.js"></script> | |
56 | +<script src="../../pacotes/cpaint/cpaint2.inc.compressed.js" type="text/javascript"></script> | |
57 | +<script language="JavaScript" type="text/javascript" src="index.js"></script> | |
58 | +</html> | |
0 | 59 | \ No newline at end of file | ... | ... |
... | ... | @@ -0,0 +1,129 @@ |
1 | +//inicializa | |
2 | +parametrosURL() | |
3 | +//eventos das guias | |
4 | +$i("guia1").onclick = function() | |
5 | +{$i("guia1obj").style.display="block";} | |
6 | +$i("guia2").onclick = function() | |
7 | +{$i("guia2obj").style.display="block";} | |
8 | +$i("guia3").onclick = function() | |
9 | +{$i("guia3obj").style.display="block";} | |
10 | +$i("guia4").onclick = function() | |
11 | +{$i("guia4obj").style.display="block";wkt();} | |
12 | +aguarde("none") | |
13 | +//remove um ponto da lista de pontos quando o mesmo for clicado | |
14 | +function remove(ponto) | |
15 | +{ | |
16 | + var p = ponto.parentNode | |
17 | + p.removeChild(ponto) | |
18 | + aplicar("limpaponto") | |
19 | +} | |
20 | +//gera string wkt com as coordenadas | |
21 | +function wkt() | |
22 | +{ | |
23 | + aguarde("block") | |
24 | + var divs = $i("resultado") | |
25 | + var els = divs.childNodes | |
26 | + var xy = new Array() | |
27 | + var ultimo = "" | |
28 | + for (i=0;i<els.length;i++) | |
29 | + { | |
30 | + if ((els[i].innerHTML) && (els[i].innerHTML.split(" ").length == 2)) | |
31 | + { | |
32 | + xy.push(els[i].innerHTML) | |
33 | + if (ultimo == ""){ultimo = els[i].innerHTML} | |
34 | + } | |
35 | + } | |
36 | + xy = xy.join(" ") | |
37 | + var cp = new cpaint(); | |
38 | + cp.set_response_type("JSON"); | |
39 | + //cp.set_debug(2) | |
40 | + cp.call(g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=mostrawkt&xy="+xy,"xy2wkt",mostrawkt); | |
41 | +} | |
42 | +//mostra o formato wkt | |
43 | +function mostrawkt(retorno) | |
44 | +{ | |
45 | + if (retorno.data != undefined) | |
46 | + { | |
47 | + var ins = retorno.data[0]+"<br>" | |
48 | + ins += retorno.data[1]+"<br>" | |
49 | + ins += retorno.data[2]+"<br>" | |
50 | + $i("wktres").innerHTML = ins+"<br>" | |
51 | + //var w = window.open() | |
52 | + //w.document.write(ins) | |
53 | + } | |
54 | + else | |
55 | + {$i("wktres").innerHTML = "<p style=color:red >Ocorreu um erro<br>"} | |
56 | + aguarde("none") | |
57 | +} | |
58 | +//limpa os pontos do mapa e inclui novos pontos conforme existirem no div resultado | |
59 | +function aplicar(tipo) | |
60 | +{ | |
61 | + var divs = $i("resultado") | |
62 | + var els = divs.childNodes | |
63 | + var xy = new Array() | |
64 | + var ultimo = "" | |
65 | + for (i=0;i<els.length;i++) | |
66 | + { | |
67 | + if ((els[i].innerHTML) && (els[i].innerHTML.split(" ").length == 2)) | |
68 | + { | |
69 | + xy.push(els[i].innerHTML) | |
70 | + if (ultimo == ""){ultimo = els[i].innerHTML} | |
71 | + } | |
72 | + } | |
73 | + if (tipo == "ponto") | |
74 | + { | |
75 | + tipo = "POINT" | |
76 | + var pos = "ponto" | |
77 | + } | |
78 | + if (tipo == "linha") | |
79 | + { | |
80 | + tipo = "LINE" | |
81 | + var pos = "linha" | |
82 | + } | |
83 | + if (tipo == "poligono") | |
84 | + { | |
85 | + tipo = "POLYGON" | |
86 | + var pos = "pol" | |
87 | + xy.push(ultimo) | |
88 | + } | |
89 | + if (tipo == "limpaponto") | |
90 | + { | |
91 | + var pos = "ponto" | |
92 | + } | |
93 | + xy = xy.join(" ") | |
94 | + var p = g_locaplic+"/classesphp/mapa_controle.php?g_sid="+g_sid+"&funcao=inserefeature&tipo="+tipo+"&pin="+window.parent.g_nomepin+pos+"&xy="+xy | |
95 | + var cp = new cpaint(); | |
96 | + //cp.set_debug(2) | |
97 | + cp.set_response_type("JSON"); | |
98 | + cp.call(p,"insereFeature",window.parent.i3GEO.atualiza); | |
99 | +} | |
100 | +//insere um ponto digitando os valores dms | |
101 | +function inserir() | |
102 | +{ | |
103 | + var xgv = $i("xg").value; | |
104 | + var xmv = $i("xm").value; | |
105 | + var xsv = $i("xs").value; | |
106 | + var ygv = $i("yg").value; | |
107 | + var ymv = $i("ym").value; | |
108 | + var ysv = $i("ys").value; | |
109 | + var xxx = window.parent.i3GEO.calculo.dms2dd(xgv,xmv,xsv); | |
110 | + var yyy = window.parent.i3GEO.calculo.dms2dd(ygv,ymv,ysv); | |
111 | + var ins = $i("resultado").innerHTML | |
112 | + ins = ins + "<div style='cursor:pointer; display:block;position:relative;top:5px;left:0px;' title='clique para remover' onclick='remove(this)'>" + xxx +" " + yyy + "</div><br>" | |
113 | + $i("resultado").innerHTML = ins | |
114 | + aplicar("ponto") | |
115 | +} | |
116 | +function colar() | |
117 | +{ | |
118 | + var xys = $i("colar").value.split(" ") | |
119 | + var ins = $i("resultado").innerHTML | |
120 | + var n = new Array() | |
121 | + for (i = 0;i < xys.length; i = i + 1) | |
122 | + {if (xys[i] != ""){n.push(xys[i])}} | |
123 | + for (i = 0;i < n.length; i = i + 2) | |
124 | + { | |
125 | + ins = ins + "<div title='clique para remover' style='cursor:pointer' onclick='remove(this)'>" + n[i] +" " + n[i+1] + "</div><br>" | |
126 | + } | |
127 | + $i("resultado").innerHTML = ins | |
128 | + aplicar("ponto") | |
129 | +} | |
0 | 130 | \ No newline at end of file | ... | ... |
ferramentas/template/index.htm
ferramentas/template/index.js
1 | 1 | //inicializa |
2 | -parametrosURL() | |
3 | 2 | function muda(template) |
4 | 3 | { |
5 | - window.parent.location = window.parent.g_locaplic+"/aplicmap/"+template+"?"+g_sid | |
4 | + window.parent.location = window.parent.i3GEO.configura.locaplic+"/aplicmap/"+template+"?"+window.parent.i3GEO.configura.sid | |
6 | 5 | } |
7 | 6 | \ No newline at end of file | ... | ... |