Multi request for distance via MKDirections

323 Views Asked by At

I'm coding an application that it use MapKit features. When I make request with for loop to get directions for many locations using MapKit's MKDirections , it gives error as "Directions is not available " with following details :

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 ??
 

1

There are 1 best solutions below

0
On

I've recognized that 2 arguments must be taken into account to avoid this type of error. Firstly, Apple Map Server doesn't give permission more than one location's request in 60 seconds, so you have to check 2 consecutive location request time. Second, maximum request number is set to 50 for Apple Map Server as it's written in error definition. So , you have to limit your "for loop" with 50 loops. I could not find any argument why this limitation requires.

with this 2 approaches , the problem has gone.