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).
location
9,637
questions
1517
votes
23
answers
1.3m
views
Where does npm install packages?
Can someone tell me where can I find the Node.js modules, which I installed using npm?
859
votes
28
answers
366k
views
What is the simplest and most robust way to get the user's current location on Android?
The LocationManager API on Android seems like it's a bit of a pain to use for an application that only needs an occasional and rough approximation of the user's location.
The app I'm working on isn't ...
767
votes
22
answers
1.1m
views
How do I get the current GPS location programmatically in Android?
I need to get my current location using GPS programmatically.
How can i achieve it?
623
votes
26
answers
286k
views
Location Services not working in iOS 8
My app that worked fine on iOS 7 doesn't work with the iOS 8 SDK.
CLLocationManager doesn't return a location, and I don't see my app under Settings -> Location Services either. I did a ...
505
votes
7
answers
302k
views
location.host vs location.hostname and cross-browser compatibility?
Which one of these is the most effective vs checking if the user agent is accessing via the correct domain.
We would like to show a small js based 'top bar' style warning if they are accessing the ...
359
votes
8
answers
1.8m
views
window.location.href and window.open () methods in JavaScript
What is the difference between window.location.href and window.open () methods in JavaScript?
327
votes
3
answers
412k
views
What's the difference between window.location= and window.location.replace()?
Is there a difference between these two lines?
var url = "http://www.google.com/";
window.location = url;
window.location.replace(url);
281
votes
25
answers
308k
views
How to check if Location Services are enabled?
I'm developing an app on Android OS. I don't know how to check if Location Services are enabled or not.
I need a method that returns "true" if they are enabled and "false" if not (so in the last case ...
263
votes
22
answers
502k
views
How to get complete address from latitude and longitude?
I want to get following values from Latitude and Longitude in android
Street Address
City / State
Zip
Complete Address
How to achieve this?
243
votes
16
answers
223k
views
Fastest Way to Find Distance Between Two Lat/Long Points
I currently have just under a million locations in a mysql database all with longitude and latitude information.
I am trying to find the distance between one point and many other points via a query. ...
238
votes
16
answers
349k
views
Get User's Current Location / Coordinates
How can I store the user's current location and also show the location on a map?
I am able to show pre-defined coordinates on a map, I just don't know how to receive information from the device.
...
218
votes
29
answers
393k
views
Nginx serves .php files as downloads, instead of executing them
I am installing a website in a droplet (Digital Ocean). I have an issue for install NGINX with PHP properly. I did a tutorial https://www.digitalocean.com/community/tutorials/how-to-install-linux-...
185
votes
23
answers
209k
views
How do I get the full path to a Perl script that is executing?
I have Perl script and need to determine the full path and filename of the script during execution. I discovered that depending on how you call the script $0 varies and sometimes contains the fullpath+...
181
votes
3
answers
157k
views
window.location.href vs window.location.replace vs window.location.assign in JavaScript
What is the difference between
window.location.href="http://example.com";
window.location.replace("http://example.com");
window.location.assign("http://example.com");
I read in many forums that ...
163
votes
4
answers
105k
views
Making a Location object in Android with latitude and longitude values
I have a program in which latitude and longitude values of a location are stored in a database, which I download.
I want to get the distance between these coordinates, and my current location.
The ...
162
votes
10
answers
153k
views
Python + Django page redirect
How do I accomplish a simple redirect (e.g. cflocation in ColdFusion, or header(location:http://) for PHP) in Django?
154
votes
21
answers
268k
views
How to mock location on device?
How can I mock my location on a physical device (Nexus One)?
I know you can do this with the emulator in the Emulator Control panel, but this doesn't work for a physical device.
141
votes
13
answers
109k
views
Turn on location services without navigating to settings page
Against the traditional approach of prompting user to go to the settings page and enable location services and come back again, I have noticed a simpler way of doing the same in some of the latest ...
140
votes
3
answers
152k
views
Android Location Providers - GPS or Network Provider?
In my application I would like to determine the user's current location. I do however have a couple of questions in this regard:
There are different Location Providers, which one is the most accurate?...
112
votes
11
answers
116k
views
Check if location services are enabled
I've been doing some research about CoreLocation. Recently, I encountered a problem that has been covered elsewhere, but in Objective C, and for iOS 8.
I feel kinda silly asking this, but how can you ...
105
votes
10
answers
96k
views
javascript window location href without hash?
I have:
var uri = window.location.href;
That provides http://example.com/something#hash
What's the best and easiest way to get the entire path without the #hash?
uri = http://example.com/...
105
votes
6
answers
86k
views
How is location accuracy measured in Android?
Does anyone know the proper interpretation of the accuracy measurements returned by getAccuracy()? For instance, are they calculated as:
Circular Error Probability (meaning, if i understand correctly,...
98
votes
10
answers
121k
views
Algorithm to find all Latitude Longitude locations within a certain distance from a given Lat Lng location
Given a database of places with Latitude + Longitude locations, such as 40.8120390, -73.4889650, how would I find all locations within a given distance of a specific location?
It doesn't seem very ...
93
votes
9
answers
95k
views
getLastKnownLocation returns null
I've read some questions about this, but I didn't quite find an answer that I needed.
So, the case is that I have my map set up, and I want to grab my current gps location.
I have checked that my ...
92
votes
4
answers
250k
views
Where are include files stored - Ubuntu Linux, GCC
So, when we do the following:
#include <stdio.h>
versus
#include "myFile.h"
the compiler, GCC in my case, knows where that stdio.h (and even the object file) are located on my hard drive. ...
90
votes
9
answers
23k
views
window.location versus just location
Across the web, I see a vast number of JavaScript programmers writing window.location instead of just location. I was curious if anyone could offer an explanation as to why. window is the global ...
87
votes
4
answers
49k
views
Difference between LocationRequest setInterval (long millis) and LocationRequest setFastestInterval (long millis)
I am writing my own background location updates for interval of every 5 minutes in android. I would like to know the difference between setInterval and setFastestInterval
When I setInterval to 5 ...
86
votes
8
answers
160k
views
Calculating distance between two geographic locations
please shed some light on this situation
Right now i have two array having latitude and longitude of nearby places and also have the user location latiude and longiude now i want to calculate the ...
86
votes
6
answers
157k
views
Redirect using AngularJS
I'm trying to redirect to another route using:
$location.path("/route");
But for some reason it is not working. I did an auto-complete widget using jQuery-UI and I'm calling a function from the ...
86
votes
7
answers
190k
views
jquery: change the URL address without redirecting? [duplicate]
Possible Duplicate:
Modify Address Bar URL in AJAX App to Match Current State
How can I change the URL address without redirecting the page?
For instance, when I click on this link below:
<a ...
84
votes
13
answers
96k
views
FusedLocationApi.getLastLocation always null
I'd like to simply retrieve device location in my Android project and in order to do so I use the play-services approach:
protected synchronized void buildGoogleApiClient() {
mGoogleApiClient ...
82
votes
15
answers
1.1m
views
PHP header(Location: ...): Force URL change in address bar
I'm currently working on a mobile site with authentication using PHP sessions with a database.
I have a login page with a form that goes to server_login.php on submit. The php file then creates some ...
81
votes
10
answers
140k
views
Android Google Maps API V2 Zoom to Current Location
I'm trying to mess around with the Maps API V2 to get more familiar with it, and I'm trying to start the map centered at the user's current location. Using the map.setMyLocationEnabled(true); ...
77
votes
17
answers
53k
views
Test if links are external with jQuery / javascript?
How do I test to see if links are external or internal? Please note:
I cannot hard code the local domain.
I cannot test for "http". I could just as easily be linking to my own site with an http ...
76
votes
5
answers
79k
views
Indoor Positioning System based on Gyroscope and Accelerometer
I am developing an Android App to track indoor position. My phone is an Google Nexus S using two sensors, the first being an Accelerometer and the second being a Gyroscope.
My idea is that from a ...
75
votes
11
answers
97k
views
How can I change a project's location pointer in Eclipse?
A project has moved to a different location, so Eclipse won't open the project. You'll immediately think about simply changing the pointer to the location, but in Eclipse they try to make this ...
75
votes
7
answers
155k
views
Get GPS location via a service in Android
I need to monitor user's locations using a background service, and then load them and show the path to the user.
Using an activity, it was quite easy to get GPS locations, but when I got to do it via ...
73
votes
11
answers
141k
views
Calculate compass bearing / heading to location in Android
I want to display an arrow at my location on a google map view that displays my direction relative to a destination location (instead of north).
a) I have calculated north using the sensor values ...
68
votes
7
answers
46k
views
iPhone - Backgrounding to poll for events
For quite a while I'd been looking into a way in my iPhone app to poll every X minutes to check the data counters. After much reading of the Background Execution documentation and a few trial apps I'd ...
66
votes
13
answers
90k
views
LocationClient getLastLocation() return null
Like the questions someone encountered before
I tested one the nexus s(4.0.4 with google play service available) and avd (4.2.2 with google api), in both case locationclient's getLastLocation() always ...
64
votes
8
answers
67k
views
How to set the location of WPF window to the bottom right corner of desktop?
I want to show my window on top of the TaskBar's clock when the windows starts.
How can I find the bottom right corner location of my desktop?
I use this code that works well in windows forms app ...
64
votes
8
answers
127k
views
Android: How to get accurate altitude?
I need to get an accurate measurement of altitude using GPS only.
I tried Location.getAltitude(), but that is terribly inaccurate.
Any advice?
64
votes
3
answers
68k
views
Difference between document.URL and location.href
I know that document.URL can not be set, while location.href can.
But the Document indicates:
URL is a replacement for the DOM Level 0 location.href property.
So when would we use document.URL?
60
votes
1
answer
64k
views
Getting The Location Of A Control Relative To The Entire Screen?
Let's say I have a Control and its location is relative to its parent. If its embedded many times and is the great great great grandchild of the main form, how can I determine what its location is on ...
60
votes
8
answers
87k
views
get the current location fast and once in android
I have an android application that need device current location (latitude and longitude). I've tried some tutorial on the net and specially some solutions from stack overflow, but they doesn't work ...
58
votes
5
answers
93k
views
NSLocationWhenInUseUsageDescription warning, but I have already added it
While I have already added:
NSLocationWhenInUseUsageDescription
I keep receiving this warning:
This app has attempted to access privacy-sensitive data without a usage description. The app's Info....
57
votes
6
answers
26k
views
Why I have to call 'exit' after redirection through header('Location..') in PHP?
You know that if you want to redirect a user in PHP you can use the header function:
header('Location: http://smowhere.com');
It is also well known that it is a good practice to put also an exit; ...
57
votes
8
answers
83k
views
How can I get the country (or its ISO code)? [duplicate]
What is the best way to get the country code?
As of now, I know two ways. One is to get by TelephonyManager and another by Locale. Which is another best and unique way to find the country code on ...
53
votes
2
answers
89k
views
Time zone issue involving date fns format()
const dt = new Date('2017-12-12');
console.log(format(dt, 'YYYY-MM-DD'));
The above code logs 2017-12-11 in the US, but 2017-12-12 in India.
I followed this github thread here and tried out things ...
52
votes
3
answers
97k
views
jQuery x y document coordinates of DOM object
I need to get the X,Y coordinates (relative to the document's top/left) for a DOM element. I can't locate any plugins or jQuery property or method that can give these to me. I can get the top and ...