Commit d0adb5b164999b62e606aabca3ca8b2004d1ce26
1 parent
72ef9de8
Exists in
master
and in
7 other branches
-
Showing
1 changed file
with
17 additions
and
10 deletions
Show diff stats
classesjs/classe_interface.js
... | ... | @@ -2927,20 +2927,27 @@ i3GEO.Interface = { |
2927 | 2927 | ); |
2928 | 2928 | //se touch |
2929 | 2929 | $i(i3GEO.Interface.IDMAPA).ontouchend = function(e) { |
2930 | + e.preventDefault(); | |
2930 | 2931 | var pos, p, lonlat; |
2931 | 2932 | if (i3GEO.eventos.cliquePerm.status === true) { |
2932 | 2933 | //recalcula a posicao do clique |
2933 | - if(i3GEOtouchesPosMapa === ""){ | |
2934 | - i3GEOtouchesPosMapa = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA)); | |
2934 | + try{ | |
2935 | + if(i3GEOtouchesPosMapa === ""){ | |
2936 | + i3GEOtouchesPosMapa = i3GEO.util.pegaPosicaoObjeto($i(i3GEO.Interface.IDMAPA)); | |
2937 | + } | |
2938 | + pos = i3GEOtouchesPosMapa; | |
2939 | + p = new google.maps.Point(e.changedTouches[0].clientX - pos[0],e.changedTouches[0].clientY - pos[1]); | |
2940 | + e = null; | |
2941 | + lonlat = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p); | |
2942 | + if(lonlat){ | |
2943 | + objposicaocursor.ddx = lonlat.lng(); | |
2944 | + objposicaocursor.ddy = lonlat.lat(); | |
2945 | + i3GEO.eventos.mouseupMapa(); | |
2946 | + } | |
2947 | + } | |
2948 | + catch(erro){ | |
2949 | + i3GEO.eventos.cliquePerm.status = true; | |
2935 | 2950 | } |
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 | - lonlat = i3GeoMapOverlay.getProjection().fromContainerPixelToLatLng(p); | |
2940 | - alert(lonlat.lng()) | |
2941 | - objposicaocursor.ddx = lonlat.lng(); | |
2942 | - objposicaocursor.ddy = lonlat.lat(); | |
2943 | - i3GEO.eventos.mouseupMapa(); | |
2944 | 2951 | } |
2945 | 2952 | i3GEO.eventos.cliquePerm.status = true; |
2946 | 2953 | }; | ... | ... |