打开 Google 外部地图 (PhoneGap)

Open Google Map externally (PhoneGap)

我正在使用 PhoneGap 来创建一个 Android 应用程序。但是,我遇到了一个问题。我想通过我的应用程序打开 Google 地图(应用程序),但是该应用程序在 href 上没有响应。

我正在 Google Play 商店中使用 PhoneGap 应用程序来调试我的应用程序 -> https://play.google.com/store/apps/details?id=com.adobe.phonegap.app&hl=nl

代码:

<a href="geo:38.897096,-77.036545">open map</a>

你的 href 不对,试试这个

<a href="https://www.google.com/maps/@-38.897096,-77.036545,8z,">open map</a>

确保您允许将要启动的外部应用程序添加到 config.xml 中的白名单。 <allow-intent href="geo:*" />。使用 geo: 的替代方法是使用 InAppBrowser 插件。 cordova.InAppBrowser.open('https://www.google.com/maps/@-38.897096,-77.036545,8z,', '_system', 'location=yes');

function openMap(may_latitude, may_longitude) {

    if (device.platform === 'iOS') {
        window.open("http://maps.apple.com/?q=" + may_latitude + ","
                + may_longitude, '_system');
    } else {

        window.open("http://maps.google.com/?q=" + may_latitude + ","
                + may_longitude, '_system');
    }
}