Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open native maps app from phonegap

Is there phonegap solution for opening the native maps app centred on a location or with a route displayed?

like image 384
juliusbangert Avatar asked Nov 29 '11 11:11

juliusbangert


2 Answers

I figured it out, just use window location and the device intercepts it...

$('#map').bind('tap', function(){
    var url = 'http://maps.google.com/maps?';
    url += 'q=[place_name]';
    url += '&near=';
    url += [lat];
    url += ',';
    url += [lon];
    url += '&z=15';
    // open the native maps app by calling window location
    window.location = url;
});
like image 91
juliusbangert Avatar answered Oct 08 '22 18:10

juliusbangert


To open iOS6 Maps app, use maps.apple.com domain.

See:

  • this question
  • Apple Schema URL Reference
like image 31
GiDo Avatar answered Oct 08 '22 19:10

GiDo