【问题标题】:Multi request for distance via MKDirections通过 MKDirections 多次请求距离
【发布时间】:2022-08-06 19:59:11
【问题描述】:

我正在编写一个使用 MapKit 功能的应用程序。当我使用 for 循环请求使用 MapKit 的 MKDirections 获取许多位置的方向时,它会给出错误,因为“方向不可用”,并带有以下详细信息:

Error Domain=MKErrorDomain Code=3 \"Directions Not Available\" UserInfo={NSLocalizedFailureReason=Route information is not available at this moment., MKErrorGEOError=-3, MKErrorGEOErrorUserInfo={
details =     (
            {
        intervalType = short;
        maxRequests = 50;
        \"throttler.keyPath\" = \"app:lszlp.nobetciEczane/0x20200/short(default/any)\";
        timeUntilReset = 54;
        windowSize = 60;
    }
);
timeUntilReset = 54; ```

what is the possible causes ??
 

    标签: time mapkit distance mkdirection


    【解决方案1】:

    我已经认识到必须考虑 2 个参数以避免此类错误。 首先,Apple Map Server 在 60 秒内不允许超过一个位置的请求,因此您必须检查 2 个连续的位置请求时间。 其次,Apple Map Server 的最大请求数设置为 50,因为它是在错误定义中写入的。因此,您必须将“for 循环”限制为 50 个循环。我找不到任何论据为什么需要这种限制。

    有了这两种方法,问题就解决了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多