【问题标题】:Directions from Source to Destinations via WayPoints using cordova plugin add cordova-plugin-googlemaps使用cordova插件通过WayPoints从源到目的地的路线添加cordova-plugin-googlemaps
【发布时间】:2016-05-05 10:49:47
【问题描述】:

我对如何通过航路点查找从源到目的地的路线感到震惊,而无需在设备中打开外部 Google 地图应用程序。在我的应用程序中,我使用了 this plugin

从这个插件中,我使用了这个 sn-p,但它渲染到设备中的谷歌地图应用程序。但我需要在同一个应用程序中执行此操作而不渲染到外部

var yourLocation = null;
map.getMyLocation(function(location) {
yourLocation = location.latLng;

map.addMarker({
"position": yourLocation,
"title": "I am around here!"
}, function(marker) {
marker.showInfoWindow();
});

map.moveCamera({
"target": yourLocation,
"zoom": 12
});
});

map.on(plugin.google.maps.event.MAP_CLICK, function(latLng) {
map.addMarker({
"position": latLng,
"title": "Destination"
 }, function(marker) {
marker.showInfoWindow();

setTimeout(function() {

  if (confirm("Do you want to go?")) {
    plugin.google.maps.external.launchNavigation({
      "from": yourLocation,
      "to": latLng
    });
  }
 }, 2000);
});
});

【问题讨论】:

    标签: android cordova google-maps ionic-framework cordova-plugins


    【解决方案1】:

    您在项目中使用的是哪个版本的 cordova?

    也许:

    此插件与 Cordova-iOS 4.0.0 不兼容。不支持 WKWebView。它们在 API 中发生了巨大的变化,由于时间紧迫,没有 ETA 何时兼容此插件。欢迎 PR!

    【讨论】:

      猜你喜欢
      • 2018-08-04
      • 2017-10-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-06-26
      • 1970-01-01
      • 2018-03-02
      • 2019-01-15
      相关资源
      最近更新 更多