Questions tagged [cllocationdistance]

Part of the Core Location Data Types. This is a distance measurement (in meters) from an existing location.

77 questions
2
votes
1 answer

Walking route distance between two locations using mapkit

I am developing an iOS app where I need to get the walking route distance between two locations. I have used CoreLocation API - (CLLocationDistance)distanceFromLocation:(const CLLocation *)location As per the documentation This method measures…
Prasad Devadiga
  • 2,573
  • 20
  • 43
2
votes
2 answers

iOS 6 CLLocationManager last location

So, as of iOS 6, -locationManager:didUpdateToLocation:fromLocation: is deprecated. Apple suggests, instead, using -locationManager:didUpdateLocations:, which provides anywhere from one to a series of recent location changes. However, in the…
Patrick Perini
  • 22,555
  • 12
  • 59
  • 88
2
votes
2 answers

CLLocation `distanceFromLocation:` takes into account ellipsoid shape of the Earth

I can't seem to see it in the Docs description, but does anyone know if the above method takes into account the ellipsoid shape of Earth or is it based on a spherical shape? I assume it does, I just need to know for sure! Thanks in advance.
Adam Carter
  • 4,741
  • 5
  • 42
  • 103
1
vote
1 answer

SwiftUI CLLocationDistance returns a huge incorrect value

First, I am a very novice coder learning as I make my app, so the app is probably comprised of unnecessary and unconventional code. Apologies in advance. Because of my lack of coding knowledge I would like to fix this while making as few changes to…
jhbetts
  • 17
  • 5
1
vote
1 answer

MKMapKit true distance between two annotations

I want to make a application that calculates the distance between the user's current location and the nearest something (store, whatnot). Is there any way to obtain the real distance (following public roads ) instead of a direct distance (line from…
Toncean Cosmin
  • 535
  • 4
  • 19
1
vote
1 answer

How to query nearest users in Firebase with Swift?

I want to find nearest users to my location. (For example up to 5km) My nodes in firebase database like below structure, + users + user_id0 - latitude: _ - longitude: _ Is there any way getting exact users in that radius. Otherwise I…
iamburak
  • 3,508
  • 4
  • 34
  • 65
1
vote
0 answers

Swift / CoreLocation : North heading from didUpdateLocation

Is it the way to get heading from inside the didUpdateLocation method ? I am grapple with task which is about sending the data about user location to container class called Ping. The Ping class have to contain basics user location as well as with…
yerpy
  • 1,366
  • 3
  • 17
  • 44
1
vote
1 answer

Notify when the user moved every 50/100 meters iOS

Hi i want to call the webservice whenever there is a location change of 50 meters(not less than this). I have tried using significant changes but it works for minimum 500 meters and startupdatelocations will call all the time. So How can i detect if…
Cintu
  • 913
  • 2
  • 16
  • 32
1
vote
1 answer

Calculate new coordinate with given coordinate and distance in meters

I have a coordinate and a CoreData database with entries which have latitude and longitude values. I want to find all objects within a given square region and therefore would like to know the top-left and bottom-right corner points with a distance…
Jeehut
  • 20,202
  • 8
  • 59
  • 80
1
vote
0 answers

How come my array of CLLocation instances is empty?

I'm currently trying to construct a way that calculates the the distance in feet between my current location and other hard coded locations. I will eventually display these distances as strings in a table view. These are the steps that I'm…
Joe H
  • 13
  • 1
  • 7
1
vote
1 answer

Filter out bad locations from CLLocationManager

I find that often while using CLLocationManager: self.locationManager = [[CLLocationManager alloc] init]; self.locationManager.delegate = self; self.locationManager.desiredAccuracy = kCLLocationAccuracyBest; self.locationManager.distanceFilter =…
soleil
  • 12,133
  • 33
  • 112
  • 183
1
vote
2 answers

Giving the different distance between two points using wifi and 3G

I am calculating the distance between two locations like below CLLocation *locA = [[CLLocation alloc] initWithLatitude:lat longitude:lon]; CLLocationCoordinate2D coordinate = [self getLocation]; CLLocation…
venkat
  • 345
  • 8
  • 21
1
vote
1 answer

How to determine if a User moved the map MKMapView by certain percentage?

I want to determine if a User moved the map by a certain percentage (lets say 20%). How may I achieve this? The movement can be in any direction.
ilight
  • 1,622
  • 2
  • 22
  • 44
1
vote
1 answer

Calculate distance from array of coordinates

Currently I can calculate the distance between two coordinates which are NSStrings. I am now trying to calculate a list of coordinates which are in a NSMutableArray but I'm stuck. I somehow need to calculate the distance between all loc or is there…
1
vote
2 answers

Initial starting location won't always start at ZERO

When I first start location updating the value will not be 0 always. Sometimes it is but sometimes I get values slightly above 0. I will get a value such as 2. So of coarse I hit the stop and start again then ill get a smaller value and continue…