geolocation

How to get the exact local time of client?

£可爱£侵袭症+ 提交于 2019-12-17 07:27:22
问题 What is the best method to get the clients local time irrespective of the time zone of clients system? I am creating an application and i need to first of all get the exact time and date of the place from where the client is accessing. Even detecting the ip address of client system has a drawback or detecting the time zone of client system may be risky at times. So, is there any way out which could be really reliable and not vulnerable to error because displaying wrong time and date to client

MongoDB Stored Procedure Equivalent

折月煮酒 提交于 2019-12-17 07:15:08
问题 I have a large CSV file containing a list of stores, in which one of the field is ZipCode. I have a separate MongoDB database called ZipCodes, which stores the latitude and longitude for any given zip code. In SQL Server, I would execute a stored procedure called InsertStore which would do a look up on the ZipCodes table to get corresponding latitude and longitude and insert the data into the Stores table. Is there something similar to the concept of stored procedures in MongoDB for this?

How to get the formatted address from a dragged marker in Google Version Maps

走远了吗. 提交于 2019-12-17 06:09:13
问题 I have made a Google map that lets you input an address into a text field. It then navigates you to the address that you entered into the text field and leaves a draggable marker that when dragged shows you the Lat and Long and The Geolocated Address. I instead of displaying the above address, would like when you drag the marker to display in the bottom corner the Address of the Marker and the not the inputted address from the text field. I have tried a number of methods to no avail. lonlat[0

How to detect country / location of visitor? [duplicate]

混江龙づ霸主 提交于 2019-12-17 05:50:33
问题 This question already has answers here : Closed 9 years ago . Possible Duplicate: Location detecting techniques for IP addresses For our website it's important to know from exactly which country our visitor is coming from. I guess the best answer for my question would be the simple geo location feature of current browser systems, which just ask the user if the website is allowed to see his geographic location: http://dev.w3.org/geo/api/spec-source.html but I don't want to bother visitor with

FusedLocationApi.getLastLocation always null

笑着哭i 提交于 2019-12-17 03:35:10
问题 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 = new GoogleApiClient.Builder( MainSearchActivity.this ) .addConnectionCallbacks(new GoogleApiClient.ConnectionCallbacks() { @Override public void onConnected( Bundle bundle ){ Location location = LocationServices.FusedLocationApi.getLastLocation(mGoogleApiClient); if( location == null ){

Best way to get geo-location in Java

若如初见. 提交于 2019-12-17 03:16:58
问题 What is the best way to get geo-location in Java (freely if possible)? Update: Not from a GPS device. Basically how Firefox 3.5 / HTML 5 does it 回答1: An easy way is with GeoLite (http://dev.maxmind.com/geoip/legacy/geolite/). Because it uses a local database no web service calls are needed and it's much faster for geocoding large numbers of IPs. Here is how: Add this Maven artifact: <dependency> <groupId>com.maxmind.geoip</groupId> <artifactId>geoip-api</artifactId> <version>1.2.11</version>

Get altitude by longitude and latitude in Android

梦想的初衷 提交于 2019-12-17 02:07:31
问题 Is there a quick and efficient way to get altitude (elevation) by longitude and latitude on the Android platform? 回答1: elevation app screen http://img509.imageshack.us/img509/4848/elevationc.jpg My approach is to use USGS Elevation Query Web Service: private double getAltitude(Double longitude, Double latitude) { double result = Double.NaN; HttpClient httpClient = new DefaultHttpClient(); HttpContext localContext = new BasicHttpContext(); String url = "http://gisdata.usgs.gov/" +

Get city name using geolocation

女生的网名这么多〃 提交于 2019-12-16 22:34:09
问题 I managed to get the user's latitude and longitude using HTML-based geolocation. //Check if browser supports W3C Geolocation API if (navigator.geolocation) { navigator.geolocation.getCurrentPosition(successFunction, errorFunction); } //Get latitude and longitude; function successFunction(position) { var lat = position.coords.latitude; var long = position.coords.longitude; } I want to display the city name, it seems the only way to get it is to use a reverse geolocation API. I read Google's

Getting map location Python

*爱你&永不变心* 提交于 2019-12-14 04:26:35
问题 Is there any way to get the computer geolocation (as in Google Maps "My Location") from a Python script? The computer would always be connected to the Internet. 回答1: >>> import re,requests >>> raw = requests.get('http://www.geoiptool.com/').text >>> latlon = re.search("GPoint\(([^)]+)\)",raw).groups(0) >>> lat,lon = map(float,latlon[0].split(",")) >>> print "Latitude:%s Longitude:%s"%(lat,lon) Latitude:-117.2455 Longitude:46.7322 a couple of caveats ... This probably is not the best method

ionic.bundle.js:25642 Error: [$injector:unpr] Unknown provider: $cordovaGeolocationProvider <- $cordovaGeolocation <- AgeCtrl

六眼飞鱼酱① 提交于 2019-12-14 04:26:00
问题 I am currently in the starting phase of building an app via Ionic. Right now i want to implement the cordova geolocation in it. However this keeps giving an error when opening it. For testing purposes i use ionic serve and check it in localhost. angular.module('starter', ['ionic','ionic.service.core', 'ui.router']) .controller('AgeCtrl', function ($scope, $state, $http, $cordovaGeolocation) { $scope.toggleItem = function (item) { item.checked = !item.checked; }; $scope.items = [ { id: '0-12'