Commit ef1ee01e126135ba316d204d7dad7e5b097858f2
1 parent
cf5d061b
Exists in
master
and in
6 other branches
Correção na definição do parâmetro de resolução da ferramenta identifica
Showing
11 changed files
with
1142 additions
and
1126 deletions
Show diff stats
css/default.css
ferramentas/identifica/index.js
... | ... | @@ -41,7 +41,7 @@ Free Software Foundation, Inc., no endereço |
41 | 41 | 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. |
42 | 42 | */ |
43 | 43 | if (typeof (i3GEOF) === 'undefined') { |
44 | - var i3GEOF = {}; | |
44 | + var i3GEOF = {}; | |
45 | 45 | } |
46 | 46 | /* |
47 | 47 | * Classe: i3GEOF.identifica |
... | ... | @@ -51,1070 +51,1079 @@ if (typeof (i3GEOF) === 'undefined') { |
51 | 51 | //diferente de null |
52 | 52 | i3GEOF.identifica = |
53 | 53 | { |
54 | - /** | |
55 | - * Array com os ids das janelas ja criadas | |
56 | - */ | |
57 | - janelas : [], | |
58 | - propJanelas : {}, | |
59 | - /** | |
60 | - * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php | |
61 | - */ | |
62 | - MUSTACHE : "", | |
63 | - MUSTACHESISTEMAS: "", | |
64 | - MUSTACHEDADOS: "", | |
65 | - /** | |
66 | - * Susbtitutos para o template | |
67 | - */ | |
68 | - mustacheHash : function(idjanela) { | |
69 | - var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.identifica.dicionario); | |
70 | - dicionario["idjanela"] = idjanela; | |
71 | - dicionario["locaplic"] = i3GEO.configura.locaplic; | |
72 | - return dicionario; | |
73 | - }, | |
74 | - /* | |
75 | - * Propriedade: mostraLinkGeohack | |
76 | - * | |
77 | - * Mostra ou não o link para abrir o site GeoHack. | |
78 | - * | |
79 | - * Este site permite o uso de vários buscadores disponíveis na internet. | |
80 | - * | |
81 | - * Type: {boolean} | |
82 | - */ | |
83 | - mostraLinkGeohack : true, | |
84 | - /* | |
85 | - * Propriedade: mostraSistemasAdicionais | |
86 | - * | |
87 | - * Mostra ou não a lista de sistemas adicionais de busca de dados. | |
88 | - * | |
89 | - * Type: {boolean} | |
90 | - */ | |
91 | - mostraSistemasAdicionais : true, | |
92 | - /* | |
93 | - * Variavel: tema | |
94 | - * | |
95 | - * Código do tema que será pesquisado | |
96 | - * | |
97 | - * Type: {String} | |
98 | - */ | |
99 | - tema : "", | |
100 | - /* | |
101 | - * Variavel: x | |
102 | - * | |
103 | - * Coordenada x | |
104 | - * | |
105 | - * Type: {Numeric} | |
106 | - */ | |
107 | - x : 0, | |
108 | - /* | |
109 | - * Variavel: y | |
110 | - * | |
111 | - * Coordenada y | |
112 | - * | |
113 | - * Type: {Numeric} | |
114 | - */ | |
115 | - y : 0, | |
116 | - /* | |
117 | - * Variavel: sistemasAdicionais | |
118 | - * | |
119 | - * Guarda a lista de sistemas adicionais que são incluídos na seleção de temas | |
120 | - * | |
121 | - * Type: {Array} | |
122 | - */ | |
123 | - sistemasAdicionais : [], | |
124 | - /* | |
125 | - * Variavel: dadosIdentifica | |
126 | - * | |
127 | - * Guarda os dados obtidos com a chamada em AJAX de identificação | |
128 | - * | |
129 | - * Type: {Array} | |
130 | - */ | |
131 | - dadosIdentifica : [], | |
54 | + resolution: 8, | |
55 | + /** | |
56 | + * Array com os ids das janelas ja criadas | |
57 | + */ | |
58 | + janelas : [], | |
59 | + propJanelas : {}, | |
60 | + /** | |
61 | + * Template no formato mustache. E preenchido na carga do javascript com o programa dependencias.php | |
62 | + */ | |
63 | + MUSTACHE : "", | |
64 | + MUSTACHESISTEMAS: "", | |
65 | + MUSTACHEDADOS: "", | |
66 | + /** | |
67 | + * Susbtitutos para o template | |
68 | + */ | |
69 | + mustacheHash : function(idjanela) { | |
70 | + var dicionario = i3GEO.idioma.objetoIdioma(i3GEOF.identifica.dicionario); | |
71 | + dicionario["idjanela"] = idjanela; | |
72 | + dicionario["locaplic"] = i3GEO.configura.locaplic; | |
73 | + dicionario["resolution"] = i3GEOF.identifica.resolution; | |
74 | + return dicionario; | |
75 | + }, | |
76 | + /* | |
77 | + * Propriedade: mostraLinkGeohack | |
78 | + * | |
79 | + * Mostra ou não o link para abrir o site GeoHack. | |
80 | + * | |
81 | + * Este site permite o uso de vários buscadores disponíveis na internet. | |
82 | + * | |
83 | + * Type: {boolean} | |
84 | + */ | |
85 | + mostraLinkGeohack : true, | |
86 | + /* | |
87 | + * Propriedade: mostraSistemasAdicionais | |
88 | + * | |
89 | + * Mostra ou não a lista de sistemas adicionais de busca de dados. | |
90 | + * | |
91 | + * Type: {boolean} | |
92 | + */ | |
93 | + mostraSistemasAdicionais : true, | |
94 | + /* | |
95 | + * Variavel: tema | |
96 | + * | |
97 | + * Código do tema que será pesquisado | |
98 | + * | |
99 | + * Type: {String} | |
100 | + */ | |
101 | + tema : "", | |
102 | + /* | |
103 | + * Variavel: x | |
104 | + * | |
105 | + * Coordenada x | |
106 | + * | |
107 | + * Type: {Numeric} | |
108 | + */ | |
109 | + x : 0, | |
110 | + /* | |
111 | + * Variavel: y | |
112 | + * | |
113 | + * Coordenada y | |
114 | + * | |
115 | + * Type: {Numeric} | |
116 | + */ | |
117 | + y : 0, | |
118 | + /* | |
119 | + * Variavel: sistemasAdicionais | |
120 | + * | |
121 | + * Guarda a lista de sistemas adicionais que são incluídos na seleção de temas | |
122 | + * | |
123 | + * Type: {Array} | |
124 | + */ | |
125 | + sistemasAdicionais : [], | |
126 | + /* | |
127 | + * Variavel: dadosIdentifica | |
128 | + * | |
129 | + * Guarda os dados obtidos com a chamada em AJAX de identificação | |
130 | + * | |
131 | + * Type: {Array} | |
132 | + */ | |
133 | + dadosIdentifica : [], | |
132 | 134 | |
133 | - /* | |
134 | - * Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário | |
135 | - */ | |
136 | - criaJanelaFlutuante : function(x, y) { | |
137 | - i3GEOF.identifica.iniciaDicionario(x, y); | |
138 | - }, | |
139 | - /* | |
140 | - * Function: iniciaDicionario | |
141 | - * | |
142 | - * Carrega o dicionário e chama a função que inicia a ferramenta | |
143 | - * | |
144 | - * O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | |
145 | - */ | |
146 | - iniciaDicionario : function(x, y, id) { | |
147 | - if (typeof (i3GEOF.identifica.dicionario) === 'undefined') { | |
148 | - if (x) { | |
149 | - i3GEO.util.scriptTag( | |
150 | - i3GEO.configura.locaplic + "/ferramentas/identifica/dicionario.js", | |
151 | - "i3GEOF.identifica.iniciaJanelaFlutuante(" + x + "," + y + ")", | |
152 | - "i3GEOF.identifica.dicionario_script"); | |
153 | - } else { | |
154 | - i3GEO.util.scriptTag( | |
155 | - i3GEO.configura.locaplic + "/ferramentas/identifica/dicionario.js", | |
156 | - "i3GEOF.identifica.iniciaJanelaFlutuante()", | |
157 | - "i3GEOF.identifica.dicionario_script"); | |
158 | - } | |
159 | - } else { | |
160 | - if (x) { | |
161 | - i3GEOF.identifica.iniciaJanelaFlutuante(x, y); | |
162 | - } else { | |
163 | - i3GEOF.identifica.iniciaJanelaFlutuante(); | |
164 | - } | |
165 | - } | |
166 | - }, | |
167 | - /* | |
168 | - * Function: inicia | |
169 | - * | |
170 | - * Inicia a janela de informações | |
171 | - * | |
172 | - * Parameters: | |
173 | - * | |
174 | - * tema {String} - código do tema, existente no mapfile armazenado na seção, que será consultado | |
175 | - * já na inicialização | |
176 | - * | |
177 | - * x {Numeric} - coordenada x do ponto que será utilizado para busca dos atributos | |
178 | - * | |
179 | - * y {Numeric} - coordenada y do ponto | |
180 | - * | |
181 | - * iddiv {String} - id do elemento html onde o conteúdo da ferramenta será incluido | |
182 | - * | |
183 | - * mostraLinkGeohack {boolean} - mostra ou não o link para o site geohacks | |
184 | - * | |
185 | - * mostraSistemasAdicionais {boolean} - mostra ou não os sistemas adicionais de busca de dados | |
186 | - * | |
187 | - * idjanela {string} | |
188 | - */ | |
189 | - inicia : function(tema, x, y, iddiv, mostraLinkGeohack, mostraSistemasAdicionais, idjanela) { | |
190 | - if(i3GEOF.identifica.MUSTACHE == ""){ | |
191 | - var t1 = i3GEO.configura.locaplic + "/ferramentas/identifica/template_mst.html", | |
192 | - t2 = i3GEO.configura.locaplic + "/ferramentas/identifica/template_sistemas_mst.html", | |
193 | - t3 = i3GEO.configura.locaplic + "/ferramentas/identifica/template_dados_mst.html"; | |
135 | + /* | |
136 | + * Para efeitos de compatibilidade antes da versão 4.7 que não tinha dicionário | |
137 | + */ | |
138 | + criaJanelaFlutuante : function(x, y) { | |
139 | + i3GEOF.identifica.iniciaDicionario(x, y); | |
140 | + }, | |
141 | + /* | |
142 | + * Function: iniciaDicionario | |
143 | + * | |
144 | + * Carrega o dicionário e chama a função que inicia a ferramenta | |
145 | + * | |
146 | + * O Javascript é carregado com o id i3GEOF.nomedaferramenta.dicionario_script | |
147 | + */ | |
148 | + iniciaDicionario : function(x, y, id) { | |
149 | + if (typeof (i3GEOF.identifica.dicionario) === 'undefined') { | |
150 | + if (x) { | |
151 | + i3GEO.util.scriptTag( | |
152 | + i3GEO.configura.locaplic + "/ferramentas/identifica/dicionario.js", | |
153 | + "i3GEOF.identifica.iniciaJanelaFlutuante(" + x + "," + y + ")", | |
154 | + "i3GEOF.identifica.dicionario_script"); | |
155 | + } else { | |
156 | + i3GEO.util.scriptTag( | |
157 | + i3GEO.configura.locaplic + "/ferramentas/identifica/dicionario.js", | |
158 | + "i3GEOF.identifica.iniciaJanelaFlutuante()", | |
159 | + "i3GEOF.identifica.dicionario_script"); | |
160 | + } | |
161 | + } else { | |
162 | + if (x) { | |
163 | + i3GEOF.identifica.iniciaJanelaFlutuante(x, y); | |
164 | + } else { | |
165 | + i3GEOF.identifica.iniciaJanelaFlutuante(); | |
166 | + } | |
167 | + } | |
168 | + }, | |
169 | + /* | |
170 | + * Function: inicia | |
171 | + * | |
172 | + * Inicia a janela de informações | |
173 | + * | |
174 | + * Parameters: | |
175 | + * | |
176 | + * tema {String} - código do tema, existente no mapfile armazenado na seção, que será consultado | |
177 | + * já na inicialização | |
178 | + * | |
179 | + * x {Numeric} - coordenada x do ponto que será utilizado para busca dos atributos | |
180 | + * | |
181 | + * y {Numeric} - coordenada y do ponto | |
182 | + * | |
183 | + * iddiv {String} - id do elemento html onde o conteúdo da ferramenta será incluido | |
184 | + * | |
185 | + * mostraLinkGeohack {boolean} - mostra ou não o link para o site geohacks | |
186 | + * | |
187 | + * mostraSistemasAdicionais {boolean} - mostra ou não os sistemas adicionais de busca de dados | |
188 | + * | |
189 | + * idjanela {string} | |
190 | + */ | |
191 | + inicia : function(tema, x, y, iddiv, mostraLinkGeohack, mostraSistemasAdicionais, idjanela) { | |
192 | + if(i3GEOF.identifica.MUSTACHE == ""){ | |
193 | + var t1 = i3GEO.configura.locaplic + "/ferramentas/identifica/template_mst.html", | |
194 | + t2 = i3GEO.configura.locaplic + "/ferramentas/identifica/template_sistemas_mst.html", | |
195 | + t3 = i3GEO.configura.locaplic + "/ferramentas/identifica/template_dados_mst.html"; | |
196 | + | |
197 | + $.when( $.get(t1),$.get(t2),$.get(t3) ).done(function(r1,r2,r3) { | |
198 | + i3GEOF.identifica.MUSTACHE = r1[0]; | |
199 | + i3GEOF.identifica.MUSTACHESISTEMAS = r2[0]; | |
200 | + i3GEOF.identifica.MUSTACHEDADOS = r3[0]; | |
201 | + i3GEOF.identifica.inicia(tema, x, y, iddiv, mostraLinkGeohack, mostraSistemasAdicionais, idjanela); | |
202 | + }).fail(function() { | |
203 | + i3GEO.janela.closeMsg($trad("erroTpl")); | |
204 | + return; | |
205 | + }); | |
206 | + return; | |
207 | + } | |
208 | + var b, onButtonClick = function(evt) { | |
209 | + var botao = evt.target; | |
210 | + if (botao) { | |
211 | + if (botao.value != "") { | |
212 | + i3GEO.mapa.ativaTema(botao.value); | |
213 | + i3GEOF.identifica.propJanelas[idjanela].tema = botao.value; | |
214 | + i3GEOF.identifica.propJanelas[idjanela].temaAtivo = botao.value; | |
194 | 215 | |
195 | - $.when( $.get(t1),$.get(t2),$.get(t3) ).done(function(r1,r2,r3) { | |
196 | - i3GEOF.identifica.MUSTACHE = r1[0]; | |
197 | - i3GEOF.identifica.MUSTACHESISTEMAS = r2[0]; | |
198 | - i3GEOF.identifica.MUSTACHEDADOS = r3[0]; | |
199 | - i3GEOF.identifica.inicia(tema, x, y, iddiv, mostraLinkGeohack, mostraSistemasAdicionais, idjanela); | |
200 | - }).fail(function() { | |
201 | - i3GEO.janela.closeMsg($trad("erroTpl")); | |
202 | - return; | |
203 | - }); | |
204 | - return; | |
216 | + var temp = i3GEO.arvoreDeCamadas.pegaTema(botao.value); | |
217 | + if (temp.identifica.toLowerCase() !== "nao") { | |
218 | + i3GEOF.identifica.buscaDadosTema(botao.value, i3GEOF.identifica.propJanelas[idjanela].x, i3GEOF.identifica.propJanelas[idjanela].y, idjanela); | |
205 | 219 | } |
206 | - var b, onButtonClick = function(evt) { | |
207 | - var botao = evt.target; | |
208 | - if (botao) { | |
209 | - if (botao.value != "") { | |
210 | - i3GEO.mapa.ativaTema(botao.value); | |
211 | - i3GEOF.identifica.propJanelas[idjanela].tema = botao.value; | |
212 | - i3GEOF.identifica.propJanelas[idjanela].temaAtivo = botao.value; | |
220 | + } | |
221 | + } | |
222 | + }; | |
223 | + try { | |
224 | + $i(iddiv).innerHTML = i3GEOF.identifica.html(idjanela); | |
225 | + if (!$i(idjanela + "i3GEOFidentificaComboCabecaSel")) { | |
226 | + i3GEO.janela.comboCabecalhoTemasBs( | |
227 | + idjanela + "i3GEOFidentificaComboCabeca", | |
228 | + idjanela + "i3GEOFidentificaComboCabecaSel", | |
229 | + "identifica", | |
230 | + "ligados", | |
231 | + onButtonClick); | |
232 | + } | |
233 | + i3GEOF.identifica.propJanelas[idjanela].tema = tema; | |
234 | + i3GEOF.identifica.propJanelas[idjanela].temaAtivo = tema; | |
235 | + i3GEOF.identifica.propJanelas[idjanela].x = x; | |
236 | + i3GEOF.identifica.propJanelas[idjanela].y = y; | |
237 | + i3GEOF.identifica.propJanelas[idjanela].marca = false; | |
238 | + i3GEOF.identifica.mostraLinkGeohack = mostraLinkGeohack; | |
239 | + i3GEOF.identifica.mostraSistemasAdicionais = mostraSistemasAdicionais; | |
240 | + // se o usuário for editor, força mostrar a lista | |
241 | + // de sistemas | |
242 | + if (i3GEO.parametros.editor.toLowerCase() == "sim") { | |
243 | + i3GEOF.identifica.mostraSistemasAdicionais == true; | |
244 | + } | |
245 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); | |
246 | + // eventos das guias | |
247 | + $i(idjanela + "i3GEOidentificaguia1").onclick = function() { | |
248 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); | |
249 | + if (i3GEO.identifica.propJanelas[idjanela].temaAtivo === "") { | |
250 | + $i(idjanela + "i3GEOidentificaguia1obj").innerHTML = $trad('selecionaTema', i3GEOF.identifica.dicionario); | |
251 | + } | |
252 | + }; | |
253 | + $i(idjanela + "i3GEOidentificaguia3").onclick = function() { | |
254 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia3", idjanela + "i3GEOidentificaguia"); | |
255 | + }; | |
256 | + $i(idjanela + "i3GEOidentificaguia5").onclick = | |
257 | + function() { | |
258 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia5", idjanela + "i3GEOidentificaguia"); | |
259 | + var ins = "", | |
260 | + gh = i3GEO.coordenadas.geohash.encodeGeoHash(i3GEOF.identifica.propJanelas[idjanela].y,i3GEOF.identifica.propJanelas[idjanela].x); | |
213 | 261 | |
214 | - var temp = i3GEO.arvoreDeCamadas.pegaTema(botao.value); | |
215 | - if (temp.identifica.toLowerCase() !== "nao") { | |
216 | - i3GEOF.identifica.buscaDadosTema(botao.value, i3GEOF.identifica.propJanelas[idjanela].x, i3GEOF.identifica.propJanelas[idjanela].y, idjanela); | |
217 | - } | |
218 | - } | |
219 | - } | |
220 | - }; | |
221 | - try { | |
222 | - $i(iddiv).innerHTML = i3GEOF.identifica.html(idjanela); | |
223 | - if (!$i(idjanela + "i3GEOFidentificaComboCabecaSel")) { | |
224 | - i3GEO.janela.comboCabecalhoTemasBs( | |
225 | - idjanela + "i3GEOFidentificaComboCabeca", | |
226 | - idjanela + "i3GEOFidentificaComboCabecaSel", | |
227 | - "identifica", | |
228 | - "ligados", | |
229 | - onButtonClick); | |
230 | - } | |
231 | - i3GEOF.identifica.propJanelas[idjanela].tema = tema; | |
232 | - i3GEOF.identifica.propJanelas[idjanela].temaAtivo = tema; | |
233 | - i3GEOF.identifica.propJanelas[idjanela].x = x; | |
234 | - i3GEOF.identifica.propJanelas[idjanela].y = y; | |
235 | - i3GEOF.identifica.propJanelas[idjanela].marca = false; | |
236 | - i3GEOF.identifica.mostraLinkGeohack = mostraLinkGeohack; | |
237 | - i3GEOF.identifica.mostraSistemasAdicionais = mostraSistemasAdicionais; | |
238 | - // se o usuário for editor, força mostrar a lista | |
239 | - // de sistemas | |
240 | - if (i3GEO.parametros.editor.toLowerCase() == "sim") { | |
241 | - i3GEOF.identifica.mostraSistemasAdicionais == true; | |
242 | - } | |
243 | - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); | |
244 | - // eventos das guias | |
245 | - $i(idjanela + "i3GEOidentificaguia1").onclick = function() { | |
246 | - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); | |
247 | - if (i3GEO.identifica.propJanelas[idjanela].temaAtivo === "") { | |
248 | - $i(idjanela + "i3GEOidentificaguia1obj").innerHTML = $trad('selecionaTema', i3GEOF.identifica.dicionario); | |
249 | - } | |
250 | - }; | |
251 | - $i(idjanela + "i3GEOidentificaguia3").onclick = function() { | |
252 | - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia3", idjanela + "i3GEOidentificaguia"); | |
253 | - }; | |
254 | - $i(idjanela + "i3GEOidentificaguia5").onclick = | |
255 | - function() { | |
256 | - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia5", idjanela + "i3GEOidentificaguia"); | |
257 | - var ins = "", | |
258 | - gh = i3GEO.coordenadas.geohash.encodeGeoHash(i3GEOF.identifica.propJanelas[idjanela].y,i3GEOF.identifica.propJanelas[idjanela].x); | |
262 | + ins += "<h5>X: " + i3GEOF.identifica.propJanelas[idjanela].x + " Y: " + i3GEOF.identifica.propJanelas[idjanela].y + "</h5>"; | |
263 | + ins += "<h5>Geohash: <a href='http://geohash.org/" + gh + "' target=_blank >" + gh + "</a></h5>"; | |
264 | + $i(idjanela + "i3GEOidentificacoord").innerHTML = ins; | |
265 | + }; | |
266 | + // | |
267 | + // verifica se existem sistemas para identificar | |
268 | + // | |
269 | + i3GEOF.identifica.atualizaSistemas(); | |
270 | + if (i3GEOF.identifica.propJanelas[idjanela].temaAtivo !== "") { | |
271 | + // verifica se o tema ativo pode ser identificado | |
272 | + var temp = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); | |
273 | + if (temp.identifica.toLowerCase() !== "nao") { | |
274 | + i3GEOF.identifica.buscaDadosTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo, "", "", idjanela); | |
275 | + } | |
276 | + } | |
277 | + } catch (erro) { | |
278 | + } | |
279 | + }, | |
280 | + buffer: function(idjanela){ | |
281 | + var js = i3GEO.configura.locaplic + "/ferramentas/bufferpt/dependencias.php"; | |
282 | + i3GEO.util.scriptTag( | |
283 | + js, | |
284 | + "i3GEOF.bufferpt.iniciaJanelaFlutuante(" + i3GEOF.identifica.propJanelas[idjanela].x | |
285 | + + "," | |
286 | + + i3GEOF.identifica.propJanelas[idjanela].y | |
287 | + + ")", | |
288 | + "i3GEOF.bufferpt_script" | |
289 | + ); | |
290 | + }, | |
291 | + atualizaSistemas : function() { | |
292 | + if (i3GEOF.identifica.mostraSistemasAdicionais === true) { | |
293 | + if (i3GEOF.identifica.sistemasAdicionais.length == 0) { | |
294 | + var p = | |
295 | + i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?funcao=pegaSistemasIdentificacao&g_sid=" | |
296 | + + i3GEO.configura.sid; | |
297 | + cpJSON.call(p, "foo", i3GEOF.identifica.montaListaSistemas); | |
298 | + } else { | |
299 | + i3GEOF.identifica.montaListaSistemas(""); | |
300 | + } | |
301 | + } | |
302 | + }, | |
303 | + /* | |
304 | + * Function: iniciaJanelaFlutuante | |
305 | + * | |
306 | + * Cria a janela flutuante para controle da ferramenta. | |
307 | + */ | |
308 | + iniciaJanelaFlutuante : function(x, y) { | |
309 | + var minimiza, cabecalho, duplica, janela, divid, temp, titulo, id = "ident" + parseInt(Math.random() * 1000000, 10); | |
310 | + i3GEOF.identifica.janelas.push(id); | |
311 | + i3GEOF.identifica.propJanelas[id] = {}; | |
312 | + if (x) { | |
313 | + objposicaocursor.ddx = x; | |
314 | + objposicaocursor.ddy = y; | |
315 | + i3GEOF.identifica.propJanelas[id].x = x; | |
316 | + i3GEOF.identifica.propJanelas[id].y = y; | |
317 | + i3GEOF.identifica.propJanelas[id].marca = false; | |
318 | + i3GEOF.identifica.x = x; | |
319 | + i3GEOF.identifica.y = y; | |
320 | + } | |
321 | + // funcao que sera executada ao ser clicado no cabeçalho da | |
322 | + // janela | |
323 | + cabecalho = function() { | |
324 | + i3GEOF.identifica.ativaFoco(id); | |
325 | + }; | |
326 | + minimiza = function() { | |
327 | + i3GEO.janela.minimiza(id); | |
328 | + }; | |
329 | + duplica = function() { | |
330 | + i3GEOF.identifica.iniciaJanelaFlutuante(i3GEOF.identifica.propJanelas[id].x, i3GEOF.identifica.propJanelas[id].y); | |
331 | + }; | |
332 | + // cria a janela flutuante | |
333 | + titulo = "<span class='i3GeoTituloJanelaBsNolink' >"+$trad("d7t")+"</span></div>"; | |
259 | 334 | |
260 | - ins += "<p>X: " + i3GEOF.identifica.propJanelas[idjanela].x + " Y: " + i3GEOF.identifica.propJanelas[idjanela].y + "</p>"; | |
261 | - ins += "<p>Geohash: <a href='http://geohash.org/" + gh + "' target=_blank >" + gh + "</a></p>"; | |
262 | - $i(idjanela + "i3GEOidentificacoord").innerHTML = ins; | |
263 | - }; | |
264 | - // | |
265 | - // verifica se existem sistemas para identificar | |
266 | - // | |
267 | - i3GEOF.identifica.atualizaSistemas(); | |
268 | - if (i3GEOF.identifica.propJanelas[idjanela].temaAtivo !== "") { | |
269 | - // verifica se o tema ativo pode ser identificado | |
270 | - var temp = i3GEO.arvoreDeCamadas.pegaTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo); | |
271 | - if (temp.identifica.toLowerCase() !== "nao") { | |
272 | - i3GEOF.identifica.buscaDadosTema(i3GEOF.identifica.propJanelas[idjanela].temaAtivo, "", "", idjanela); | |
273 | - } | |
274 | - } | |
275 | - } catch (erro) { | |
276 | - } | |
277 | - }, | |
278 | - buffer: function(idjanela){ | |
279 | - var js = i3GEO.configura.locaplic + "/ferramentas/bufferpt/dependencias.php"; | |
280 | - i3GEO.util.scriptTag( | |
281 | - js, | |
282 | - "i3GEOF.bufferpt.iniciaJanelaFlutuante(" + i3GEOF.identifica.propJanelas[idjanela].x | |
283 | - + "," | |
284 | - + i3GEOF.identifica.propJanelas[idjanela].y | |
285 | - + ")", | |
286 | - "i3GEOF.bufferpt_script" | |
287 | - ); | |
288 | - }, | |
289 | - atualizaSistemas : function() { | |
290 | - if (i3GEOF.identifica.mostraSistemasAdicionais === true) { | |
291 | - if (i3GEOF.identifica.sistemasAdicionais.length == 0) { | |
292 | - var p = | |
293 | - i3GEO.configura.locaplic + "/classesphp/mapa_controle.php?funcao=pegaSistemasIdentificacao&g_sid=" | |
294 | - + i3GEO.configura.sid; | |
295 | - cpJSON.call(p, "foo", i3GEOF.identifica.montaListaSistemas); | |
296 | - } else { | |
297 | - i3GEOF.identifica.montaListaSistemas(""); | |
298 | - } | |
299 | - } | |
300 | - }, | |
301 | - /* | |
302 | - * Function: iniciaJanelaFlutuante | |
303 | - * | |
304 | - * Cria a janela flutuante para controle da ferramenta. | |
305 | - */ | |
306 | - iniciaJanelaFlutuante : function(x, y) { | |
307 | - var minimiza, cabecalho, duplica, janela, divid, temp, titulo, id = "ident" + parseInt(Math.random() * 1000000, 10); | |
308 | - i3GEOF.identifica.janelas.push(id); | |
309 | - i3GEOF.identifica.propJanelas[id] = {}; | |
310 | - if (x) { | |
311 | - objposicaocursor.ddx = x; | |
312 | - objposicaocursor.ddy = y; | |
313 | - i3GEOF.identifica.propJanelas[id].x = x; | |
314 | - i3GEOF.identifica.propJanelas[id].y = y; | |
315 | - i3GEOF.identifica.propJanelas[id].marca = false; | |
316 | - i3GEOF.identifica.x = x; | |
317 | - i3GEOF.identifica.y = y; | |
318 | - } | |
319 | - // funcao que sera executada ao ser clicado no cabeçalho da | |
320 | - // janela | |
321 | - cabecalho = function() { | |
322 | - i3GEOF.identifica.ativaFoco(id); | |
323 | - }; | |
324 | - minimiza = function() { | |
325 | - i3GEO.janela.minimiza(id); | |
326 | - }; | |
327 | - duplica = function() { | |
328 | - i3GEOF.identifica.iniciaJanelaFlutuante(i3GEOF.identifica.propJanelas[id].x, i3GEOF.identifica.propJanelas[id].y); | |
329 | - }; | |
330 | - // cria a janela flutuante | |
331 | - titulo = "<span class='i3GeoTituloJanelaBsNolink' >"+$trad("d7t")+"</span></div>"; | |
335 | + janela = | |
336 | + i3GEO.janela.cria( | |
337 | + "470px", | |
338 | + "270px", | |
339 | + "", | |
340 | + "", | |
341 | + "", | |
342 | + titulo, | |
343 | + id, | |
344 | + false, | |
345 | + "hd", | |
346 | + cabecalho, | |
347 | + minimiza, | |
348 | + "", | |
349 | + true, | |
350 | + i3GEO.configura.locaplic + "/imagens/oxygen/16x16/telepathy-kde.png", | |
351 | + duplica, | |
352 | + "", | |
353 | + "", | |
354 | + "70" | |
355 | + ); | |
356 | + divid = janela[2].id; | |
357 | + if (i3GEOF.identifica.janelas.length > 1) { | |
358 | + temp = janela[0].cfg.config; | |
359 | + janela[0].moveTo( | |
360 | + temp.x.value + (i3GEOF.identifica.janelas.length * 50), | |
361 | + temp.y.value + (i3GEOF.identifica.janelas.length * 15)); | |
362 | + } | |
363 | + i3GEOF.identifica.inicia(i3GEO.temaAtivo, objposicaocursor.ddx, objposicaocursor.ddy, divid, true, true, id); | |
364 | + janela[2].style.backgroundColor = "white"; | |
332 | 365 | |
333 | - janela = | |
334 | - i3GEO.janela.cria( | |
335 | - "470px", | |
336 | - "270px", | |
337 | - "", | |
338 | - "", | |
339 | - "", | |
340 | - titulo, | |
341 | - id, | |
342 | - false, | |
343 | - "hd", | |
344 | - cabecalho, | |
345 | - minimiza, | |
346 | - "", | |
347 | - true, | |
348 | - i3GEO.configura.locaplic + "/imagens/oxygen/16x16/telepathy-kde.png", | |
349 | - duplica, | |
350 | - "", | |
351 | - "", | |
352 | - "70" | |
353 | - ); | |
354 | - divid = janela[2].id; | |
355 | - if (i3GEOF.identifica.janelas.length > 1) { | |
356 | - temp = janela[0].cfg.config; | |
357 | - janela[0].moveTo( | |
358 | - temp.x.value + (i3GEOF.identifica.janelas.length * 50), | |
359 | - temp.y.value + (i3GEOF.identifica.janelas.length * 15)); | |
360 | - } | |
361 | - i3GEOF.identifica.inicia(i3GEO.temaAtivo, objposicaocursor.ddx, objposicaocursor.ddy, divid, true, true, id); | |
362 | - janela[2].style.backgroundColor = "white"; | |
366 | + i3GEOF.identifica.propJanelas[id].aguarde = $i(id + "_imagemCabecalho").style; | |
367 | + i3GEOF.identifica.propJanelas[id].atualiza = true; | |
368 | + temp = 'i3GEOF.identifica.propJanelas["' + id + '"].atualiza = this.checked'; | |
369 | + janela[0] | |
370 | + .setFooter("<div class='checkbox text-left'><label><input checked id='{{{idjanela}}}i3GEOtabelatipolista' type='checkbox' onclick='" + temp + "'><span class='checkbox-material noprint'><span class='check'></span></span> " + $trad('atualizaJanela', i3GEOF.identifica.dicionario) + "</label></div>"); | |
363 | 371 | |
364 | - i3GEOF.identifica.propJanelas[id].aguarde = $i(id + "_imagemCabecalho").style; | |
365 | - i3GEOF.identifica.propJanelas[id].atualiza = true; | |
366 | - temp = 'i3GEOF.identifica.propJanelas["' + id + '"].atualiza = this.checked'; | |
367 | - janela[0] | |
368 | - .setFooter("<div class='checkbox text-left'><label><input checked id='{{{idjanela}}}i3GEOtabelatipolista' type='checkbox' onclick='" + temp + "'><span class='checkbox-material noprint'><span class='check'></span></span> " + $trad('atualizaJanela', i3GEOF.identifica.dicionario) + "</label></div>"); | |
372 | + temp = function() { | |
373 | + i3GEOF.identifica.limpaMarca(id); | |
374 | + i3GEOF.identifica.janelas.remove(id); | |
375 | + i3GEOF.identifica.propJanelas[id] = null; | |
376 | + if (i3GEOF.identifica.janelas.length === 0) { | |
377 | + i3GEO.eventos.removeEventos("MOUSECLIQUE", ["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]); | |
378 | + i3GEO.eventos.removeEventos("MOUSECLIQUEPERM", ["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]); | |
379 | + i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM", ["i3GEO.mapa.dialogo.verificaTipDefault()"]); | |
380 | + // reativa o evento default | |
381 | + i3GEO.eventos.cliquePerm.ativa(); | |
382 | + } | |
383 | + }; | |
384 | + YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
385 | + }, | |
386 | + limpaMarca : function(id) { | |
387 | + i3GEO.desenho.removePins(id); | |
388 | + i3GEOF.identifica.propJanelas[id].marca = false; | |
389 | + }, | |
390 | + /* | |
391 | + * Function: ativaFoco | |
392 | + * | |
393 | + * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado | |
394 | + */ | |
395 | + ativaFoco : function(id) { | |
369 | 396 | |
370 | - temp = function() { | |
371 | - i3GEOF.identifica.limpaMarca(id); | |
372 | - i3GEOF.identifica.janelas.remove(id); | |
373 | - i3GEOF.identifica.propJanelas[id] = null; | |
374 | - if (i3GEOF.identifica.janelas.length === 0) { | |
375 | - i3GEO.eventos.removeEventos("MOUSECLIQUE", ["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]); | |
376 | - i3GEO.eventos.removeEventos("MOUSECLIQUEPERM", ["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]); | |
377 | - i3GEO.eventos.adicionaEventos("MOUSECLIQUEPERM", ["i3GEO.mapa.dialogo.verificaTipDefault()"]); | |
378 | - // reativa o evento default | |
379 | - i3GEO.eventos.cliquePerm.ativa(); | |
380 | - } | |
381 | - }; | |
382 | - YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
383 | - }, | |
384 | - limpaMarca : function(id) { | |
385 | - i3GEO.desenho.removePins(id); | |
386 | - i3GEOF.identifica.propJanelas[id].marca = false; | |
387 | - }, | |
388 | - /* | |
389 | - * Function: ativaFoco | |
390 | - * | |
391 | - * Refaz a interface da ferramenta quando a janela flutuante tem seu foco ativado | |
392 | - */ | |
393 | - ativaFoco : function(id) { | |
397 | + }, | |
398 | + mostraImagemPonto : function(id) { | |
399 | + if (i3GEO.Interface.ATUAL === "googleearth") { | |
400 | + return; | |
401 | + } | |
402 | + if (i3GEOF.identifica.propJanelas[id].marca === false) { | |
403 | + i3GEOF.identifica.propJanelas[id].marca = | |
404 | + i3GEO.desenho.addPin(i3GEOF.identifica.propJanelas[id].x, i3GEOF.identifica.propJanelas[id].y, "", "", "", id); | |
405 | + } else { | |
406 | + i3GEO.desenho.movePin( | |
407 | + i3GEOF.identifica.propJanelas[id].marca, | |
408 | + i3GEOF.identifica.propJanelas[id].x, | |
409 | + i3GEOF.identifica.propJanelas[id].y); | |
410 | + } | |
411 | + }, | |
412 | + /* | |
413 | + * Function: html | |
414 | + * | |
415 | + * Gera o código html para apresentação das opções da ferramenta | |
416 | + * | |
417 | + * Retorno: | |
418 | + * | |
419 | + * String com o código html | |
420 | + */ | |
421 | + html : function(idjanela) { | |
422 | + var ins = Mustache.render(i3GEOF.identifica.MUSTACHE, i3GEOF.identifica.mustacheHash(idjanela)); | |
423 | + return ins; | |
424 | + }, | |
425 | + /* | |
426 | + * Abre a janela flutuante para controlar o processo de reposicionar um ponto. Ativada apenas quando o usuario puder editar um tema | |
427 | + */ | |
428 | + janelaMoverPonto : function(tema, idreg) { | |
429 | + if ($i("i3GEOF.movePonto_corpo")) { | |
430 | + return; | |
431 | + } | |
432 | + var temp, titulo; | |
433 | + // cria a janela flutuante | |
434 | + titulo = "<div class='i3GeoTituloJanela'>" + $trad('move', i3GEOF.identifica.dicionario) + "</div>"; | |
435 | + i3GEO.janela.cria("250px", "100px", "", "", "", titulo, "i3GEOF.movePonto", false, "hd", "", ""); | |
436 | + $i("i3GEOF.movePonto_corpo").style.backgroundColor = "white"; | |
437 | + i3GEO.eventos.removeEventos("MOUSECLIQUEPERM", ["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]); | |
438 | + i3GEO.eventos.adicionaEventos("MOUSECLIQUE", [ | |
439 | + "i3GEOF.identifica.atualizaJanelaMoverPonto()" | |
440 | + ]); | |
441 | + temp = function() { | |
442 | + i3GEO.eventos.adicionaEventos("MOUSECLIQUE", ["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]); | |
443 | + }; | |
444 | + YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
445 | + $i("i3GEOF.movePonto_corpo").innerHTML = | |
446 | + "" + $trad('cliqueNovaPosicao', i3GEOF.identifica.dicionario) | |
447 | + + "<br><br><p class=paragrafo >X: </p>" | |
448 | + + "<div class='i3geoForm100 i3geoFormIconeEdita' ><input type=text id=i3GEOF.movePontoX /></div>" | |
449 | + + "<br><p class=paragrafo >Y: </p>" | |
450 | + + "<div class='i3geoForm100 i3geoFormIconeEdita' ><input type=text id=i3GEOF.movePontoY /></div>" | |
451 | + + "<input type=buttom value='" | |
452 | + + $trad('move', i3GEOF.identifica.dicionario) | |
453 | + + "' id=i3GEOF.moveAplica />" | |
454 | + + "<input type=hidden value='" | |
455 | + + tema | |
456 | + + "' id=i3GEOF.moveAplicaTema />"; | |
394 | 457 | |
395 | - }, | |
396 | - mostraImagemPonto : function(id) { | |
397 | - if (i3GEO.Interface.ATUAL === "googleearth") { | |
398 | - return; | |
399 | - } | |
400 | - if (i3GEOF.identifica.propJanelas[id].marca === false) { | |
401 | - i3GEOF.identifica.propJanelas[id].marca = | |
402 | - i3GEO.desenho.addPin(i3GEOF.identifica.propJanelas[id].x, i3GEOF.identifica.propJanelas[id].y, "", "", "", id); | |
403 | - } else { | |
404 | - i3GEO.desenho.movePin( | |
405 | - i3GEOF.identifica.propJanelas[id].marca, | |
406 | - i3GEOF.identifica.propJanelas[id].x, | |
407 | - i3GEOF.identifica.propJanelas[id].y); | |
458 | + new YAHOO.widget.Button( | |
459 | + "i3GEOF.moveAplica", | |
460 | + { | |
461 | + onclick : { | |
462 | + fn : function() { | |
463 | + var x = $i("i3GEOF.movePontoX").value, y = $i("i3GEOF.movePontoY").value, tema = | |
464 | + $i("i3GEOF.moveAplicaTema").value, p = | |
465 | + i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=atualizageometria&g_sid=" | |
466 | + + i3GEO.configura.sid, temp = function(retorno) { | |
467 | + i3GEO.janela.fechaAguarde("aguardeSalvaPonto"); | |
468 | + i3GEO.Interface.atualizaTema("", tema); | |
469 | + i3GEOF.identifica.buscaDadosTema(tema, x, y); | |
470 | + }; | |
471 | + i3GEO.janela.AGUARDEMODAL = true; | |
472 | + i3GEO.janela.abreAguarde("aguardeSalvaPonto", "Adicionando..."); | |
473 | + i3GEO.janela.AGUARDEMODAL = false; | |
474 | + cpJSON.call(p, "foo", temp, "&idunico=" + idreg + "&tema=" + tema + "&wkt=POINT(" + x + " " + y + ")"); | |
475 | + } | |
408 | 476 | } |
409 | - }, | |
410 | - /* | |
411 | - * Function: html | |
412 | - * | |
413 | - * Gera o código html para apresentação das opções da ferramenta | |
414 | - * | |
415 | - * Retorno: | |
416 | - * | |
417 | - * String com o código html | |
418 | - */ | |
419 | - html : function(idjanela) { | |
420 | - var ins = Mustache.render(i3GEOF.identifica.MUSTACHE, i3GEOF.identifica.mustacheHash(idjanela)); | |
421 | - return ins; | |
422 | - }, | |
423 | - /* | |
424 | - * Abre a janela flutuante para controlar o processo de reposicionar um ponto. Ativada apenas quando o usuario puder editar um tema | |
425 | - */ | |
426 | - janelaMoverPonto : function(tema, idreg) { | |
427 | - if ($i("i3GEOF.movePonto_corpo")) { | |
428 | - return; | |
477 | + }); | |
478 | + }, | |
479 | + atualizaJanelaMoverPonto : function() { | |
480 | + if ($i("i3GEOF.movePontoX")) { | |
481 | + $i("i3GEOF.movePontoX").value = objposicaocursor.ddx; | |
482 | + $i("i3GEOF.movePontoY").value = objposicaocursor.ddy; | |
483 | + } else { | |
484 | + i3GEO.eventos.removeEventos("MOUSECLIQUE", [ | |
485 | + "i3GEOF.identifica.atualizaJanelaMoverPonto()" | |
486 | + ]); | |
487 | + } | |
488 | + }, | |
489 | + /* | |
490 | + * Function: montaLinkGeohack | |
491 | + * | |
492 | + * Monta o link para o site geohack | |
493 | + * | |
494 | + * Return: | |
495 | + * | |
496 | + * {String} | |
497 | + */ | |
498 | + montaLinkGeohack : function() { | |
499 | + return "<a href='#' onclick='i3GEOF.identifica.abreLinkGeohack()' >Buscadores web</a><br>"; | |
500 | + }, | |
501 | + abreLinkGeohack : function() { | |
502 | + var b, x, y, w, s, param; | |
503 | + b = i3GEO.calculo.dd2dms(i3GEOF.identifica.x, i3GEOF.identifica.y); | |
504 | + x = b[0].split(" "); | |
505 | + y = b[1].split(" "); | |
506 | + w = "W"; | |
507 | + s = "S"; | |
508 | + if (x[0] * 1 > 0) { | |
509 | + w = "L"; | |
510 | + } | |
511 | + if (y[0] * 1 > 0) { | |
512 | + s = "N"; | |
513 | + } | |
514 | + if (x[0] * 1 < 0) { | |
515 | + x[0] = x[0] * -1; | |
516 | + } | |
517 | + if (y[0] * 1 < 0) { | |
518 | + y[0] = y[0] * -1; | |
519 | + } | |
520 | + param = y[0] + "_" + y[1] + "_" + y[2] + "_" + s + "_" + x[0] + "_" + x[1] + "_" + x[2] + "_" + w; | |
521 | + window.open("http://tools.wikimedia.de/~magnus/geo/geohack.php?params=" + param); | |
522 | + }, | |
523 | + /* | |
524 | + * Function: montaListaSistemas | |
525 | + * | |
526 | + * Obtém a lista de sistemas especiais de consulta. | |
527 | + * | |
528 | + * O resultado é inserido no div com id "listaSistemas". | |
529 | + * | |
530 | + * Cada sistema consiste em uma URL para a qual serão passados os parametros x e y. | |
531 | + * | |
532 | + */ | |
533 | + montaListaSistemas : function(retorno) { | |
534 | + var l, divins, ig, sistema, pub, exec, temp, t, linhas = [], ltema, i, idjanela, n = i3GEOF.identifica.janelas.length; | |
535 | + if (retorno !== undefined ) { | |
536 | + if (retorno.data && i3GEOF.identifica.sistemasAdicionais.length == 0) { | |
537 | + sis = retorno.data; | |
538 | + for (ig = 0; ig < sis.length; ig++) { | |
539 | + if (sis[ig].PUBLICADO && sis[ig].PUBLICADO.toLowerCase() == "sim" ) { | |
540 | + sistema = sis[ig].NOME; | |
541 | + exec = sis[ig].ABRIR; | |
542 | + temp = exec.split("?"); | |
543 | + if (temp.length !== 2) { | |
544 | + exec += "?"; | |
545 | + } | |
546 | + t = "blank"; | |
547 | + if (sis[ig].TARGET) { | |
548 | + t = sis[ig].TARGET; | |
549 | + } | |
550 | + i3GEOF.identifica.sistemasAdicionais.push(sistema + "," + exec + "," + t); | |
429 | 551 | } |
430 | - var temp, titulo; | |
431 | - // cria a janela flutuante | |
432 | - titulo = "<div class='i3GeoTituloJanela'>" + $trad('move', i3GEOF.identifica.dicionario) + "</div>"; | |
433 | - i3GEO.janela.cria("250px", "100px", "", "", "", titulo, "i3GEOF.movePonto", false, "hd", "", ""); | |
434 | - $i("i3GEOF.movePonto_corpo").style.backgroundColor = "white"; | |
435 | - i3GEO.eventos.removeEventos("MOUSECLIQUEPERM", ["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]); | |
436 | - i3GEO.eventos.adicionaEventos("MOUSECLIQUE", [ | |
437 | - "i3GEOF.identifica.atualizaJanelaMoverPonto()" | |
438 | - ]); | |
439 | - temp = function() { | |
440 | - i3GEO.eventos.adicionaEventos("MOUSECLIQUE", ["i3GEO.mapa.dialogo.cliqueIdentificaDefault()"]); | |
441 | - }; | |
442 | - YAHOO.util.Event.addListener(janela[0].close, "click", temp); | |
443 | - $i("i3GEOF.movePonto_corpo").innerHTML = | |
444 | - "" + $trad('cliqueNovaPosicao', i3GEOF.identifica.dicionario) | |
445 | - + "<br><br><p class=paragrafo >X: </p>" | |
446 | - + "<div class='i3geoForm100 i3geoFormIconeEdita' ><input type=text id=i3GEOF.movePontoX /></div>" | |
447 | - + "<br><p class=paragrafo >Y: </p>" | |
448 | - + "<div class='i3geoForm100 i3geoFormIconeEdita' ><input type=text id=i3GEOF.movePontoY /></div>" | |
449 | - + "<input type=buttom value='" | |
450 | - + $trad('move', i3GEOF.identifica.dicionario) | |
451 | - + "' id=i3GEOF.moveAplica />" | |
452 | - + "<input type=hidden value='" | |
453 | - + tema | |
454 | - + "' id=i3GEOF.moveAplicaTema />"; | |
455 | - | |
456 | - new YAHOO.widget.Button( | |
457 | - "i3GEOF.moveAplica", | |
458 | - { | |
459 | - onclick : { | |
460 | - fn : function() { | |
461 | - var x = $i("i3GEOF.movePontoX").value, y = $i("i3GEOF.movePontoY").value, tema = | |
462 | - $i("i3GEOF.moveAplicaTema").value, p = | |
463 | - i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=atualizageometria&g_sid=" | |
464 | - + i3GEO.configura.sid, temp = function(retorno) { | |
465 | - i3GEO.janela.fechaAguarde("aguardeSalvaPonto"); | |
466 | - i3GEO.Interface.atualizaTema("", tema); | |
467 | - i3GEOF.identifica.buscaDadosTema(tema, x, y); | |
468 | - }; | |
469 | - i3GEO.janela.AGUARDEMODAL = true; | |
470 | - i3GEO.janela.abreAguarde("aguardeSalvaPonto", "Adicionando..."); | |
471 | - i3GEO.janela.AGUARDEMODAL = false; | |
472 | - cpJSON.call(p, "foo", temp, "&idunico=" + idreg + "&tema=" + tema + "&wkt=POINT(" + x + " " + y + ")"); | |
473 | - } | |
474 | - } | |
475 | - }); | |
476 | - }, | |
477 | - atualizaJanelaMoverPonto : function() { | |
478 | - if ($i("i3GEOF.movePontoX")) { | |
479 | - $i("i3GEOF.movePontoX").value = objposicaocursor.ddx; | |
480 | - $i("i3GEOF.movePontoY").value = objposicaocursor.ddy; | |
481 | - } else { | |
482 | - i3GEO.eventos.removeEventos("MOUSECLIQUE", [ | |
483 | - "i3GEOF.identifica.atualizaJanelaMoverPonto()" | |
484 | - ]); | |
552 | + } | |
553 | + } | |
554 | + if (i3GEOF.identifica.sistemasAdicionais.length > 0) { | |
555 | + for (i = 0; i < n; i++) { | |
556 | + idjanela = i3GEOF.identifica.janelas[i]; | |
557 | + divins = $i(idjanela + "i3GEOidentificalistaSistemas"); | |
558 | + linhas = []; | |
559 | + if (divins) { | |
560 | + linhas.push({ | |
561 | + "idjanela": idjanela, | |
562 | + "nome": "Mostra os dados de todos os temas do mapa", | |
563 | + "click": "i3GEOF.identifica.buscaDadosTema('ligados','','','" + idjanela + "')" | |
564 | + }); | |
565 | + for (l = 0; l < i3GEOF.identifica.sistemasAdicionais.length; l++) { | |
566 | + ltema = i3GEOF.identifica.sistemasAdicionais[l].split(","); | |
567 | + if (ltema.length > 1) { | |
568 | + linhas.push({ | |
569 | + "idjanela": idjanela, | |
570 | + "nome": ltema[0], | |
571 | + "click": "i3GEOF.identifica.mostraDadosSistema('" + ltema[1] + "','" + ltema[2] + "','" + idjanela + "')" | |
572 | + }); | |
573 | + } | |
574 | + } | |
575 | + temp = Mustache.render("{{#data}}" + i3GEOF.identifica.MUSTACHESISTEMAS + "{{/data}}", {"data":linhas}); | |
576 | + divins.innerHTML = temp; | |
485 | 577 | } |
486 | - }, | |
487 | - /* | |
488 | - * Function: montaLinkGeohack | |
489 | - * | |
490 | - * Monta o link para o site geohack | |
491 | - * | |
492 | - * Return: | |
493 | - * | |
494 | - * {String} | |
495 | - */ | |
496 | - montaLinkGeohack : function() { | |
497 | - return "<a href='#' onclick='i3GEOF.identifica.abreLinkGeohack()' >Buscadores web</a><br>"; | |
498 | - }, | |
499 | - abreLinkGeohack : function() { | |
500 | - var b, x, y, w, s, param; | |
501 | - b = i3GEO.calculo.dd2dms(i3GEOF.identifica.x, i3GEOF.identifica.y); | |
502 | - x = b[0].split(" "); | |
503 | - y = b[1].split(" "); | |
504 | - w = "W"; | |
505 | - s = "S"; | |
506 | - if (x[0] * 1 > 0) { | |
507 | - w = "L"; | |
578 | + } | |
579 | + } | |
580 | + } | |
581 | + }, | |
582 | + /* | |
583 | + * Function: buscaDadosTema | |
584 | + * | |
585 | + * Obtém os dados de um tema para o ponto de coordenadas clicado no mapa | |
586 | + * | |
587 | + * Veja: | |
588 | + * | |
589 | + * <i3GEO.php.identifica3> | |
590 | + */ | |
591 | + buscaDadosTema : function(tema, x, y, idjanela) { | |
592 | + var res, opcao, resolucao, janelas, n, i, id; | |
593 | + if (tema != "" && i3GEO.temaAtivo === "") { | |
594 | + i3GEO.temaAtivo = tema; | |
595 | + } | |
596 | + if (idjanela) { | |
597 | + janelas = [ | |
598 | + idjanela | |
599 | + ]; | |
600 | + } else { | |
601 | + janelas = i3GEOF.identifica.janelas; | |
602 | + } | |
603 | + // guarda o valor de x y nas variaveis de uso global da ferramenta | |
604 | + if (x && x != "") { | |
605 | + i3GEOF.identifica.x = x; | |
606 | + i3GEOF.identifica.y = y; | |
607 | + } | |
608 | + n = janelas.length; | |
609 | + if (n == 0 || (idjanela && !$i(idjanela + "i3GEOidentificaguia1obj"))) { | |
610 | + if (x && x != "") { | |
611 | + i3GEOF.identifica.criaJanelaFlutuante(x, y); | |
612 | + } else { | |
613 | + i3GEOF.identifica.criaJanelaFlutuante(); | |
614 | + } | |
615 | + return; | |
616 | + } | |
617 | + try { | |
618 | + if (tema === "ligados") { | |
619 | + opcao = "ligados"; | |
620 | + tema = ""; | |
621 | + } else { | |
622 | + opcao = "tema"; | |
623 | + } | |
624 | + for (i = 0; i < n; i++) { | |
625 | + id = janelas[i]; | |
626 | + if (i3GEOF.identifica.propJanelas[id].atualiza == undefined || i3GEOF.identifica.propJanelas[id].atualiza === true) { | |
627 | + if (x && x != "") { | |
628 | + i3GEOF.identifica.propJanelas[id].x = x; | |
629 | + i3GEOF.identifica.propJanelas[id].y = y; | |
508 | 630 | } |
509 | - if (y[0] * 1 > 0) { | |
510 | - s = "N"; | |
631 | + if (tema != "" && idjanela) { | |
632 | + i3GEOF.identifica.propJanelas[id].temaAtivo = tema; | |
511 | 633 | } |
512 | - if (x[0] * 1 < 0) { | |
513 | - x[0] = x[0] * -1; | |
634 | + if ($i(id + "i3GEOidentificaguia1obj")) { | |
635 | + res = $i(id + "i3GEOidentificaresolucao"); | |
636 | + if (res) { | |
637 | + resolucao = res.value; | |
638 | + } else { | |
639 | + resolucao = 5; | |
640 | + } | |
641 | + i3GEOF.identifica.buscaDadosTemaJanela(id, resolucao, opcao); | |
514 | 642 | } |
515 | - if (y[0] * 1 < 0) { | |
516 | - y[0] = y[0] * -1; | |
643 | + } | |
644 | + } | |
645 | + } catch (e) { | |
646 | + if (!x) { | |
647 | + i3GEOF.identifica.criaJanelaFlutuante(); | |
648 | + } else { | |
649 | + i3GEOF.identifica.criaJanelaFlutuante(x, y); | |
650 | + } | |
651 | + } | |
652 | + }, | |
653 | + buscaDadosTemaJanela : function(idjanela, resolucao, opcao) { | |
654 | + i3GEOF.identifica.mostraImagemPonto(idjanela); | |
655 | + var f = function(retorno) { | |
656 | + // i3GEOF.identifica.dadosIdentifica = retorno.data; | |
657 | + if (retorno !== undefined) { | |
658 | + i3GEOF.identifica.mostraDadosTema(retorno.data, idjanela); | |
659 | + } else { | |
660 | + i3GEOF.identifica.mostraDadosTema(undefined, idjanela); | |
661 | + } | |
662 | + }; | |
663 | + if(opcao == "ligados"){ | |
664 | + listaDeTemas = ""; | |
665 | + } else { | |
666 | + listaDeTemas = i3GEOF.identifica.propJanelas[idjanela].temaAtivo; | |
667 | + } | |
668 | + // importante: os temas editaveis nao utilizam alias em seus nomes | |
669 | + // se o usuario estiver logado | |
670 | + i3GEO.php.identifica3( | |
671 | + f, | |
672 | + i3GEOF.identifica.propJanelas[idjanela].x, | |
673 | + i3GEOF.identifica.propJanelas[idjanela].y, | |
674 | + resolucao, | |
675 | + opcao, | |
676 | + i3GEO.configura.locaplic, | |
677 | + i3GEO.configura.sid, | |
678 | + i3GEOF.identifica.propJanelas[idjanela].temaAtivo, | |
679 | + i3GEO.parametros.mapexten, | |
680 | + listaDeTemas, | |
681 | + "nao"); | |
682 | + }, | |
683 | + /* | |
684 | + * Function: mostraDadosSistema | |
685 | + * | |
686 | + * Obtém os dados de um sistema para o ponto de coordenadas clicado no mapa | |
687 | + * | |
688 | + * Parametros: | |
689 | + * | |
690 | + * exec {String} - url que será aberta | |
691 | + * | |
692 | + * target {String} (depreciado) - _self|self| onde a url será aberta. Se for "self", será aberta na mesma janela, caso | |
693 | + * contrário, em uma nova página do navegador | |
694 | + */ | |
695 | + mostraDadosSistema : function(exec, target, idjanela) { | |
696 | + i3GEOF.identifica.mostraImagemPonto(idjanela); | |
697 | + exec += "&x=" + i3GEOF.identifica.propJanelas[idjanela].x + "&y=" + i3GEOF.identifica.propJanelas[idjanela].y; | |
698 | + if (target === "target") { | |
699 | + window.open(exec); | |
700 | + } else { | |
701 | + i3GEOF.identifica.abrejanelaIframe("500", "500", exec); | |
702 | + } | |
703 | + var i = $i("i3GEOmarcaIdentifica"); | |
704 | + if (i) { | |
705 | + i.style.display = "block"; | |
706 | + } | |
707 | + }, | |
708 | + /* | |
709 | + * Function abrejanelaIframe | |
710 | + * | |
711 | + * Abre uma janela flutuante contendo um iframe | |
712 | + * | |
713 | + * Parametros: | |
714 | + * | |
715 | + * w {string} - largura | |
716 | + * | |
717 | + * h {string} - altura | |
718 | + * | |
719 | + * s {string} - src do iframe | |
720 | + */ | |
721 | + abrejanelaIframe : function(w, h, s) { | |
722 | + var janelaeditor = | |
723 | + i3GEO.janela.cria(w, h, s, parseInt(Math.random() * 100, 10), 10, "", "janela" + i3GEO.util.randomRGB(), false); | |
724 | + var temp = function() { | |
725 | + i3GEOF.identifica.sistemasAdicionais = []; | |
726 | + i3GEOF.identifica.atualizaSistemas(); | |
727 | + }; | |
728 | + YAHOO.util.Event.addListener(janelaeditor[0].close, "click", temp, janelaeditor[0].panel, { | |
729 | + id : janelaeditor[0].id | |
730 | + }, true); | |
731 | + }, | |
732 | + /** | |
733 | + * Aplica um estilo a um elemento de todas as janelas | |
734 | + */ | |
735 | + aplicaEstilo : function(posFixo, estilo, valor) { | |
736 | + var n = i3GEOF.identifica.janelas, i = 0, temp; | |
737 | + for (i = 0; i < n; i++) { | |
738 | + temp = $i(i3GEOF.identifica.janelas[i]); | |
739 | + if (temp) { | |
740 | + temp = $i(i3GEOF.identifica.janelas[i] + posFixo); | |
741 | + if (temp) { | |
742 | + temp.style[estilo] = valor; | |
743 | + } | |
744 | + } | |
745 | + } | |
746 | + }, | |
747 | + /* | |
748 | + * Function: mostraDadosTema | |
749 | + * | |
750 | + * Mostra os dados obtidos de um ou mais temas. | |
751 | + * | |
752 | + * Recebe o resultado em JSON da operação de consulta realizada pelo servidor e formata os dados para | |
753 | + * apresentação na tela. | |
754 | + * | |
755 | + * Parametros: | |
756 | + * | |
757 | + * retorno {JSON} - objeto JSON com os dados <i3GEO.php.identifica3> | |
758 | + */ | |
759 | + mostraDadosTema : function(retorno, idjanela) { | |
760 | + var classeTemp="",codigo_tipo_regiao = "",alvo, filtro, camada, idreg, idsalva, paramsalva, i, res = "", ntemas, resultados, nres, cor, j, nitens, k, atualN = "todas", inicio = | |
761 | + 0, numResultados = 0, tip, link, textovalor; | |
762 | + | |
763 | + if ($i(idjanela + "i3GEOFidentificaNocorrencias")) { | |
764 | + atualN = $i(idjanela + "i3GEOFidentificaNocorrencias").value; | |
765 | + } | |
766 | + i3GEOF.identifica.aplicaEstilo("_corpo", "scrollTop", 0); | |
767 | + if (retorno == undefined || retorno == "") { | |
768 | + $i(idjanela + "i3GEOidentificaguia1obj").innerHTML = $trad('msgNadaEncontrado', i3GEOF.identifica.dicionario); | |
769 | + return; | |
770 | + } | |
771 | + i = $i("i3GEOmarcaIdentifica"); | |
772 | + if (i) { | |
773 | + i.style.display = "block"; | |
774 | + } | |
775 | + var lista = []; | |
776 | + if (retorno !== undefined) { | |
777 | + $i(idjanela + "i3GEOidentificaguia1obj").innerHTML = ""; | |
778 | + ntemas = retorno.length; | |
779 | + for (i = 0; i < ntemas; i++) { | |
780 | + // nome do tema e icone de remover filtro | |
781 | + // icone que mostra as medidas das variaveis vinculadas a uma regiao, se for o caso | |
782 | + if (retorno[i].codigo_tipo_regiao && retorno[i].codigo_tipo_regiao != "") { | |
783 | + classeTemp = ""; | |
784 | + codigo_tipo_regiao = retorno[i].codigo_tipo_regiao; | |
785 | + } else { | |
786 | + codigo_tipo_regiao = ""; | |
787 | + classeTemp = "hidden"; | |
788 | + } | |
789 | + var dadosTema = { | |
790 | + "nome": retorno[i].nome, | |
791 | + "codigoTema": retorno[i].tema, | |
792 | + "idjanela": idjanela, | |
793 | + "codigo_tipo_regiao": codigo_tipo_regiao, | |
794 | + "classeCssRegiao": classeTemp, | |
795 | + "textoRemoveFiltro": $trad('removeFiltro', i3GEOF.identifica.dicionario), | |
796 | + "registros" : [] | |
797 | + }; | |
798 | + resultados = retorno[i].resultado; | |
799 | + // encontrou algo | |
800 | + if (resultados[0] !== " ") { | |
801 | + nres = resultados.length; | |
802 | + numResultados = nres; | |
803 | + if (atualN != "todas") { | |
804 | + nres = atualN * 1; | |
805 | + inicio = atualN * 1 - 1; | |
517 | 806 | } |
518 | - param = y[0] + "_" + y[1] + "_" + y[2] + "_" + s + "_" + x[0] + "_" + x[1] + "_" + x[2] + "_" + w; | |
519 | - window.open("http://tools.wikimedia.de/~magnus/geo/geohack.php?params=" + param); | |
520 | - }, | |
521 | - /* | |
522 | - * Function: montaListaSistemas | |
523 | - * | |
524 | - * Obtém a lista de sistemas especiais de consulta. | |
525 | - * | |
526 | - * O resultado é inserido no div com id "listaSistemas". | |
527 | - * | |
528 | - * Cada sistema consiste em uma URL para a qual serão passados os parametros x e y. | |
529 | - * | |
530 | - */ | |
531 | - montaListaSistemas : function(retorno) { | |
532 | - var l, divins, ig, sistema, pub, exec, temp, t, linhas = [], ltema, i, idjanela, n = i3GEOF.identifica.janelas.length; | |
533 | - if (retorno !== undefined ) { | |
534 | - if (retorno.data && i3GEOF.identifica.sistemasAdicionais.length == 0) { | |
535 | - sis = retorno.data; | |
536 | - for (ig = 0; ig < sis.length; ig++) { | |
537 | - if (sis[ig].PUBLICADO && sis[ig].PUBLICADO.toLowerCase() == "sim" ) { | |
538 | - sistema = sis[ig].NOME; | |
539 | - exec = sis[ig].ABRIR; | |
540 | - temp = exec.split("?"); | |
541 | - if (temp.length !== 2) { | |
542 | - exec += "?"; | |
543 | - } | |
544 | - t = "blank"; | |
545 | - if (sis[ig].TARGET) { | |
546 | - t = sis[ig].TARGET; | |
547 | - } | |
548 | - i3GEOF.identifica.sistemasAdicionais.push(sistema + "," + exec + "," + t); | |
549 | - } | |
550 | - } | |
807 | + var registros = []; | |
808 | + for (j = inicio; j < nres; j++) { | |
809 | + var linha = {}; | |
810 | + nitens = resultados[j].length; | |
811 | + // pega o valor do item que e o id unico no sistema | |
812 | + // METAESTAT | |
813 | + idreg = ""; | |
814 | + for (k = 0; k < nitens; k++) { | |
815 | + if (resultados[j][k].item === retorno[i].colunaidunico) { | |
816 | + idreg = resultados[j][k].valor; | |
551 | 817 | } |
552 | - if (i3GEOF.identifica.sistemasAdicionais.length > 0) { | |
553 | - for (i = 0; i < n; i++) { | |
554 | - idjanela = i3GEOF.identifica.janelas[i]; | |
555 | - divins = $i(idjanela + "i3GEOidentificalistaSistemas"); | |
556 | - linhas = []; | |
557 | - if (divins) { | |
558 | - linhas.push({ | |
559 | - "idjanela": idjanela, | |
560 | - "nome": "Mostra os dados de todos os temas do mapa", | |
561 | - "click": "i3GEOF.identifica.buscaDadosTema('ligados','','','" + idjanela + "')" | |
562 | - }); | |
563 | - for (l = 0; l < i3GEOF.identifica.sistemasAdicionais.length; l++) { | |
564 | - ltema = i3GEOF.identifica.sistemasAdicionais[l].split(","); | |
565 | - if (ltema.length > 1) { | |
566 | - linhas.push({ | |
567 | - "idjanela": idjanela, | |
568 | - "nome": ltema[0], | |
569 | - "click": "i3GEOF.identifica.mostraDadosSistema('" + ltema[1] + "','" + ltema[2] + "','" + idjanela + "')" | |
570 | - }); | |
571 | - } | |
572 | - } | |
573 | - temp = Mustache.render("{{#data}}" + i3GEOF.identifica.MUSTACHESISTEMAS + "{{/data}}", {"data":linhas}); | |
574 | - divins.innerHTML = temp; | |
575 | - } | |
576 | - } | |
818 | + } | |
819 | + linha.idreg = idreg; | |
820 | + linha.classeCssEditavel = "hidden"; | |
821 | + // opcao para apagar e mover o registro | |
822 | + if (idreg != "" && retorno[i].editavel == "todos") { | |
823 | + linha.classeCssEditavel = ""; | |
824 | + linha.tema = retorno[i].tema; | |
825 | + linha.apagaRegistro = $trad('apagaRegistro', i3GEOF.identifica.dicionario); | |
826 | + linha.move = $trad('move', i3GEOF.identifica.dicionario); | |
827 | + } | |
828 | + linha.colunas = []; | |
829 | + for (k = 0; k < nitens; k++) { | |
830 | + | |
831 | + tip = " "; | |
832 | + textovalor = resultados[j][k].valor; | |
833 | + var coluna = { | |
834 | + "tip": "", | |
835 | + "textovalor": textovalor, | |
836 | + "classeCssEditavel": "hidden" | |
837 | + }; | |
838 | + // insere o input para edicao | |
839 | + // se for uma regiao cadastrada, todos os campos | |
840 | + // sao editaveis | |
841 | + if (idreg != "" && (resultados[j][k].item === retorno[i].editavel || retorno[i].editavel == "todos")) { | |
842 | + coluna.classeCssEditavel = ""; | |
843 | + if (retorno[i].tiposalva == "regiao") { | |
844 | + retorno[i].id_medida_variavel = 0; | |
845 | + } | |
846 | + idsalva = | |
847 | + "idsalva" + retorno[i].tema | |
848 | + + "_" | |
849 | + + idreg | |
850 | + + "_" | |
851 | + + resultados[j][k].item | |
852 | + + "_" | |
853 | + + retorno[i].tiposalva; | |
854 | + paramsalva = | |
855 | + "\"" + retorno[i].tema | |
856 | + + "\"," | |
857 | + + idreg | |
858 | + + ",\"" | |
859 | + + resultados[j][k].item | |
860 | + + "\",\"" | |
861 | + + retorno[i].tiposalva | |
862 | + + "\""; | |
863 | + coluna.idsalva = idsalva; | |
864 | + coluna.paramsalva = paramsalva; | |
577 | 865 | } |
578 | - } | |
579 | - }, | |
580 | - /* | |
581 | - * Function: buscaDadosTema | |
582 | - * | |
583 | - * Obtém os dados de um tema para o ponto de coordenadas clicado no mapa | |
584 | - * | |
585 | - * Veja: | |
586 | - * | |
587 | - * <i3GEO.php.identifica3> | |
588 | - */ | |
589 | - buscaDadosTema : function(tema, x, y, idjanela) { | |
590 | - var res, opcao, resolucao, janelas, n, i, id; | |
591 | - if (tema != "" && i3GEO.temaAtivo === "") { | |
592 | - i3GEO.temaAtivo = tema; | |
593 | - } | |
594 | - if (idjanela) { | |
595 | - janelas = [ | |
596 | - idjanela | |
597 | - ]; | |
598 | - } else { | |
599 | - janelas = i3GEOF.identifica.janelas; | |
600 | - } | |
601 | - // guarda o valor de x y nas variaveis de uso global da ferramenta | |
602 | - if (x && x != "") { | |
603 | - i3GEOF.identifica.x = x; | |
604 | - i3GEOF.identifica.y = y; | |
605 | - } | |
606 | - n = janelas.length; | |
607 | - if (n == 0 || (idjanela && !$i(idjanela + "i3GEOidentificaguia1obj"))) { | |
608 | - if (x && x != "") { | |
609 | - i3GEOF.identifica.criaJanelaFlutuante(x, y); | |
866 | + coluna.etiquetaAtiva = $trad('etiquetaAtiva', i3GEOF.identifica.dicionario); | |
867 | + if (resultados[j][k].tip && resultados[j][k].tip.toLowerCase() == "sim") { | |
868 | + coluna.classeCssTip = ""; | |
610 | 869 | } else { |
611 | - i3GEOF.identifica.criaJanelaFlutuante(); | |
870 | + coluna.classeCssTip = "hidden"; | |
612 | 871 | } |
613 | - return; | |
614 | - } | |
615 | - try { | |
616 | - if (tema === "ligados") { | |
617 | - opcao = "ligados"; | |
618 | - tema = ""; | |
619 | - } else { | |
620 | - opcao = "tema"; | |
872 | + coluna.item = resultados[j][k].item; | |
873 | + coluna.valor = resultados[j][k].valor; | |
874 | + coluna.idjanela = idjanela; | |
875 | + coluna.filtraValor = $trad('filtraValor', i3GEOF.identifica.dicionario); | |
876 | + coluna.tema = retorno[i].tema; | |
877 | + | |
878 | + // verifica se o texto possui tags de abertura e | |
879 | + // fechamento html | |
880 | + //try { | |
881 | + if (textovalor && (textovalor.search(">") >= 0 || textovalor.search("<") >= 0)) { | |
882 | + filtro = ""; | |
883 | + coluna.classeCssFiltro = "hidden"; | |
621 | 884 | } |
622 | - for (i = 0; i < n; i++) { | |
623 | - id = janelas[i]; | |
624 | - if (i3GEOF.identifica.propJanelas[id].atualiza == undefined || i3GEOF.identifica.propJanelas[id].atualiza === true) { | |
625 | - if (x && x != "") { | |
626 | - i3GEOF.identifica.propJanelas[id].x = x; | |
627 | - i3GEOF.identifica.propJanelas[id].y = y; | |
628 | - } | |
629 | - if (tema != "" && idjanela) { | |
630 | - i3GEOF.identifica.propJanelas[id].temaAtivo = tema; | |
631 | - } | |
632 | - if ($i(id + "i3GEOidentificaguia1obj")) { | |
633 | - res = $i(id + "i3GEOidentificaresolucao"); | |
634 | - if (res) { | |
635 | - resolucao = res.value; | |
636 | - } else { | |
637 | - resolucao = 5; | |
638 | - } | |
639 | - i3GEOF.identifica.buscaDadosTemaJanela(id, resolucao, opcao); | |
640 | - } | |
641 | - } | |
885 | + // o mesmo problema pode ocorrer em raster, | |
886 | + // que possuem o nome da classe como valor | |
887 | + if (resultados[j][k].alias.search(">") >= 0 || resultados[j][k].alias.search("<") >= 0) { | |
888 | + filtro = ""; | |
889 | + coluna.classeCssFiltro = "hidden"; | |
642 | 890 | } |
643 | - } catch (e) { | |
644 | - if (!x) { | |
645 | - i3GEOF.identifica.criaJanelaFlutuante(); | |
891 | + //} catch (e) { | |
892 | + //} | |
893 | + | |
894 | + if (resultados[j][k].link === "") { | |
895 | + coluna.alias = resultados[j][k].alias; | |
896 | + coluna.textovalor = textovalor; | |
897 | + coluna.link = ""; | |
898 | + coluna.classeCssLink = "hidden"; | |
646 | 899 | } else { |
647 | - i3GEOF.identifica.criaJanelaFlutuante(x, y); | |
900 | + try { | |
901 | + link = eval(resultados[j][k].link); | |
902 | + } catch (e) { | |
903 | + link = resultados[j][k].link; | |
904 | + } | |
905 | + if(resultados[j][k].idIframe){ | |
906 | + alvo = resultados[j][k].idIframe; | |
907 | + } | |
908 | + else{ | |
909 | + alvo = "_blank"; | |
910 | + } | |
911 | + coluna.alias = resultados[j][k].alias; | |
912 | + coluna.link = link; | |
913 | + coluna.textovalor = textovalor; | |
914 | + coluna.alvo = alvo; | |
915 | + coluna.classeCssLink = ""; | |
916 | + | |
648 | 917 | } |
649 | - } | |
650 | - }, | |
651 | - buscaDadosTemaJanela : function(idjanela, resolucao, opcao) { | |
652 | - i3GEOF.identifica.mostraImagemPonto(idjanela); | |
653 | - var f = function(retorno) { | |
654 | - // i3GEOF.identifica.dadosIdentifica = retorno.data; | |
655 | - if (retorno !== undefined) { | |
656 | - i3GEOF.identifica.mostraDadosTema(retorno.data, idjanela); | |
657 | - } else { | |
658 | - i3GEOF.identifica.mostraDadosTema(undefined, idjanela); | |
918 | + coluna.classeCssImg = "hidden"; | |
919 | + coluna.img = ""; | |
920 | + if (resultados[j][k].img !== "") { | |
921 | + coluna.classeCssImg = ""; | |
922 | + coluna.img = resultados[j][k].img; | |
659 | 923 | } |
660 | - }; | |
661 | - if(opcao == "ligados"){ | |
662 | - listaDeTemas = ""; | |
663 | - } else { | |
664 | - listaDeTemas = i3GEOF.identifica.propJanelas[idjanela].temaAtivo; | |
924 | + linha.colunas.push(coluna); | |
925 | + } | |
926 | + registros.push(linha); | |
665 | 927 | } |
666 | - // importante: os temas editaveis nao utilizam alias em seus nomes | |
667 | - // se o usuario estiver logado | |
668 | - i3GEO.php.identifica3( | |
669 | - f, | |
670 | - i3GEOF.identifica.propJanelas[idjanela].x, | |
671 | - i3GEOF.identifica.propJanelas[idjanela].y, | |
672 | - resolucao, | |
673 | - opcao, | |
674 | - i3GEO.configura.locaplic, | |
675 | - i3GEO.configura.sid, | |
676 | - i3GEOF.identifica.propJanelas[idjanela].temaAtivo, | |
677 | - i3GEO.parametros.mapexten, | |
678 | - listaDeTemas, | |
679 | - "nao"); | |
680 | - }, | |
681 | - /* | |
682 | - * Function: mostraDadosSistema | |
683 | - * | |
684 | - * Obtém os dados de um sistema para o ponto de coordenadas clicado no mapa | |
685 | - * | |
686 | - * Parametros: | |
687 | - * | |
688 | - * exec {String} - url que será aberta | |
689 | - * | |
690 | - * target {String} (depreciado) - _self|self| onde a url será aberta. Se for "self", será aberta na mesma janela, caso | |
691 | - * contrário, em uma nova página do navegador | |
692 | - */ | |
693 | - mostraDadosSistema : function(exec, target, idjanela) { | |
694 | - i3GEOF.identifica.mostraImagemPonto(idjanela); | |
695 | - exec += "&x=" + i3GEOF.identifica.propJanelas[idjanela].x + "&y=" + i3GEOF.identifica.propJanelas[idjanela].y; | |
696 | - if (target === "target") { | |
697 | - window.open(exec); | |
928 | + dadosTema.registros = registros; | |
929 | + } else { | |
930 | + // verifica o tipo de tema | |
931 | + camada = i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo, "", "name"); | |
932 | + if (retorno[i].tiposalva == "regiao" && parseInt(camada.type, 10) == 0) { | |
933 | + // opcao para adicionar um ponto | |
934 | + res += | |
935 | + $trad('msgNadaEncontrado2', i3GEOF.identifica.dicionario) + "<br><a href='#' onclick='i3GEOF.identifica.adicionaPontoRegiao(\"" | |
936 | + + idjanela | |
937 | + + "\")' >" | |
938 | + + $trad('adicionaPonto', i3GEOF.identifica.dicionario) | |
939 | + + "</a>"; | |
698 | 940 | } else { |
699 | - i3GEOF.identifica.abrejanelaIframe("500", "500", exec); | |
700 | - } | |
701 | - var i = $i("i3GEOmarcaIdentifica"); | |
702 | - if (i) { | |
703 | - i.style.display = "block"; | |
704 | - } | |
705 | - }, | |
706 | - /* | |
707 | - * Function abrejanelaIframe | |
708 | - * | |
709 | - * Abre uma janela flutuante contendo um iframe | |
710 | - * | |
711 | - * Parametros: | |
712 | - * | |
713 | - * w {string} - largura | |
714 | - * | |
715 | - * h {string} - altura | |
716 | - * | |
717 | - * s {string} - src do iframe | |
718 | - */ | |
719 | - abrejanelaIframe : function(w, h, s) { | |
720 | - var janelaeditor = | |
721 | - i3GEO.janela.cria(w, h, s, parseInt(Math.random() * 100, 10), 10, "", "janela" + i3GEO.util.randomRGB(), false); | |
722 | - var temp = function() { | |
723 | - i3GEOF.identifica.sistemasAdicionais = []; | |
724 | - i3GEOF.identifica.atualizaSistemas(); | |
725 | - }; | |
726 | - YAHOO.util.Event.addListener(janelaeditor[0].close, "click", temp, janelaeditor[0].panel, { | |
727 | - id : janelaeditor[0].id | |
728 | - }, true); | |
729 | - }, | |
730 | - /** | |
731 | - * Aplica um estilo a um elemento de todas as janelas | |
732 | - */ | |
733 | - aplicaEstilo : function(posFixo, estilo, valor) { | |
734 | - var n = i3GEOF.identifica.janelas, i = 0, temp; | |
735 | - for (i = 0; i < n; i++) { | |
736 | - temp = $i(i3GEOF.identifica.janelas[i]); | |
737 | - if (temp) { | |
738 | - temp = $i(i3GEOF.identifica.janelas[i] + posFixo); | |
739 | - if (temp) { | |
740 | - temp.style[estilo] = valor; | |
741 | - } | |
742 | - } | |
743 | - } | |
744 | - }, | |
745 | - /* | |
746 | - * Function: mostraDadosTema | |
747 | - * | |
748 | - * Mostra os dados obtidos de um ou mais temas. | |
749 | - * | |
750 | - * Recebe o resultado em JSON da operação de consulta realizada pelo servidor e formata os dados para | |
751 | - * apresentação na tela. | |
752 | - * | |
753 | - * Parametros: | |
754 | - * | |
755 | - * retorno {JSON} - objeto JSON com os dados <i3GEO.php.identifica3> | |
756 | - */ | |
757 | - mostraDadosTema : function(retorno, idjanela) { | |
758 | - var classeTemp="",codigo_tipo_regiao = "",alvo, filtro, camada, idreg, idsalva, paramsalva, i, res = "", ntemas, resultados, nres, cor, j, nitens, k, atualN = "todas", inicio = | |
759 | - 0, numResultados = 0, tip, link, textovalor; | |
760 | - | |
761 | - if ($i(idjanela + "i3GEOFidentificaNocorrencias")) { | |
762 | - atualN = $i(idjanela + "i3GEOFidentificaNocorrencias").value; | |
941 | + res += $trad('msgNadaEncontrado2', i3GEOF.identifica.dicionario); | |
763 | 942 | } |
764 | - i3GEOF.identifica.aplicaEstilo("_corpo", "scrollTop", 0); | |
765 | - if (retorno == undefined || retorno == "") { | |
766 | - $i(idjanela + "i3GEOidentificaguia1obj").innerHTML = $trad('msgNadaEncontrado', i3GEOF.identifica.dicionario); | |
767 | - return; | |
768 | - } | |
769 | - i = $i("i3GEOmarcaIdentifica"); | |
770 | - if (i) { | |
771 | - i.style.display = "block"; | |
772 | - } | |
773 | - var lista = []; | |
774 | - if (retorno !== undefined) { | |
775 | - $i(idjanela + "i3GEOidentificaguia1obj").innerHTML = ""; | |
776 | - ntemas = retorno.length; | |
777 | - for (i = 0; i < ntemas; i++) { | |
778 | - // nome do tema e icone de remover filtro | |
779 | - // icone que mostra as medidas das variaveis vinculadas a uma regiao, se for o caso | |
780 | - if (retorno[i].codigo_tipo_regiao && retorno[i].codigo_tipo_regiao != "") { | |
781 | - classeTemp = ""; | |
782 | - codigo_tipo_regiao = retorno[i].codigo_tipo_regiao; | |
783 | - } else { | |
784 | - codigo_tipo_regiao = ""; | |
785 | - classeTemp = "hidden"; | |
786 | - } | |
787 | - var dadosTema = { | |
788 | - "nome": retorno[i].nome, | |
789 | - "codigoTema": retorno[i].tema, | |
790 | - "idjanela": idjanela, | |
791 | - "codigo_tipo_regiao": codigo_tipo_regiao, | |
792 | - "classeCssRegiao": classeTemp, | |
793 | - "textoRemoveFiltro": $trad('removeFiltro', i3GEOF.identifica.dicionario), | |
794 | - "registros" : [] | |
795 | - }; | |
796 | - resultados = retorno[i].resultado; | |
797 | - // encontrou algo | |
798 | - if (resultados[0] !== " ") { | |
799 | - nres = resultados.length; | |
800 | - numResultados = nres; | |
801 | - if (atualN != "todas") { | |
802 | - nres = atualN * 1; | |
803 | - inicio = atualN * 1 - 1; | |
804 | - } | |
805 | - var registros = []; | |
806 | - for (j = inicio; j < nres; j++) { | |
807 | - var linha = {}; | |
808 | - nitens = resultados[j].length; | |
809 | - // pega o valor do item que e o id unico no sistema | |
810 | - // METAESTAT | |
811 | - idreg = ""; | |
812 | - for (k = 0; k < nitens; k++) { | |
813 | - if (resultados[j][k].item === retorno[i].colunaidunico) { | |
814 | - idreg = resultados[j][k].valor; | |
815 | - } | |
816 | - } | |
817 | - linha.idreg = idreg; | |
818 | - linha.classeCssEditavel = "hidden"; | |
819 | - // opcao para apagar e mover o registro | |
820 | - if (idreg != "" && retorno[i].editavel == "todos") { | |
821 | - linha.classeCssEditavel = ""; | |
822 | - linha.tema = retorno[i].tema; | |
823 | - linha.apagaRegistro = $trad('apagaRegistro', i3GEOF.identifica.dicionario); | |
824 | - linha.move = $trad('move', i3GEOF.identifica.dicionario); | |
825 | - } | |
826 | - linha.colunas = []; | |
827 | - for (k = 0; k < nitens; k++) { | |
828 | - | |
829 | - tip = " "; | |
830 | - textovalor = resultados[j][k].valor; | |
831 | - var coluna = { | |
832 | - "tip": "", | |
833 | - "textovalor": textovalor, | |
834 | - "classeCssEditavel": "hidden" | |
835 | - }; | |
836 | - // insere o input para edicao | |
837 | - // se for uma regiao cadastrada, todos os campos | |
838 | - // sao editaveis | |
839 | - if (idreg != "" && (resultados[j][k].item === retorno[i].editavel || retorno[i].editavel == "todos")) { | |
840 | - coluna.classeCssEditavel = ""; | |
841 | - if (retorno[i].tiposalva == "regiao") { | |
842 | - retorno[i].id_medida_variavel = 0; | |
843 | - } | |
844 | - idsalva = | |
845 | - "idsalva" + retorno[i].tema | |
846 | - + "_" | |
847 | - + idreg | |
848 | - + "_" | |
849 | - + resultados[j][k].item | |
850 | - + "_" | |
851 | - + retorno[i].tiposalva; | |
852 | - paramsalva = | |
853 | - "\"" + retorno[i].tema | |
854 | - + "\"," | |
855 | - + idreg | |
856 | - + ",\"" | |
857 | - + resultados[j][k].item | |
858 | - + "\",\"" | |
859 | - + retorno[i].tiposalva | |
860 | - + "\""; | |
861 | - coluna.idsalva = idsalva; | |
862 | - coluna.paramsalva = paramsalva; | |
863 | - } | |
864 | - coluna.etiquetaAtiva = $trad('etiquetaAtiva', i3GEOF.identifica.dicionario); | |
865 | - if (resultados[j][k].tip && resultados[j][k].tip.toLowerCase() == "sim") { | |
866 | - coluna.classeCssTip = ""; | |
867 | - } else { | |
868 | - coluna.classeCssTip = "hidden"; | |
869 | - } | |
870 | - coluna.item = resultados[j][k].item; | |
871 | - coluna.valor = resultados[j][k].valor; | |
872 | - coluna.idjanela = idjanela; | |
873 | - coluna.filtraValor = $trad('filtraValor', i3GEOF.identifica.dicionario); | |
874 | - coluna.tema = retorno[i].tema; | |
875 | - | |
876 | - // verifica se o texto possui tags de abertura e | |
877 | - // fechamento html | |
878 | - //try { | |
879 | - if (textovalor && (textovalor.search(">") >= 0 || textovalor.search("<") >= 0)) { | |
880 | - filtro = ""; | |
881 | - coluna.classeCssFiltro = "hidden"; | |
882 | - } | |
883 | - // o mesmo problema pode ocorrer em raster, | |
884 | - // que possuem o nome da classe como valor | |
885 | - if (resultados[j][k].alias.search(">") >= 0 || resultados[j][k].alias.search("<") >= 0) { | |
886 | - filtro = ""; | |
887 | - coluna.classeCssFiltro = "hidden"; | |
888 | - } | |
889 | - //} catch (e) { | |
890 | - //} | |
891 | - | |
892 | - if (resultados[j][k].link === "") { | |
893 | - coluna.alias = resultados[j][k].alias; | |
894 | - coluna.textovalor = textovalor; | |
895 | - coluna.link = ""; | |
896 | - coluna.classeCssLink = "hidden"; | |
897 | - } else { | |
898 | - try { | |
899 | - link = eval(resultados[j][k].link); | |
900 | - } catch (e) { | |
901 | - link = resultados[j][k].link; | |
902 | - } | |
903 | - if(resultados[j][k].idIframe){ | |
904 | - alvo = resultados[j][k].idIframe; | |
905 | - } | |
906 | - else{ | |
907 | - alvo = "_blank"; | |
908 | - } | |
909 | - coluna.alias = resultados[j][k].alias; | |
910 | - coluna.link = link; | |
911 | - coluna.textovalor = textovalor; | |
912 | - coluna.alvo = alvo; | |
913 | - coluna.classeCssLink = ""; | |
943 | + } | |
944 | + lista.push(dadosTema); | |
945 | + } | |
946 | + if (ntemas == 1) { | |
947 | + res = i3GEOF.identifica.montaOpcoesIdentificaOcorrencia(atualN, numResultados) + res; | |
948 | + } | |
949 | + $i(idjanela + "i3GEOidentificaguia1obj").innerHTML = res; | |
950 | + temp = Mustache.render("{{#data}}" + i3GEOF.identifica.MUSTACHEDADOS + "{{/data}}", {"data":lista}); | |
951 | + $i(idjanela + "i3GEOidentificaguia1obj").innerHTML = temp; | |
914 | 952 | |
915 | - } | |
916 | - coluna.classeCssImg = "hidden"; | |
917 | - coluna.img = ""; | |
918 | - if (resultados[j][k].img !== "") { | |
919 | - coluna.classeCssImg = ""; | |
920 | - coluna.img = resultados[j][k].img; | |
921 | - } | |
922 | - linha.colunas.push(coluna); | |
923 | - } | |
924 | - registros.push(linha); | |
925 | - } | |
926 | - dadosTema.registros = registros; | |
927 | - } else { | |
928 | - // verifica o tipo de tema | |
929 | - camada = i3GEO.arvoreDeCamadas.pegaTema(i3GEO.temaAtivo, "", "name"); | |
930 | - if (retorno[i].tiposalva == "regiao" && parseInt(camada.type, 10) == 0) { | |
931 | - // opcao para adicionar um ponto | |
932 | - res += | |
933 | - $trad('msgNadaEncontrado2', i3GEOF.identifica.dicionario) + "<br><a href='#' onclick='i3GEOF.identifica.adicionaPontoRegiao(\"" | |
934 | - + idjanela | |
935 | - + "\")' >" | |
936 | - + $trad('adicionaPonto', i3GEOF.identifica.dicionario) | |
937 | - + "</a>"; | |
938 | - } else { | |
939 | - res += $trad('msgNadaEncontrado2', i3GEOF.identifica.dicionario); | |
940 | - } | |
941 | - } | |
942 | - lista.push(dadosTema); | |
943 | - } | |
944 | - if (ntemas == 1) { | |
945 | - res = i3GEOF.identifica.montaOpcoesIdentificaOcorrencia(atualN, numResultados) + res; | |
946 | - } | |
947 | - $i(idjanela + "i3GEOidentificaguia1obj").innerHTML = res; | |
948 | - temp = Mustache.render("{{#data}}" + i3GEOF.identifica.MUSTACHEDADOS + "{{/data}}", {"data":lista}); | |
949 | - $i(idjanela + "i3GEOidentificaguia1obj").innerHTML = temp; | |
953 | + i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); | |
954 | + } | |
955 | + }, | |
956 | + filtrar : function(tema, item, valor, idjanela) { | |
957 | + if (i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility === "visible") { | |
958 | + return; | |
959 | + } | |
960 | + i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "visible"; | |
961 | + var filtro = "", | |
962 | + temp = function(retorno) { | |
963 | + i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden"; | |
964 | + i3GEO.Interface.atualizaTema(retorno, tema); | |
965 | + }, | |
966 | + p = i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=sim&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", | |
967 | + cp = new cpaint(); | |
950 | 968 | |
951 | - i3GEO.guias.mostraGuiaFerramenta(idjanela + "i3GEOidentificaguia1", idjanela + "i3GEOidentificaguia"); | |
952 | - } | |
953 | - }, | |
954 | - filtrar : function(tema, item, valor, idjanela) { | |
955 | - if (i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility === "visible") { | |
956 | - return; | |
957 | - } | |
958 | - i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "visible"; | |
959 | - var filtro = "", | |
960 | - temp = function(retorno) { | |
961 | - i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden"; | |
962 | - i3GEO.Interface.atualizaTema(retorno, tema); | |
963 | - }, | |
964 | - p = i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=sim&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", | |
965 | - cp = new cpaint(); | |
969 | + filtro = "(*[" + item + "]* = *" + valor + "*)"; | |
970 | + cp.set_response_type("JSON"); | |
971 | + cp.set_transfer_mode('POST'); | |
972 | + cp.call(p, "insereFiltro", temp, "tema=" + tema + "&filtro=" + i3GEO.util.base64encode(filtro)); | |
973 | + }, | |
974 | + removeFiltro : function(tema, idjanela) { | |
975 | + if (i3GEOF.identifica.propJanelas[idjanela].visibility === "visible") { | |
976 | + return; | |
977 | + } | |
978 | + i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "visible"; | |
979 | + var temp = function(retorno) { | |
980 | + i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden"; | |
981 | + i3GEO.Interface.atualizaTema(retorno, tema); | |
982 | + }, p = | |
983 | + i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=nao&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", cp = | |
984 | + new cpaint(); | |
985 | + cp.set_response_type("JSON"); | |
986 | + cp.set_transfer_mode('POST'); | |
987 | + cp.call(p, "insereFiltro", temp, "tema=" + tema + "&filtro="); | |
988 | + }, | |
989 | + adicionaPontoRegiao : function(idjanela) { | |
990 | + var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid=" + i3GEO.configura.sid, tema = | |
991 | + i3GEOF.identifica.propJanelas[idjanela].temaAtivo, temp = function(retorno) { | |
992 | + i3GEO.janela.fechaAguarde("aguardeSalvaPonto"); | |
993 | + i3GEO.Interface.atualizaTema("", tema); | |
994 | + i3GEOF.identifica.buscaDadosTema(tema); | |
995 | + }; | |
996 | + i3GEO.janela.AGUARDEMODAL = true; | |
997 | + i3GEO.janela.abreAguarde("aguardeSalvaPonto", "Adicionando..."); | |
998 | + i3GEO.janela.AGUARDEMODAL = false; | |
999 | + cpJSON.call(p, "foo", temp, "&tema=" + tema | |
1000 | + + "&wkt=POINT(" | |
1001 | + + i3GEOF.identifica.propJanelas[idjanela].x | |
1002 | + + " " | |
1003 | + + i3GEOF.identifica.propJanelas[idjanela].y | |
1004 | + + ")"); | |
1005 | + }, | |
1006 | + apagaRegiao : function(tema, idreg) { | |
1007 | + var excluir = | |
1008 | + function() { | |
1009 | + var p = | |
1010 | + i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=excluiRegistro&g_sid=" + i3GEO.configura.sid, temp = | |
1011 | + function() { | |
1012 | + i3GEO.janela.fechaAguarde("aguardeRemovendo"); | |
1013 | + i3GEO.Interface.atualizaTema("", tema); | |
1014 | + i3GEOF.identifica.buscaDadosTema(tema); | |
1015 | + }; | |
1016 | + i3GEO.janela.AGUARDEMODAL = true; | |
1017 | + i3GEO.janela.abreAguarde("aguardeRemovendo", "Excluindo..."); | |
1018 | + i3GEO.janela.AGUARDEMODAL = false; | |
1019 | + cpJSON.call(p, "foo", temp, "&tema=" + tema + "&identificador=" + idreg); | |
1020 | + }; | |
1021 | + i3GEO.janela.confirma( | |
1022 | + $trad('removeRegistroBD', i3GEOF.identifica.dicionario), | |
1023 | + "", | |
1024 | + $trad('sim', i3GEOF.identifica.dicionario), | |
1025 | + $trad('cancela', i3GEOF.identifica.dicionario), | |
1026 | + excluir); | |
1027 | + }, | |
1028 | + salvaDados : function(tema, idreg, coluna, tiposalva) { | |
1029 | + var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=salvaRegistro&g_sid=" + i3GEO.configura.sid, idvalor = | |
1030 | + $i("idsalva" + tema + "_" + idreg + "_" + coluna + "_" + tiposalva), temp = function(retorno) { | |
1031 | + i3GEO.janela.fechaAguarde("aguardeSalvaAtributos"); | |
1032 | + i3GEO.Interface.atualizaTema("", i3GEOF.identifica.tema); | |
1033 | + }; | |
966 | 1034 | |
967 | - filtro = "(*[" + item + "]* = *" + valor + "*)"; | |
968 | - cp.set_response_type("JSON"); | |
969 | - cp.set_transfer_mode('POST'); | |
970 | - cp.call(p, "insereFiltro", temp, "tema=" + tema + "&filtro=" + i3GEO.util.base64encode(filtro)); | |
971 | - }, | |
972 | - removeFiltro : function(tema, idjanela) { | |
973 | - if (i3GEOF.identifica.propJanelas[idjanela].visibility === "visible") { | |
974 | - return; | |
975 | - } | |
976 | - i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "visible"; | |
977 | - var temp = function(retorno) { | |
978 | - i3GEOF.identifica.propJanelas[idjanela].aguarde.visibility = "hidden"; | |
979 | - i3GEO.Interface.atualizaTema(retorno, tema); | |
980 | - }, p = | |
981 | - i3GEO.configura.locaplic + "/ferramentas/filtro/exec.php?base64=nao&g_sid=" + i3GEO.configura.sid + "&funcao=inserefiltro", cp = | |
982 | - new cpaint(); | |
983 | - cp.set_response_type("JSON"); | |
984 | - cp.set_transfer_mode('POST'); | |
985 | - cp.call(p, "insereFiltro", temp, "tema=" + tema + "&filtro="); | |
986 | - }, | |
987 | - adicionaPontoRegiao : function(idjanela) { | |
988 | - var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=adicionaGeometria&g_sid=" + i3GEO.configura.sid, tema = | |
989 | - i3GEOF.identifica.propJanelas[idjanela].temaAtivo, temp = function(retorno) { | |
990 | - i3GEO.janela.fechaAguarde("aguardeSalvaPonto"); | |
991 | - i3GEO.Interface.atualizaTema("", tema); | |
992 | - i3GEOF.identifica.buscaDadosTema(tema); | |
993 | - }; | |
994 | - i3GEO.janela.AGUARDEMODAL = true; | |
995 | - i3GEO.janela.abreAguarde("aguardeSalvaPonto", "Adicionando..."); | |
996 | - i3GEO.janela.AGUARDEMODAL = false; | |
997 | - cpJSON.call(p, "foo", temp, "&tema=" + tema | |
998 | - + "&wkt=POINT(" | |
999 | - + i3GEOF.identifica.propJanelas[idjanela].x | |
1000 | - + " " | |
1001 | - + i3GEOF.identifica.propJanelas[idjanela].y | |
1002 | - + ")"); | |
1003 | - }, | |
1004 | - apagaRegiao : function(tema, idreg) { | |
1005 | - var excluir = | |
1006 | - function() { | |
1007 | - var p = | |
1008 | - i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=excluiRegistro&g_sid=" + i3GEO.configura.sid, temp = | |
1009 | - function() { | |
1010 | - i3GEO.janela.fechaAguarde("aguardeRemovendo"); | |
1011 | - i3GEO.Interface.atualizaTema("", tema); | |
1012 | - i3GEOF.identifica.buscaDadosTema(tema); | |
1013 | - }; | |
1014 | - i3GEO.janela.AGUARDEMODAL = true; | |
1015 | - i3GEO.janela.abreAguarde("aguardeRemovendo", "Excluindo..."); | |
1016 | - i3GEO.janela.AGUARDEMODAL = false; | |
1017 | - cpJSON.call(p, "foo", temp, "&tema=" + tema + "&identificador=" + idreg); | |
1018 | - }; | |
1019 | - i3GEO.janela.confirma( | |
1020 | - $trad('removeRegistroBD', i3GEOF.identifica.dicionario), | |
1021 | - "", | |
1022 | - $trad('sim', i3GEOF.identifica.dicionario), | |
1023 | - $trad('cancela', i3GEOF.identifica.dicionario), | |
1024 | - excluir); | |
1025 | - }, | |
1026 | - salvaDados : function(tema, idreg, coluna, tiposalva) { | |
1027 | - var p = i3GEO.configura.locaplic + "/ferramentas/editortema/exec.php?funcao=salvaRegistro&g_sid=" + i3GEO.configura.sid, idvalor = | |
1028 | - $i("idsalva" + tema + "_" + idreg + "_" + coluna + "_" + tiposalva), temp = function(retorno) { | |
1029 | - i3GEO.janela.fechaAguarde("aguardeSalvaAtributos"); | |
1030 | - i3GEO.Interface.atualizaTema("", i3GEOF.identifica.tema); | |
1031 | - }; | |
1035 | + if (idvalor) { | |
1036 | + i3GEO.janela.AGUARDEMODAL = true; | |
1037 | + i3GEO.janela.abreAguarde("aguardeSalvaAtributos", "Salvando..."); | |
1038 | + i3GEO.janela.AGUARDEMODAL = false; | |
1039 | + cpJSON.call(p, "foo", temp, "&tema=" + tema + "&coluna=" + coluna + "&valor=" + idvalor.value + "&identificador=" + idreg); | |
1040 | + } else { | |
1041 | + alert("ocorreu um erro"); | |
1042 | + } | |
1043 | + }, | |
1044 | + montaOpcoesIdentificaOcorrencia : function(atual, nres) { | |
1045 | + var ins, select, i, nocor; | |
1046 | + if (!atual) { | |
1047 | + atual = "todas"; | |
1048 | + } | |
1049 | + sel = ""; | |
1050 | + select = | |
1051 | + "<select id=i3GEOFidentificaNocorrencias onchange='i3GEOF.identifica.mostraDadosTema(i3GEOF.identifica.dadosIdentifica)'>"; | |
1052 | + if (atual == "todas") { | |
1053 | + sel = "SELECTED"; | |
1054 | + } | |
1055 | + select += "<option value='todas' " + sel + " >" + $trad('todas', i3GEOF.identifica.dicionario) + "</option>"; | |
1056 | + nocor = nres + 1; | |
1057 | + for (i = 1; i < nocor; i++) { | |
1058 | + sel = ""; | |
1059 | + if (atual == i) { | |
1060 | + sel = "SELECTED"; | |
1061 | + } | |
1062 | + select += "<option value=" + i + " " + sel + " >" + i + "</option>"; | |
1063 | + } | |
1064 | + select += "</select>"; | |
1065 | + ins = "<table><tr>"; | |
1066 | + ins += "<td>" + $trad('mostraOcorrencia', i3GEOF.identifica.dicionario) + ": </td>"; | |
1067 | + ins += "<td> " + select + "</td>"; | |
1068 | + ins += "</tr></table>"; | |
1069 | + if (nres == 1) { | |
1070 | + ins = ""; | |
1071 | + } | |
1072 | + return ins; | |
1073 | + }, | |
1074 | + listaVariaveis : function(codigo_tipo_regiao, idjanela) { | |
1075 | + var p, temp; | |
1076 | + temp = function(retorno) { | |
1077 | + var ins = "", n, i, m, j, d, dd, nc, ic, ndd, idd; | |
1078 | + n = retorno.length; | |
1032 | 1079 | |
1033 | - if (idvalor) { | |
1034 | - i3GEO.janela.AGUARDEMODAL = true; | |
1035 | - i3GEO.janela.abreAguarde("aguardeSalvaAtributos", "Salvando..."); | |
1036 | - i3GEO.janela.AGUARDEMODAL = false; | |
1037 | - cpJSON.call(p, "foo", temp, "&tema=" + tema + "&coluna=" + coluna + "&valor=" + idvalor.value + "&identificador=" + idreg); | |
1038 | - } else { | |
1039 | - alert("ocorreu um erro"); | |
1040 | - } | |
1041 | - }, | |
1042 | - montaOpcoesIdentificaOcorrencia : function(atual, nres) { | |
1043 | - var ins, select, i, nocor; | |
1044 | - if (!atual) { | |
1045 | - atual = "todas"; | |
1046 | - } | |
1047 | - sel = ""; | |
1048 | - select = | |
1049 | - "<select id=i3GEOFidentificaNocorrencias onchange='i3GEOF.identifica.mostraDadosTema(i3GEOF.identifica.dadosIdentifica)'>"; | |
1050 | - if (atual == "todas") { | |
1051 | - sel = "SELECTED"; | |
1052 | - } | |
1053 | - select += "<option value='todas' " + sel + " >" + $trad('todas', i3GEOF.identifica.dicionario) + "</option>"; | |
1054 | - nocor = nres + 1; | |
1055 | - for (i = 1; i < nocor; i++) { | |
1056 | - sel = ""; | |
1057 | - if (atual == i) { | |
1058 | - sel = "SELECTED"; | |
1080 | + if (n > 0) { | |
1081 | + // cada variavel | |
1082 | + for (i = 0; i < n; i++) { | |
1083 | + d = retorno[i]; | |
1084 | + ins += "<b>" + d.variavel + "</b>"; | |
1085 | + m = d.dados.length; | |
1086 | + // cada medida | |
1087 | + for (j = 0; j < m; j++) { | |
1088 | + dd = d.dados[j]; | |
1089 | + // ins += " -> " + dd.medida; | |
1090 | + nc = dd.dados.colunas.length; | |
1091 | + ins += "<table class='lista4' ><tr>"; | |
1092 | + // cabecalho | |
1093 | + for (ic = 0; ic < nc; ic++) { | |
1094 | + ins += "<td>" + dd.dados.aliascolunas[ic] + "</td>"; | |
1095 | + } | |
1096 | + ins += "</tr>"; | |
1097 | + ndd = dd.dados.dados.length; | |
1098 | + // cada valor | |
1099 | + for (idd = 0; idd < ndd; idd++) { | |
1100 | + ins += "<tr>"; | |
1101 | + for (ic = 0; ic < nc; ic++) { | |
1102 | + ins += "<td>" + dd.dados.dados[idd][dd.dados.colunas[ic]] + "</td>"; | |
1059 | 1103 | } |
1060 | - select += "<option value=" + i + " " + sel + " >" + i + "</option>"; | |
1061 | - } | |
1062 | - select += "</select>"; | |
1063 | - ins = "<table><tr>"; | |
1064 | - ins += "<td>" + $trad('mostraOcorrencia', i3GEOF.identifica.dicionario) + ": </td>"; | |
1065 | - ins += "<td> " + select + "</td>"; | |
1066 | - ins += "</tr></table>"; | |
1067 | - if (nres == 1) { | |
1068 | - ins = ""; | |
1104 | + ins += "</tr>"; | |
1105 | + } | |
1106 | + ins += "</table>"; | |
1069 | 1107 | } |
1070 | - return ins; | |
1071 | - }, | |
1072 | - listaVariaveis : function(codigo_tipo_regiao, idjanela) { | |
1073 | - var p, temp; | |
1074 | - temp = function(retorno) { | |
1075 | - var ins = "", n, i, m, j, d, dd, nc, ic, ndd, idd; | |
1076 | - n = retorno.length; | |
1077 | - | |
1078 | - if (n > 0) { | |
1079 | - // cada variavel | |
1080 | - for (i = 0; i < n; i++) { | |
1081 | - d = retorno[i]; | |
1082 | - ins += "<b>" + d.variavel + "</b>"; | |
1083 | - m = d.dados.length; | |
1084 | - // cada medida | |
1085 | - for (j = 0; j < m; j++) { | |
1086 | - dd = d.dados[j]; | |
1087 | - // ins += " -> " + dd.medida; | |
1088 | - nc = dd.dados.colunas.length; | |
1089 | - ins += "<table class='lista4' ><tr>"; | |
1090 | - // cabecalho | |
1091 | - for (ic = 0; ic < nc; ic++) { | |
1092 | - ins += "<td>" + dd.dados.aliascolunas[ic] + "</td>"; | |
1093 | - } | |
1094 | - ins += "</tr>"; | |
1095 | - ndd = dd.dados.dados.length; | |
1096 | - // cada valor | |
1097 | - for (idd = 0; idd < ndd; idd++) { | |
1098 | - ins += "<tr>"; | |
1099 | - for (ic = 0; ic < nc; ic++) { | |
1100 | - ins += "<td>" + dd.dados.dados[idd][dd.dados.colunas[ic]] + "</td>"; | |
1101 | - } | |
1102 | - ins += "</tr>"; | |
1103 | - } | |
1104 | - ins += "</table>"; | |
1105 | - } | |
1106 | - } | |
1107 | - } | |
1108 | - i3GEO.janela.mensagemSimples("<div style='overflow:auto;height:100%'>" + ins + "</div>", ""); | |
1109 | - }; | |
1110 | - p = i3GEO.configura.locaplic + "/classesphp/metaestat_controle.php?funcao=LISTATODOSATRIBUTOSMEDIDAVARIAVELXY", cpJSON.call( | |
1111 | - p, | |
1112 | - "foo", | |
1113 | - temp, | |
1114 | - "&codigo_tipo_regiao=" + codigo_tipo_regiao | |
1115 | - + "&x=" | |
1116 | - + i3GEOF.identifica.propJanelas[idjanela].x | |
1117 | - + "&y=" | |
1118 | - + i3GEOF.identifica.propJanelas[idjanela].y); | |
1108 | + } | |
1119 | 1109 | } |
1110 | + i3GEO.janela.mensagemSimples("<div style='overflow:auto;height:100%'>" + ins + "</div>", ""); | |
1111 | + }; | |
1112 | + p = i3GEO.configura.locaplic + "/classesphp/metaestat_controle.php?funcao=LISTATODOSATRIBUTOSMEDIDAVARIAVELXY", cpJSON.call( | |
1113 | + p, | |
1114 | + "foo", | |
1115 | + temp, | |
1116 | + "&codigo_tipo_regiao=" + codigo_tipo_regiao | |
1117 | + + "&x=" | |
1118 | + + i3GEOF.identifica.propJanelas[idjanela].x | |
1119 | + + "&y=" | |
1120 | + + i3GEOF.identifica.propJanelas[idjanela].y); | |
1121 | + } | |
1120 | 1122 | }; |
1123 | +//aplica ao codigo i3GEOF definicoes feitas na interface do mapa | |
1124 | +//isso permite a substituicao de funcoes e parametros | |
1125 | +if(i3GEO.configura.ferramentas.hasOwnProperty("identifica")){ | |
1126 | + jQuery.each( i3GEO.configura.ferramentas.identifica, function(index, value) { | |
1127 | + i3GEOF.identifica[index] = i3GEO.configura.ferramentas.identifica[index]; | |
1128 | + }); | |
1129 | +} | ... | ... |
ferramentas/identifica/template_mst.html
... | ... | @@ -28,7 +28,7 @@ |
28 | 28 | <!-- Resultado --> |
29 | 29 | <div class='container-fluid'> |
30 | 30 | <div id='{{{idjanela}}}i3GEOFidentificaComboCabeca' class='form-group condensed' style='width: 100%'> |
31 | - | |
31 | + | |
32 | 32 | </div> |
33 | 33 | </div> |
34 | 34 | <div class='container-fluid' id='{{{idjanela}}}i3GEOidentificaguia1obj'></div> |
... | ... | @@ -37,7 +37,7 @@ |
37 | 37 | <div class='container-fluid' id='{{{idjanela}}}i3GEOidentificaguia3obj'> |
38 | 38 | <div class='form-group label-fixed'> |
39 | 39 | <label class="control-label" for="{{{idjanela}}}i3GEOtabelafiltro1">{{{resolucaoBusca}}}</label> |
40 | - <input class="form-control input-lg" type='text' id='{{{idjanela}}}i3GEOidentificaresolucao' value='10' /> | |
40 | + <input class="form-control input-lg" type='text' id='{{{idjanela}}}i3GEOidentificaresolucao' value='{{{resolution}}}' /> | |
41 | 41 | </div> |
42 | 42 | |
43 | 43 | <div id='{{{idjanela}}}i3GEOidentificalistaSistemas'></div> | ... | ... |
interface/ol.htm
... | ... | @@ -115,13 +115,31 @@ |
115 | 115 | </div> |
116 | 116 | <!-- barra de icones de navegacao --> |
117 | 117 | <div class="ol-i3GEOcontrols ol-control" data-traduzir="true"> |
118 | - <span id="i3GEOzoomInOut" class="hidden-xs hidden-sm" style="cursor:pointer;"></span> | |
118 | + <button onclick="$('.ol-i3GEOcontrols .toggle').toggle();" style="float: left;"> | |
119 | + <i class="material-icons">menu</i> | |
120 | + </button> | |
121 | + <!-- Para o botao de fullscreen e necessario uma funcao. Veja abaixo nas configuracoes o item afterStart --> | |
122 | + <span id="i3GEOFullscreen" style="cursor:pointer;" title="{{{d9}}}"> | |
123 | + </span> | |
124 | + <button class="toggle" data-tutorial="referencia" title="{{{d9}}}" onclick="i3GEO.maparef.inicia()" style="float: left;cursor:pointer;display:none;"> | |
125 | + <i class="material-icons">picture_in_picture</i> | |
126 | + </button> | |
127 | + <br> | |
128 | + <div class="clearfix"></div> | |
129 | + <span id="i3GEOzoomInOut" style="cursor:pointer;"></span> | |
130 | + <button class="toggle" title="Spy" onclick="i3GEO.navega.basemapSpy.start()" style="float: left; cursor:pointer;display:none;"> | |
131 | + <i class="material-icons">highlight</i> | |
132 | + </button> | |
133 | + <br> | |
119 | 134 | <button title="{{{d2t}}}" onclick="i3GEO.Interface.zoom2ext(i3GEO.parametros.extentTotal)" style="float: left;"> |
120 | 135 | <i class="material-icons">public</i> |
121 | 136 | </button> |
122 | 137 | <button onclick="i3GEO.Interface.zoomli()" data-tutorial="barranavegacao" style="float: left;"> |
123 | 138 | <i class="material-icons">zoom_in</i> |
124 | 139 | </button> |
140 | + <button class="toggle" title="{{{graticule}}}" onclick="i3GEO.Interface.grade()" data-tutorial='grade' style="float: left;display:none;"> | |
141 | + <i class="material-icons">grid_on</i> | |
142 | + </button> | |
125 | 143 | <br> |
126 | 144 | <button title="{{{volta}}}" onclick="i3GEO.navega.extensaoAnterior()" style="float: left;"> |
127 | 145 | <i class="material-icons">undo</i> |
... | ... | @@ -129,24 +147,14 @@ |
129 | 147 | <button title="{{{avanca}}}" onclick="i3GEO.navega.extensaoProximo()" style="float: left;"> |
130 | 148 | <i class="material-icons">redo</i> |
131 | 149 | </button> |
132 | - <br> | |
133 | - <button title="{{{graticule}}}" onclick="i3GEO.Interface.grade()" data-tutorial='grade' style="float: left;"> | |
134 | - <i class="material-icons">grid_on</i> | |
135 | - </button> | |
136 | - <button data-tutorial="marcador" class="hidden-xs hidden-sm" title="{{{x79}}}" data-template="templates/ferramentasSend.html" onclick="i3GEO.marcador.inicia(this)" style="float: left;"> | |
150 | + <button class="toggle" data-tutorial="marcador" title="{{{x79}}}" data-template="templates/ferramentasSend.html" onclick="i3GEO.marcador.inicia(this)" style="float: left;display:none;"> | |
137 | 151 | <i class="material-icons">bookmark_border</i> |
138 | 152 | </button> |
139 | - <br> | |
140 | - <button data-tutorial="referencia" class="hidden-xs hidden-sm" title="{{{d9}}}" onclick="i3GEO.maparef.inicia()" style="float: left;cursor:pointer;"> | |
141 | - <i class="material-icons">picture_in_picture</i> | |
142 | - </button> | |
143 | - <button class="hidden-xs hidden-sm" title="Spy" onclick="i3GEO.navega.basemapSpy.start()" style="float: left; cursor:pointer;"> | |
144 | - <i class="material-icons">highlight</i> | |
153 | + <!-- so funciona com OSM | |
154 | + <button class="hidden-xs hidden-sm" title="{{{d18t}}}" onclick="i3GEO.navega.lente.start()" style="float: left; cursor:pointer;"> | |
155 | + <i class="material-icons">loupe</i> | |
145 | 156 | </button> |
146 | - <br> | |
147 | - <!-- Para o botao de fullscreen e necessario uma funcao. Veja abaixo nas configuracoes o item afterStart --> | |
148 | - <span id="i3GEOFullscreen" class="hidden-xs hidden-sm" style="cursor:pointer;" title="{{{d9}}}"> | |
149 | - </span> | |
157 | + --> | |
150 | 158 | </div> |
151 | 159 | <!--barra de progresso que e mostrada conforme as camadas sao desenhadas no mapa. Esse elemento deve ter o id="i3GEOprogressoCamadas" --> |
152 | 160 | <div id="i3GEOprogressoCamadas" class="progress" style="display: block; position: absolute; top: 0px; height: 5px; width: 0%; margin: auto;"> | ... | ... |
interface/openlayersdebug.htm
... | ... | @@ -114,13 +114,31 @@ |
114 | 114 | </div> |
115 | 115 | <!-- barra de icones de navegacao --> |
116 | 116 | <div class="ol-i3GEOcontrols ol-control" data-traduzir="true"> |
117 | - <span id="i3GEOzoomInOut" class="hidden-xs hidden-sm" style="cursor:pointer;"></span> | |
117 | + <button onclick="$('.ol-i3GEOcontrols .toggle').toggle();" style="float: left;"> | |
118 | + <i class="material-icons">menu</i> | |
119 | + </button> | |
120 | + <!-- Para o botao de fullscreen e necessario uma funcao. Veja abaixo nas configuracoes o item afterStart --> | |
121 | + <span id="i3GEOFullscreen" style="cursor:pointer;" title="{{{d9}}}"> | |
122 | + </span> | |
123 | + <button class="toggle" data-tutorial="referencia" title="{{{d9}}}" onclick="i3GEO.maparef.inicia()" style="float: left;cursor:pointer;display:none;"> | |
124 | + <i class="material-icons">picture_in_picture</i> | |
125 | + </button> | |
126 | + <br> | |
127 | + <div class="clearfix"></div> | |
128 | + <span id="i3GEOzoomInOut" style="cursor:pointer;"></span> | |
129 | + <button class="toggle" title="Spy" onclick="i3GEO.navega.basemapSpy.start()" style="float: left; cursor:pointer;display:none;"> | |
130 | + <i class="material-icons">highlight</i> | |
131 | + </button> | |
132 | + <br> | |
118 | 133 | <button title="{{{d2t}}}" onclick="i3GEO.Interface.zoom2ext(i3GEO.parametros.extentTotal)" style="float: left;"> |
119 | 134 | <i class="material-icons">public</i> |
120 | 135 | </button> |
121 | 136 | <button onclick="i3GEO.Interface.zoomli()" data-tutorial="barranavegacao" style="float: left;"> |
122 | 137 | <i class="material-icons">zoom_in</i> |
123 | 138 | </button> |
139 | + <button class="toggle" title="{{{graticule}}}" onclick="i3GEO.Interface.grade()" data-tutorial='grade' style="float: left;display:none;"> | |
140 | + <i class="material-icons">grid_on</i> | |
141 | + </button> | |
124 | 142 | <br> |
125 | 143 | <button title="{{{volta}}}" onclick="i3GEO.navega.extensaoAnterior()" style="float: left;"> |
126 | 144 | <i class="material-icons">undo</i> |
... | ... | @@ -128,24 +146,14 @@ |
128 | 146 | <button title="{{{avanca}}}" onclick="i3GEO.navega.extensaoProximo()" style="float: left;"> |
129 | 147 | <i class="material-icons">redo</i> |
130 | 148 | </button> |
131 | - <br> | |
132 | - <button title="{{{graticule}}}" onclick="i3GEO.Interface.grade()" data-tutorial='grade' style="float: left;"> | |
133 | - <i class="material-icons">grid_on</i> | |
134 | - </button> | |
135 | - <button data-tutorial="marcador" class="hidden-xs hidden-sm" title="{{{x79}}}" data-template="templates/ferramentasSend.html" onclick="i3GEO.marcador.inicia(this)" style="float: left;"> | |
149 | + <button class="toggle" data-tutorial="marcador" title="{{{x79}}}" data-template="templates/ferramentasSend.html" onclick="i3GEO.marcador.inicia(this)" style="float: left;display:none;"> | |
136 | 150 | <i class="material-icons">bookmark_border</i> |
137 | 151 | </button> |
138 | - <br> | |
139 | - <button data-tutorial="referencia" class="hidden-xs hidden-sm" title="{{{d9}}}" onclick="i3GEO.maparef.inicia()" style="float: left;cursor:pointer;"> | |
140 | - <i class="material-icons">picture_in_picture</i> | |
141 | - </button> | |
142 | - <button class="hidden-xs hidden-sm" title="Spy" onclick="i3GEO.navega.basemapSpy.start()" style="float: left; cursor:pointer;"> | |
143 | - <i class="material-icons">highlight</i> | |
152 | + <!-- so funciona com OSM | |
153 | + <button class="hidden-xs hidden-sm" title="{{{d18t}}}" onclick="i3GEO.navega.lente.start()" style="float: left; cursor:pointer;"> | |
154 | + <i class="material-icons">loupe</i> | |
144 | 155 | </button> |
145 | - <br> | |
146 | - <!-- Para o botao de fullscreen e necessario uma funcao. Veja abaixo nas configuracoes o item afterStart --> | |
147 | - <span id="i3GEOFullscreen" class="hidden-xs hidden-sm" style="cursor:pointer;" title="{{{d9}}}"> | |
148 | - </span> | |
156 | + --> | |
149 | 157 | </div> |
150 | 158 | <!--barra de progresso que e mostrada conforme as camadas sao desenhadas no mapa. Esse elemento deve ter o id="i3GEOprogressoCamadas" --> |
151 | 159 | <div id="i3GEOprogressoCamadas" class="progress" style="display: block; position: absolute; top: 0px; height: 5px; width: 0%; margin: auto;"> |
... | ... | @@ -934,7 +942,7 @@ |
934 | 942 | //ferramenta de identificacao |
935 | 943 | identifica : { |
936 | 944 | //resolucao em pixels para busca de elementos |
937 | - resolution : 8 | |
945 | + resolution : 12 | |
938 | 946 | }, |
939 | 947 | legenda : { |
940 | 948 | //define o local onde os templates da ferramenta ficam armazenados | ... | ... |
interface/osm.htm
... | ... | @@ -115,13 +115,31 @@ |
115 | 115 | </div> |
116 | 116 | <!-- barra de icones de navegacao --> |
117 | 117 | <div class="ol-i3GEOcontrols ol-control" data-traduzir="true"> |
118 | - <span id="i3GEOzoomInOut" class="hidden-xs hidden-sm" style="cursor:pointer;"></span> | |
118 | + <button onclick="$('.ol-i3GEOcontrols .toggle').toggle();" style="float: left;"> | |
119 | + <i class="material-icons">menu</i> | |
120 | + </button> | |
121 | + <!-- Para o botao de fullscreen e necessario uma funcao. Veja abaixo nas configuracoes o item afterStart --> | |
122 | + <span id="i3GEOFullscreen" style="cursor:pointer;" title="{{{d9}}}"> | |
123 | + </span> | |
124 | + <button class="toggle" data-tutorial="referencia" title="{{{d9}}}" onclick="i3GEO.maparef.inicia()" style="float: left;cursor:pointer;display:none;"> | |
125 | + <i class="material-icons">picture_in_picture</i> | |
126 | + </button> | |
127 | + <br> | |
128 | + <div class="clearfix"></div> | |
129 | + <span id="i3GEOzoomInOut" style="cursor:pointer;"></span> | |
130 | + <button class="toggle" title="Spy" onclick="i3GEO.navega.basemapSpy.start()" style="float: left; cursor:pointer;display:none;"> | |
131 | + <i class="material-icons">highlight</i> | |
132 | + </button> | |
133 | + <br> | |
119 | 134 | <button title="{{{d2t}}}" onclick="i3GEO.Interface.zoom2ext(i3GEO.parametros.extentTotal)" style="float: left;"> |
120 | 135 | <i class="material-icons">public</i> |
121 | 136 | </button> |
122 | 137 | <button onclick="i3GEO.Interface.zoomli()" data-tutorial="barranavegacao" style="float: left;"> |
123 | 138 | <i class="material-icons">zoom_in</i> |
124 | 139 | </button> |
140 | + <button class="toggle" title="{{{d18t}}}" onclick="i3GEO.navega.lente.start()" style="float: left; cursor:pointer;display:none;"> | |
141 | + <i class="material-icons">loupe</i> | |
142 | + </button> | |
125 | 143 | <br> |
126 | 144 | <button title="{{{volta}}}" onclick="i3GEO.navega.extensaoAnterior()" style="float: left;"> |
127 | 145 | <i class="material-icons">undo</i> |
... | ... | @@ -129,27 +147,13 @@ |
129 | 147 | <button title="{{{avanca}}}" onclick="i3GEO.navega.extensaoProximo()" style="float: left;"> |
130 | 148 | <i class="material-icons">redo</i> |
131 | 149 | </button> |
132 | - <br> | |
133 | - <button title="{{{graticule}}}" onclick="i3GEO.Interface.grade()" data-tutorial='grade' style="float: left;"> | |
134 | - <i class="material-icons">grid_on</i> | |
135 | - </button> | |
136 | - <button data-tutorial="marcador" class="hidden-xs hidden-sm" title="{{{x79}}}" data-template="templates/ferramentasSend.html" onclick="i3GEO.marcador.inicia(this)" style="float: left;"> | |
150 | + <button class="toggle" data-tutorial="marcador" title="{{{x79}}}" data-template="templates/ferramentasSend.html" onclick="i3GEO.marcador.inicia(this)" style="float: left;display:none;"> | |
137 | 151 | <i class="material-icons">bookmark_border</i> |
138 | 152 | </button> |
139 | 153 | <br> |
140 | - <button data-tutorial="referencia" class="hidden-xs hidden-sm" title="{{{d9}}}" onclick="i3GEO.maparef.inicia()" style="float: left;cursor:pointer;"> | |
141 | - <i class="material-icons">picture_in_picture</i> | |
142 | - </button> | |
143 | - <button class="hidden-xs hidden-sm" title="Spy" onclick="i3GEO.navega.basemapSpy.start()" style="float: left; cursor:pointer;"> | |
144 | - <i class="material-icons">highlight</i> | |
145 | - </button> | |
146 | - <br> | |
147 | - <button class="hidden-xs hidden-sm" title="{{{d18t}}}" onclick="i3GEO.navega.lente.start()" style="float: left; cursor:pointer;"> | |
148 | - <i class="material-icons">loupe</i> | |
154 | + <button class="toggle" title="{{{graticule}}}" onclick="i3GEO.Interface.grade()" data-tutorial='grade' style="float: left;display:none;"> | |
155 | + <i class="material-icons">grid_on</i> | |
149 | 156 | </button> |
150 | - <!-- Para o botao de fullscreen e necessario uma funcao. Veja abaixo nas configuracoes o item afterStart --> | |
151 | - <span id="i3GEOFullscreen" class="hidden-xs hidden-sm" style="cursor:pointer;" title="{{{d9}}}"> | |
152 | - </span> | |
153 | 157 | </div> |
154 | 158 | <!--barra de progresso que e mostrada conforme as camadas sao desenhadas no mapa. Esse elemento deve ter o id="i3GEOprogressoCamadas" --> |
155 | 159 | <div id="i3GEOprogressoCamadas" class="progress" style="display: block; position: absolute; top: 0px; height: 5px; width: 0%; margin: auto;"> | ... | ... |
interface/osmdebug.htm
... | ... | @@ -115,13 +115,31 @@ |
115 | 115 | </div> |
116 | 116 | <!-- barra de icones de navegacao --> |
117 | 117 | <div class="ol-i3GEOcontrols ol-control" data-traduzir="true"> |
118 | - <span id="i3GEOzoomInOut" class="hidden-xs hidden-sm" style="cursor:pointer;"></span> | |
118 | + <button onclick="$('.ol-i3GEOcontrols .toggle').toggle();" style="float: left;"> | |
119 | + <i class="material-icons">menu</i> | |
120 | + </button> | |
121 | + <!-- Para o botao de fullscreen e necessario uma funcao. Veja abaixo nas configuracoes o item afterStart --> | |
122 | + <span id="i3GEOFullscreen" style="cursor:pointer;" title="{{{d9}}}"> | |
123 | + </span> | |
124 | + <button class="toggle" data-tutorial="referencia" title="{{{d9}}}" onclick="i3GEO.maparef.inicia()" style="float: left;cursor:pointer;display:none;"> | |
125 | + <i class="material-icons">picture_in_picture</i> | |
126 | + </button> | |
127 | + <br> | |
128 | + <div class="clearfix"></div> | |
129 | + <span id="i3GEOzoomInOut" style="cursor:pointer;"></span> | |
130 | + <button class="toggle" title="Spy" onclick="i3GEO.navega.basemapSpy.start()" style="float: left; cursor:pointer;display:none;"> | |
131 | + <i class="material-icons">highlight</i> | |
132 | + </button> | |
133 | + <br> | |
119 | 134 | <button title="{{{d2t}}}" onclick="i3GEO.Interface.zoom2ext(i3GEO.parametros.extentTotal)" style="float: left;"> |
120 | 135 | <i class="material-icons">public</i> |
121 | 136 | </button> |
122 | 137 | <button onclick="i3GEO.Interface.zoomli()" data-tutorial="barranavegacao" style="float: left;"> |
123 | 138 | <i class="material-icons">zoom_in</i> |
124 | 139 | </button> |
140 | + <button class="toggle" title="{{{d18t}}}" onclick="i3GEO.navega.lente.start()" style="float: left; cursor:pointer;display:none;"> | |
141 | + <i class="material-icons">loupe</i> | |
142 | + </button> | |
125 | 143 | <br> |
126 | 144 | <button title="{{{volta}}}" onclick="i3GEO.navega.extensaoAnterior()" style="float: left;"> |
127 | 145 | <i class="material-icons">undo</i> |
... | ... | @@ -129,27 +147,14 @@ |
129 | 147 | <button title="{{{avanca}}}" onclick="i3GEO.navega.extensaoProximo()" style="float: left;"> |
130 | 148 | <i class="material-icons">redo</i> |
131 | 149 | </button> |
132 | - <br> | |
133 | - <button title="{{{graticule}}}" onclick="i3GEO.Interface.grade()" data-tutorial='grade' style="float: left;"> | |
134 | - <i class="material-icons">grid_on</i> | |
135 | - </button> | |
136 | - <button data-tutorial="marcador" class="hidden-xs hidden-sm" title="{{{x79}}}" data-template="templates/ferramentasSend.html" onclick="i3GEO.marcador.inicia(this)" style="float: left;"> | |
150 | + <button class="toggle" data-tutorial="marcador" title="{{{x79}}}" data-template="templates/ferramentasSend.html" onclick="i3GEO.marcador.inicia(this)" style="float: left;display:none;"> | |
137 | 151 | <i class="material-icons">bookmark_border</i> |
138 | 152 | </button> |
139 | 153 | <br> |
140 | - <button data-tutorial="referencia" class="hidden-xs hidden-sm" title="{{{d9}}}" onclick="i3GEO.maparef.inicia()" style="float: left;cursor:pointer;"> | |
141 | - <i class="material-icons">picture_in_picture</i> | |
142 | - </button> | |
143 | - <button class="hidden-xs hidden-sm" title="Spy" onclick="i3GEO.navega.basemapSpy.start()" style="float: left; cursor:pointer;"> | |
144 | - <i class="material-icons">highlight</i> | |
145 | - </button> | |
146 | - <br> | |
147 | - <button class="hidden-xs hidden-sm" title="{{{d18t}}}" onclick="i3GEO.navega.lente.start()" style="float: left; cursor:pointer;"> | |
148 | - <i class="material-icons">loupe</i> | |
154 | + <button class="toggle" title="{{{graticule}}}" onclick="i3GEO.Interface.grade()" data-tutorial='grade' style="float: left;display:none;"> | |
155 | + <i class="material-icons">grid_on</i> | |
149 | 156 | </button> |
150 | - <!-- Para o botao de fullscreen e necessario uma funcao. Veja abaixo nas configuracoes o item afterStart --> | |
151 | - <span id="i3GEOFullscreen" class="hidden-xs hidden-sm" style="cursor:pointer;" title="{{{d9}}}"> | |
152 | - </span> | |
157 | + | |
153 | 158 | </div> |
154 | 159 | <!--barra de progresso que e mostrada conforme as camadas sao desenhadas no mapa. Esse elemento deve ter o id="i3GEOprogressoCamadas" --> |
155 | 160 | <div id="i3GEOprogressoCamadas" class="progress" style="display: block; position: absolute; top: 0px; height: 5px; width: 0%; margin: auto;"> | ... | ... |
js/compactados/navega_compacto.js
1 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.navega={EXTENSOES:{lista:[],redo:[],posicao:0,emAcao:false},offset:function(pixelx,pixely){if(i3GEO.Interface.ATUAL=="openlayers"){var view=i3geoOL.getView(),mover=[pixelx,pixely],s=i3geoOL.getSize(),dx=s[0]/2+mover[0],dy=s[1]/2+mover[1];view.centerOn(view.getCenter(),s,[dx,dy])}},ativaPan:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setOptions({draggable:true})}if(i3GEO.Interface.ATUAL==="openlayers"){marcadorZoom="";i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan)}},registraExt:function(ext){if(i3GEO.navega.EXTENSOES.emAcao==false){var l=i3GEO.navega.EXTENSOES.lista,n=l.length;if(n>10){l.shift()}n=l.length;if(n>0&&l[n-1]===ext){return}l.push(ext)}else{i3GEO.navega.EXTENSOES.emAcao=false}},extensaoAnterior:function(){i3GEO.navega.EXTENSOES.emAcao=true;var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;if(l.length>0){if(l.length>1){e=l.pop();i3GEO.navega.zoomExt("","","",e);if(r.length>10){r.shift()}if(r.length>0&&r[r.length-1]===e){return}else{r.push(a)}}}else{l.push(i3GEO.parametros.mapexten)}},extensaoProximo:function(){var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;i3GEO.navega.EXTENSOES.emAcao=true;if(r.length>0){i3GEO.navega.zoomExt("","","",r[r.length-1]);e=r.pop();if(l.length>10){l.pop()}if(l.length>0&&l[l.length-1]===e){return}l.push(a)}},pan2ponto:function(x,y){i3GEO.Interface[i3GEO.Interface.ATUAL].pan2ponto(x,y);i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar()},centroDoMapa:function(){var xy;switch(i3GEO.Interface.ATUAL){case"openlayers":xy=i3geoOL.getCenter();if(xy){return[xy.lon,xy.lat]}else{return false}break;case"googlemaps":xy=i3GeoMap.getCenter();if(xy){return[xy.lng(),xy.lat()]}else{return false}break;default:return false}},marcaCentroDoMapa:function(xy){var t=$i("i3GeoCentroDoMapa");if(t&&t.style.display==="block"){return}if(xy!=false){xy=i3GEO.calculo.dd2tela(xy[0]*1,xy[1]*1,$i(i3GEO.Interface.IDMAPA),i3GEO.parametros.mapexten,i3GEO.parametros.pixelsize);i3GEO.util.criaPin("i3GeoCentroDoMapa",i3GEO.configura.locaplic+'/imagens/alvo.png','30px','30px');i3GEO.util.posicionaImagemNoMapa("i3GeoCentroDoMapa",xy[0],xy[1])}},removeCookieExtensao:function(){var nomecookie="i3geoOLUltimaExtensao";if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}i3GEO.util.insereCookie(nomecookie,"")},zoomin:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomIn();return}},zoomout:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomOut();return}},zoomponto:function(locaplic,sid,x,y,tamanho,simbolo,cor){if(!simbolo){simbolo="ponto"}if(!tamanho){tamanho=15}if(!cor){cor="255 0 0"}if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.zoomponto(i3GEO.atualiza,x,y,tamanho,simbolo,cor)},zoompontoIMG:function(locaplic,sid,x,y){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.pan(i3GEO.atualiza,'','',x,y)},xy2xy:function(locaplic,sid,xi,yi,xf,yf,ext,tipoimagem){var disty,distx,ex,novoxi,novoxf,novoyf,nex;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}disty=(yi*-1)+yf;distx=(xi*-1)+xf;ex=ext.split(" ");novoxi=(ex[0]*1)-distx;novoxf=(ex[2]*1)-distx;novoyi=(ex[1]*1)-disty;novoyf=(ex[3]*1)-disty;if((distx===0)&&(disty===0)){return false}else{nex=novoxi+" "+novoyi+" "+novoxf+" "+novoyf;i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,tipoimagem,nex);return true}},localizaIP:function(locaplic,sid,funcao){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.localizaIP(funcao)},zoomIP:function(locaplic,sid){try{if(arguments.length>0){i3GEO.configura.locaplic=locaplic;i3GEO.configura.sid=sid}var mostraIP=function(retorno){if(retorno.data.latitude!==null){i3GEO.navega.zoomponto(locaplic,sid,retorno.data.longitude,retorno.data.latitude)}else{i3GEO.janela.tempoMsg("Nao foi possivel identificar a localizacao.")}};i3GEO.navega.localizaIP(locaplic,sid,mostraIP)}catch(e){}},zoomExt:function(locaplic,sid,tipoimagem,ext){var f;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}if(tipoimagem===""){tipoimagem="nenhum"}ext=i3GEO.util.extGeo2OSM(ext);i3GEO.php.mudaext(function(retorno){i3GEO.atualiza(retorno)},tipoimagem,ext)},aplicaEscala:function(escala){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setZoom(i3GEO.Interface.googlemaps.escala2nzoom(escala))}if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomToScale(escala,true);i3GEO.parametros.mapscale=parseInt(i3geoOL.getScale(),10)}},atualizaEscalaNumerica:function(escala){console.log("atualizaEscalaNumerica");var e=$i("i3GEOescalanum");if(!e){return}if(arguments.length===1){e.value=$.number(escala,0,$trad("dec"),$trad("mil"))}else{if(i3GEO.Interface.ATUAL==="googlemaps"){e.value=parseInt(i3GEO.parametros.mapscale,10)}if(i3GEO.Interface.ATUAL==="openlayers"){e.value=$.number(i3geoOL.getScale(),0,$trad("dec"),$trad("mil"))}}},panFixo:function(){alert("panFixo foi depreciado na versao 6.0")},mostraRosaDosVentos:function(){alert("mostraRosaDosVentos foi depreciado na versao 6.0")},autoRedesenho:{INTERVALO:0,ID:"tempoRedesenho",ativa:function(id){if(arguments.length===0){id="tempoRedesenho"}i3GEO.navega.autoRedesenho.ID=id;if(($i(id))&&i3GEO.navega.autoRedesenho.INTERVALO>0){$i(id).style.display="block"}if(i3GEO.navega.autoRedesenho.INTERVALO>0){i3GEO.navega.tempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.redesenha()',i3GEO.navega.autoRedesenho.INTERVALO)}if(($i(id))&&(i3GEO.navega.autoRedesenho.INTERVALO>0)){$i(id).innerHTML=i3GEO.navega.autoRedesenho.INTERVALO/1000;i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},desativa:function(){i3GEO.navega.autoRedesenho.INTERVALO=0;clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);i3GEO.navega.tempoRedesenho="";i3GEO.navega.contaTempoRedesenho="";if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).style.display="none"}},redesenha:function(){clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;case"googlemaps":i3GEO.Interface.googlemaps.redesenha();break;default:i3GEO.atualiza("")}i3GEO.navega.autoRedesenho.ativa(i3GEO.navega.autoRedesenho.ID)},contagem:function(){if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).innerHTML=parseInt($i(i3GEO.navega.autoRedesenho.ID).innerHTML,10)-1}i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},zoomBox:{inicia:function(){alert("zoomBox depreciado na versao 6.0")}},lente:{_lenteCompose:"",eventMouseout:function(){if(i3GEO.navega.lente._lenteCompose!=""){var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getLayersBy("visible",true)[0]}i3GEO.navega.lente.stop(imagery,i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.lente._lenteCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.lente._lenteCompose);i3GEO.navega.lente._lenteCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.lente.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getLayersBy("visible",true)[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.lente._lenteCompose!=""){i3GEO.navega.lente.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.lente.eventMouseout);var a=i3geoOL.on('postcompose',function(event){var context=event.context;var pixelRatio=event.frameState.pixelRatio;var half=radius*pixelRatio;var centerX=objposicaocursor.imgx*pixelRatio;var centerY=objposicaocursor.imgy*pixelRatio;var originX=centerX-half;var originY=centerY-half;var size=2*half+1;var sourceData=context.getImageData(originX,originY,size,size).data;var dest=context.createImageData(size,size);var destData=dest.data;for(var j=0;j<size;++j){for(var i=0;i<size;++i){var dI=i-half;var dJ=j-half;var dist=Math.sqrt(dI*dI+dJ*dJ);var sourceI=i;var sourceJ=j;if(dist<half){sourceI=Math.round(half+dI/2);sourceJ=Math.round(half+dJ/2)}var destOffset=(j*size+i)*4;var sourceOffset=(sourceJ*size+sourceI)*4;destData[destOffset]=sourceData[sourceOffset];destData[destOffset+1]=sourceData[sourceOffset+1];destData[destOffset+2]=sourceData[sourceOffset+2];destData[destOffset+3]=sourceData[sourceOffset+3]}}context.beginPath();context.arc(centerX,centerY,half,0,2*Math.PI);context.lineWidth=3*pixelRatio;context.strokeStyle='rgba(255,255,255,0.5)';context.putImageData(dest,originX,originY);context.stroke();context.restore()});i3GEO.navega.lente._lenteCompose=[a]}},destacaTema:{inicia:function(){i3GEO.janela.tempoMsg("removido na versao 8")}},basemapSpy:{_spyCompose:"",eventMouseout:function(){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(i3geoOL.getLayerBase(),i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.basemapSpy._spyCompose);i3GEO.navega.basemapSpy._spyCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getAllLayers()[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);var a=imagery.on('precompose',function(event){var ctx=event.context;var pixelRatio=event.frameState.pixelRatio;ctx.save();ctx.beginPath();ctx.arc(objposicaocursor.imgx*pixelRatio,objposicaocursor.imgy*pixelRatio,radius*pixelRatio,0,2*Math.PI);ctx.lineWidth=5*pixelRatio;ctx.strokeStyle='rgba(0,0,0,0.5)';ctx.stroke();ctx.clip()});var b=imagery.on('postcompose',function(event){var ctx=event.context;ctx.restore()});i3GEO.navega.basemapSpy._spyCompose=[a,b]}},dialogo:{wiki:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.wiki()","wiki","wiki","dependencias.php","i3GEOF.wiki.iniciaJanelaFlutuante()")},metar:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.metar()","metar","metar","dependencias.php","i3GEOF.metar.iniciaJanelaFlutuante()")},buscaFotos:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.buscaFotos()","buscafotos","buscaFotos","dependencias.php","i3GEOF.buscaFotos.iniciaJanelaFlutuante()")},google:function(coordenadas){i3GEO.navega.dialogo.google.coordenadas=coordenadas;var temp,janela,idgoogle="googlemaps"+Math.random();janela=i3GEO.janela.cria((i3GEO.parametros.w/2.5)+25+"px",(i3GEO.parametros.h/2.5)+18+"px",i3GEO.configura.locaplic+"/ferramentas/googlemaps1/index.php","","","<span class='i3GeoTituloJanelaBsNolink' >Google maps</span></div>",idgoogle,false,"hd","","","",false,"","","","","68");temp=function(){i3GEO.desenho.removePins("boxOndeGoogle");i3GEO.desenho.removePins("googlemaps")};$(janela[0].close).click(temp)},confluence:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.confluence()","confluence","confluence","dependencias.php","i3GEOF.confluence.iniciaJanelaFlutuante()")}},atualizaGoogle:function(idgoogle){try{parent.frames[idgoogle+"i"].panTogoogle()}catch(e){i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle('"+idgoogle+"')"]);i3GEO.desenho.removePins("googlemaps");i3GEO.desenho.removePins("boxOndeGoogle")}},dragZoom:function(){i3GEO.navega.dragZoom.draw=new ol.interaction.Draw({type:"Circle",freehand:false,geometryFunction:ol.interaction.Draw.createRegularPolygon(4)});i3GEO.navega.dragZoom.draw.setActive(false);i3GEO.navega.dragZoom.draw.on("drawend",function(evt){var pol=evt.feature.getGeometry();i3geoOL.getView().fit(pol);i3GEO.navega.dragZoom.draw.setActive(false)});document.body.addEventListener('keydown',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(true)}});document.body.addEventListener('keyup',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(false)}});return i3GEO.navega.dragZoom.draw}}; | |
2 | 1 | \ No newline at end of file |
2 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.navega={EXTENSOES:{lista:[],redo:[],posicao:0,emAcao:false},offset:function(pixelx,pixely){if(i3GEO.Interface.ATUAL=="openlayers"){var view=i3geoOL.getView(),mover=[pixelx,pixely],s=i3geoOL.getSize(),dx=s[0]/2+mover[0],dy=s[1]/2+mover[1];view.centerOn(view.getCenter(),s,[dx,dy])}},ativaPan:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setOptions({draggable:true})}if(i3GEO.Interface.ATUAL==="openlayers"){marcadorZoom="";i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan)}},registraExt:function(ext){if(i3GEO.navega.EXTENSOES.emAcao==false){var l=i3GEO.navega.EXTENSOES.lista,n=l.length;if(n>10){l.shift()}n=l.length;if(n>0&&l[n-1]===ext){return}l.push(ext)}else{i3GEO.navega.EXTENSOES.emAcao=false}},extensaoAnterior:function(){i3GEO.navega.EXTENSOES.emAcao=true;var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;if(l.length>0){if(l.length>1){e=l.pop();i3GEO.navega.zoomExt("","","",e);if(r.length>10){r.shift()}if(r.length>0&&r[r.length-1]===e){return}else{r.push(a)}}}else{l.push(i3GEO.parametros.mapexten)}},extensaoProximo:function(){var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;i3GEO.navega.EXTENSOES.emAcao=true;if(r.length>0){i3GEO.navega.zoomExt("","","",r[r.length-1]);e=r.pop();if(l.length>10){l.pop()}if(l.length>0&&l[l.length-1]===e){return}l.push(a)}},pan2ponto:function(x,y){i3GEO.Interface[i3GEO.Interface.ATUAL].pan2ponto(x,y);i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar()},centroDoMapa:function(){var xy;switch(i3GEO.Interface.ATUAL){case"openlayers":xy=i3geoOL.getCenter();if(xy){return[xy.lon,xy.lat]}else{return false}break;case"googlemaps":xy=i3GeoMap.getCenter();if(xy){return[xy.lng(),xy.lat()]}else{return false}break;default:return false}},marcaCentroDoMapa:function(xy){var t=$i("i3GeoCentroDoMapa");if(t&&t.style.display==="block"){return}if(xy!=false){xy=i3GEO.calculo.dd2tela(xy[0]*1,xy[1]*1,$i(i3GEO.Interface.IDMAPA),i3GEO.parametros.mapexten,i3GEO.parametros.pixelsize);i3GEO.util.criaPin("i3GeoCentroDoMapa",i3GEO.configura.locaplic+'/imagens/alvo.png','30px','30px');i3GEO.util.posicionaImagemNoMapa("i3GeoCentroDoMapa",xy[0],xy[1])}},removeCookieExtensao:function(){var nomecookie="i3geoOLUltimaExtensao";if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}i3GEO.util.insereCookie(nomecookie,"")},zoomin:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomIn();return}},zoomout:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomOut();return}},zoomponto:function(locaplic,sid,x,y,tamanho,simbolo,cor){if(!simbolo){simbolo="ponto"}if(!tamanho){tamanho=15}if(!cor){cor="255 0 0"}if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.zoomponto(i3GEO.atualiza,x,y,tamanho,simbolo,cor)},zoompontoIMG:function(locaplic,sid,x,y){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.pan(i3GEO.atualiza,'','',x,y)},xy2xy:function(locaplic,sid,xi,yi,xf,yf,ext,tipoimagem){var disty,distx,ex,novoxi,novoxf,novoyf,nex;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}disty=(yi*-1)+yf;distx=(xi*-1)+xf;ex=ext.split(" ");novoxi=(ex[0]*1)-distx;novoxf=(ex[2]*1)-distx;novoyi=(ex[1]*1)-disty;novoyf=(ex[3]*1)-disty;if((distx===0)&&(disty===0)){return false}else{nex=novoxi+" "+novoyi+" "+novoxf+" "+novoyf;i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,tipoimagem,nex);return true}},localizaIP:function(locaplic,sid,funcao){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.localizaIP(funcao)},zoomIP:function(locaplic,sid){try{if(arguments.length>0){i3GEO.configura.locaplic=locaplic;i3GEO.configura.sid=sid}var mostraIP=function(retorno){if(retorno.data.latitude!==null){i3GEO.navega.zoomponto(locaplic,sid,retorno.data.longitude,retorno.data.latitude)}else{i3GEO.janela.tempoMsg("Nao foi possivel identificar a localizacao.")}};i3GEO.navega.localizaIP(locaplic,sid,mostraIP)}catch(e){}},zoomExt:function(locaplic,sid,tipoimagem,ext){var f;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}if(tipoimagem===""){tipoimagem="nenhum"}ext=i3GEO.util.extGeo2OSM(ext);i3GEO.php.mudaext(function(retorno){i3GEO.atualiza(retorno)},tipoimagem,ext)},aplicaEscala:function(escala){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setZoom(i3GEO.Interface.googlemaps.escala2nzoom(escala))}if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomToScale(escala,true);i3GEO.parametros.mapscale=parseInt(i3geoOL.getScale(),10)}},atualizaEscalaNumerica:function(escala){console.log("atualizaEscalaNumerica");var e=$i("i3GEOescalanum");if(!e){return}if(arguments.length===1){e.value=$.number(escala,0,$trad("dec"),$trad("mil"))}else{if(i3GEO.Interface.ATUAL==="googlemaps"){e.value=parseInt(i3GEO.parametros.mapscale,10)}if(i3GEO.Interface.ATUAL==="openlayers"){e.value=$.number(i3geoOL.getScale(),0,$trad("dec"),$trad("mil"))}}},panFixo:function(){alert("panFixo foi depreciado na versao 6.0")},mostraRosaDosVentos:function(){alert("mostraRosaDosVentos foi depreciado na versao 6.0")},autoRedesenho:{INTERVALO:0,ID:"tempoRedesenho",ativa:function(id){if(arguments.length===0){id="tempoRedesenho"}i3GEO.navega.autoRedesenho.ID=id;if(($i(id))&&i3GEO.navega.autoRedesenho.INTERVALO>0){$i(id).style.display="block"}if(i3GEO.navega.autoRedesenho.INTERVALO>0){i3GEO.navega.tempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.redesenha()',i3GEO.navega.autoRedesenho.INTERVALO)}if(($i(id))&&(i3GEO.navega.autoRedesenho.INTERVALO>0)){$i(id).innerHTML=i3GEO.navega.autoRedesenho.INTERVALO/1000;i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},desativa:function(){i3GEO.navega.autoRedesenho.INTERVALO=0;clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);i3GEO.navega.tempoRedesenho="";i3GEO.navega.contaTempoRedesenho="";if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).style.display="none"}},redesenha:function(){clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;case"googlemaps":i3GEO.Interface.googlemaps.redesenha();break;default:i3GEO.atualiza("")}i3GEO.navega.autoRedesenho.ativa(i3GEO.navega.autoRedesenho.ID)},contagem:function(){if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).innerHTML=parseInt($i(i3GEO.navega.autoRedesenho.ID).innerHTML,10)-1}i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},zoomBox:{inicia:function(){alert("zoomBox depreciado na versao 6.0")}},lente:{_lenteCompose:"",eventMouseout:function(){if(i3GEO.navega.lente._lenteCompose!=""){i3GEO.navega.lente.stop(i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.lente._lenteCompose!=""){i3geoOL.renderSync()}},stop:function(container){ol.Observable.unByKey(i3GEO.navega.lente._lenteCompose);i3GEO.navega.lente._lenteCompose="";container.removeEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.lente.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var container=i3geoOL.getTargetElement();var radius=75;container.addEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.lente.eventMouseout);var a=i3geoOL.on('postcompose',function(event){var context=event.context;var pixelRatio=event.frameState.pixelRatio;var half=radius*pixelRatio;var centerX=objposicaocursor.imgx*pixelRatio;var centerY=objposicaocursor.imgy*pixelRatio;var originX=centerX-half;var originY=centerY-half;var size=2*half+1;var sourceData=context.getImageData(originX,originY,size,size).data;var dest=context.createImageData(size,size);var destData=dest.data;for(var j=0;j<size;++j){for(var i=0;i<size;++i){var dI=i-half;var dJ=j-half;var dist=Math.sqrt(dI*dI+dJ*dJ);var sourceI=i;var sourceJ=j;if(dist<half){sourceI=Math.round(half+dI/2);sourceJ=Math.round(half+dJ/2)}var destOffset=(j*size+i)*4;var sourceOffset=(sourceJ*size+sourceI)*4;destData[destOffset]=sourceData[sourceOffset];destData[destOffset+1]=sourceData[sourceOffset+1];destData[destOffset+2]=sourceData[sourceOffset+2];destData[destOffset+3]=sourceData[sourceOffset+3]}}context.beginPath();context.arc(centerX,centerY,half,0,2*Math.PI);context.lineWidth=3*pixelRatio;context.strokeStyle='rgba(255,255,255,0.5)';context.putImageData(dest,originX,originY);context.stroke();context.restore()});i3GEO.navega.lente._lenteCompose=[a]}},destacaTema:{inicia:function(){i3GEO.janela.tempoMsg("removido na versao 8")}},basemapSpy:{_spyCompose:"",eventMouseout:function(){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(i3geoOL.getLayerBase(),i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.basemapSpy._spyCompose);i3GEO.navega.basemapSpy._spyCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getAllLayers()[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);var a=imagery.on('precompose',function(event){var ctx=event.context;var pixelRatio=event.frameState.pixelRatio;ctx.save();ctx.beginPath();ctx.arc(objposicaocursor.imgx*pixelRatio,objposicaocursor.imgy*pixelRatio,radius*pixelRatio,0,2*Math.PI);ctx.lineWidth=5*pixelRatio;ctx.strokeStyle='rgba(0,0,0,0.5)';ctx.stroke();ctx.clip()});var b=imagery.on('postcompose',function(event){var ctx=event.context;ctx.restore()});i3GEO.navega.basemapSpy._spyCompose=[a,b]}},dialogo:{wiki:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.wiki()","wiki","wiki","dependencias.php","i3GEOF.wiki.iniciaJanelaFlutuante()")},metar:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.metar()","metar","metar","dependencias.php","i3GEOF.metar.iniciaJanelaFlutuante()")},buscaFotos:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.buscaFotos()","buscafotos","buscaFotos","dependencias.php","i3GEOF.buscaFotos.iniciaJanelaFlutuante()")},google:function(coordenadas){i3GEO.navega.dialogo.google.coordenadas=coordenadas;var temp,janela,idgoogle="googlemaps"+Math.random();janela=i3GEO.janela.cria((i3GEO.parametros.w/2.5)+25+"px",(i3GEO.parametros.h/2.5)+18+"px",i3GEO.configura.locaplic+"/ferramentas/googlemaps1/index.php","","","<span class='i3GeoTituloJanelaBsNolink' >Google maps</span></div>",idgoogle,false,"hd","","","",false,"","","","","68");temp=function(){i3GEO.desenho.removePins("boxOndeGoogle");i3GEO.desenho.removePins("googlemaps")};$(janela[0].close).click(temp)},confluence:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.confluence()","confluence","confluence","dependencias.php","i3GEOF.confluence.iniciaJanelaFlutuante()")}},atualizaGoogle:function(idgoogle){try{parent.frames[idgoogle+"i"].panTogoogle()}catch(e){i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle('"+idgoogle+"')"]);i3GEO.desenho.removePins("googlemaps");i3GEO.desenho.removePins("boxOndeGoogle")}},dragZoom:function(){i3GEO.navega.dragZoom.draw=new ol.interaction.Draw({type:"Circle",freehand:false,geometryFunction:ol.interaction.Draw.createRegularPolygon(4)});i3GEO.navega.dragZoom.draw.setActive(false);i3GEO.navega.dragZoom.draw.on("drawend",function(evt){var pol=evt.feature.getGeometry();i3geoOL.getView().fit(pol);i3GEO.navega.dragZoom.draw.setActive(false)});document.body.addEventListener('keydown',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(true)}});document.body.addEventListener('keyup',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(false)}});return i3GEO.navega.dragZoom.draw}}; | |
3 | 3 | \ No newline at end of file | ... | ... |
js/i3geo_tudo_compacto8.js
... | ... | @@ -272,7 +272,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.guias={LARGURAGUIAMOVEL:350,C |
272 | 272 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.arvoreDeCamadas={FUNCOES:{farolescala:true,excluir:true,sobe:true,desce:true,fonte:true,zoomtema:true,compartilhar:true,opacidade:true,mudanome:true,procurar:true,toponimia:true,etiquetas:true,filtrar:true,tabela:true,grafico:true,editorlegenda:true,destacar:true,cortina:true,sql:true,comentar:true,temporizador:true,wms:true,tme:true,copia:true,storymap:true,animagif:true},CAMADAS:"",FILTRO:"",CAMADASINDEXADAS:[],config:{"idOnde":"listaTemas","aposIniciar":"","templateCamada":"templates/camada.html","idListaFundo":"","templateCamadaFundo":"templates/camadaFundo.html","idListaLayersGr":"","templateCamadaGr":"templates/camadaGr.html","verificaAbrangencia":""},carregaTemplates:function(){var t1=i3GEO.arvoreDeCamadas.config.templateCamada,t2=i3GEO.arvoreDeCamadas.config.templateCamadaFundo,t3=i3GEO.arvoreDeCamadas.config.templateCamadaGr;$.ajax(t1).always(function(r1){i3GEO.template.camada=r1;if(r1.status){i3GEO.template.camada=""}$.ajax(t2).always(function(r2){i3GEO.template.camadaFundo=r2;if(r2.status){i3GEO.template.camadaFundo=""}$.ajax(t3).always(function(r3){i3GEO.template.camadaGr=r3;if(r3.status){i3GEO.template.camadaGr=""}i3GEO.arvoreDeCamadas.inicia()})})})},inicia:function(config){if(config){$.each(config,function(i,v){if(v!=undefined){i3GEO.arvoreDeCamadas.config[i]=v}})}if(!i3GEO.template.camada||!i3GEO.template.camadaFundo){i3GEO.arvoreDeCamadas.carregaTemplates();return}else{config=i3GEO.arvoreDeCamadas.config;var novoel,temp;i3GEO.arvoreDeCamadas.atualiza(i3GEO.arvoreDeCamadas.CAMADAS);if(!$i(config.idOnde)){return}if(config.verificaAbrangencia!=""){i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.arvoreDeCamadas.verificaAbrangenciaTemas()"])}if(config.aposIniciar!==""){if(jQuery.isFunction(config.aposIniciar)){config.aposIniciar.call()}}}},adicionaLayersGr:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var temp=$i(i3GEO.arvoreDeCamadas.config.idListaLayersGr),layers=i3geoOL.getLayersGr(),lista=[],camada={};if(temp){$.each(layers,function(i,layer){var p=layer.getProperties();camada={...i3GEO.idioma.OBJETOIDIOMA};camada.name=p.name;camada.tema=p.title;camada.locaplic=i3GEO.configura.locaplic;if(layer.getVisible()==true){camada.checked="checked"}else{camada.checked=""}lista.push(camada)});var t=Mustache.render("{{#data}}"+i3GEO.template.camadaGr+"{{/data}}",{"data":lista});$(temp).html(t)}},atualiza:function(temas,forca){if(i3GEO.template.camada==undefined||i3GEO.template.camada==false){return}if(arguments.length===0){temas=i3GEO.arvoreDeCamadas.CAMADAS;i3GEO.arvoreDeCamadas.CAMADAS="";forca=false}var clone=[],camada={},config=i3GEO.arvoreDeCamadas.config,temp;temp=$i(config.idOnde);if(temp){if(forca===true){temp.innerHTML=""}if(temp.innerHTML!==""){if(i3GEO.arvoreDeCamadas.comparaTemas(temas,i3GEO.arvoreDeCamadas.CAMADAS)){i3GEO.arvoreDeCamadas.CAMADAS=temas;return}}}i3GEO.arvoreDeCamadas.CAMADAS=temas;i3GEO.arvoreDeCamadas.CAMADASINDEXADAS=[];$.each(i3GEO.arvoreDeCamadas.CAMADAS,function(i,tema){var mostra=true;i3GEO.pluginI3geo.aplicaPropriedades(tema);camada={};camada.name=tema.name;camada.tema=tema.tema;if(tema.status!=0){camada.checked="checked"}else{camada.checked=""}if(tema.sel&&tema.sel.toLowerCase()==="sim"){camada.classeCss="camadaSelecionada"}else{camada.classeCss=""}if(temp&&i3GEO.arvoreDeCamadas.FILTRO!==""){if(i3GEO.arvoreDeCamadas.FILTRO==="desligados"&&camada.checked=="checked"){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="ligados"&&camada.checked==""){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="selecionados"&&tema.sel.toLowerCase()!=="sim"){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="download"&&tema.download.toLowerCase()!=="sim"){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="wms"&&tema.connectiontype*1!==7){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="raster"&&tema.type*1!==3){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="toponimia"&&tema.type*1!==4){mostra=false}}if(temp&&mostra==true){i3GEO.arvoreDeCamadas.montaIconesTema(tema,camada);i3GEO.arvoreDeCamadas.montaOpcoesTema(tema,camada);if(tema.iconetema!==""){camada.iconetema="<img class='i3GEOiconeTema' src='"+tema.iconetema+"' />"}if(tema.maxscaledenom&&(tema.maxscaledenom*1>i3GEO.parametros.mapscale*1&&tema.minscaledenom*1<i3GEO.parametros.mapscale*1)){camada.rangeScale="out";camada.rangeScaleMsg=$trad("rangeScaleMsg")}else{camada.rangeScale="in"}if(tema.escondido.toLowerCase()!=="sim"){clone.push(camada)}}i3GEO.arvoreDeCamadas.CAMADASINDEXADAS[camada.name]=tema});if(temp){var t=Mustache.render("{{#data}}"+i3GEO.template.camada+"{{/data}}",{"data":clone});$("#"+config.idOnde).html(t);$("#"+config.idOnde).sortable({scroll:false,axis:"y",revert:true,update:function(event,ui){var els=i3GEO.arvoreDeCamadas.listaLigadosDesligadosArvore(config.idOnde);var lista=els[2].join(",");var temp=function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}i3GEO.arvoreDeCamadas.atualiza(i3GEO.arvoreDeCamadas.CAMADAS,true)};i3GEO.php.reordenatemas(temp,lista)}})}i3GEO.arvoreDeCamadas.adicionaCamadasDeFundo(config);i3GEO.arvoreDeCamadas.adicionaLayersGr();i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS)},adicionaCamadasDeFundo:function(config){if(i3GEO.Interface.ATUAL=="openlayers"){var temp=temp=$i(config.idOnde);if(temp&&$("#"+config.idListaFundo).html()==""){clone=[{"name":"camadaDeFundo","value":"nenhum","title":$trad("nenhum")}];$.each(i3GEO.Interface.openlayers.LAYERSADICIONAIS,function(i,layer){camada={};temp=layer.getProperties();camada.name="camadaDeFundo";if(temp.preview){camada.preview=temp.preview}else{camada.preview=""}camada.value=temp.name;camada.title=temp.title;if(temp.visible===true){camada.checked="checked"}else{camada.checked=""}clone.push(camada)});var t=Mustache.to_html("{{#data}}"+i3GEO.template.camadaFundo+"{{/data}}",{"data":clone});$("#"+config.idListaFundo).html(t);$("#"+config.idListaFundo+" label").tooltip({animation:false,trigger:"hover",placement:"auto",html:true,template:"<div class='tooltip ' ><div class='tooltip-inner'></div></div>"})}}},ligaDesligaTemas:function(lista,status){},atualizaLegenda:function(idtema){},montaTextoTema:function(tema){if(i3GEO.tema.TEMPORIZADORESID[tema.name]==undefined&&tema.temporizador!=""){i3GEO.tema.temporizador(tema.name,tema.temporizador)}return(html)},montaOpcoesTema:function(temaObj,camada){camada.ferramentasTexto=$trad("u15a");camada.ferramentasTitle=$trad("ferramCamadas");camada.removerTexto=$trad("t12");camada.removerTitle=$trad("t12a");camada.sobeTexto=$trad("t13");camada.sobeTitle=$trad("t14");camada.desceTexto=$trad("t15");camada.desceTitle=$trad("t16");camada.tabelaTexto=$trad("tabela");camada.tabelaTitle=$trad("t30");camada.editorlegendaTexto=$trad("t33");if(temaObj.zoomtema.toLowerCase()==="sim"){camada.zoomtemaTexto=$trad("t17");camada.zoomtemaTitle=$trad("t18")}else{camada.zoomtema="hidden"}if(temaObj.sel.toLowerCase()==="sim"){camada.selTexto=$trad("t5");camada.selTitle=$trad("t4")}else{camada.sel="hidden"}if(temaObj.sel.toLowerCase()==="sim"){camada.zoomSelTexto=$trad("t4a")}else{camada.zoomsel="hidden"}if(temaObj.link_tema!=""&&temaObj.features.toLowerCase()!=="sim"&&temaObj.name!="mundo"){camada.linkTexto=$trad("a9");camada.linkTitle=$trad("a9")}else{camada.link="hidden"}if(temaObj.download.toLowerCase()==="sim"||temaObj.download===""&&temaObj.features.toLowerCase()!=="sim"){camada.downloadTexto="Download";camada.downloadTitle=$trad("t6")}else{camada.download="hidden"}if(temaObj.permiteogc.toLowerCase()==="sim"){camada.permiteogcTexto="OGC"}else{camada.permiteogc="hidden"}return camada},montaIconesTema:function(temaObj,camada){if(temaObj.escala!=0){if(temaObj.escala*1<i3GEO.parametros.mapscale*1){camada.farol="green";camada.farolTitle=$trad("t9")}if(temaObj.escala*1>i3GEO.parametros.mapscale*1){camada.farol="red";camada.farolTitle=$trad("t10")}if(temaObj.escala===0){camada.farol="yellow";camada.farolTitle=$trad("t11")}}else{camada.farol="hidden"}if(temaObj.contextoescala.toLowerCase()==="sim"){camada.contextoescala="";camada.contextoescalaTitle=$trad("t36")}else{camada.contextoescala="hidden"}if(temaObj.plugini3geo){var iconePlugin=i3GEO.pluginI3geo.clickArvoreDeCamadas(temaObj);if(iconePlugin!=false){camada.iconePlugin=iconePlugin}}if(temaObj.ferramentas){var html="",fer="",fers=temaObj.ferramentas;for(fer in fers){if(i3GEO.configura.ferramentasLayers[fer]){html+=i3GEO.configura.ferramentasLayers[fer].icone(temaObj.name)}}camada.iconeFerramentas=html}return camada},atualizaFarol:function(mapscale){var farol,l,ltema,escala,iu=i3GEO.util,im=i3GEO.configura.locaplic+"/imagens/",camadas=i3GEO.arvoreDeCamadas.CAMADAS;farol="maisamarelo.png";l=camadas.length-1;if(l>=0){do{ltema=camadas[l];escala=ltema.escala;if(escala*1<mapscale*1){farol="maisverde.png"}if(escala*1>mapscale*1){farol="maisvermelho.png"}if(escala*1===0){farol="maisamarelo.png"}iu.defineValor("farol"+ltema.name,"src",im+farol)}while(l--)}},aplicaTemas:function(tipo){if(arguments.length===0){tipo="normal"}var t="",temp;if(tipo==="normal"){t=i3GEO.arvoreDeCamadas.listaLigadosDesligados("mantem")}if(tipo==="ligartodos"){t=i3GEO.arvoreDeCamadas.listaLigadosDesligados("marca")}if(tipo==="desligartodos"){t=i3GEO.arvoreDeCamadas.listaLigadosDesligados("desmarca")}temp=function(){i3GEO.atualiza();i3GEO.janela.fechaAguarde("redesenha")};if(tipo==="normal"){i3GEO.php.ligatemas(temp,t[1].toString(),t[0].toString());return}if(tipo==="ligartodos"){i3GEO.php.ligatemas(temp,"",t[2].toString());return}if(tipo==="desligartodos"){i3GEO.php.ligatemas(temp,t[2].toString(),"")}},listaLigadosDesligados:function(){if(!i3GEO.arvoreDeCamadas.CAMADAS){return[[],[],[]]}var i=0,ligados=[],desligados=[],todos=[],camada,camadas=i3GEO.arvoreDeCamadas.CAMADAS;i=camadas.length;while(i>0){i-=1;camada=camadas[i];todos.push(camada["name"]);if(parseInt(camada["status"],10)===2){ligados.push(camada["name"])}else{desligados.push(camada["name"])}}return([ligados,desligados,todos])},listaLigadosDesligadosArvore:function(onde){if(!i3GEO.arvoreDeCamadas.CAMADAS){return[[],[],[]]}var n,i,ligados=[],desligados=[],todos=[],camada,camadas;camadas=$i(onde).getElementsByTagName("input");n=camadas.length;for(i=0;i<n;i++){camada=camadas[i];todos.push(camada.value);if(camada.checked==true){ligados.push(camada["name"])}else{desligados.push(camada["name"])}}return([ligados,desligados,todos])},capturaCheckBox:function(tema){var onde=$i(i3GEO.arvoreDeCamadas.config.idOnde),camadas,n,i;if(onde){camadas=onde.getElementsByTagName("input");n=camadas.length;for(i=0;i<n;i++){if(camadas[i].name==tema){return camadas[i]}}}return false},comparaTemas:function(novo,atual){try{var novon=novo.length,i;if(novon!==atual.length){return(false)}for(i=0;i<novon;i+=1){if(novo[i].name!==atual[i].name){return(false)}if(novo[i].tema!==atual[i].tema){return(false)}if(novo[i].sel!==atual[i].sel){return(false)}if(novo[i].status!==atual[i].status){return(false)}}return(true)}catch(e){return true}},pegaTema:function(valor,camadas,parametro){var i;if(!camadas||camadas==""){camadas=i3GEO.arvoreDeCamadas.CAMADAS}else{camadas=i3GEO.arvoreDeCamadas.converteChaveValor2normal(camadas)}if(!parametro){parametro="name"}i=camadas.length;while(i>0){i-=1;if(camadas[i][parametro]===valor){return camadas[i]}}return""},filtraCamadas:function(propriedade,valor,operador,camadas){if(!camadas){camadas=i3GEO.arvoreDeCamadas.CAMADAS}var resultado,i=0,temp,nelementos=camadas.length,ltema;resultado=[];if(nelementos>0){do{ltema=camadas[i];if(ltema.escondido.toLowerCase()!=="sim"){temp=ltema[propriedade];if(operador==="igual"){if(temp+"".toLowerCase()==valor+"".toLowerCase()){resultado.push(ltema)}}if(operador==="diferente"){if(temp+"".toLowerCase()!==valor+"".toLowerCase()){resultado.push(ltema)}}if(operador==="menor"){if(temp+"".toLowerCase()<valor+"".toLowerCase()){resultado.push(ltema)}}}i+=1}while(i<nelementos)}return resultado},alteraPropCamadas:function(propriedade,valor,camada){var i=0,nelementos=i3GEO.arvoreDeCamadas.CAMADAS.length,ltema;if(nelementos>0){do{ltema=i3GEO.arvoreDeCamadas.CAMADAS[i];if(ltema.name===camada){ltema[propriedade]=valor}i+=1}while(i<nelementos)}},verificaAbrangenciaTemas:function(){var nos=$("#"+i3GEO.arvoreDeCamadas.config.idOnde).find("input");$.each(nos,function(i,no){var ltema=i3GEO.arvoreDeCamadas.CAMADASINDEXADAS[no.value];var temp=ltema.exttema;if(temp!==""&&temp!=undefined){if(i3GEO.util.intersectaBox(temp,i3GEO.parametros.mapexten)===false){$(no).addClass(i3GEO.arvoreDeCamadas.config.verificaAbrangencia)}else{$(no).removeClass(i3GEO.arvoreDeCamadas.config.verificaAbrangencia)}}})},verificaAplicaExtensao:function(){var i=0,temp="",nelementos=i3GEO.arvoreDeCamadas.CAMADAS.length,ltema;try{if(nelementos>0){do{ltema=i3GEO.arvoreDeCamadas.CAMADAS[i];if(ltema.aplicaextensao.toLowerCase()==="sim"){temp=ltema.name}i+=1}while(i<nelementos)}}catch(e){return""}return temp},converteChaveValor2normal:function(obj){if(obj.chaves){var i,tema,j,t,chaves=obj.chaves,temas=obj.valores,ntemas=temas.length,nchaves=chaves.length,novo=[];for(i=0;i<ntemas;i++){tema=temas[i];t={};for(j=0;j<nchaves;j++){t[chaves[j]]=tema[j]}novo.push(t)}return novo}else{return obj}},registaCamadas:function(obj){var i;obj=i3GEO.arvoreDeCamadas.converteChaveValor2normal(obj);i3GEO.arvoreDeCamadas.CAMADAS=obj;i3GEO.arvoreDeCamadas.CAMADASINDEXADAS=[];$.each(i3GEO.arvoreDeCamadas.CAMADAS,function(i,tema){i3GEO.arvoreDeCamadas.CAMADASINDEXADAS[tema.name]=tema})},dialogo:{filtro:function(){i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.filtro()","filtroarvore","filtroarvore","dependencias.php","i3GEOF.filtroarvore.iniciaJanelaFlutuante()")},excluir:function(){i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.excluir()","excluirarvore","excluirarvore","dependencias.php","i3GEOF.excluirarvore.iniciaJanelaFlutuante()")}}}; |
273 | 273 | // |
274 | 274 | //compactados/navega_compacto.js |
275 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.navega={EXTENSOES:{lista:[],redo:[],posicao:0,emAcao:false},offset:function(pixelx,pixely){if(i3GEO.Interface.ATUAL=="openlayers"){var view=i3geoOL.getView(),mover=[pixelx,pixely],s=i3geoOL.getSize(),dx=s[0]/2+mover[0],dy=s[1]/2+mover[1];view.centerOn(view.getCenter(),s,[dx,dy])}},ativaPan:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setOptions({draggable:true})}if(i3GEO.Interface.ATUAL==="openlayers"){marcadorZoom="";i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan)}},registraExt:function(ext){if(i3GEO.navega.EXTENSOES.emAcao==false){var l=i3GEO.navega.EXTENSOES.lista,n=l.length;if(n>10){l.shift()}n=l.length;if(n>0&&l[n-1]===ext){return}l.push(ext)}else{i3GEO.navega.EXTENSOES.emAcao=false}},extensaoAnterior:function(){i3GEO.navega.EXTENSOES.emAcao=true;var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;if(l.length>0){if(l.length>1){e=l.pop();i3GEO.navega.zoomExt("","","",e);if(r.length>10){r.shift()}if(r.length>0&&r[r.length-1]===e){return}else{r.push(a)}}}else{l.push(i3GEO.parametros.mapexten)}},extensaoProximo:function(){var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;i3GEO.navega.EXTENSOES.emAcao=true;if(r.length>0){i3GEO.navega.zoomExt("","","",r[r.length-1]);e=r.pop();if(l.length>10){l.pop()}if(l.length>0&&l[l.length-1]===e){return}l.push(a)}},pan2ponto:function(x,y){i3GEO.Interface[i3GEO.Interface.ATUAL].pan2ponto(x,y);i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar()},centroDoMapa:function(){var xy;switch(i3GEO.Interface.ATUAL){case"openlayers":xy=i3geoOL.getCenter();if(xy){return[xy.lon,xy.lat]}else{return false}break;case"googlemaps":xy=i3GeoMap.getCenter();if(xy){return[xy.lng(),xy.lat()]}else{return false}break;default:return false}},marcaCentroDoMapa:function(xy){var t=$i("i3GeoCentroDoMapa");if(t&&t.style.display==="block"){return}if(xy!=false){xy=i3GEO.calculo.dd2tela(xy[0]*1,xy[1]*1,$i(i3GEO.Interface.IDMAPA),i3GEO.parametros.mapexten,i3GEO.parametros.pixelsize);i3GEO.util.criaPin("i3GeoCentroDoMapa",i3GEO.configura.locaplic+'/imagens/alvo.png','30px','30px');i3GEO.util.posicionaImagemNoMapa("i3GeoCentroDoMapa",xy[0],xy[1])}},removeCookieExtensao:function(){var nomecookie="i3geoOLUltimaExtensao";if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}i3GEO.util.insereCookie(nomecookie,"")},zoomin:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomIn();return}},zoomout:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomOut();return}},zoomponto:function(locaplic,sid,x,y,tamanho,simbolo,cor){if(!simbolo){simbolo="ponto"}if(!tamanho){tamanho=15}if(!cor){cor="255 0 0"}if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.zoomponto(i3GEO.atualiza,x,y,tamanho,simbolo,cor)},zoompontoIMG:function(locaplic,sid,x,y){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.pan(i3GEO.atualiza,'','',x,y)},xy2xy:function(locaplic,sid,xi,yi,xf,yf,ext,tipoimagem){var disty,distx,ex,novoxi,novoxf,novoyf,nex;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}disty=(yi*-1)+yf;distx=(xi*-1)+xf;ex=ext.split(" ");novoxi=(ex[0]*1)-distx;novoxf=(ex[2]*1)-distx;novoyi=(ex[1]*1)-disty;novoyf=(ex[3]*1)-disty;if((distx===0)&&(disty===0)){return false}else{nex=novoxi+" "+novoyi+" "+novoxf+" "+novoyf;i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,tipoimagem,nex);return true}},localizaIP:function(locaplic,sid,funcao){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.localizaIP(funcao)},zoomIP:function(locaplic,sid){try{if(arguments.length>0){i3GEO.configura.locaplic=locaplic;i3GEO.configura.sid=sid}var mostraIP=function(retorno){if(retorno.data.latitude!==null){i3GEO.navega.zoomponto(locaplic,sid,retorno.data.longitude,retorno.data.latitude)}else{i3GEO.janela.tempoMsg("Nao foi possivel identificar a localizacao.")}};i3GEO.navega.localizaIP(locaplic,sid,mostraIP)}catch(e){}},zoomExt:function(locaplic,sid,tipoimagem,ext){var f;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}if(tipoimagem===""){tipoimagem="nenhum"}ext=i3GEO.util.extGeo2OSM(ext);i3GEO.php.mudaext(function(retorno){i3GEO.atualiza(retorno)},tipoimagem,ext)},aplicaEscala:function(escala){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setZoom(i3GEO.Interface.googlemaps.escala2nzoom(escala))}if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomToScale(escala,true);i3GEO.parametros.mapscale=parseInt(i3geoOL.getScale(),10)}},atualizaEscalaNumerica:function(escala){console.log("atualizaEscalaNumerica");var e=$i("i3GEOescalanum");if(!e){return}if(arguments.length===1){e.value=$.number(escala,0,$trad("dec"),$trad("mil"))}else{if(i3GEO.Interface.ATUAL==="googlemaps"){e.value=parseInt(i3GEO.parametros.mapscale,10)}if(i3GEO.Interface.ATUAL==="openlayers"){e.value=$.number(i3geoOL.getScale(),0,$trad("dec"),$trad("mil"))}}},panFixo:function(){alert("panFixo foi depreciado na versao 6.0")},mostraRosaDosVentos:function(){alert("mostraRosaDosVentos foi depreciado na versao 6.0")},autoRedesenho:{INTERVALO:0,ID:"tempoRedesenho",ativa:function(id){if(arguments.length===0){id="tempoRedesenho"}i3GEO.navega.autoRedesenho.ID=id;if(($i(id))&&i3GEO.navega.autoRedesenho.INTERVALO>0){$i(id).style.display="block"}if(i3GEO.navega.autoRedesenho.INTERVALO>0){i3GEO.navega.tempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.redesenha()',i3GEO.navega.autoRedesenho.INTERVALO)}if(($i(id))&&(i3GEO.navega.autoRedesenho.INTERVALO>0)){$i(id).innerHTML=i3GEO.navega.autoRedesenho.INTERVALO/1000;i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},desativa:function(){i3GEO.navega.autoRedesenho.INTERVALO=0;clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);i3GEO.navega.tempoRedesenho="";i3GEO.navega.contaTempoRedesenho="";if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).style.display="none"}},redesenha:function(){clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;case"googlemaps":i3GEO.Interface.googlemaps.redesenha();break;default:i3GEO.atualiza("")}i3GEO.navega.autoRedesenho.ativa(i3GEO.navega.autoRedesenho.ID)},contagem:function(){if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).innerHTML=parseInt($i(i3GEO.navega.autoRedesenho.ID).innerHTML,10)-1}i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},zoomBox:{inicia:function(){alert("zoomBox depreciado na versao 6.0")}},lente:{_lenteCompose:"",eventMouseout:function(){if(i3GEO.navega.lente._lenteCompose!=""){var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getLayersBy("visible",true)[0]}i3GEO.navega.lente.stop(imagery,i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.lente._lenteCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.lente._lenteCompose);i3GEO.navega.lente._lenteCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.lente.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getLayersBy("visible",true)[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.lente._lenteCompose!=""){i3GEO.navega.lente.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.lente.eventMouseout);var a=i3geoOL.on('postcompose',function(event){var context=event.context;var pixelRatio=event.frameState.pixelRatio;var half=radius*pixelRatio;var centerX=objposicaocursor.imgx*pixelRatio;var centerY=objposicaocursor.imgy*pixelRatio;var originX=centerX-half;var originY=centerY-half;var size=2*half+1;var sourceData=context.getImageData(originX,originY,size,size).data;var dest=context.createImageData(size,size);var destData=dest.data;for(var j=0;j<size;++j){for(var i=0;i<size;++i){var dI=i-half;var dJ=j-half;var dist=Math.sqrt(dI*dI+dJ*dJ);var sourceI=i;var sourceJ=j;if(dist<half){sourceI=Math.round(half+dI/2);sourceJ=Math.round(half+dJ/2)}var destOffset=(j*size+i)*4;var sourceOffset=(sourceJ*size+sourceI)*4;destData[destOffset]=sourceData[sourceOffset];destData[destOffset+1]=sourceData[sourceOffset+1];destData[destOffset+2]=sourceData[sourceOffset+2];destData[destOffset+3]=sourceData[sourceOffset+3]}}context.beginPath();context.arc(centerX,centerY,half,0,2*Math.PI);context.lineWidth=3*pixelRatio;context.strokeStyle='rgba(255,255,255,0.5)';context.putImageData(dest,originX,originY);context.stroke();context.restore()});i3GEO.navega.lente._lenteCompose=[a]}},destacaTema:{inicia:function(){i3GEO.janela.tempoMsg("removido na versao 8")}},basemapSpy:{_spyCompose:"",eventMouseout:function(){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(i3geoOL.getLayerBase(),i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.basemapSpy._spyCompose);i3GEO.navega.basemapSpy._spyCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getAllLayers()[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);var a=imagery.on('precompose',function(event){var ctx=event.context;var pixelRatio=event.frameState.pixelRatio;ctx.save();ctx.beginPath();ctx.arc(objposicaocursor.imgx*pixelRatio,objposicaocursor.imgy*pixelRatio,radius*pixelRatio,0,2*Math.PI);ctx.lineWidth=5*pixelRatio;ctx.strokeStyle='rgba(0,0,0,0.5)';ctx.stroke();ctx.clip()});var b=imagery.on('postcompose',function(event){var ctx=event.context;ctx.restore()});i3GEO.navega.basemapSpy._spyCompose=[a,b]}},dialogo:{wiki:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.wiki()","wiki","wiki","dependencias.php","i3GEOF.wiki.iniciaJanelaFlutuante()")},metar:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.metar()","metar","metar","dependencias.php","i3GEOF.metar.iniciaJanelaFlutuante()")},buscaFotos:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.buscaFotos()","buscafotos","buscaFotos","dependencias.php","i3GEOF.buscaFotos.iniciaJanelaFlutuante()")},google:function(coordenadas){i3GEO.navega.dialogo.google.coordenadas=coordenadas;var temp,janela,idgoogle="googlemaps"+Math.random();janela=i3GEO.janela.cria((i3GEO.parametros.w/2.5)+25+"px",(i3GEO.parametros.h/2.5)+18+"px",i3GEO.configura.locaplic+"/ferramentas/googlemaps1/index.php","","","<span class='i3GeoTituloJanelaBsNolink' >Google maps</span></div>",idgoogle,false,"hd","","","",false,"","","","","68");temp=function(){i3GEO.desenho.removePins("boxOndeGoogle");i3GEO.desenho.removePins("googlemaps")};$(janela[0].close).click(temp)},confluence:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.confluence()","confluence","confluence","dependencias.php","i3GEOF.confluence.iniciaJanelaFlutuante()")}},atualizaGoogle:function(idgoogle){try{parent.frames[idgoogle+"i"].panTogoogle()}catch(e){i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle('"+idgoogle+"')"]);i3GEO.desenho.removePins("googlemaps");i3GEO.desenho.removePins("boxOndeGoogle")}},dragZoom:function(){i3GEO.navega.dragZoom.draw=new ol.interaction.Draw({type:"Circle",freehand:false,geometryFunction:ol.interaction.Draw.createRegularPolygon(4)});i3GEO.navega.dragZoom.draw.setActive(false);i3GEO.navega.dragZoom.draw.on("drawend",function(evt){var pol=evt.feature.getGeometry();i3geoOL.getView().fit(pol);i3GEO.navega.dragZoom.draw.setActive(false)});document.body.addEventListener('keydown',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(true)}});document.body.addEventListener('keyup',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(false)}});return i3GEO.navega.dragZoom.draw}}; | |
275 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.navega={EXTENSOES:{lista:[],redo:[],posicao:0,emAcao:false},offset:function(pixelx,pixely){if(i3GEO.Interface.ATUAL=="openlayers"){var view=i3geoOL.getView(),mover=[pixelx,pixely],s=i3geoOL.getSize(),dx=s[0]/2+mover[0],dy=s[1]/2+mover[1];view.centerOn(view.getCenter(),s,[dx,dy])}},ativaPan:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setOptions({draggable:true})}if(i3GEO.Interface.ATUAL==="openlayers"){marcadorZoom="";i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan)}},registraExt:function(ext){if(i3GEO.navega.EXTENSOES.emAcao==false){var l=i3GEO.navega.EXTENSOES.lista,n=l.length;if(n>10){l.shift()}n=l.length;if(n>0&&l[n-1]===ext){return}l.push(ext)}else{i3GEO.navega.EXTENSOES.emAcao=false}},extensaoAnterior:function(){i3GEO.navega.EXTENSOES.emAcao=true;var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;if(l.length>0){if(l.length>1){e=l.pop();i3GEO.navega.zoomExt("","","",e);if(r.length>10){r.shift()}if(r.length>0&&r[r.length-1]===e){return}else{r.push(a)}}}else{l.push(i3GEO.parametros.mapexten)}},extensaoProximo:function(){var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;i3GEO.navega.EXTENSOES.emAcao=true;if(r.length>0){i3GEO.navega.zoomExt("","","",r[r.length-1]);e=r.pop();if(l.length>10){l.pop()}if(l.length>0&&l[l.length-1]===e){return}l.push(a)}},pan2ponto:function(x,y){i3GEO.Interface[i3GEO.Interface.ATUAL].pan2ponto(x,y);i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar()},centroDoMapa:function(){var xy;switch(i3GEO.Interface.ATUAL){case"openlayers":xy=i3geoOL.getCenter();if(xy){return[xy.lon,xy.lat]}else{return false}break;case"googlemaps":xy=i3GeoMap.getCenter();if(xy){return[xy.lng(),xy.lat()]}else{return false}break;default:return false}},marcaCentroDoMapa:function(xy){var t=$i("i3GeoCentroDoMapa");if(t&&t.style.display==="block"){return}if(xy!=false){xy=i3GEO.calculo.dd2tela(xy[0]*1,xy[1]*1,$i(i3GEO.Interface.IDMAPA),i3GEO.parametros.mapexten,i3GEO.parametros.pixelsize);i3GEO.util.criaPin("i3GeoCentroDoMapa",i3GEO.configura.locaplic+'/imagens/alvo.png','30px','30px');i3GEO.util.posicionaImagemNoMapa("i3GeoCentroDoMapa",xy[0],xy[1])}},removeCookieExtensao:function(){var nomecookie="i3geoOLUltimaExtensao";if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}i3GEO.util.insereCookie(nomecookie,"")},zoomin:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomIn();return}},zoomout:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomOut();return}},zoomponto:function(locaplic,sid,x,y,tamanho,simbolo,cor){if(!simbolo){simbolo="ponto"}if(!tamanho){tamanho=15}if(!cor){cor="255 0 0"}if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.zoomponto(i3GEO.atualiza,x,y,tamanho,simbolo,cor)},zoompontoIMG:function(locaplic,sid,x,y){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.pan(i3GEO.atualiza,'','',x,y)},xy2xy:function(locaplic,sid,xi,yi,xf,yf,ext,tipoimagem){var disty,distx,ex,novoxi,novoxf,novoyf,nex;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}disty=(yi*-1)+yf;distx=(xi*-1)+xf;ex=ext.split(" ");novoxi=(ex[0]*1)-distx;novoxf=(ex[2]*1)-distx;novoyi=(ex[1]*1)-disty;novoyf=(ex[3]*1)-disty;if((distx===0)&&(disty===0)){return false}else{nex=novoxi+" "+novoyi+" "+novoxf+" "+novoyf;i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,tipoimagem,nex);return true}},localizaIP:function(locaplic,sid,funcao){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.localizaIP(funcao)},zoomIP:function(locaplic,sid){try{if(arguments.length>0){i3GEO.configura.locaplic=locaplic;i3GEO.configura.sid=sid}var mostraIP=function(retorno){if(retorno.data.latitude!==null){i3GEO.navega.zoomponto(locaplic,sid,retorno.data.longitude,retorno.data.latitude)}else{i3GEO.janela.tempoMsg("Nao foi possivel identificar a localizacao.")}};i3GEO.navega.localizaIP(locaplic,sid,mostraIP)}catch(e){}},zoomExt:function(locaplic,sid,tipoimagem,ext){var f;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}if(tipoimagem===""){tipoimagem="nenhum"}ext=i3GEO.util.extGeo2OSM(ext);i3GEO.php.mudaext(function(retorno){i3GEO.atualiza(retorno)},tipoimagem,ext)},aplicaEscala:function(escala){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setZoom(i3GEO.Interface.googlemaps.escala2nzoom(escala))}if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomToScale(escala,true);i3GEO.parametros.mapscale=parseInt(i3geoOL.getScale(),10)}},atualizaEscalaNumerica:function(escala){console.log("atualizaEscalaNumerica");var e=$i("i3GEOescalanum");if(!e){return}if(arguments.length===1){e.value=$.number(escala,0,$trad("dec"),$trad("mil"))}else{if(i3GEO.Interface.ATUAL==="googlemaps"){e.value=parseInt(i3GEO.parametros.mapscale,10)}if(i3GEO.Interface.ATUAL==="openlayers"){e.value=$.number(i3geoOL.getScale(),0,$trad("dec"),$trad("mil"))}}},panFixo:function(){alert("panFixo foi depreciado na versao 6.0")},mostraRosaDosVentos:function(){alert("mostraRosaDosVentos foi depreciado na versao 6.0")},autoRedesenho:{INTERVALO:0,ID:"tempoRedesenho",ativa:function(id){if(arguments.length===0){id="tempoRedesenho"}i3GEO.navega.autoRedesenho.ID=id;if(($i(id))&&i3GEO.navega.autoRedesenho.INTERVALO>0){$i(id).style.display="block"}if(i3GEO.navega.autoRedesenho.INTERVALO>0){i3GEO.navega.tempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.redesenha()',i3GEO.navega.autoRedesenho.INTERVALO)}if(($i(id))&&(i3GEO.navega.autoRedesenho.INTERVALO>0)){$i(id).innerHTML=i3GEO.navega.autoRedesenho.INTERVALO/1000;i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},desativa:function(){i3GEO.navega.autoRedesenho.INTERVALO=0;clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);i3GEO.navega.tempoRedesenho="";i3GEO.navega.contaTempoRedesenho="";if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).style.display="none"}},redesenha:function(){clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;case"googlemaps":i3GEO.Interface.googlemaps.redesenha();break;default:i3GEO.atualiza("")}i3GEO.navega.autoRedesenho.ativa(i3GEO.navega.autoRedesenho.ID)},contagem:function(){if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).innerHTML=parseInt($i(i3GEO.navega.autoRedesenho.ID).innerHTML,10)-1}i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},zoomBox:{inicia:function(){alert("zoomBox depreciado na versao 6.0")}},lente:{_lenteCompose:"",eventMouseout:function(){if(i3GEO.navega.lente._lenteCompose!=""){i3GEO.navega.lente.stop(i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.lente._lenteCompose!=""){i3geoOL.renderSync()}},stop:function(container){ol.Observable.unByKey(i3GEO.navega.lente._lenteCompose);i3GEO.navega.lente._lenteCompose="";container.removeEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.lente.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var container=i3geoOL.getTargetElement();var radius=75;container.addEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.lente.eventMouseout);var a=i3geoOL.on('postcompose',function(event){var context=event.context;var pixelRatio=event.frameState.pixelRatio;var half=radius*pixelRatio;var centerX=objposicaocursor.imgx*pixelRatio;var centerY=objposicaocursor.imgy*pixelRatio;var originX=centerX-half;var originY=centerY-half;var size=2*half+1;var sourceData=context.getImageData(originX,originY,size,size).data;var dest=context.createImageData(size,size);var destData=dest.data;for(var j=0;j<size;++j){for(var i=0;i<size;++i){var dI=i-half;var dJ=j-half;var dist=Math.sqrt(dI*dI+dJ*dJ);var sourceI=i;var sourceJ=j;if(dist<half){sourceI=Math.round(half+dI/2);sourceJ=Math.round(half+dJ/2)}var destOffset=(j*size+i)*4;var sourceOffset=(sourceJ*size+sourceI)*4;destData[destOffset]=sourceData[sourceOffset];destData[destOffset+1]=sourceData[sourceOffset+1];destData[destOffset+2]=sourceData[sourceOffset+2];destData[destOffset+3]=sourceData[sourceOffset+3]}}context.beginPath();context.arc(centerX,centerY,half,0,2*Math.PI);context.lineWidth=3*pixelRatio;context.strokeStyle='rgba(255,255,255,0.5)';context.putImageData(dest,originX,originY);context.stroke();context.restore()});i3GEO.navega.lente._lenteCompose=[a]}},destacaTema:{inicia:function(){i3GEO.janela.tempoMsg("removido na versao 8")}},basemapSpy:{_spyCompose:"",eventMouseout:function(){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(i3geoOL.getLayerBase(),i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.basemapSpy._spyCompose);i3GEO.navega.basemapSpy._spyCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getAllLayers()[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);var a=imagery.on('precompose',function(event){var ctx=event.context;var pixelRatio=event.frameState.pixelRatio;ctx.save();ctx.beginPath();ctx.arc(objposicaocursor.imgx*pixelRatio,objposicaocursor.imgy*pixelRatio,radius*pixelRatio,0,2*Math.PI);ctx.lineWidth=5*pixelRatio;ctx.strokeStyle='rgba(0,0,0,0.5)';ctx.stroke();ctx.clip()});var b=imagery.on('postcompose',function(event){var ctx=event.context;ctx.restore()});i3GEO.navega.basemapSpy._spyCompose=[a,b]}},dialogo:{wiki:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.wiki()","wiki","wiki","dependencias.php","i3GEOF.wiki.iniciaJanelaFlutuante()")},metar:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.metar()","metar","metar","dependencias.php","i3GEOF.metar.iniciaJanelaFlutuante()")},buscaFotos:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.buscaFotos()","buscafotos","buscaFotos","dependencias.php","i3GEOF.buscaFotos.iniciaJanelaFlutuante()")},google:function(coordenadas){i3GEO.navega.dialogo.google.coordenadas=coordenadas;var temp,janela,idgoogle="googlemaps"+Math.random();janela=i3GEO.janela.cria((i3GEO.parametros.w/2.5)+25+"px",(i3GEO.parametros.h/2.5)+18+"px",i3GEO.configura.locaplic+"/ferramentas/googlemaps1/index.php","","","<span class='i3GeoTituloJanelaBsNolink' >Google maps</span></div>",idgoogle,false,"hd","","","",false,"","","","","68");temp=function(){i3GEO.desenho.removePins("boxOndeGoogle");i3GEO.desenho.removePins("googlemaps")};$(janela[0].close).click(temp)},confluence:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.confluence()","confluence","confluence","dependencias.php","i3GEOF.confluence.iniciaJanelaFlutuante()")}},atualizaGoogle:function(idgoogle){try{parent.frames[idgoogle+"i"].panTogoogle()}catch(e){i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle('"+idgoogle+"')"]);i3GEO.desenho.removePins("googlemaps");i3GEO.desenho.removePins("boxOndeGoogle")}},dragZoom:function(){i3GEO.navega.dragZoom.draw=new ol.interaction.Draw({type:"Circle",freehand:false,geometryFunction:ol.interaction.Draw.createRegularPolygon(4)});i3GEO.navega.dragZoom.draw.setActive(false);i3GEO.navega.dragZoom.draw.on("drawend",function(evt){var pol=evt.feature.getGeometry();i3geoOL.getView().fit(pol);i3GEO.navega.dragZoom.draw.setActive(false)});document.body.addEventListener('keydown',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(true)}});document.body.addEventListener('keyup',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(false)}});return i3GEO.navega.dragZoom.draw}}; | |
276 | 276 | // |
277 | 277 | //compactados/eventos_compacto.js |
278 | 278 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}var objposicaocursor={ddx:"",ddy:"",dmsx:"",dmsy:"",telax:"",telay:"",imgx:"",imgy:"",refx:"",refy:""};i3GEO.eventos={CONTATOUCH:0,MOUSEOVERDATA:[],MOUSEOUTDATA:[],RESIZE:[],SELECAO:[],ATUALIZAARVORECAMADAS:[],ATIVATEMA:[],NAVEGAMAPA:[],MOUSEPARADO:[],MOUSEMOVE:[],MOUSEDOWN:[],MOUSEUP:["i3GEO.eventos.cliquePerm.executa()"],MOUSECLIQUE:["i3GEO.eventos.cliqueCapturaPt()"],MOUSECLIQUEPERM:["i3GEO.mapa.dialogo.verificaTipDefault()"],TIMERPARADO:"",mouseOverData:function(){i3GEO.eventos.executaEventos(this.MOUSEOVERDATA)},mouseOutData:function(){i3GEO.eventos.executaEventos(this.MOUSEOUTDATA)},mouseParado:function(){try{clearTimeout(this.TIMERPARADO)}catch(e){this.TIMERPARADO=""}if(objposicaocursor.dentroDomapa===false){return}try{if(objposicaocursor.imgy===""){objposicaocursor.imgy=1;objposicaocursor.imgx=1}if(i3GEO.eventos.MOUSEPARADO.length>0&&objposicaocursor.imgy>0&&objposicaocursor.imgx>0){if(objposicaocursor.imgx>0){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEPARADO)}}}catch(e){}},navegaMapa:function(){i3GEO.eventos.executaEventos(this.NAVEGAMAPA)},mousemoveMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEMOVE)},mousedownMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEDOWN)},mouseupMapa:function(exy){if(!exy){i3GEO.eventos.executaEventos(this.MOUSEUP)}else{if(i3GEO.Interface.ATUAL==="googlemaps"&&exy.target&&!exy.target.src){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))}pos=i3GEOtouchesPosMapa;p=new google.maps.Point(exy.clientX-pos[0],exy.clientY-pos[1]);e=null;lonlat=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p);if(lonlat){objposicaocursor.ddx=lonlat.lng();objposicaocursor.ddy=lonlat.lat()}i3GEO.eventos.executaEventos(this.MOUSEUP)}else if(i3GEO.Interface.ATUAL==="openlayers"&&exy.target&&exy.target.tagName==="CANVAS"){i3GEO.eventos.executaEventos(this.MOUSEUP)}}},mousecliqueMapa:function(){i3GEO.eventos.executaEventos(this.MOUSECLIQUE)},resizeMapa:function(){i3GEO.eventos.executaEventos(this.RESIZE)},executaEventos:function(eventos){if(i3GEO.Interface.STATUS.pan===true){return}var f=0;try{if(eventos.length>0){f=eventos.length-1;if(f>=0){do{if(eventos[f]!==""){if(typeof(eventos[f])==="function"){eventos[f].call()}else{eval(eventos[f])}}}while(f--)}}}catch(e){eventos[f]=""}},removeEventos:function(tipo,eventos){var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].remove(eventos[i])}i3GEO.eventos[tipo].remove("");i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},adicionaEventos:function(tipo,eventos){if(eventos==""){i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique();return}var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].push(eventos[i])}i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},posicaoMouseMapa:function(e){var teladd,teladms,container="",targ="",pos,mousex,mousey,xfig,yfig,xreffig,yreffig,xtela,ytela,c,ex;if(!e){e=window.event}try{if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.parentNode){container=targ.parentNode.id}}catch(erro){return}if(container!=="mapaReferencia"){return}pos=i3GEO.util.pegaPosicaoObjeto(targ);mousex=0;mousey=0;if(e.pageX||e.pageY){mousex=e.pageX;mousey=e.pageY}else if(e.clientX||e.clientY){mousex=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;mousey=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}xfig=mousex-pos[0];yfig=mousey-pos[1];xreffig=xfig;yreffig=yfig;xtela=mousex;ytela=mousey;c=i3GEO.parametros.celularef;ex=i3GEO.parametros.extentref;teladd=i3GEO.calculo.tela2dd(xfig,yfig,c,ex,targ.id);teladms=i3GEO.calculo.dd2dms(teladd[0],teladd[1]);objposicaocursor={ddx:teladd[0],ddy:teladd[1],dmsx:teladms[0],dmsy:teladms[1],telax:xtela,telay:ytela,imgx:xfig,imgy:yfig,refx:xreffig,refy:yreffig,dentroDomapa:true}},ativa:function(docMapa){if(!docMapa){return}var timer=0;var delay=300;var prevent=false;docMapa.onmouseover=function(){objposicaocursor.dentroDomapa=true;this.onmousemove=function(exy){i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.posicaoMouseMapa(exy);try{i3GEO.eventos.mousemoveMapa()}catch(e){}}};docMapa.onmouseout=function(){objposicaocursor.dentroDomapa=false};docMapa.onmousedown=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousedownMapa()};docMapa.onclick=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousecliqueMapa(exy)};docMapa.ondblclick=function(){if(objposicaocursor.dentroDomapa===false){return}clearTimeout(timer);prevent=true};docMapa.onmouseup=function(exy){if(objposicaocursor.dentroDomapa===false){return}if(i3GEO.Interface.ATUAL==="googlemaps"){if(modoAtual==="move"){modoAtual="";return}}i3GEO.eventos.cliquePerm.status=true;timer=setTimeout(function(){if(!prevent){i3GEO.eventos.mouseupMapa(exy)}prevent=false},delay)};docMapa.ontouchmove=function(exy){i3GEO.eventos.CONTATOUCH++;i3GEO.Interface.STATUS.pan=true;i3GEO.eventos.posicaoMouseMapa(exy)};docMapa.ontouchcancel=function(exy){i3GEO.eventos.CONTATOUCH=0}},botaoDireita:function(exy){try{var k=(navm)?event.button:exy.button;if(k!==2){return false}else{return true}}catch(e){return false}},cliqueCapturaPt:function(ixg,ixm,ixs,iyg,iym,iys){var x,y,doc=document;if(arguments.length===0){ixg="ixg";ixm="ixm";ixs="ixs";iyg="iyg";iym="iym";iys="iys";if($i("wdocai")){doc=(navm)?document.frames("wdocai").document:$i("wdocai").contentDocument}}try{if(doc){x=objposicaocursor.dmsx.split(" ");y=objposicaocursor.dmsy.split(" ");if(doc.getElementById(ixg)){doc.getElementById(ixg).value=x[0]}if(doc.getElementById(ixm)){doc.getElementById(ixm).value=x[1]}if(doc.getElementById(ixs)){doc.getElementById(ixs).value=$.number(x[2],2,$trad("dec"),$trad("mil"))}if(doc.getElementById(iyg)){doc.getElementById(iyg).value=y[0]}if(doc.getElementById(iym)){doc.getElementById(iym).value=y[1]}if(doc.getElementById(iys)){doc.getElementById(iys).value=$.number(y[2],2,$trad("dec"),$trad("mil"))}}}catch(m){}},cliquePerm:{ativo:true,status:true,executa:function(evt){if(i3GEO.eventos.cliquePerm.ativo===true&&i3GEO.eventos.cliquePerm.status===true){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSECLIQUEPERM)}},ativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=true}},desativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=false}},ativoinicial:true}}; | ... | ... |
js/i3geo_tudo_compacto8.js.php
... | ... | @@ -272,7 +272,7 @@ if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.guias={LARGURAGUIAMOVEL:350,C |
272 | 272 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.arvoreDeCamadas={FUNCOES:{farolescala:true,excluir:true,sobe:true,desce:true,fonte:true,zoomtema:true,compartilhar:true,opacidade:true,mudanome:true,procurar:true,toponimia:true,etiquetas:true,filtrar:true,tabela:true,grafico:true,editorlegenda:true,destacar:true,cortina:true,sql:true,comentar:true,temporizador:true,wms:true,tme:true,copia:true,storymap:true,animagif:true},CAMADAS:"",FILTRO:"",CAMADASINDEXADAS:[],config:{"idOnde":"listaTemas","aposIniciar":"","templateCamada":"templates/camada.html","idListaFundo":"","templateCamadaFundo":"templates/camadaFundo.html","idListaLayersGr":"","templateCamadaGr":"templates/camadaGr.html","verificaAbrangencia":""},carregaTemplates:function(){var t1=i3GEO.arvoreDeCamadas.config.templateCamada,t2=i3GEO.arvoreDeCamadas.config.templateCamadaFundo,t3=i3GEO.arvoreDeCamadas.config.templateCamadaGr;$.ajax(t1).always(function(r1){i3GEO.template.camada=r1;if(r1.status){i3GEO.template.camada=""}$.ajax(t2).always(function(r2){i3GEO.template.camadaFundo=r2;if(r2.status){i3GEO.template.camadaFundo=""}$.ajax(t3).always(function(r3){i3GEO.template.camadaGr=r3;if(r3.status){i3GEO.template.camadaGr=""}i3GEO.arvoreDeCamadas.inicia()})})})},inicia:function(config){if(config){$.each(config,function(i,v){if(v!=undefined){i3GEO.arvoreDeCamadas.config[i]=v}})}if(!i3GEO.template.camada||!i3GEO.template.camadaFundo){i3GEO.arvoreDeCamadas.carregaTemplates();return}else{config=i3GEO.arvoreDeCamadas.config;var novoel,temp;i3GEO.arvoreDeCamadas.atualiza(i3GEO.arvoreDeCamadas.CAMADAS);if(!$i(config.idOnde)){return}if(config.verificaAbrangencia!=""){i3GEO.eventos.adicionaEventos("NAVEGAMAPA",["i3GEO.arvoreDeCamadas.verificaAbrangenciaTemas()"])}if(config.aposIniciar!==""){if(jQuery.isFunction(config.aposIniciar)){config.aposIniciar.call()}}}},adicionaLayersGr:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var temp=$i(i3GEO.arvoreDeCamadas.config.idListaLayersGr),layers=i3geoOL.getLayersGr(),lista=[],camada={};if(temp){$.each(layers,function(i,layer){var p=layer.getProperties();camada={...i3GEO.idioma.OBJETOIDIOMA};camada.name=p.name;camada.tema=p.title;camada.locaplic=i3GEO.configura.locaplic;if(layer.getVisible()==true){camada.checked="checked"}else{camada.checked=""}lista.push(camada)});var t=Mustache.render("{{#data}}"+i3GEO.template.camadaGr+"{{/data}}",{"data":lista});$(temp).html(t)}},atualiza:function(temas,forca){if(i3GEO.template.camada==undefined||i3GEO.template.camada==false){return}if(arguments.length===0){temas=i3GEO.arvoreDeCamadas.CAMADAS;i3GEO.arvoreDeCamadas.CAMADAS="";forca=false}var clone=[],camada={},config=i3GEO.arvoreDeCamadas.config,temp;temp=$i(config.idOnde);if(temp){if(forca===true){temp.innerHTML=""}if(temp.innerHTML!==""){if(i3GEO.arvoreDeCamadas.comparaTemas(temas,i3GEO.arvoreDeCamadas.CAMADAS)){i3GEO.arvoreDeCamadas.CAMADAS=temas;return}}}i3GEO.arvoreDeCamadas.CAMADAS=temas;i3GEO.arvoreDeCamadas.CAMADASINDEXADAS=[];$.each(i3GEO.arvoreDeCamadas.CAMADAS,function(i,tema){var mostra=true;i3GEO.pluginI3geo.aplicaPropriedades(tema);camada={};camada.name=tema.name;camada.tema=tema.tema;if(tema.status!=0){camada.checked="checked"}else{camada.checked=""}if(tema.sel&&tema.sel.toLowerCase()==="sim"){camada.classeCss="camadaSelecionada"}else{camada.classeCss=""}if(temp&&i3GEO.arvoreDeCamadas.FILTRO!==""){if(i3GEO.arvoreDeCamadas.FILTRO==="desligados"&&camada.checked=="checked"){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="ligados"&&camada.checked==""){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="selecionados"&&tema.sel.toLowerCase()!=="sim"){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="download"&&tema.download.toLowerCase()!=="sim"){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="wms"&&tema.connectiontype*1!==7){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="raster"&&tema.type*1!==3){mostra=false}if(i3GEO.arvoreDeCamadas.FILTRO==="toponimia"&&tema.type*1!==4){mostra=false}}if(temp&&mostra==true){i3GEO.arvoreDeCamadas.montaIconesTema(tema,camada);i3GEO.arvoreDeCamadas.montaOpcoesTema(tema,camada);if(tema.iconetema!==""){camada.iconetema="<img class='i3GEOiconeTema' src='"+tema.iconetema+"' />"}if(tema.maxscaledenom&&(tema.maxscaledenom*1>i3GEO.parametros.mapscale*1&&tema.minscaledenom*1<i3GEO.parametros.mapscale*1)){camada.rangeScale="out";camada.rangeScaleMsg=$trad("rangeScaleMsg")}else{camada.rangeScale="in"}if(tema.escondido.toLowerCase()!=="sim"){clone.push(camada)}}i3GEO.arvoreDeCamadas.CAMADASINDEXADAS[camada.name]=tema});if(temp){var t=Mustache.render("{{#data}}"+i3GEO.template.camada+"{{/data}}",{"data":clone});$("#"+config.idOnde).html(t);$("#"+config.idOnde).sortable({scroll:false,axis:"y",revert:true,update:function(event,ui){var els=i3GEO.arvoreDeCamadas.listaLigadosDesligadosArvore(config.idOnde);var lista=els[2].join(",");var temp=function(retorno){i3GEO.atualiza(retorno);if(i3GEO.Interface.ATUAL==="openlayers"){i3GEO.Interface.openlayers.ordenaLayers()}i3GEO.arvoreDeCamadas.atualiza(i3GEO.arvoreDeCamadas.CAMADAS,true)};i3GEO.php.reordenatemas(temp,lista)}})}i3GEO.arvoreDeCamadas.adicionaCamadasDeFundo(config);i3GEO.arvoreDeCamadas.adicionaLayersGr();i3GEO.eventos.executaEventos(i3GEO.eventos.ATUALIZAARVORECAMADAS)},adicionaCamadasDeFundo:function(config){if(i3GEO.Interface.ATUAL=="openlayers"){var temp=temp=$i(config.idOnde);if(temp&&$("#"+config.idListaFundo).html()==""){clone=[{"name":"camadaDeFundo","value":"nenhum","title":$trad("nenhum")}];$.each(i3GEO.Interface.openlayers.LAYERSADICIONAIS,function(i,layer){camada={};temp=layer.getProperties();camada.name="camadaDeFundo";if(temp.preview){camada.preview=temp.preview}else{camada.preview=""}camada.value=temp.name;camada.title=temp.title;if(temp.visible===true){camada.checked="checked"}else{camada.checked=""}clone.push(camada)});var t=Mustache.to_html("{{#data}}"+i3GEO.template.camadaFundo+"{{/data}}",{"data":clone});$("#"+config.idListaFundo).html(t);$("#"+config.idListaFundo+" label").tooltip({animation:false,trigger:"hover",placement:"auto",html:true,template:"<div class='tooltip ' ><div class='tooltip-inner'></div></div>"})}}},ligaDesligaTemas:function(lista,status){},atualizaLegenda:function(idtema){},montaTextoTema:function(tema){if(i3GEO.tema.TEMPORIZADORESID[tema.name]==undefined&&tema.temporizador!=""){i3GEO.tema.temporizador(tema.name,tema.temporizador)}return(html)},montaOpcoesTema:function(temaObj,camada){camada.ferramentasTexto=$trad("u15a");camada.ferramentasTitle=$trad("ferramCamadas");camada.removerTexto=$trad("t12");camada.removerTitle=$trad("t12a");camada.sobeTexto=$trad("t13");camada.sobeTitle=$trad("t14");camada.desceTexto=$trad("t15");camada.desceTitle=$trad("t16");camada.tabelaTexto=$trad("tabela");camada.tabelaTitle=$trad("t30");camada.editorlegendaTexto=$trad("t33");if(temaObj.zoomtema.toLowerCase()==="sim"){camada.zoomtemaTexto=$trad("t17");camada.zoomtemaTitle=$trad("t18")}else{camada.zoomtema="hidden"}if(temaObj.sel.toLowerCase()==="sim"){camada.selTexto=$trad("t5");camada.selTitle=$trad("t4")}else{camada.sel="hidden"}if(temaObj.sel.toLowerCase()==="sim"){camada.zoomSelTexto=$trad("t4a")}else{camada.zoomsel="hidden"}if(temaObj.link_tema!=""&&temaObj.features.toLowerCase()!=="sim"&&temaObj.name!="mundo"){camada.linkTexto=$trad("a9");camada.linkTitle=$trad("a9")}else{camada.link="hidden"}if(temaObj.download.toLowerCase()==="sim"||temaObj.download===""&&temaObj.features.toLowerCase()!=="sim"){camada.downloadTexto="Download";camada.downloadTitle=$trad("t6")}else{camada.download="hidden"}if(temaObj.permiteogc.toLowerCase()==="sim"){camada.permiteogcTexto="OGC"}else{camada.permiteogc="hidden"}return camada},montaIconesTema:function(temaObj,camada){if(temaObj.escala!=0){if(temaObj.escala*1<i3GEO.parametros.mapscale*1){camada.farol="green";camada.farolTitle=$trad("t9")}if(temaObj.escala*1>i3GEO.parametros.mapscale*1){camada.farol="red";camada.farolTitle=$trad("t10")}if(temaObj.escala===0){camada.farol="yellow";camada.farolTitle=$trad("t11")}}else{camada.farol="hidden"}if(temaObj.contextoescala.toLowerCase()==="sim"){camada.contextoescala="";camada.contextoescalaTitle=$trad("t36")}else{camada.contextoescala="hidden"}if(temaObj.plugini3geo){var iconePlugin=i3GEO.pluginI3geo.clickArvoreDeCamadas(temaObj);if(iconePlugin!=false){camada.iconePlugin=iconePlugin}}if(temaObj.ferramentas){var html="",fer="",fers=temaObj.ferramentas;for(fer in fers){if(i3GEO.configura.ferramentasLayers[fer]){html+=i3GEO.configura.ferramentasLayers[fer].icone(temaObj.name)}}camada.iconeFerramentas=html}return camada},atualizaFarol:function(mapscale){var farol,l,ltema,escala,iu=i3GEO.util,im=i3GEO.configura.locaplic+"/imagens/",camadas=i3GEO.arvoreDeCamadas.CAMADAS;farol="maisamarelo.png";l=camadas.length-1;if(l>=0){do{ltema=camadas[l];escala=ltema.escala;if(escala*1<mapscale*1){farol="maisverde.png"}if(escala*1>mapscale*1){farol="maisvermelho.png"}if(escala*1===0){farol="maisamarelo.png"}iu.defineValor("farol"+ltema.name,"src",im+farol)}while(l--)}},aplicaTemas:function(tipo){if(arguments.length===0){tipo="normal"}var t="",temp;if(tipo==="normal"){t=i3GEO.arvoreDeCamadas.listaLigadosDesligados("mantem")}if(tipo==="ligartodos"){t=i3GEO.arvoreDeCamadas.listaLigadosDesligados("marca")}if(tipo==="desligartodos"){t=i3GEO.arvoreDeCamadas.listaLigadosDesligados("desmarca")}temp=function(){i3GEO.atualiza();i3GEO.janela.fechaAguarde("redesenha")};if(tipo==="normal"){i3GEO.php.ligatemas(temp,t[1].toString(),t[0].toString());return}if(tipo==="ligartodos"){i3GEO.php.ligatemas(temp,"",t[2].toString());return}if(tipo==="desligartodos"){i3GEO.php.ligatemas(temp,t[2].toString(),"")}},listaLigadosDesligados:function(){if(!i3GEO.arvoreDeCamadas.CAMADAS){return[[],[],[]]}var i=0,ligados=[],desligados=[],todos=[],camada,camadas=i3GEO.arvoreDeCamadas.CAMADAS;i=camadas.length;while(i>0){i-=1;camada=camadas[i];todos.push(camada["name"]);if(parseInt(camada["status"],10)===2){ligados.push(camada["name"])}else{desligados.push(camada["name"])}}return([ligados,desligados,todos])},listaLigadosDesligadosArvore:function(onde){if(!i3GEO.arvoreDeCamadas.CAMADAS){return[[],[],[]]}var n,i,ligados=[],desligados=[],todos=[],camada,camadas;camadas=$i(onde).getElementsByTagName("input");n=camadas.length;for(i=0;i<n;i++){camada=camadas[i];todos.push(camada.value);if(camada.checked==true){ligados.push(camada["name"])}else{desligados.push(camada["name"])}}return([ligados,desligados,todos])},capturaCheckBox:function(tema){var onde=$i(i3GEO.arvoreDeCamadas.config.idOnde),camadas,n,i;if(onde){camadas=onde.getElementsByTagName("input");n=camadas.length;for(i=0;i<n;i++){if(camadas[i].name==tema){return camadas[i]}}}return false},comparaTemas:function(novo,atual){try{var novon=novo.length,i;if(novon!==atual.length){return(false)}for(i=0;i<novon;i+=1){if(novo[i].name!==atual[i].name){return(false)}if(novo[i].tema!==atual[i].tema){return(false)}if(novo[i].sel!==atual[i].sel){return(false)}if(novo[i].status!==atual[i].status){return(false)}}return(true)}catch(e){return true}},pegaTema:function(valor,camadas,parametro){var i;if(!camadas||camadas==""){camadas=i3GEO.arvoreDeCamadas.CAMADAS}else{camadas=i3GEO.arvoreDeCamadas.converteChaveValor2normal(camadas)}if(!parametro){parametro="name"}i=camadas.length;while(i>0){i-=1;if(camadas[i][parametro]===valor){return camadas[i]}}return""},filtraCamadas:function(propriedade,valor,operador,camadas){if(!camadas){camadas=i3GEO.arvoreDeCamadas.CAMADAS}var resultado,i=0,temp,nelementos=camadas.length,ltema;resultado=[];if(nelementos>0){do{ltema=camadas[i];if(ltema.escondido.toLowerCase()!=="sim"){temp=ltema[propriedade];if(operador==="igual"){if(temp+"".toLowerCase()==valor+"".toLowerCase()){resultado.push(ltema)}}if(operador==="diferente"){if(temp+"".toLowerCase()!==valor+"".toLowerCase()){resultado.push(ltema)}}if(operador==="menor"){if(temp+"".toLowerCase()<valor+"".toLowerCase()){resultado.push(ltema)}}}i+=1}while(i<nelementos)}return resultado},alteraPropCamadas:function(propriedade,valor,camada){var i=0,nelementos=i3GEO.arvoreDeCamadas.CAMADAS.length,ltema;if(nelementos>0){do{ltema=i3GEO.arvoreDeCamadas.CAMADAS[i];if(ltema.name===camada){ltema[propriedade]=valor}i+=1}while(i<nelementos)}},verificaAbrangenciaTemas:function(){var nos=$("#"+i3GEO.arvoreDeCamadas.config.idOnde).find("input");$.each(nos,function(i,no){var ltema=i3GEO.arvoreDeCamadas.CAMADASINDEXADAS[no.value];var temp=ltema.exttema;if(temp!==""&&temp!=undefined){if(i3GEO.util.intersectaBox(temp,i3GEO.parametros.mapexten)===false){$(no).addClass(i3GEO.arvoreDeCamadas.config.verificaAbrangencia)}else{$(no).removeClass(i3GEO.arvoreDeCamadas.config.verificaAbrangencia)}}})},verificaAplicaExtensao:function(){var i=0,temp="",nelementos=i3GEO.arvoreDeCamadas.CAMADAS.length,ltema;try{if(nelementos>0){do{ltema=i3GEO.arvoreDeCamadas.CAMADAS[i];if(ltema.aplicaextensao.toLowerCase()==="sim"){temp=ltema.name}i+=1}while(i<nelementos)}}catch(e){return""}return temp},converteChaveValor2normal:function(obj){if(obj.chaves){var i,tema,j,t,chaves=obj.chaves,temas=obj.valores,ntemas=temas.length,nchaves=chaves.length,novo=[];for(i=0;i<ntemas;i++){tema=temas[i];t={};for(j=0;j<nchaves;j++){t[chaves[j]]=tema[j]}novo.push(t)}return novo}else{return obj}},registaCamadas:function(obj){var i;obj=i3GEO.arvoreDeCamadas.converteChaveValor2normal(obj);i3GEO.arvoreDeCamadas.CAMADAS=obj;i3GEO.arvoreDeCamadas.CAMADASINDEXADAS=[];$.each(i3GEO.arvoreDeCamadas.CAMADAS,function(i,tema){i3GEO.arvoreDeCamadas.CAMADASINDEXADAS[tema.name]=tema})},dialogo:{filtro:function(){i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.filtro()","filtroarvore","filtroarvore","dependencias.php","i3GEOF.filtroarvore.iniciaJanelaFlutuante()")},excluir:function(){i3GEO.util.dialogoFerramenta("i3GEO.arvoreDeCamadas.dialogo.excluir()","excluirarvore","excluirarvore","dependencias.php","i3GEOF.excluirarvore.iniciaJanelaFlutuante()")}}}; |
273 | 273 | // |
274 | 274 | //compactados/navega_compacto.js |
275 | -if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.navega={EXTENSOES:{lista:[],redo:[],posicao:0,emAcao:false},offset:function(pixelx,pixely){if(i3GEO.Interface.ATUAL=="openlayers"){var view=i3geoOL.getView(),mover=[pixelx,pixely],s=i3geoOL.getSize(),dx=s[0]/2+mover[0],dy=s[1]/2+mover[1];view.centerOn(view.getCenter(),s,[dx,dy])}},ativaPan:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setOptions({draggable:true})}if(i3GEO.Interface.ATUAL==="openlayers"){marcadorZoom="";i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan)}},registraExt:function(ext){if(i3GEO.navega.EXTENSOES.emAcao==false){var l=i3GEO.navega.EXTENSOES.lista,n=l.length;if(n>10){l.shift()}n=l.length;if(n>0&&l[n-1]===ext){return}l.push(ext)}else{i3GEO.navega.EXTENSOES.emAcao=false}},extensaoAnterior:function(){i3GEO.navega.EXTENSOES.emAcao=true;var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;if(l.length>0){if(l.length>1){e=l.pop();i3GEO.navega.zoomExt("","","",e);if(r.length>10){r.shift()}if(r.length>0&&r[r.length-1]===e){return}else{r.push(a)}}}else{l.push(i3GEO.parametros.mapexten)}},extensaoProximo:function(){var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;i3GEO.navega.EXTENSOES.emAcao=true;if(r.length>0){i3GEO.navega.zoomExt("","","",r[r.length-1]);e=r.pop();if(l.length>10){l.pop()}if(l.length>0&&l[l.length-1]===e){return}l.push(a)}},pan2ponto:function(x,y){i3GEO.Interface[i3GEO.Interface.ATUAL].pan2ponto(x,y);i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar()},centroDoMapa:function(){var xy;switch(i3GEO.Interface.ATUAL){case"openlayers":xy=i3geoOL.getCenter();if(xy){return[xy.lon,xy.lat]}else{return false}break;case"googlemaps":xy=i3GeoMap.getCenter();if(xy){return[xy.lng(),xy.lat()]}else{return false}break;default:return false}},marcaCentroDoMapa:function(xy){var t=$i("i3GeoCentroDoMapa");if(t&&t.style.display==="block"){return}if(xy!=false){xy=i3GEO.calculo.dd2tela(xy[0]*1,xy[1]*1,$i(i3GEO.Interface.IDMAPA),i3GEO.parametros.mapexten,i3GEO.parametros.pixelsize);i3GEO.util.criaPin("i3GeoCentroDoMapa",i3GEO.configura.locaplic+'/imagens/alvo.png','30px','30px');i3GEO.util.posicionaImagemNoMapa("i3GeoCentroDoMapa",xy[0],xy[1])}},removeCookieExtensao:function(){var nomecookie="i3geoOLUltimaExtensao";if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}i3GEO.util.insereCookie(nomecookie,"")},zoomin:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomIn();return}},zoomout:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomOut();return}},zoomponto:function(locaplic,sid,x,y,tamanho,simbolo,cor){if(!simbolo){simbolo="ponto"}if(!tamanho){tamanho=15}if(!cor){cor="255 0 0"}if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.zoomponto(i3GEO.atualiza,x,y,tamanho,simbolo,cor)},zoompontoIMG:function(locaplic,sid,x,y){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.pan(i3GEO.atualiza,'','',x,y)},xy2xy:function(locaplic,sid,xi,yi,xf,yf,ext,tipoimagem){var disty,distx,ex,novoxi,novoxf,novoyf,nex;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}disty=(yi*-1)+yf;distx=(xi*-1)+xf;ex=ext.split(" ");novoxi=(ex[0]*1)-distx;novoxf=(ex[2]*1)-distx;novoyi=(ex[1]*1)-disty;novoyf=(ex[3]*1)-disty;if((distx===0)&&(disty===0)){return false}else{nex=novoxi+" "+novoyi+" "+novoxf+" "+novoyf;i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,tipoimagem,nex);return true}},localizaIP:function(locaplic,sid,funcao){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.localizaIP(funcao)},zoomIP:function(locaplic,sid){try{if(arguments.length>0){i3GEO.configura.locaplic=locaplic;i3GEO.configura.sid=sid}var mostraIP=function(retorno){if(retorno.data.latitude!==null){i3GEO.navega.zoomponto(locaplic,sid,retorno.data.longitude,retorno.data.latitude)}else{i3GEO.janela.tempoMsg("Nao foi possivel identificar a localizacao.")}};i3GEO.navega.localizaIP(locaplic,sid,mostraIP)}catch(e){}},zoomExt:function(locaplic,sid,tipoimagem,ext){var f;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}if(tipoimagem===""){tipoimagem="nenhum"}ext=i3GEO.util.extGeo2OSM(ext);i3GEO.php.mudaext(function(retorno){i3GEO.atualiza(retorno)},tipoimagem,ext)},aplicaEscala:function(escala){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setZoom(i3GEO.Interface.googlemaps.escala2nzoom(escala))}if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomToScale(escala,true);i3GEO.parametros.mapscale=parseInt(i3geoOL.getScale(),10)}},atualizaEscalaNumerica:function(escala){console.log("atualizaEscalaNumerica");var e=$i("i3GEOescalanum");if(!e){return}if(arguments.length===1){e.value=$.number(escala,0,$trad("dec"),$trad("mil"))}else{if(i3GEO.Interface.ATUAL==="googlemaps"){e.value=parseInt(i3GEO.parametros.mapscale,10)}if(i3GEO.Interface.ATUAL==="openlayers"){e.value=$.number(i3geoOL.getScale(),0,$trad("dec"),$trad("mil"))}}},panFixo:function(){alert("panFixo foi depreciado na versao 6.0")},mostraRosaDosVentos:function(){alert("mostraRosaDosVentos foi depreciado na versao 6.0")},autoRedesenho:{INTERVALO:0,ID:"tempoRedesenho",ativa:function(id){if(arguments.length===0){id="tempoRedesenho"}i3GEO.navega.autoRedesenho.ID=id;if(($i(id))&&i3GEO.navega.autoRedesenho.INTERVALO>0){$i(id).style.display="block"}if(i3GEO.navega.autoRedesenho.INTERVALO>0){i3GEO.navega.tempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.redesenha()',i3GEO.navega.autoRedesenho.INTERVALO)}if(($i(id))&&(i3GEO.navega.autoRedesenho.INTERVALO>0)){$i(id).innerHTML=i3GEO.navega.autoRedesenho.INTERVALO/1000;i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},desativa:function(){i3GEO.navega.autoRedesenho.INTERVALO=0;clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);i3GEO.navega.tempoRedesenho="";i3GEO.navega.contaTempoRedesenho="";if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).style.display="none"}},redesenha:function(){clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;case"googlemaps":i3GEO.Interface.googlemaps.redesenha();break;default:i3GEO.atualiza("")}i3GEO.navega.autoRedesenho.ativa(i3GEO.navega.autoRedesenho.ID)},contagem:function(){if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).innerHTML=parseInt($i(i3GEO.navega.autoRedesenho.ID).innerHTML,10)-1}i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},zoomBox:{inicia:function(){alert("zoomBox depreciado na versao 6.0")}},lente:{_lenteCompose:"",eventMouseout:function(){if(i3GEO.navega.lente._lenteCompose!=""){var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getLayersBy("visible",true)[0]}i3GEO.navega.lente.stop(imagery,i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.lente._lenteCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.lente._lenteCompose);i3GEO.navega.lente._lenteCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.lente.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getLayersBy("visible",true)[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.lente._lenteCompose!=""){i3GEO.navega.lente.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.lente.eventMouseout);var a=i3geoOL.on('postcompose',function(event){var context=event.context;var pixelRatio=event.frameState.pixelRatio;var half=radius*pixelRatio;var centerX=objposicaocursor.imgx*pixelRatio;var centerY=objposicaocursor.imgy*pixelRatio;var originX=centerX-half;var originY=centerY-half;var size=2*half+1;var sourceData=context.getImageData(originX,originY,size,size).data;var dest=context.createImageData(size,size);var destData=dest.data;for(var j=0;j<size;++j){for(var i=0;i<size;++i){var dI=i-half;var dJ=j-half;var dist=Math.sqrt(dI*dI+dJ*dJ);var sourceI=i;var sourceJ=j;if(dist<half){sourceI=Math.round(half+dI/2);sourceJ=Math.round(half+dJ/2)}var destOffset=(j*size+i)*4;var sourceOffset=(sourceJ*size+sourceI)*4;destData[destOffset]=sourceData[sourceOffset];destData[destOffset+1]=sourceData[sourceOffset+1];destData[destOffset+2]=sourceData[sourceOffset+2];destData[destOffset+3]=sourceData[sourceOffset+3]}}context.beginPath();context.arc(centerX,centerY,half,0,2*Math.PI);context.lineWidth=3*pixelRatio;context.strokeStyle='rgba(255,255,255,0.5)';context.putImageData(dest,originX,originY);context.stroke();context.restore()});i3GEO.navega.lente._lenteCompose=[a]}},destacaTema:{inicia:function(){i3GEO.janela.tempoMsg("removido na versao 8")}},basemapSpy:{_spyCompose:"",eventMouseout:function(){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(i3geoOL.getLayerBase(),i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.basemapSpy._spyCompose);i3GEO.navega.basemapSpy._spyCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getAllLayers()[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);var a=imagery.on('precompose',function(event){var ctx=event.context;var pixelRatio=event.frameState.pixelRatio;ctx.save();ctx.beginPath();ctx.arc(objposicaocursor.imgx*pixelRatio,objposicaocursor.imgy*pixelRatio,radius*pixelRatio,0,2*Math.PI);ctx.lineWidth=5*pixelRatio;ctx.strokeStyle='rgba(0,0,0,0.5)';ctx.stroke();ctx.clip()});var b=imagery.on('postcompose',function(event){var ctx=event.context;ctx.restore()});i3GEO.navega.basemapSpy._spyCompose=[a,b]}},dialogo:{wiki:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.wiki()","wiki","wiki","dependencias.php","i3GEOF.wiki.iniciaJanelaFlutuante()")},metar:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.metar()","metar","metar","dependencias.php","i3GEOF.metar.iniciaJanelaFlutuante()")},buscaFotos:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.buscaFotos()","buscafotos","buscaFotos","dependencias.php","i3GEOF.buscaFotos.iniciaJanelaFlutuante()")},google:function(coordenadas){i3GEO.navega.dialogo.google.coordenadas=coordenadas;var temp,janela,idgoogle="googlemaps"+Math.random();janela=i3GEO.janela.cria((i3GEO.parametros.w/2.5)+25+"px",(i3GEO.parametros.h/2.5)+18+"px",i3GEO.configura.locaplic+"/ferramentas/googlemaps1/index.php","","","<span class='i3GeoTituloJanelaBsNolink' >Google maps</span></div>",idgoogle,false,"hd","","","",false,"","","","","68");temp=function(){i3GEO.desenho.removePins("boxOndeGoogle");i3GEO.desenho.removePins("googlemaps")};$(janela[0].close).click(temp)},confluence:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.confluence()","confluence","confluence","dependencias.php","i3GEOF.confluence.iniciaJanelaFlutuante()")}},atualizaGoogle:function(idgoogle){try{parent.frames[idgoogle+"i"].panTogoogle()}catch(e){i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle('"+idgoogle+"')"]);i3GEO.desenho.removePins("googlemaps");i3GEO.desenho.removePins("boxOndeGoogle")}},dragZoom:function(){i3GEO.navega.dragZoom.draw=new ol.interaction.Draw({type:"Circle",freehand:false,geometryFunction:ol.interaction.Draw.createRegularPolygon(4)});i3GEO.navega.dragZoom.draw.setActive(false);i3GEO.navega.dragZoom.draw.on("drawend",function(evt){var pol=evt.feature.getGeometry();i3geoOL.getView().fit(pol);i3GEO.navega.dragZoom.draw.setActive(false)});document.body.addEventListener('keydown',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(true)}});document.body.addEventListener('keyup',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(false)}});return i3GEO.navega.dragZoom.draw}}; | |
275 | +if(typeof(i3GEO)==='undefined'){var i3GEO={}}i3GEO.navega={EXTENSOES:{lista:[],redo:[],posicao:0,emAcao:false},offset:function(pixelx,pixely){if(i3GEO.Interface.ATUAL=="openlayers"){var view=i3geoOL.getView(),mover=[pixelx,pixely],s=i3geoOL.getSize(),dx=s[0]/2+mover[0],dy=s[1]/2+mover[1];view.centerOn(view.getCenter(),s,[dx,dy])}},ativaPan:function(){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setOptions({draggable:true})}if(i3GEO.Interface.ATUAL==="openlayers"){marcadorZoom="";i3GEO.Interface.openlayers.OLpanel.activateControl(i3GEO.Interface.openlayers.OLpan)}},registraExt:function(ext){if(i3GEO.navega.EXTENSOES.emAcao==false){var l=i3GEO.navega.EXTENSOES.lista,n=l.length;if(n>10){l.shift()}n=l.length;if(n>0&&l[n-1]===ext){return}l.push(ext)}else{i3GEO.navega.EXTENSOES.emAcao=false}},extensaoAnterior:function(){i3GEO.navega.EXTENSOES.emAcao=true;var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;if(l.length>0){if(l.length>1){e=l.pop();i3GEO.navega.zoomExt("","","",e);if(r.length>10){r.shift()}if(r.length>0&&r[r.length-1]===e){return}else{r.push(a)}}}else{l.push(i3GEO.parametros.mapexten)}},extensaoProximo:function(){var l=i3GEO.navega.EXTENSOES.lista,r=i3GEO.navega.EXTENSOES.redo,a=i3GEO.parametros.mapexten,e;i3GEO.navega.EXTENSOES.emAcao=true;if(r.length>0){i3GEO.navega.zoomExt("","","",r[r.length-1]);e=r.pop();if(l.length>10){l.pop()}if(l.length>0&&l[l.length-1]===e){return}l.push(a)}},pan2ponto:function(x,y){i3GEO.Interface[i3GEO.Interface.ATUAL].pan2ponto(x,y);i3GEO.Interface[i3GEO.Interface.ATUAL].recalcPar()},centroDoMapa:function(){var xy;switch(i3GEO.Interface.ATUAL){case"openlayers":xy=i3geoOL.getCenter();if(xy){return[xy.lon,xy.lat]}else{return false}break;case"googlemaps":xy=i3GeoMap.getCenter();if(xy){return[xy.lng(),xy.lat()]}else{return false}break;default:return false}},marcaCentroDoMapa:function(xy){var t=$i("i3GeoCentroDoMapa");if(t&&t.style.display==="block"){return}if(xy!=false){xy=i3GEO.calculo.dd2tela(xy[0]*1,xy[1]*1,$i(i3GEO.Interface.IDMAPA),i3GEO.parametros.mapexten,i3GEO.parametros.pixelsize);i3GEO.util.criaPin("i3GeoCentroDoMapa",i3GEO.configura.locaplic+'/imagens/alvo.png','30px','30px');i3GEO.util.posicionaImagemNoMapa("i3GeoCentroDoMapa",xy[0],xy[1])}},removeCookieExtensao:function(){var nomecookie="i3geoOLUltimaExtensao";if(i3GEO.Interface.openlayers.googleLike===true){nomecookie="i3geoUltima_ExtensaoOSM"}i3GEO.util.insereCookie(nomecookie,"")},zoomin:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomIn();return}},zoomout:function(locaplic,sid){if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomOut();return}},zoomponto:function(locaplic,sid,x,y,tamanho,simbolo,cor){if(!simbolo){simbolo="ponto"}if(!tamanho){tamanho=15}if(!cor){cor="255 0 0"}if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.zoomponto(i3GEO.atualiza,x,y,tamanho,simbolo,cor)},zoompontoIMG:function(locaplic,sid,x,y){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.pan(i3GEO.atualiza,'','',x,y)},xy2xy:function(locaplic,sid,xi,yi,xf,yf,ext,tipoimagem){var disty,distx,ex,novoxi,novoxf,novoyf,nex;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}disty=(yi*-1)+yf;distx=(xi*-1)+xf;ex=ext.split(" ");novoxi=(ex[0]*1)-distx;novoxf=(ex[2]*1)-distx;novoyi=(ex[1]*1)-disty;novoyf=(ex[3]*1)-disty;if((distx===0)&&(disty===0)){return false}else{nex=novoxi+" "+novoyi+" "+novoxf+" "+novoyf;i3GEO.navega.zoomExt(i3GEO.configura.locaplic,i3GEO.configura.sid,tipoimagem,nex);return true}},localizaIP:function(locaplic,sid,funcao){if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}i3GEO.php.localizaIP(funcao)},zoomIP:function(locaplic,sid){try{if(arguments.length>0){i3GEO.configura.locaplic=locaplic;i3GEO.configura.sid=sid}var mostraIP=function(retorno){if(retorno.data.latitude!==null){i3GEO.navega.zoomponto(locaplic,sid,retorno.data.longitude,retorno.data.latitude)}else{i3GEO.janela.tempoMsg("Nao foi possivel identificar a localizacao.")}};i3GEO.navega.localizaIP(locaplic,sid,mostraIP)}catch(e){}},zoomExt:function(locaplic,sid,tipoimagem,ext){var f;if(locaplic!==""){i3GEO.configura.locaplic=locaplic}if(sid!==""){i3GEO.configura.sid=sid}if(tipoimagem===""){tipoimagem="nenhum"}ext=i3GEO.util.extGeo2OSM(ext);i3GEO.php.mudaext(function(retorno){i3GEO.atualiza(retorno)},tipoimagem,ext)},aplicaEscala:function(escala){if(i3GEO.Interface.ATUAL==="googlemaps"){i3GeoMap.setZoom(i3GEO.Interface.googlemaps.escala2nzoom(escala))}if(i3GEO.Interface.ATUAL==="openlayers"){i3geoOL.zoomToScale(escala,true);i3GEO.parametros.mapscale=parseInt(i3geoOL.getScale(),10)}},atualizaEscalaNumerica:function(escala){console.log("atualizaEscalaNumerica");var e=$i("i3GEOescalanum");if(!e){return}if(arguments.length===1){e.value=$.number(escala,0,$trad("dec"),$trad("mil"))}else{if(i3GEO.Interface.ATUAL==="googlemaps"){e.value=parseInt(i3GEO.parametros.mapscale,10)}if(i3GEO.Interface.ATUAL==="openlayers"){e.value=$.number(i3geoOL.getScale(),0,$trad("dec"),$trad("mil"))}}},panFixo:function(){alert("panFixo foi depreciado na versao 6.0")},mostraRosaDosVentos:function(){alert("mostraRosaDosVentos foi depreciado na versao 6.0")},autoRedesenho:{INTERVALO:0,ID:"tempoRedesenho",ativa:function(id){if(arguments.length===0){id="tempoRedesenho"}i3GEO.navega.autoRedesenho.ID=id;if(($i(id))&&i3GEO.navega.autoRedesenho.INTERVALO>0){$i(id).style.display="block"}if(i3GEO.navega.autoRedesenho.INTERVALO>0){i3GEO.navega.tempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.redesenha()',i3GEO.navega.autoRedesenho.INTERVALO)}if(($i(id))&&(i3GEO.navega.autoRedesenho.INTERVALO>0)){$i(id).innerHTML=i3GEO.navega.autoRedesenho.INTERVALO/1000;i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},desativa:function(){i3GEO.navega.autoRedesenho.INTERVALO=0;clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);i3GEO.navega.tempoRedesenho="";i3GEO.navega.contaTempoRedesenho="";if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).style.display="none"}},redesenha:function(){clearTimeout(i3GEO.navega.tempoRedesenho);clearTimeout(i3GEO.navega.contaTempoRedesenho);switch(i3GEO.Interface.ATUAL){case"openlayers":i3GEO.Interface.openlayers.atualizaMapa();break;case"googlemaps":i3GEO.Interface.googlemaps.redesenha();break;default:i3GEO.atualiza("")}i3GEO.navega.autoRedesenho.ativa(i3GEO.navega.autoRedesenho.ID)},contagem:function(){if($i(i3GEO.navega.autoRedesenho.ID)){$i(i3GEO.navega.autoRedesenho.ID).innerHTML=parseInt($i(i3GEO.navega.autoRedesenho.ID).innerHTML,10)-1}i3GEO.navega.contaTempoRedesenho=setTimeout('i3GEO.navega.autoRedesenho.contagem()',1000)}},zoomBox:{inicia:function(){alert("zoomBox depreciado na versao 6.0")}},lente:{_lenteCompose:"",eventMouseout:function(){if(i3GEO.navega.lente._lenteCompose!=""){i3GEO.navega.lente.stop(i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.lente._lenteCompose!=""){i3geoOL.renderSync()}},stop:function(container){ol.Observable.unByKey(i3GEO.navega.lente._lenteCompose);i3GEO.navega.lente._lenteCompose="";container.removeEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.lente.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var container=i3geoOL.getTargetElement();var radius=75;container.addEventListener('mousemove',i3GEO.navega.lente.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.lente.eventMouseout);var a=i3geoOL.on('postcompose',function(event){var context=event.context;var pixelRatio=event.frameState.pixelRatio;var half=radius*pixelRatio;var centerX=objposicaocursor.imgx*pixelRatio;var centerY=objposicaocursor.imgy*pixelRatio;var originX=centerX-half;var originY=centerY-half;var size=2*half+1;var sourceData=context.getImageData(originX,originY,size,size).data;var dest=context.createImageData(size,size);var destData=dest.data;for(var j=0;j<size;++j){for(var i=0;i<size;++i){var dI=i-half;var dJ=j-half;var dist=Math.sqrt(dI*dI+dJ*dJ);var sourceI=i;var sourceJ=j;if(dist<half){sourceI=Math.round(half+dI/2);sourceJ=Math.round(half+dJ/2)}var destOffset=(j*size+i)*4;var sourceOffset=(sourceJ*size+sourceI)*4;destData[destOffset]=sourceData[sourceOffset];destData[destOffset+1]=sourceData[sourceOffset+1];destData[destOffset+2]=sourceData[sourceOffset+2];destData[destOffset+3]=sourceData[sourceOffset+3]}}context.beginPath();context.arc(centerX,centerY,half,0,2*Math.PI);context.lineWidth=3*pixelRatio;context.strokeStyle='rgba(255,255,255,0.5)';context.putImageData(dest,originX,originY);context.stroke();context.restore()});i3GEO.navega.lente._lenteCompose=[a]}},destacaTema:{inicia:function(){i3GEO.janela.tempoMsg("removido na versao 8")}},basemapSpy:{_spyCompose:"",eventMouseout:function(){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(i3geoOL.getLayerBase(),i3geoOL.getTargetElement())}},eventMouseMove:function(event){if(i3GEO.navega.basemapSpy._spyCompose!=""){i3geoOL.renderSync()}},stop:function(imagery,container){ol.Observable.unByKey(i3GEO.navega.basemapSpy._spyCompose);i3GEO.navega.basemapSpy._spyCompose="";imagery.setZIndex(imagery.get("zIndexOriginal"));container.removeEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.removeEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);i3geoOL.renderSync()},start:function(){if(i3GEO.Interface.ATUAL!="openlayers"){return}var imagery=i3geoOL.getLayerBase();if(!imagery){imagery=i3geoOL.getAllLayers()[0]}var container=i3geoOL.getTargetElement();if(i3GEO.navega.basemapSpy._spyCompose!=""){i3GEO.navega.basemapSpy.stop(imagery,container);return}var radius=75;imagery.set("zIndexOriginal",imagery.getZIndex());imagery.setZIndex(1000);container.addEventListener('mousemove',i3GEO.navega.basemapSpy.eventMouseMove);container.addEventListener('mouseout',i3GEO.navega.basemapSpy.eventMouseout);var a=imagery.on('precompose',function(event){var ctx=event.context;var pixelRatio=event.frameState.pixelRatio;ctx.save();ctx.beginPath();ctx.arc(objposicaocursor.imgx*pixelRatio,objposicaocursor.imgy*pixelRatio,radius*pixelRatio,0,2*Math.PI);ctx.lineWidth=5*pixelRatio;ctx.strokeStyle='rgba(0,0,0,0.5)';ctx.stroke();ctx.clip()});var b=imagery.on('postcompose',function(event){var ctx=event.context;ctx.restore()});i3GEO.navega.basemapSpy._spyCompose=[a,b]}},dialogo:{wiki:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.wiki()","wiki","wiki","dependencias.php","i3GEOF.wiki.iniciaJanelaFlutuante()")},metar:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.metar()","metar","metar","dependencias.php","i3GEOF.metar.iniciaJanelaFlutuante()")},buscaFotos:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.buscaFotos()","buscafotos","buscaFotos","dependencias.php","i3GEOF.buscaFotos.iniciaJanelaFlutuante()")},google:function(coordenadas){i3GEO.navega.dialogo.google.coordenadas=coordenadas;var temp,janela,idgoogle="googlemaps"+Math.random();janela=i3GEO.janela.cria((i3GEO.parametros.w/2.5)+25+"px",(i3GEO.parametros.h/2.5)+18+"px",i3GEO.configura.locaplic+"/ferramentas/googlemaps1/index.php","","","<span class='i3GeoTituloJanelaBsNolink' >Google maps</span></div>",idgoogle,false,"hd","","","",false,"","","","","68");temp=function(){i3GEO.desenho.removePins("boxOndeGoogle");i3GEO.desenho.removePins("googlemaps")};$(janela[0].close).click(temp)},confluence:function(){i3GEO.util.dialogoFerramenta("i3GEO.navega.dialogo.confluence()","confluence","confluence","dependencias.php","i3GEOF.confluence.iniciaJanelaFlutuante()")}},atualizaGoogle:function(idgoogle){try{parent.frames[idgoogle+"i"].panTogoogle()}catch(e){i3GEO.eventos.removeEventos("NAVEGAMAPA",["i3GEO.navega.atualizaGoogle('"+idgoogle+"')"]);i3GEO.desenho.removePins("googlemaps");i3GEO.desenho.removePins("boxOndeGoogle")}},dragZoom:function(){i3GEO.navega.dragZoom.draw=new ol.interaction.Draw({type:"Circle",freehand:false,geometryFunction:ol.interaction.Draw.createRegularPolygon(4)});i3GEO.navega.dragZoom.draw.setActive(false);i3GEO.navega.dragZoom.draw.on("drawend",function(evt){var pol=evt.feature.getGeometry();i3geoOL.getView().fit(pol);i3GEO.navega.dragZoom.draw.setActive(false)});document.body.addEventListener('keydown',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(true)}});document.body.addEventListener('keyup',function(event){if(event.keyCode==16){i3GEO.navega.dragZoom.draw.setActive(false)}});return i3GEO.navega.dragZoom.draw}}; | |
276 | 276 | // |
277 | 277 | //compactados/eventos_compacto.js |
278 | 278 | if(typeof(i3GEO)==='undefined'){var i3GEO={}}var objposicaocursor={ddx:"",ddy:"",dmsx:"",dmsy:"",telax:"",telay:"",imgx:"",imgy:"",refx:"",refy:""};i3GEO.eventos={CONTATOUCH:0,MOUSEOVERDATA:[],MOUSEOUTDATA:[],RESIZE:[],SELECAO:[],ATUALIZAARVORECAMADAS:[],ATIVATEMA:[],NAVEGAMAPA:[],MOUSEPARADO:[],MOUSEMOVE:[],MOUSEDOWN:[],MOUSEUP:["i3GEO.eventos.cliquePerm.executa()"],MOUSECLIQUE:["i3GEO.eventos.cliqueCapturaPt()"],MOUSECLIQUEPERM:["i3GEO.mapa.dialogo.verificaTipDefault()"],TIMERPARADO:"",mouseOverData:function(){i3GEO.eventos.executaEventos(this.MOUSEOVERDATA)},mouseOutData:function(){i3GEO.eventos.executaEventos(this.MOUSEOUTDATA)},mouseParado:function(){try{clearTimeout(this.TIMERPARADO)}catch(e){this.TIMERPARADO=""}if(objposicaocursor.dentroDomapa===false){return}try{if(objposicaocursor.imgy===""){objposicaocursor.imgy=1;objposicaocursor.imgx=1}if(i3GEO.eventos.MOUSEPARADO.length>0&&objposicaocursor.imgy>0&&objposicaocursor.imgx>0){if(objposicaocursor.imgx>0){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSEPARADO)}}}catch(e){}},navegaMapa:function(){i3GEO.eventos.executaEventos(this.NAVEGAMAPA)},mousemoveMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEMOVE)},mousedownMapa:function(){i3GEO.eventos.executaEventos(this.MOUSEDOWN)},mouseupMapa:function(exy){if(!exy){i3GEO.eventos.executaEventos(this.MOUSEUP)}else{if(i3GEO.Interface.ATUAL==="googlemaps"&&exy.target&&!exy.target.src){if(i3GEOtouchesPosMapa===""){i3GEOtouchesPosMapa=i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA))}pos=i3GEOtouchesPosMapa;p=new google.maps.Point(exy.clientX-pos[0],exy.clientY-pos[1]);e=null;lonlat=i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p);if(lonlat){objposicaocursor.ddx=lonlat.lng();objposicaocursor.ddy=lonlat.lat()}i3GEO.eventos.executaEventos(this.MOUSEUP)}else if(i3GEO.Interface.ATUAL==="openlayers"&&exy.target&&exy.target.tagName==="CANVAS"){i3GEO.eventos.executaEventos(this.MOUSEUP)}}},mousecliqueMapa:function(){i3GEO.eventos.executaEventos(this.MOUSECLIQUE)},resizeMapa:function(){i3GEO.eventos.executaEventos(this.RESIZE)},executaEventos:function(eventos){if(i3GEO.Interface.STATUS.pan===true){return}var f=0;try{if(eventos.length>0){f=eventos.length-1;if(f>=0){do{if(eventos[f]!==""){if(typeof(eventos[f])==="function"){eventos[f].call()}else{eval(eventos[f])}}}while(f--)}}}catch(e){eventos[f]=""}},removeEventos:function(tipo,eventos){var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].remove(eventos[i])}i3GEO.eventos[tipo].remove("");i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},adicionaEventos:function(tipo,eventos){if(eventos==""){i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique();return}var i,n=eventos.length;for(i=0;i<n;i++){i3GEO.eventos[tipo].push(eventos[i])}i3GEO.eventos[tipo]=i3GEO.eventos[tipo].getUnique()},posicaoMouseMapa:function(e){var teladd,teladms,container="",targ="",pos,mousex,mousey,xfig,yfig,xreffig,yreffig,xtela,ytela,c,ex;if(!e){e=window.event}try{if(e.target){targ=e.target}else if(e.srcElement){targ=e.srcElement}if(targ.parentNode){container=targ.parentNode.id}}catch(erro){return}if(container!=="mapaReferencia"){return}pos=i3GEO.util.pegaPosicaoObjeto(targ);mousex=0;mousey=0;if(e.pageX||e.pageY){mousex=e.pageX;mousey=e.pageY}else if(e.clientX||e.clientY){mousex=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft;mousey=e.clientY+document.body.scrollTop+document.documentElement.scrollTop}xfig=mousex-pos[0];yfig=mousey-pos[1];xreffig=xfig;yreffig=yfig;xtela=mousex;ytela=mousey;c=i3GEO.parametros.celularef;ex=i3GEO.parametros.extentref;teladd=i3GEO.calculo.tela2dd(xfig,yfig,c,ex,targ.id);teladms=i3GEO.calculo.dd2dms(teladd[0],teladd[1]);objposicaocursor={ddx:teladd[0],ddy:teladd[1],dmsx:teladms[0],dmsy:teladms[1],telax:xtela,telay:ytela,imgx:xfig,imgy:yfig,refx:xreffig,refy:yreffig,dentroDomapa:true}},ativa:function(docMapa){if(!docMapa){return}var timer=0;var delay=300;var prevent=false;docMapa.onmouseover=function(){objposicaocursor.dentroDomapa=true;this.onmousemove=function(exy){i3GEO.eventos.cliquePerm.status=true;i3GEO.eventos.posicaoMouseMapa(exy);try{i3GEO.eventos.mousemoveMapa()}catch(e){}}};docMapa.onmouseout=function(){objposicaocursor.dentroDomapa=false};docMapa.onmousedown=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousedownMapa()};docMapa.onclick=function(exy){if(objposicaocursor.dentroDomapa===false){return}i3GEO.eventos.mousecliqueMapa(exy)};docMapa.ondblclick=function(){if(objposicaocursor.dentroDomapa===false){return}clearTimeout(timer);prevent=true};docMapa.onmouseup=function(exy){if(objposicaocursor.dentroDomapa===false){return}if(i3GEO.Interface.ATUAL==="googlemaps"){if(modoAtual==="move"){modoAtual="";return}}i3GEO.eventos.cliquePerm.status=true;timer=setTimeout(function(){if(!prevent){i3GEO.eventos.mouseupMapa(exy)}prevent=false},delay)};docMapa.ontouchmove=function(exy){i3GEO.eventos.CONTATOUCH++;i3GEO.Interface.STATUS.pan=true;i3GEO.eventos.posicaoMouseMapa(exy)};docMapa.ontouchcancel=function(exy){i3GEO.eventos.CONTATOUCH=0}},botaoDireita:function(exy){try{var k=(navm)?event.button:exy.button;if(k!==2){return false}else{return true}}catch(e){return false}},cliqueCapturaPt:function(ixg,ixm,ixs,iyg,iym,iys){var x,y,doc=document;if(arguments.length===0){ixg="ixg";ixm="ixm";ixs="ixs";iyg="iyg";iym="iym";iys="iys";if($i("wdocai")){doc=(navm)?document.frames("wdocai").document:$i("wdocai").contentDocument}}try{if(doc){x=objposicaocursor.dmsx.split(" ");y=objposicaocursor.dmsy.split(" ");if(doc.getElementById(ixg)){doc.getElementById(ixg).value=x[0]}if(doc.getElementById(ixm)){doc.getElementById(ixm).value=x[1]}if(doc.getElementById(ixs)){doc.getElementById(ixs).value=$.number(x[2],2,$trad("dec"),$trad("mil"))}if(doc.getElementById(iyg)){doc.getElementById(iyg).value=y[0]}if(doc.getElementById(iym)){doc.getElementById(iym).value=y[1]}if(doc.getElementById(iys)){doc.getElementById(iys).value=$.number(y[2],2,$trad("dec"),$trad("mil"))}}}catch(m){}},cliquePerm:{ativo:true,status:true,executa:function(evt){if(i3GEO.eventos.cliquePerm.ativo===true&&i3GEO.eventos.cliquePerm.status===true){i3GEO.eventos.executaEventos(i3GEO.eventos.MOUSECLIQUEPERM)}},ativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=true}},desativa:function(){if(i3GEO.eventos.cliquePerm.ativoinicial===true){i3GEO.eventos.cliquePerm.ativo=false}},ativoinicial:true}}; | ... | ... |
js/navega.js
... | ... | @@ -663,11 +663,7 @@ i3GEO.navega = |
663 | 663 | _lenteCompose: "", |
664 | 664 | eventMouseout: function() { |
665 | 665 | if(i3GEO.navega.lente._lenteCompose != ""){ |
666 | - var imagery = i3geoOL.getLayerBase(); | |
667 | - if(!imagery){ | |
668 | - imagery = i3geoOL.getLayersBy("visible",true)[0]; | |
669 | - } | |
670 | - i3GEO.navega.lente.stop(imagery,i3geoOL.getTargetElement()); | |
666 | + i3GEO.navega.lente.stop(i3geoOL.getTargetElement()); | |
671 | 667 | } |
672 | 668 | }, |
673 | 669 | eventMouseMove: function(event) { |
... | ... | @@ -675,10 +671,9 @@ i3GEO.navega = |
675 | 671 | i3geoOL.renderSync(); |
676 | 672 | } |
677 | 673 | }, |
678 | - stop: function(imagery,container){ | |
674 | + stop: function(container){ | |
679 | 675 | ol.Observable.unByKey(i3GEO.navega.lente._lenteCompose); |
680 | 676 | i3GEO.navega.lente._lenteCompose = ""; |
681 | - imagery.setZIndex(imagery.get("zIndexOriginal")); | |
682 | 677 | container.removeEventListener('mousemove', i3GEO.navega.lente.eventMouseMove); |
683 | 678 | container.removeEventListener('mouseout', i3GEO.navega.lente.eventMouseout); |
684 | 679 | i3geoOL.renderSync(); |
... | ... | @@ -690,22 +685,10 @@ i3GEO.navega = |
690 | 685 | if(i3GEO.Interface.ATUAL != "openlayers"){ |
691 | 686 | return; |
692 | 687 | } |
693 | - var imagery = i3geoOL.getLayerBase(); | |
694 | - if(!imagery){ | |
695 | - imagery = i3geoOL.getLayersBy("visible",true)[0]; | |
696 | - } | |
697 | 688 | var container = i3geoOL.getTargetElement(); |
698 | - if(i3GEO.navega.lente._lenteCompose != ""){ | |
699 | - i3GEO.navega.lente.stop(imagery,container); | |
700 | - return; | |
701 | - } | |
702 | 689 | var radius = 75; |
703 | - imagery.set("zIndexOriginal",imagery.getZIndex()); | |
704 | - imagery.setZIndex(1000); | |
705 | - | |
706 | 690 | container.addEventListener('mousemove', i3GEO.navega.lente.eventMouseMove); |
707 | 691 | container.addEventListener('mouseout', i3GEO.navega.lente.eventMouseout); |
708 | - | |
709 | 692 | var a = i3geoOL.on('postcompose', function(event) { |
710 | 693 | var context = event.context; |
711 | 694 | var pixelRatio = event.frameState.pixelRatio; | ... | ... |