【问题标题】:Google Places API - status: "REQUEST_DENIED" on mobileGoogle Places API - 状态:移动设备上的“REQUEST_DENIED”
【发布时间】:2017-04-14 00:38:35
【问题描述】:

我正在使用距离矩阵服务来获取两点之间的步行时间。它在桌面上运行良好,但在我的移动设备上,我从回调中获得了 REQUEST_DENIED 状态。关于如何让它在移动设备上运行的任何想法?

function calculateDistance(origin, destination) {
  var service = new google.maps.DistanceMatrixService();
  service.getDistanceMatrix(
  {
    origins: [origin],
    destinations: [destination],
    travelMode: google.maps.TravelMode.WALKING,
    unitSystem: google.maps.UnitSystem.METRIC,
    avoidHighways: false,
    avoidTolls: false
  }, callback);
}

【问题讨论】:

  • 你能分享一个重现这个的样本吗?
  • 您能否确认您的项目中启用了距离矩阵 API 网络服务?

标签: google-maps google-maps-api-3 google-places-api google-distancematrix-api


【解决方案1】:

您需要在项目的info.plist 文件中添加<key>NSExceptionAllowsInsecureHTTPLoads</key>

【讨论】:

    猜你喜欢
    • 2013-07-15
    • 2012-02-22
    • 1970-01-01
    • 2013-10-10
    • 1970-01-01
    • 2012-08-29
    • 2012-01-15
    • 2012-05-10
    • 2013-09-12
    相关资源
    最近更新 更多