PDA

View Full Version : Link launching Google Map App not working on Android



aron.duby
5 Jan 2011, 4:58 PM
I have a table that has a listener, and when it's clicked I'd like it to open the Google Map Application, unfortunately it just opens up the mobile web version. The page I'm trying this on is http://client.grcmc.org/wip/grtagtour/m/AD21004 and click on the far right icon with the 2 x's with a dotted line between them. Here's the listener code:


// add the data to the template
this.bonus_tpl.overwrite(this.body.child('div'), data);

// add the listeners
Ext.get(Ext.DomQuery.select('table.bonus_stop')).addListener('click', function(evt, el, o){
location.href = Ext.get(el).up('table.bonus_stop').down('.file').getHTML();
});At first I thought it was the phone not picking up on the fact that it should open in the app, but then I added the same url to the text on the page (Google Maps) and it opens the app as is it should.

Then I thought maybe it's a javascript issue, so then I made http://client.grcmc.org/wip/grtagtour/m/test.php with the top link using location.href through an onclick function and the bottom being a regular link to the same url. Both of them work as expected.

So the only link that doesn't launch the app is in the ext listener. Any ideas on how to get this to work?

aron.duby
6 Jan 2011, 10:26 AM
I found a nasty hack that accomplishes what I wanted. In the tpl I can wrap the table with an anchor tag with the proper link, and remove the listener and it works. It's horrible, and it makes my skin crawl, but it's a band-aid for now. I'd still like to find out why using the listener method doesn't work.

I took my hack out of the linked page for now since it's still in development in case anyone wants to attempt this one.