Commit 08703c44a500e17cf9191cbc4be4386c4eb32d9d
1 parent
a8d80b38
Exists in
master
and in
7 other branches
-
Showing
3 changed files
with
27 additions
and
32 deletions
Show diff stats
classesjs/classe_eventos.js
@@ -529,16 +529,6 @@ i3GEO.eventos = | @@ -529,16 +529,6 @@ i3GEO.eventos = | ||
529 | docMapa.onmouseup = function(exy) { | 529 | docMapa.onmouseup = function(exy) { |
530 | i3GEO.eventos.mouseupMapa(exy); | 530 | i3GEO.eventos.mouseupMapa(exy); |
531 | }; | 531 | }; |
532 | - docMapa.ontouchend = function(exy) { | ||
533 | - if(i3GEO.Interface.ATUAL === "googlemaps"){ | ||
534 | - if (i3GEO.eventos.cliquePerm.status === true) { | ||
535 | - //exy = exy.latLng; | ||
536 | - alert(exy) | ||
537 | - i3GEO.eventos.mouseupMapa(exy); | ||
538 | - } | ||
539 | - i3GEO.eventos.cliquePerm.status = true; | ||
540 | - } | ||
541 | - }; | ||
542 | docMapa.ontouchmove = function(exy) { | 532 | docMapa.ontouchmove = function(exy) { |
543 | i3GEO.eventos.cliquePerm.status = false; | 533 | i3GEO.eventos.cliquePerm.status = false; |
544 | }; | 534 | }; |
classesjs/classe_interface.js
@@ -2826,6 +2826,9 @@ i3GEO.Interface = { | @@ -2826,6 +2826,9 @@ i3GEO.Interface = { | ||
2826 | } | 2826 | } |
2827 | }, | 2827 | }, |
2828 | registraEventos : function() { | 2828 | registraEventos : function() { |
2829 | + //essa variavel guarda a posicao do mapa na tela | ||
2830 | + //e usada em vercoes com dispositivo touche para melhorar a performance | ||
2831 | + i3GEOtouchesPosMapa = ""; | ||
2829 | var modoAtual = ""; | 2832 | var modoAtual = ""; |
2830 | google.maps.event.addListener( | 2833 | google.maps.event.addListener( |
2831 | i3GeoMap, | 2834 | i3GeoMap, |
@@ -2894,7 +2897,10 @@ i3GEO.Interface = { | @@ -2894,7 +2897,10 @@ i3GEO.Interface = { | ||
2894 | i3GeoMap, | 2897 | i3GeoMap, |
2895 | "mousemove", | 2898 | "mousemove", |
2896 | function(ponto) { | 2899 | function(ponto) { |
2897 | - var teladms, tela, pos = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA)); | 2900 | + if(i3GEOtouchesPosMapa === ""){ |
2901 | + i3GEOtouchesPosMapa = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA)); | ||
2902 | + } | ||
2903 | + var teladms, tela, pos = i3GEOtouchesPosMapa; | ||
2898 | if (modoAtual === "move") { | 2904 | if (modoAtual === "move") { |
2899 | return; | 2905 | return; |
2900 | } | 2906 | } |
@@ -2918,6 +2924,26 @@ i3GEO.Interface = { | @@ -2918,6 +2924,26 @@ i3GEO.Interface = { | ||
2918 | }; | 2924 | }; |
2919 | } | 2925 | } |
2920 | ); | 2926 | ); |
2927 | + //se touch | ||
2928 | + $i(i3GEO.Interface.IDMAPA).ontouchend = function(e) { | ||
2929 | + var pos, p, lonlat; | ||
2930 | + if (i3GEO.eventos.cliquePerm.status === true) { | ||
2931 | + //recalcula a posicao do clique | ||
2932 | + if(e.changedTouches){ | ||
2933 | + if(i3GEOtouchesPosMapa === ""){ | ||
2934 | + i3GEOtouchesPosMapa = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA)); | ||
2935 | + } | ||
2936 | + pos = i3GEOtouchesPosMapa; | ||
2937 | + p = new google.maps.Point(e.changedTouches[0].clientX - pos[0],e.changedTouches[0].clientY - pos[1]); | ||
2938 | + e = null; | ||
2939 | + } | ||
2940 | + lonlat = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p); | ||
2941 | + objposicaocursor.ddx = lonlat.lng(); | ||
2942 | + objposicaocursor.ddy = lonlat.lat(); | ||
2943 | + i3GEO.eventos.mouseupMapa(); | ||
2944 | + } | ||
2945 | + i3GEO.eventos.cliquePerm.status = true; | ||
2946 | + }; | ||
2921 | }, | 2947 | }, |
2922 | retornaIndiceLayer : function(nomeLayer) { | 2948 | retornaIndiceLayer : function(nomeLayer) { |
2923 | var i = false; | 2949 | var i = false; |
classesjs/classe_mapa.js
@@ -1501,27 +1501,6 @@ i3GEO.mapa = | @@ -1501,27 +1501,6 @@ i3GEO.mapa = | ||
1501 | var ntemas, etiquetas, j, retorna, targ = "", | 1501 | var ntemas, etiquetas, j, retorna, targ = "", |
1502 | x = objposicaocursor.ddx, y = objposicaocursor.ddy; | 1502 | x = objposicaocursor.ddx, y = objposicaocursor.ddy; |
1503 | 1503 | ||
1504 | - if (!e) { | ||
1505 | - e = window.event; | ||
1506 | - } | ||
1507 | - /* | ||
1508 | - try { | ||
1509 | - if (e.target) { | ||
1510 | - targ = e.target; | ||
1511 | - } else { | ||
1512 | - if (e.srcElement) { | ||
1513 | - targ = e.srcElement; | ||
1514 | - } | ||
1515 | - } | ||
1516 | - if (targ.parentNode) { | ||
1517 | - container = targ.parentNode.id; | ||
1518 | - } | ||
1519 | - | ||
1520 | - } catch (erro) { | ||
1521 | - targ = null; | ||
1522 | - } | ||
1523 | - */ | ||
1524 | - | ||
1525 | ntemas = i3GEO.arvoreDeCamadas.CAMADAS.length; | 1504 | ntemas = i3GEO.arvoreDeCamadas.CAMADAS.length; |
1526 | etiquetas = false; | 1505 | etiquetas = false; |
1527 | for (j = 0; j < ntemas; j += 1) { | 1506 | for (j = 0; j < ntemas; j += 1) { |