Commit b86073529a2b811eab92eec7f510f7a1d86db74a
1 parent
f88e5066
Exists in
master
and in
7 other branches
Corrige erro que não permitia a eliminação de elementos gráficos no editor vetor…
…ial ao ser removido da tela
Showing
6 changed files
with
49 additions
and
40 deletions
Show diff stats
classesjs/classe_barradebotoes.js
... | ... | @@ -1286,8 +1286,8 @@ i3GEO.barraDeBotoes = { |
1286 | 1286 | }, |
1287 | 1287 | mostraJanela: function(objeto,mensagem,evt){ |
1288 | 1288 | if(mensagem === ""){ |
1289 | - try{clearTimeout(timeMostraAjudaBotoes);}catch(e){} | |
1290 | - try{clearTimeout(timeAjudaBotoes);}catch(e){} | |
1289 | + try{clearTimeout(i3GEO.barraDeBotoes.timeMostraAjudaBotoes);}catch(e){} | |
1290 | + try{clearTimeout(i3GEO.barraDeBotoes.timeAjudaBotoes);}catch(e){} | |
1291 | 1291 | return; |
1292 | 1292 | } |
1293 | 1293 | var divmensagem = $i("divMensagemBarraDeBotoes"),balloonAjuda, |
... | ... | @@ -1327,8 +1327,8 @@ i3GEO.barraDeBotoes = { |
1327 | 1327 | divmensagem.style.left = (parseInt(YAHOO.util.Dom.getStyle(objeto,"width"),10)/2)+pos[0]-5+"px"; |
1328 | 1328 | divmensagem.style.top = pos[1]+5+parseInt(YAHOO.util.Dom.getStyle(objeto,"height"),10)+"px"; |
1329 | 1329 | } |
1330 | - try{clearTimeout(timeAjudaBotoes);}catch(e){} | |
1331 | - timeMostraAjudaBotoes = setTimeout("i3GEO.barraDeBotoes.mostraJanelaAjuda('"+mensagem+"');",5000); | |
1330 | + try{clearTimeout(i3GEO.barraDeBotoes.timeAjudaBotoes);}catch(e){} | |
1331 | + i3GEO.barraDeBotoes.timeMostraAjudaBotoes = setTimeout("i3GEO.barraDeBotoes.mostraJanelaAjuda('"+mensagem+"');",5000); | |
1332 | 1332 | } |
1333 | 1333 | else{ |
1334 | 1334 | hideAllTooltips(); |
... | ... | @@ -1340,8 +1340,8 @@ i3GEO.barraDeBotoes = { |
1340 | 1340 | balloonAjuda.vOffset = -24; |
1341 | 1341 | balloonAjuda.images = i3GEO.configura.locaplic+'/pacotes/balloon-tooltips/htdocs/images/GBubblec'; |
1342 | 1342 | mensagem = "<table style='z-index:20000' ><tr><td style='text-align:left;'><span style='text-align:right;cursor:pointer;color:blue;' onclick='javascript:i3GEO.util.insereCookie(\"botoesAjuda\",\"nao\");i3GEO.barraDeBotoes.AJUDA = false;'>fecha</span><br><div style='vertical-align:middle;text-align:left;width:250px;border: 0px solid black;border-left:1px;' id='divMensagemBarraDeBotoesCorpo'>"+mensagem+"</div></td></tr></table>"; |
1343 | - try{clearTimeout(timeAjudaBotoes);}catch(e){} | |
1344 | - timeMostraAjudaBotoes = setTimeout(function(){ | |
1343 | + try{clearTimeout(i3GEO.barraDeBotoes.timeAjudaBotoes);}catch(e){} | |
1344 | + i3GEO.barraDeBotoes.timeMostraAjudaBotoes = setTimeout(function(){ | |
1345 | 1345 | balloonAjuda.cleanup(); |
1346 | 1346 | balloonIsVisible = false; |
1347 | 1347 | //alert(mensagem); |
... | ... | @@ -1350,7 +1350,7 @@ i3GEO.barraDeBotoes = { |
1350 | 1350 | else |
1351 | 1351 | {balloonAjuda.showTooltip(objeto,mensagem,null,null,null,pos[0]+12,pos[1]);} |
1352 | 1352 | try{clearTimeout(timeMostraAjudaBotoes);}catch(e){} |
1353 | - timeAjudaBotoes = setTimeout(function(){balloonAjuda.cleanup();},4000); | |
1353 | + i3GEO.barraDeBotoes.timeAjudaBotoes = setTimeout(function(){balloonAjuda.cleanup();},4000); | |
1354 | 1354 | },4000); |
1355 | 1355 | } |
1356 | 1356 | } |
... | ... | @@ -1358,12 +1358,13 @@ i3GEO.barraDeBotoes = { |
1358 | 1358 | mostraJanelaAjuda:function(mensagem){ |
1359 | 1359 | $i("divMensagemBarraDeBotoesCorpo").innerHTML = mensagem; |
1360 | 1360 | YAHOO.util.Dom.setStyle("divMensagemBarraDeBotoes","display","block"); |
1361 | - try{clearTimeout(timeMostraAjudaBotoes);}catch(e){} | |
1362 | - timeAjudaBotoes = setTimeout(function(){i3GEO.barraDeBotoes.escondeJanelaAjuda();},3000); | |
1361 | + try{clearTimeout(i3GEO.barraDeBotoes.timeMostraAjudaBotoes);}catch(e){} | |
1362 | + i3GEO.barraDeBotoes.timeAjudaBotoes = setTimeout(function(){i3GEO.barraDeBotoes.escondeJanelaAjuda();},3000); | |
1363 | 1363 | }, |
1364 | 1364 | escondeJanelaAjuda:function(){ |
1365 | 1365 | try{ |
1366 | - clearTimeout(timeAjudaBotoes); | |
1366 | + if(i3GEO.barraDeBotoes.timeAjudaBotoes) | |
1367 | + {clearTimeout(i3GEO.barraDeBotoes.timeAjudaBotoes);} | |
1367 | 1368 | } |
1368 | 1369 | catch(e){} |
1369 | 1370 | if($i("divMensagemBarraDeBotoes")) | ... | ... |
classesjs/classe_eventos.js
... | ... | @@ -56,13 +56,13 @@ Exemplos: |
56 | 56 | |
57 | 57 | Para incluir uma função em um determinado evento utilize |
58 | 58 | |
59 | - if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaEscalaNumerica()") < 0) | |
59 | + if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.gadgets.atualizaEscalaNumerica()") < 0) | |
60 | 60 | |
61 | - {i3GEO.eventos.NAVEGAMAPA.push("atualizaEscalaNumerica()");} | |
61 | + {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.gadgets.atualizaEscalaNumerica()");} | |
62 | 62 | |
63 | 63 | Para remover utilize |
64 | 64 | |
65 | - i3GEO.eventos.NAVEGAMAPA.remove("atualizaEscalaNumerica()"); | |
65 | + i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.gadgets.atualizaEscalaNumerica()"); | |
66 | 66 | */ |
67 | 67 | i3GEO.eventos = { |
68 | 68 | /* | ... | ... |
classesjs/classe_gadgets.js
... | ... | @@ -242,23 +242,6 @@ i3GEO.gadgets = { |
242 | 242 | if(onde){ |
243 | 243 | if(onde.style.display == "none") |
244 | 244 | {onde.style.display = "block";} |
245 | - atualizaEscalaNumerica = function(escala){ | |
246 | - var e = $i("i3geo_escalanum"); | |
247 | - if(!e){ | |
248 | - i3GEO.eventos.NAVEGAMAPA.remove("atualizaEscalaNumerica()"); | |
249 | - return; | |
250 | - } | |
251 | - if(arguments.length === 1) | |
252 | - {e.value = escala;} | |
253 | - else{ | |
254 | - if(i3GEO.parametros.mapscale !== ""){ | |
255 | - e.value = parseInt(i3GEO.parametros.mapscale,10); | |
256 | - } | |
257 | - else{ | |
258 | - e.value = 0; | |
259 | - } | |
260 | - } | |
261 | - }; | |
262 | 245 | if(!$i("i3geo_escalanum")){ |
263 | 246 | i = $inputText(id,"100","i3geo_escalanum",$trad("d10"),"9",parseInt(i3GEO.parametros.mapscale,10)); |
264 | 247 | ins = "<table><tr><td>"+i; |
... | ... | @@ -267,13 +250,28 @@ i3GEO.gadgets = { |
267 | 250 | ins += "</td><td><img src='"+i3GEO.util.$im("branco.gif")+"' class='tic' onclick='"+temp+"' /></td></tr></table>"; |
268 | 251 | onde.innerHTML = ins; |
269 | 252 | } |
270 | - if(i3GEO.eventos.NAVEGAMAPA.toString().search("atualizaEscalaNumerica()") < 0) | |
271 | - {i3GEO.eventos.NAVEGAMAPA.push("atualizaEscalaNumerica()");} | |
253 | + if(i3GEO.eventos.NAVEGAMAPA.toString().search("i3GEO.gadgets.atualizaEscalaNumerica()") < 0) | |
254 | + {i3GEO.eventos.NAVEGAMAPA.push("i3GEO.gadgets.atualizaEscalaNumerica()");} | |
272 | 255 | } |
256 | + }, | |
257 | + atualizaEscalaNumerica: function(escala){ | |
258 | + var e = $i("i3geo_escalanum"); | |
259 | + if(!e){ | |
260 | + i3GEO.eventos.NAVEGAMAPA.remove("i3GEO.gadgets.atualizaEscalaNumerica()"); | |
261 | + return; | |
262 | + } | |
263 | + if(arguments.length === 1) | |
264 | + {e.value = escala;} | |
273 | 265 | else{ |
274 | - atualizaEscalaNumerica = function(){}; | |
266 | + if(i3GEO.parametros.mapscale !== ""){ | |
267 | + e.value = parseInt(i3GEO.parametros.mapscale,10); | |
268 | + } | |
269 | + else{ | |
270 | + e.value = 0; | |
271 | + } | |
275 | 272 | } |
276 | 273 | }, |
274 | + | |
277 | 275 | /* |
278 | 276 | Function: mostraEscalaGrafica |
279 | 277 | ... | ... |
classesjs/classe_interface.js
... | ... | @@ -1314,9 +1314,7 @@ i3GEO.Interface = { |
1314 | 1314 | i3GEO.parametros.mapexten = bounds[0]+" "+bounds[1]+" "+bounds[2]+" "+bounds[3]; |
1315 | 1315 | i3GEO.parametros.mapscale = escalaAtual; |
1316 | 1316 | i3GEO.parametros.pixelsize = i3geoOL.getResolution(); |
1317 | - try{ | |
1318 | - atualizaEscalaNumerica(parseInt(escalaAtual,10)); | |
1319 | - }catch(e){} | |
1317 | + i3GEO.gadgets.atualizaEscalaNumerica(parseInt(escalaAtual,10)); | |
1320 | 1318 | }, |
1321 | 1319 | zoom2ext: function(ext){ |
1322 | 1320 | var m,b; | ... | ... |
interface/openlayers.htm
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 | </div> |
102 | 102 | </div> |
103 | 103 | |
104 | -<script src="../classesjs/i3geo.js"></script> | |
104 | +<script src="../classesjs/i3geonaocompacto.js"></script> | |
105 | 105 | <script src="../pacotes/openlayers/OpenLayers29.js.php"></script> |
106 | 106 | <!-- estilo necessário para a ferramenta de edição --> |
107 | 107 | <style> | ... | ... |
mashups/openlayers.js.php
... | ... | @@ -33,7 +33,12 @@ i3GEO.editorOL = { |
33 | 33 | "http://labs.metacarta.com/wms/vmap0", |
34 | 34 | {layers: 'basic'} |
35 | 35 | ), |
36 | - jpl_wms: new OpenLayers.Layer.WMS( "NASA Global Mosaic", "http://wms.jpl.nasa.gov/wms.cgi", {layers: "modis,global_mosaic"},{singleTile:true}), | |
36 | + jpl_wms: new OpenLayers.Layer.WMS( | |
37 | + "NASA Global Mosaic", | |
38 | + "http://wms.jpl.nasa.gov/wms.cgi", | |
39 | + {layers: "modis,global_mosaic"}, | |
40 | + {singleTile:true} | |
41 | + ), | |
37 | 42 | osm_wms: new OpenLayers.Layer.WMS( |
38 | 43 | "Open Street Map", |
39 | 44 | "http://full.wms.geofabrik.de/std/demo_key?", |
... | ... | @@ -907,8 +912,15 @@ i3GEO.editorOL = { |
907 | 912 | trigger: function(){ |
908 | 913 | if(window.confirm("A edição será perdida. Continua?")){ |
909 | 914 | i3GEOpanelEditor.destroy(); |
910 | - YAHOO.temaativo.container.panel.destroy(); | |
911 | - i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.layergrafico); | |
915 | + if(YAHOO.temaativo && YAHOO.temaativo.container.panel) | |
916 | + {YAHOO.temaativo.container.panel.destroy();} | |
917 | + try{ | |
918 | + if(i3GEO.editorOL.layergrafico) | |
919 | + {i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.layergrafico);} | |
920 | + if(i3GEO.editorOL.backup) | |
921 | + {i3GEO.editorOL.mapa.removeLayer(i3GEO.editorOL.backup);} | |
922 | + } | |
923 | + catch(e){} | |
912 | 924 | } |
913 | 925 | }, |
914 | 926 | title: "fecha editor" | ... | ... |