Questions tagged [location]

Location is a specific position in physical space, e.g. a point on the surface of the Earth described using latitude and longitude coordinates. This tag should NOT be used for questions related to the position of a virtual element e.g. position of a pixel on a bitmap or position of a layout element on UI (use [position] tag in that cases).

The term location is used to identify a point or an area in physical space, such as on the Earths surface or within a room.

A relative location is a description of position relative to another known site — for example, "2 miles north of London".

An absolute location is designated using a specific pairing of latitude and longitude in a Cartesian coordinate grid — for example, a Spherical coordinate system or an ellipsoid-based system such as the World Geodetic System—or similar methods.

The term location generally implies a relatively high degree of certainty of position.

9647 questions
40
votes
11 answers

Find city name and country from latitude and longitude in Swift

I'm working on application in Swift3 and I have letter problem i can't find the answer for it. How can I know city name and country short names base on latitude and longitude? import UIKit import CoreLocation class ViewController:…
joshua
  • 947
  • 2
  • 8
  • 14
38
votes
3 answers

Android 11 users can’t grant background location permission?

As of Android 11, apps targeting SDK 30+ will not show a user an option to grant background location permission to an app more than once. If not initially granted, it requires users to go to a settings page. How do we bring a user to the proper…
davidgyoung
  • 63,876
  • 14
  • 121
  • 204
38
votes
2 answers

LocationRequest constructor is marked as internal

I'm trying to set up location updates in my Android app using com.google.android.gms:play-services-location:12.0.0, but I'm getting the following error: LocationRequest constructor is marked as internal and should not be accessed from apps My…
Duncan Lukkenaer
  • 12,050
  • 13
  • 64
  • 97
38
votes
1 answer

Using Google Play Services LocationClient in background service

My app is designed to track user's location periodically and send it to server, Recently I changed my code with Google play services Location API. I created the locationclient and connected to the service in onStartCommand public int…
Thiyaga B
  • 971
  • 1
  • 9
  • 26
37
votes
4 answers

How to get the base path in jQuery?

window.locationworks fine, but returns me the whole, absolute path, like http://domain.xyz/punch/lines. But I only need http://domain.xyz/. How can I extract only that first part? And how can I make that dynamic, I mean to be always the same even…
leymannx
  • 5,138
  • 5
  • 45
  • 48
36
votes
5 answers

Google Play Service location API returns wrong location sometimes

We have an app which captures user's location using Google Play Service Location API for each transactions like Geotag land, upon placing an order etc. After capturing these locations from mobile we'll sync it to server and show it in web…
35
votes
6 answers

How to group latitude/longitude points that are 'close' to each other?

I have a database of user submitted latitude/longitude points and am trying to group 'close' points together. 'Close' is relative, but for now it seems to ~500 feet. At first it seemed I could just group by rows that have the same latitude/longitude…
Tim Lytle
  • 17,549
  • 10
  • 60
  • 91
35
votes
3 answers

Change Location Mode to High Accuracy Programmatically Android

Is it possible to get the information on the location mode which the user has selected among the three modes under the location settings options i.e 1.Hight Accuracy 2.Battery Saving 3.GPS Only I want to programmatically check if user has selected…
ik024
  • 3,566
  • 7
  • 38
  • 61
35
votes
6 answers

How to get Android GPS location

Cheers, I'm trying to get the current GPS-Location via Android. I followed this Tutorial and Vogellas article aswell. Though it ain't working. When using LocationManager.NETWORK_PROVIDER I'm always getting a latitude of 51 and longitude of 9 - no…
Sebastian
  • 1,593
  • 4
  • 26
  • 41
34
votes
3 answers

How to find your current location with CoreLocation

I need to find my current location with CoreLocation, I tried multiple methods but so far my CLLocationManager has only returned 0's.. (0.000.00.000). Here's my code (updated to work): Imports: #import…
Aleksander Azizi
  • 9,829
  • 9
  • 59
  • 87
34
votes
9 answers

Fastest way to detect external URLs

What's the fastest method to detect if foo='http://john.doe' is an external url (in comparsion to window.location.href)?
mate64
  • 9,876
  • 17
  • 64
  • 96
34
votes
8 answers

Get location android Kotlin

I recently added get location function. When I try to show longitude and latitude, it returns zero. This my LocationListener class: inner class MylocationListener: LocationListener { constructor():super(){ mylocation= Location("me") …
Nour Medhat
  • 567
  • 4
  • 9
  • 15
33
votes
3 answers

How to simulate driving a route in real device

I have a locations based app and I want to test it without real moving. I know I can provide a kml file of points but I don't want to use emulator, but real device. could you tell me what is the best way to simulate driving a route on the device? I…
dvrm
  • 3,749
  • 4
  • 34
  • 43
33
votes
11 answers

Can't find the class com.google.android.gms.location.LocationClient (android)

I have download a demo project from http://developer.android.com/training/location/retrieve-current.html, and I think I don't lost any steps; But I can't find which jar file contain the “com.google.android.gms.location.LocationClient.class” file We…
Jerry Sun
  • 331
  • 1
  • 3
  • 3
32
votes
3 answers

Decoding the CLLocationAccuracy const's

the following are listed in CLLocation.h but from my experience they are deceiving names- possibly originally thought up to serve two purposes, 1. to test the accuracy of the location returned, but also 2. to set how hard the location manager works,…
dave
  • 883
  • 3
  • 11
  • 13