Questions tagged [mkdirection]

The MKDirections class obtain directions and route information from within an iOS device.

The MKDirections class obtain directions and route information from within an iOS device.

26 questions
0
votes
0 answers

calculating estimated time of arrival and distance to arrival in objective C

I am getting the addresses, make them as string and using geocoding I get coordinates for each (latitude and longitude) and I need to calculate estimated arrival time and estimated distance to arrive and notify the user within a certain radius. I…
Man
  • 9
  • 4
0
votes
1 answer

How to handler an error of MKDirectionsRequest

I'm not very familiar with error handling and so any advice would be really appreciated. My code makes multiple calls recursively to the Apple API for calculating a route as it needs to calculate the distance for multiple options. do { …
Iona Ryder
  • 187
  • 3
  • 12
0
votes
2 answers

MKDirections : Directions Not Available

I am creating an app like an UBER and i am using MapKit ,i want to display route between two locations and for this i have use following code viewMap.delegate = self let sourceLocation = CLLocationCoordinate2D(latitude: sourceLatitude,…
Khushbu Desai
  • 1,003
  • 1
  • 10
  • 32
0
votes
2 answers

Swift Direction Request does not calculate in if statement correctly

I wanted to calculate distances from users current location to many different location and put these calculations into calculations array. So I can sort this array and find the closest location. At the end I want to show the closest location on the…
0
votes
0 answers

calculateDirectionsWithCompletionHandler not returning with error or response

I'm calling the calculateDirectionsWithCompletionHandler method from MKDirections, but the completion handler is never called. Not even with an error. And since the request is made in the main thread, the entire application gets stuck. I ensure that…
GGirotto
  • 848
  • 2
  • 10
  • 31
0
votes
1 answer

MKDirections calculateWithCompletionHandler

I'm attempting to make an MKDirections request inside of a function and then return that value. This is what I have so far func requestETA(userCLLocation: CLLocation, coordinate: CLLocationCoordinate2D) -> String { let request =…
S. Doe
  • 155
  • 1
  • 11
0
votes
1 answer

Xcode Directions coordinate in Swift

I have this code to get directions from a source point(userLocation) to a annotation(pin choosed from user).` func showRouteOnMap() { let request = MKDirectionsRequest() request.source = MKMapItem(placemark: MKPlacemark(coordinate:…
0
votes
1 answer

MapKit - transit type for MKDirectionsRequest() not Working

Now I'm doing somethig nice with Swift 3, I hope: Calculating a route between 2 places. I am using the Xcode simulator. I can calculate it by car, walking, or with transit. This is what I have: mapview.delegate = self let request =…
H.N.
  • 1,207
  • 2
  • 12
  • 28
-1
votes
1 answer

Determine distance on travelled path mkmapview swift

I have a functionality where user travels by his car from start to end location. I need to calculate the distance between the start and end locations on which the user has travelled. There may be multiple routes to the destination and I am getting…
Roshni
  • 153
  • 2
  • 14
-1
votes
1 answer

I want to create React Native App, but getting this error. What can I do?

Actual image here: https://drive.google.com/open?id=1avqikjxB6n2dnBNh9qZ0Yugk7kNki8wb Terminal output: Microsoft Windows [Version 10.0.18362.720] (c) 2019 Microsoft Corporation. All rights reserved. C:\Users\Khalid Babu\Desktop\ReactNative>npx…
-2
votes
1 answer

MKMapView delegate method are not getting called - Routes not being display on map

I would like to display the route from the one location to a second location. I have created some methods. The first one is to getDirection(), second is to createDirectionRequest and the rendererFor method. I am calling the getDirections method in…
Vangola
  • 128
  • 7
1
2