Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Ext User
    Join Date
    Dec 2010
    Posts
    9
    Vote Rating
    0
    wbwb is on a distinguished road

      0  

    Default [OPEN-642] map on 1.0.1 not responding to click events on iPhone, Android

    [OPEN-642] map on 1.0.1 not responding to click events on iPhone, Android


    in sencha touch 1.0 the map worked fine on iPhone for click events, which I do using

    var l = google.maps.event.addListener(worldMap.map, "click", function(event) { alert('foo');
    ...

    but in 1.0.1 the function is not being called. did something break it?

    click event doesn't trigger on: iPhone 3GS, T-mobile G2 Android 2.2
    click event triggers on: Chrome v8 on laptop

  2. #2
    Sencha - Training Team mrsunshine's Avatar
    Join Date
    Sep 2008
    Location
    Germany - Darmstadt
    Posts
    690
    Vote Rating
    12
    mrsunshine will become famous soon enough

      0  

    Default


    did you tried the "tap" event instead? on mobile browsers you have no mouse which can fire a click event. But tap event will interpret as click on desktop browsers

  3. #3
    Ext User
    Join Date
    Dec 2010
    Posts
    9
    Vote Rating
    0
    wbwb is on a distinguished road

      0  

    Default


    Thanks for the response mrsunshine. I just tried tap, and it doesn't work in any mobile browser and it doesn't work on the desktop either. I think this has to do to the google map event handlers -- I think there is only click and not tap

  4. #4
    Sencha - Training Team mrsunshine's Avatar
    Join Date
    Sep 2008
    Location
    Germany - Darmstadt
    Posts
    690
    Vote Rating
    12
    mrsunshine will become famous soon enough

      0  

    Default


    you're right i add a listener to the markers in my application

    PHP Code:
    google.maps.event.addListener(
                
    marker,
                
    'click',
                function() {
                    
    infoWindow.open(mapmarker);
                }
            ); 
    works for the marker

  5. #5
    Sencha - Sencha Touch Dev Team Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Vote Rating
    14
    Jacky Nguyen has a spectacular aura about Jacky Nguyen has a spectacular aura about

      0  

    Default


    Click event binding of google maps API does not work properly with Sencha Touch's Event Manager currently. You can do this instead:

    Code:
    Ext.setup({
        onReady: function(){
            new Ext.Panel({
                fullscreen: true,
                items     : [{
                    xtype: 'map',
                    useCurrentLocation: true,
                    listeners: {
                        el: {
                            click: function() {
                                alert('click');
                            }
                        }
                    }
                }]
            });
        }
    });
    Sencha Touch Lead Architect

  6. #6
    Ext User
    Join Date
    Dec 2010
    Posts
    9
    Vote Rating
    0
    wbwb is on a distinguished road

      0  

    Default


    thanks for the quick response Jacky

    I really appreciate the work you guys are doing

    I'm crossing my fingers this will be fixed in 1.0.2. This is a blocking issue for us -- the map is not that only thing that needs to accept events; we have markers and circles as well

    I'd be happy to help test pre-releases as well if needed

  7. #7
    Sencha - Sencha Touch Dev Team Jacky Nguyen's Avatar
    Join Date
    Jul 2009
    Location
    Palo Alto, California
    Posts
    469
    Vote Rating
    14
    Jacky Nguyen has a spectacular aura about Jacky Nguyen has a spectacular aura about

      0  

    Default


    Can you confirm currently markers can't get click event as well?
    Sencha Touch Lead Architect

  8. #8
    Ext User
    Join Date
    Dec 2010
    Posts
    9
    Vote Rating
    0
    wbwb is on a distinguished road

      0  

    Default


    Sorry, I was mistaken -- clicking on markers does work in Sencha Touch 1.0.1. Only map clicks don't work. I will use your workaround until this is fixed. Thanks!

  9. #9
    Ext User
    Join Date
    Dec 2010
    Posts
    9
    Vote Rating
    0
    wbwb is on a distinguished road

      0  

    Default


    By the way, I just want to note that the workaround is okay for capturing clicks but doesn't capture the lat/long coordinates clicked, which is essential to doing map interactions.

  10. #10
    Sencha User
    Join Date
    Jun 2010
    Posts
    66
    Vote Rating
    0
    dontbugme is on a distinguished road

      0  

    Default


    Does anyone know a workaround for this?

    My app depends on the user clicking on the map to select a location, and then using that location to call an API.

    This bug renders my app useless on both the iPhone and Android. I am considering forgoing Sencha Touch just because of this. The ease of making UI from Sencha Touch is great, but if our app doesn't work, we really have no choice. It would be a great Christmas present if someone could tell me some way I can still get the clicked long/lat from the map.

Similar Threads

  1. Android and click events on map
    By xnakxx in forum Sencha Touch 1.x: Discussion
    Replies: 12
    Last Post: 29 Aug 2011, 8:12 AM
  2. Replies: 4
    Last Post: 3 Dec 2010, 5:43 AM
  3. Default Android and iPhone click/tap styles?
    By djkraz in forum Sencha Touch 1.x: Discussion
    Replies: 1
    Last Post: 21 Sep 2010, 6:47 AM
  4. Click events and href in Android
    By wprater in forum Sencha Touch 1.x: Discussion
    Replies: 3
    Last Post: 17 Sep 2010, 9:34 AM

Thread Participants: 17