juliusbangert
juliusbangert

Reputation: 657

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?

Upvotes: 6

Views: 6359

Answers (2)

GiDo
GiDo

Reputation: 1340

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

See:

Upvotes: 1

juliusbangert
juliusbangert

Reputation: 657

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;
});

Upvotes: 8

Related Questions