geolocation

How to call function when user Allows or Denies access to “Physical Location”?

蹲街弑〆低调 提交于 2019-11-28 11:21:09
My application is powered by jquery mobile and uses geolocation. After my application attempts to get the user's location, the (Chrome) browser prompts the user: Example.com wants to track your physical location [allow] [deny] My goal is: If the user clicks "Allow", function 1 is called (location is used by app). If the user clicks "Deny", function 2 is called (address form appears). How can I bind a function to the event that occurs (if any) when the user clicks the "Allow" or "Deny" button? The getCurrentPosition function accepts two function arguments. Heck, the first is executed when you

Calculating distance (pythagoras) and running count in sql query

我们两清 提交于 2019-11-28 11:01:46
问题 I am trying to build a rather complicated query in SQL, and being a beginner i would immensely appreciate some help to build it. I am trying to achieve the following: 1/ Calculate the distance between a postcode in the target_postcodes table - say E1 1AA - and all the postcodes in the the population_postcodes table using Cartesian latitude and longitude coordinates using Pythagoras: SQRT( POW(MY_Y_AXIS - Y_AXIS, 2) + POW(MY_X_AXIS-X_AXIS, 2) ) 2/ Create a new column with those distance values

Network location provider not giving location android

a 夏天 提交于 2019-11-28 10:38:24
I am developing a small android application in which I want to find out the user's current location by using the network provider. I tried this in following ways but it's not giving me any output : networklocationManager = (LocationManager) this .getSystemService(Context.LOCATION_SERVICE); // Define a listener that responds to location updates LocationListener networklocationListener = new LocationListener() { public void onLocationChanged(Location location) { Log.i("********************************", "this is my network location " + location); String Location_text = "NETWORK LOCATION latitude

How do I get geolocation in openweather API

南楼画角 提交于 2019-11-28 10:20:28
问题 How do I get mu openweather API to work with geolocation? This is my current html code: <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css"> <link rel="stylesheet" href="main.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type='text/javascript' src='app.js'></script> </head> <body> <div class="jumbotron"> <button onclick="getLocation()">Get my location.<

Parsing Google Geo API (Reverse Geocoding) with jQuery

与世无争的帅哥 提交于 2019-11-28 10:08:06
问题 I'm sure I'm not the only one, but I cannot parse/return anything when jQuery takes a request to lookup an address when the data being requested is the latitude and longitude so Google can return the data, but it cannot be read by jQuery? http://maps.googleapis.com/maps/api/geocode/json With parameters: latlng=51.276914,1.077252 &sensor=false In Firebug it says 200 OK but nothing is displayed in the response: I can see it when I open it: http://maps.googleapis.com/maps/api/geocode/json?latlng

In new chrome (44.0.2403.157) geolocations doesnt works

泄露秘密 提交于 2019-11-28 10:06:57
Its seems like in new chrome version on MacOs on Linux Mint and on Windows geolocations doesnt works! Its returns error: "ERROR(2): Network location provider at ' https://www.googleapis.com/ ' : Returned error code 403." Does anyone has same problem? Must be a bug in the latest version of Chrome, also happens in the page of Google Maps API: https://developers.google.com/maps/documentation/javascript/examples/map-geolocation Hopefully it will be fixed fast. Edited: Try now, it works :) Apparently this API has been forbidden access from insecure locations see here I filed a bug ticket here:

onLocationChanged is not called automatically

一个人想着一个人 提交于 2019-11-28 10:02:44
I have a problem with onLocationChanged event in Android. Here's the triggering: case R.id.start: { Points.add(overlay.getMyLocation()); // Points' type is ArrayList<GeoPoint> mgr.requestLocationUpdates(best, 0, 3, locationListener); } break; And here's the onLocationChanged method: public void onLocationChanged(Location location) { i++; Points.add(overlay.getMyLocation()); MapOverlay mapOverlay = new MapOverlay(Points.get(i-1), Points.get(i)); map.getOverlays().add(mapOverlay); //does the drawing mMapController.animateTo(Points.get(i)); } So, onLocationChanged is called only once and only

Exactly how accurate is IP Geolocation?

人盡茶涼 提交于 2019-11-28 09:46:19
I'm setting up a iPhone tracking system for my friends, so they can submit their location to my website by their iPhone, anywhere, anytime - by WiFi or cellular data. The website will use Google Maps for their coordination's so that my other friends can track where they are, however, it is the accuracy of the IP to coordinates to Google Maps is what I'm concerned about, exactly how accurate is it to use Google Maps that would track down the locations by an IP address? I was thinking about 95%, but this was tested in a village which was quite fairly accurate, but what happens if it was in a

Wait until a condition is true?

﹥>﹥吖頭↗ 提交于 2019-11-28 09:41:57
I'm using navigator.geolocation.watchPosition in JavaScript, and I want a way to deal with the possibility that the user might submit a form relying on location before watchPosition has found its location. Ideally the user would see a 'Waiting for location' message periodically until the location was obtained, then the form would submit. However, I'm not sure how to implement this in JavaScript given its lack of a wait function. Current code: var current_latlng = null; function gpsSuccess(pos){ //console.log('gpsSuccess'); if (pos.coords) { lat = pos.coords.latitude; lng = pos.coords.longitude

Is there a way of detecting whether a user has already given permission to use navigator.geolocation?

£可爱£侵袭症+ 提交于 2019-11-28 09:06:13
Apart from setting a cookie the first time round, is there a way of detecting whether a user has already given permission for navigator.geolocation to return the lat/long of the browser? If there is, what is it and is it the same across all browsers or different across all browsers? This subject has been partially answered elsewhere According to GeoLocation API – Chrome / Safari – Permission management and Visual Differences , Chrome asks for a revokable one-time permission. I haven't finished reading the article, but it would seem that storage of permissions is not a purely-Chrome thing to do