geolocation

How to get the marked speed limit of a road, out of longitude and latitude [closed]

ε祈祈猫儿з 提交于 2019-11-27 05:38:23
问题 I know that is not a technical question, but I don't know where else to ask. Is there a way to get the marked speed limit of a road from google or bing maps? or any other web service? 回答1: You cannot obtain this information from Bing Maps or Google Maps. Nor am I aware of any other webservices that provide this information (certainly not any free ones). Open Street Map (http://osm.org) has the ability for ways to be recorded with the maxspeed tag. You could download the OSM planet dataset and

function fail never called if user declines to share geolocation in firefox

蓝咒 提交于 2019-11-27 05:34:58
问题 So I have this javascript code. In safari and chrome, if user declines to share location, it goes to fail function as it should; however, in Firefox, it does not. Any helps appreciated. function initGeolocation() { if( navigator.geolocation ) { // Call getCurrentPosition with success and failure callbacks navigator.geolocation.getCurrentPosition( success, fail ); } else { alert("Sorry, your browser does not support geolocation services."); } } var map; function success(position) { var

unable to cope with the asynchronous nature of navigator.geolocation

て烟熏妆下的殇ゞ 提交于 2019-11-27 04:55:53
I'm using the navigator.geolocation.getCurrentPosition(function) api in firefox 3.6. When i try to call this method repeatedly I see that sometimes it works and sometimes it doesn't. I figured that the problem is because of its asynchronous callback nature. I can see that the callback function is being called at some point but my outer function is already exiting so i cannot catch the values of the position coordinates. I'm pretty new to javascript so i'm assuming other javascript coders might have already figured out how to deal with it. Please help. Edit: here's a sample piece of code i'm

How to pass JavaScript values to JSF EL and backing bean?

↘锁芯ラ 提交于 2019-11-27 04:47:00
问题 I am doing JSF geolocation service where I need to pass latitude and longitude to bean for processing. HTML5 allows getting location with JavaScript, for example like is done in http://code.google.com/p/geo-location-javascript/. Putting following code to JSF page shows alert with GPS coordinates <script> if (geo_position_js.init()) { geo_position_js.getCurrentPosition(success_callback,error_callback,{enableHighAccuracy:true,options:5000}); } else { alert("Functionality not available"); }

Getting 0.0 for latitude and longitude while showing current location in map

无人久伴 提交于 2019-11-27 04:46:34
问题 I am using the following code to get my current location. But the problem I am facing is, it always returns 0.0 for latitude and longitude. I have turned on the GPS settings in the phone and set all the permissions. But still I am facing this. locationManager = (LocationManager)getSystemService(Context.LOCATION_SERVICE); customLocationListener = new CustomLocationListener(); locationManager.requestLocationUpdates( LocationManager.GPS_PROVIDER, 0, 0, customLocationListener); class

How do I enable geolocation support in chromedriver?

眉间皱痕 提交于 2019-11-27 04:39:57
I need to test a JS geolocation functionality with Selenium and I am using chromedriver to run the test on the latest Chrome. The problem is now that Chrome prompts me to enable Geolocation during the test and that I don't know how to click that little bar on runtime, so I am desperately looking for a way to start the chromedriver and chrome with some option or trigger to enable this by default. All I could find here was however how I can disable geolocation altogether. How can I solve this issue? In the known issues section of the chromedriver wiki they said that you Cannot specify a custom

How to get the exact local time of client?

这一生的挚爱 提交于 2019-11-27 04:28:48
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 is something very embarassing. Madara Uchiha In JavaScript? Just instantiate a new Date object var now

Quicker way to calculate geographic distance between two points

拈花ヽ惹草 提交于 2019-11-27 04:25:56
问题 I borrowed the following method from somewhere on the internet (Can't remember where). But its doing a straight forward process, finding the distance between two gps points. It works just fine, except that it may be a little slow, as I'm running it across millions of points. I was wondering if anyone knows an approach that would be computationally less expensive. The accuracy needs to be in the general area of 'correct' but doesn't need to be 100% accurate. private double distFrom(double lat1

Country name for GPS coordinates

微笑、不失礼 提交于 2019-11-27 04:23:48
问题 Is there an easy way to get the name of the country on whose territory a given point is located? I don't care too much about accuracy nor about ambiguities given by political disputes. Just need a good enough approximation. 回答1: EDIT: The Yahoo Where API is no longer available. Try the Yahoo! APIs. Latitude and Longitude Latitude and longitude can be specified for the location parameter. Latitude and longitude may be expressed as decimal degrees or degrees-minutes-seconds, with either leading

Android get location or prompt to enable location service if disabled

狂风中的少年 提交于 2019-11-27 04:18:05
问题 I've found bits and pieces of this answer scattered through other posts, but I wanted to record it here for others. How can I simply request the user's GPS and/or Network location and, if they haven't enabled the service, prompt them to do so? 回答1: If you want to capture the location on a button push, here's how you'd do it. If the user does not have a location service enabled, this will send them to the settings menu to enable it. First, you must add the permission "android.permission.ACCESS