geolocation

get current latitude and longitude from gps enabled device

笑着哭i 提交于 2019-11-28 20:54:16
I would like to get the latitude and longitude of current location from gps enabled mobile device right from the web browser. May I know is this possible? how to do it? does it require geolocation api? Some coding example would be helpful. Thanks. Marko Use the HTML5 Geolocation API, here's the official spec and examples . EDIT I've updated my answer to include current browser support. W3C Geolocation API support Firefox 3.5+ Safari 5.0+ Chrome 5.0+ Opera iPhone 3.0+ Android 2.0+ · · Other phones not listed above use Gears or their own, platform-specific APIs. W3C geolocation API Gears

Fetch Latitude Longitude by passing postcodes to maps.google.com using Javascript

落爺英雄遲暮 提交于 2019-11-28 20:51:10
I have Postcode in my large database, which contains values like SL5 9JH, LU1 3TQ etc. Now when I am pasting above postcode to maps.google.com it's pointing to a perfect location.. My requirement is like I want to pass post codes to maps.google.com and it should return a related latitude and longitude of that pointed location, that I want to store in my database. So, most probably there should be some javascript for that... If anybody have another idea regarding that please provide it.. Thanks in advance... Daniel Vassallo The technical term for the process you describe is called reverse

How to get country code and currency code by IP-address?

那年仲夏 提交于 2019-11-28 20:48:56
I am new in zend Framework. And i want to get currency code, country code by the ip-address. Can i have any example url?. Please Help me... Thanks in advance. You can use my service, the http://ipinfo.io API to get the country code: function get_country($ip) { return file_get_contents("http://ipinfo.io/{$ip}/country"); } echo get_country("8.8.8.8"); // => US If you're interested in other details you could make a more generic function: function ip_details($ip) { $json = file_get_contents("http://ipinfo.io/{$ip}"); $details = json_decode($json); return $details; } $details = ip_details("8.8.8.8"

getting users geolocation via html5 and javascript

可紊 提交于 2019-11-28 20:43:25
I am trying to get the users geolocation via the html5 geolcation api, and i use the following snippet for it: if (navigator.geolocation) { var timeoutVal = 10 * 1000 * 1000; navigator.geolocation.getCurrentPosition( displayPosition, displayError, { enableHighAccuracy: true, timeout: timeoutVal, maximumAge: 0 } ); } else { // DO SOME STUFF HERE } function displayPosition(position) { // configuration var myZoom = 12; var myMarkerIsDraggable = true; var myCoordsLenght = 6; var defaultLat = position.coords.latitude; var defaultLng = position.coords.longitude; document.getElementById('latitude')

Location search autocomplete that integrates with bing/google geocoding

会有一股神秘感。 提交于 2019-11-28 20:41:25
问题 Any nice suggestions on auto complete location searches, that integrate with something like Google or Bings location data? I am wanting capture the location of my users on sign up, currently I have a free text input box. I am wanting to have some sort of auto complete that guides the user to inputting more sanitised information, ideally I would like to geo-code the user too. I'm currently using the jQuery autocomplete for the autosearch, but this requires me to provide the location data,

Website that recognizes user's location/IP & changes lang. based on that

做~自己de王妃 提交于 2019-11-28 19:52:51
title is pretty clear. My websites consists of both English-written and Spanish-written versions. You can go to the main site, which is in Spanish, by clicking http://www.chrishonn.com and to the translated version, which is in English, at http://en.chrishonn.com . At the index of each page there is a link (at the bottom) which allow the user to pass from one site to the other. However, I was wondering, how do big sites like Google, Yahoo!, and other brands' websites to recognize the user's geographical location/IP so that - depending on that - the site's language is adapted ( i.e. you are

Google App Engine Geohashing

ぃ、小莉子 提交于 2019-11-28 19:42:21
I am writing a web application using GWT and App Engine. My application will need to post and query items based on their latitude, longitude. As a result of google's distributed database design you can't simple query a set of inequalities. Instead they suggest doing geohashing. The method is described on this page. http://code.google.com/appengine/articles/geosearch.html Essentially you pre compute a bounding box so that you can query items that have been tagged with that bounding box. There is one part of the process that I don't understand. What does the "slice" attribute mean? Thanks for

How to Sort Geo-points according to the distance from current location in Android

一世执手 提交于 2019-11-28 19:02:05
I have a "Place" object with a LatLng coordinate for each: import com.google.android.gms.maps.model.LatLng; public class Place{ public String name; public LatLng latlng; public Restaurant(String name, LatLng latlng) { this.name = name; this.latlng = latlng; } } and I have an ArrayList of these Places, something like this: ArrayList<Place> places = new ArrayList<Place>(); places.add("Place 1", LatLng(90.0,90.0)); places.add("Place 2", LatLng(93.0,93.0)); places.add("Place 3", LatLng(83.0,92.0)); places.add("Place 4", LatLng(93.0,91.0)); and I have "my" LatLng: LatLng myLocation = new LatLng(10

Geolocation feedback while accepting the request

混江龙づ霸主 提交于 2019-11-28 18:58:57
the geolocation implementation is quite good and got few steps to observe but only on thing is missing, i guess. Im not able to see if the user accepted the request or not ( before i get the position object ), i dunno if the user just ignores my request ( during my timeout ) or if the request just get lost ( and the failure callback doesnt get called for no reason ). It would be useful to set a timestamp when the user accepts the request, i couldnt find anything which gives me that kind of response. Based on my new understanding of what you are after, you want something like this. (Tested: in

When do I need android.hardware.location.gps and android.hardware.location.network?

核能气质少年 提交于 2019-11-28 18:51:27
问题 Google is informing by email of changes to the Android location permissions: We’re making a change on October 15th, 2016 that will affect apps targeting API version 21 (Android 5.0, Lollipop) or higher that use ACCESS_FINE_LOCATION but don't explicitly have the "android.hardware.location.gps" uses-feature. Going forward, these apps will be available to install on devices that don't have GPS hardware. In most cases this won't be an issue since Wi-Fi and Cell-ID based location provides high