Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Android and click events on map

  1. #1
    Ext User xnakxx's Avatar
    Join Date
    Sep 2010
    Location
    Central Valley Ca
    Posts
    84

    Default Android and click events on map

    has anybody else ran into the situation where a "click" event bound to a marker will not fire for Android based phones.

    Code:
    google.maps.event.addListener(marker, 'click', function() {
    alert("tapped");
    
    }
    I'm not sure if this is Sencha specific but thought somebody here would have some input.
    would one of the touch[start | end] events be better suited?

  2. #2
    Sencha User
    Join Date
    Jul 2008
    Location
    Montreal
    Posts
    1

    Default

    I have the exact same problem. No event fired when clicking on marker. This only happens when accessing through the Android WebView component though. If I launch the browser on the same phone, I can click markers.

    Quote Originally Posted by xnakxx View Post
    has anybody else ran into the situation where a "click" event bound to a marker will not fire for Android based phones.

    Code:
    google.maps.event.addListener(marker, 'click', function() {
    alert("tapped");
    
    }
    I'm not sure if this is Sencha specific but thought somebody here would have some input.
    would one of the touch[start | end] events be better suited?

  3. #3
    Ext User xnakxx's Avatar
    Join Date
    Sep 2010
    Location
    Central Valley Ca
    Posts
    84

    Default

    intresting.
    i am using the browser and having the problem.
    what version / Phone are you using?

  4. #4

    Default

    I'm having the exact same problem. Clicks on the map work for iPhone/iPad but not for Android devices.

  5. #5

    Default

    Anybody have a solution or workaround for this? Sencha devs - any ideas?

  6. #6

    Exclamation I'm having this same problem.

    Just chiming in so I can keep apprised of any solution. It only happens on Android for me. iPhone and iPad versions of my app work fine.

  7. #7

    Default Maps not working with Sencha

    I am facing the same problem

  8. #8

    Default

    I was having a similar issue with clicks on the map itself (outside of markers/info windows) on both Android and iOS devices. Not sure if the cause is the same, but I was able to get my click event handlers to fire properly with a small hack:

    Code:
    Ext.gesture.Manager.onMouseEvent = function(e) {
        if (!e.isSimulated)
            e.stopPropagation();
    }
    The current (sencha-touch-1.0.1a) implementation of this onMouseEvent method both stops propagation and prevents default for non-"simulated" click events (when Ext.supports.Touch). If both the preventDefault and stopPropagation are removed then some event handlers get fired twice. If only the preventDefault is removed, however, I haven't noticed any adverse side effects, and handlers registered as listeners for click events on the map get fired as expected on mobile devices.

    Maybe a Sencha dev could offer a better suggestion (or an explanation of why this isn't a good idea, if it's not), but this worked for me.

    Thanks,

    Bo

  9. #9

  10. #10
    Sencha User psenough's Avatar
    Join Date
    Apr 2011
    Location
    Finland
    Posts
    24

    Default

    was having same problem using v1.1.0 on an android.
    this fix made it work for me.
    would be nice it this was integrated into the library package itself, or the map example atleast.
    Last edited by psenough; 9 Jun 2011 at 8:04 AM. Reason: map example is not in kitchen sink :p

Page 1 of 2 12 LastLast

Similar Threads

  1. [FIXED-207] Ext.Map: wrapped map unavailable in afterRender
    By cnelissen in forum Sencha Touch 1.x: Bugs
    Replies: 2
    Last Post: 8 Sep 2010, 7:05 PM
  2. Multitouch gestures on Android and the map
    By Trevor.S in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 9 Aug 2010, 7:42 AM
  3. Ext.Map/Google Maps marker and android
    By apw in forum Sencha Touch 1.x: Discussion
    Replies: 2
    Last Post: 26 Jun 2010, 5:11 AM
  4. Replies: 2
    Last Post: 23 Aug 2007, 8:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •