Commit 166f5f1e286dbd606a65c47d3b85d99315d701bf
1 parent
f083859c
Exists in
master
and in
7 other branches
--no commit message
Showing
3 changed files
with
37 additions
and
4 deletions
Show diff stats
classesjs/classe_interface.js
... | ... | @@ -949,7 +949,8 @@ i3GEO.Interface = { |
949 | 949 | var layers = i3geoOL.getLayersByName(obj.value), |
950 | 950 | temp = function(){i3GEO.mapa.legendaHTML.atualiza();}, |
951 | 951 | desligar = "", |
952 | - ligar = ""; | |
952 | + ligar = "", | |
953 | + b; | |
953 | 954 | if(layers.length > 0){ |
954 | 955 | layers[0].setVisibility(obj.checked); |
955 | 956 | if(obj.checked) |
... | ... | @@ -962,8 +963,11 @@ i3GEO.Interface = { |
962 | 963 | desligar = obj.value; |
963 | 964 | i3GEO.arvoreDeCamadas.alteraPropCamadas("status","0",obj.value); |
964 | 965 | } |
965 | - i3GEO.php.ligatemas(temp,desligar,ligar); | |
966 | + //i3GEO.php.ligatemas(temp,desligar,ligar); | |
966 | 967 | //beacons pattern |
968 | + b = new Image(); | |
969 | + b.src = i3GEO.configura.locaplic+"/classesphp/mapa_controle.php?funcao=ligatemasbeacon&desligar="+desligar+"&ligar="+ligar+"&adicionar=nao&g_sid="+i3GEO.configura.sid; | |
970 | + b.onerror = function(){i3GEO.mapa.legendaHTML.atualiza();} | |
967 | 971 | } |
968 | 972 | }, |
969 | 973 | ativaFundo: function(id){ | ... | ... |
classesjs/classe_mapa.js
... | ... | @@ -256,7 +256,8 @@ i3GEO.mapa = { |
256 | 256 | */ |
257 | 257 | atualiza: function(){ |
258 | 258 | if(typeof(console) !== 'undefined'){console.info("i3GEO.mapa.legendaHTML.atualiza()");} |
259 | - var temp = function(retorno){ | |
259 | + var idleg, | |
260 | + temp = function(retorno){ | |
260 | 261 | var s,ins,elementos,i; |
261 | 262 | if(i3GEO.mapa.legendaHTML.ID !== "" && $i(i3GEO.mapa.legendaHTML.ID)){ |
262 | 263 | if ((retorno.data !== "erro") && (retorno.data !== undefined)){ |
... | ... | @@ -275,7 +276,13 @@ i3GEO.mapa = { |
275 | 276 | {elementos[i].style.display="none";} |
276 | 277 | } |
277 | 278 | }; |
278 | - if(i3GEO.mapa.legendaHTML.ID !== "" || $i("wlegenda")) | |
279 | + if(i3GEO.mapa.legendaHTML.ID !== ""){ | |
280 | + idleg = $i(i3GEO.mapa.legendaHTML.ID); | |
281 | + if(idleg && idleg.style.display === "block") | |
282 | + {i3GEO.mapa.legendaHTML.obtem(temp);} | |
283 | + } | |
284 | + idleg = $i("wlegenda"); | |
285 | + if (idleg && idleg.style.display === "block") | |
279 | 286 | {i3GEO.mapa.legendaHTML.obtem(temp);} |
280 | 287 | }, |
281 | 288 | /* | ... | ... |
classesphp/mapa_controle.php
... | ... | @@ -952,6 +952,28 @@ Liga e desliga temas no mapa atual. |
952 | 952 | $m->salva(); |
953 | 953 | break; |
954 | 954 | /* |
955 | +Valor: LIGATEMASBEACON | |
956 | + | |
957 | +Liga e desliga temas no mapa atual partindo de uma chamada via tag IMG | |
958 | + | |
959 | +Retorna um código de erro para indicar o fim do retorno. | |
960 | + | |
961 | +Veja no livro "Javascript de Alto Desempenho", de Nicholas C. Zakas pg. 162 | |
962 | + | |
963 | +<Mapa->ligaDesligaTemas> | |
964 | +*/ | |
965 | + case "LIGATEMASBEACON": | |
966 | + include_once("classe_mapa.php"); | |
967 | + copiaSeguranca($map_file); | |
968 | + $m = new Mapa($map_file,$locaplic); | |
969 | + $retorno = $m->ligaDesligaTemas($ligar,$desligar,$adicionar); | |
970 | + $m->salva(); | |
971 | + ob_start(); | |
972 | + header("HTTP/1.1 204 Not Content"); | |
973 | + header("Status: 204 Not Content"); | |
974 | + ob_end_flush(); | |
975 | + break; | |
976 | +/* | |
955 | 977 | Valor: ADTEMA |
956 | 978 | |
957 | 979 | Adiciona um novo tema ao mapa. | ... | ... |