geolocation

How does a browser get GPS data from a computer?

[亡魂溺海] 提交于 2019-12-01 03:30:50
问题 This question was migrated from Super User because it can be answered on Stack Overflow. Migrated 8 years ago . HTML5 browser can retrive the gps position of a computer. http://diveintohtml5.ep.io/geolocation.html I would like to create an application that fakes a GPS device, but I couldn't read anywhere how the browser gets GPS data from the computer. 回答1: Chrome and Firefox: GPS via gpsd if available (Linux only) 1, 2 system's Location API (Windows 7 only) 2 WiFi networks via Google

Google Maps API Geocode Synchronously

陌路散爱 提交于 2019-12-01 03:07:38
I was wondering if its possible to geocode something using googlemaps api synchronously so instead of waiting for a callback function to be called, it would wait for a value to be returned. Has anyone found a way to do something like this. P.S.: I'm using version 3 of the api The Geocoder calls your callback function with the value. That's the only way to do it. If it were synchronous, your script would freeze while it waited for the Geocode to process. There really isn't any reason to do it like that. What exactly are you trying to accomplish? Yes, what you are trying to achieve is possible,

Safari Localhost Permission Blocked

房东的猫 提交于 2019-12-01 02:07:52
So ran into this issue today, where I have a website that needs the geolocation of the user. It was working fine when running locally on localhost, but now I get an error saying "Access to geolocation was blocked over insecure connection to http://localhost:4200 ". WTF Apple? I also tried 127.0.0.1 but got the same result. Am I missing something in the dev settings or did Apple just break everything? Safari Version: 9.1.3 (11601.7.8) Maybe it's possible to use https ( How to get angular-cli to ng serve over HTTPS ) and if not is possible directly for some reason maybe you can use a transparent

Geolocation error with IP address 127.0.0.1

狂风中的少年 提交于 2019-12-01 01:49:55
OK, so I tried implementing this, http://ipaddressextensions.codeplex.com/ . It is displaying the output as:- 127.0.0.1 RESERVED ZZ What on earth is this "RESERVED" and "ZZ"? It should be displayed as "INDIA IN". The IP address is of the local host. All right, but what about the country name and country code? Why won't they display correctly? What do I need to change in my code? loxxy When you are testing from home, both server and user are one (your PC). So you can't expect it to show the country as the IP address for IIS is a self address. Your code seems to be fine. Also you can use a free

Scrape User Location from Twitter

╄→гoц情女王★ 提交于 2019-12-01 01:40:25
问题 I am trying to scrape latitude and longitude of user from Twitter with respect to user names. The user name list is a csv file with more than 50 names in one input file. The below are two trials that I have made by far. Neither of them seems to be working. Corrections in any one of the program or an entirely new approach is welcome. I have list of User_names and I am trying to lookup user profile and pull the geolocation from the profile or timeline. I could not find much of samples anywhere

Cordova Geolocation plugin returning empty position object on Android

拥有回忆 提交于 2019-12-01 01:31:19
问题 I've had quite some issues with the Geolocation Cordova plugin (org.apache.cordova.geolocation). It works fine on iOS, but it doesn't at all on Android. As I understand, the plugin used to include native Android code, but this was removed at some point, because it was too buggy/slow and the native web HTML5 implementation was much more stable and fast. If I use the latest plugin version (0.3.2) which still has the native code, it does work (but slow and indeed, not always). But when it does

Google geolocation using cell tower info- Curl 400 Bad request PHP

这一生的挚爱 提交于 2019-12-01 01:30:16
I'm trying to get latitude and longitude from cell tower info using Google's geolocation api . It requires a valid JSON with information like MCC, MNC, cellId, lac etc.., My PHP post request looks like this. <?php header("Access-Control-Allow-Origin: *"); $mcc = $_POST["mcc"]; $mnc = $_POST["mnc"]; $cellId = $_POST["cellId"]; $lac = $_POST["lac"]; $post_array = array( "cellId" => (int) $cellId, "locationAreaCode" => (int) $lac, "mobileCountryCode" => (int) $mcc, "mobileNetworkCode" => (int) $mnc, ); $post_data = json_encode(array('cellTowers' => array($post_array))); echo $post_data; $url =

Catch Geolocation Error - Async Await

牧云@^-^@ 提交于 2019-12-01 01:30:00
问题 How can I catch the geolocation specific error to notify the user that they must have geolocation turned on? The catch logs an error called PositionError as referenced here in the Mozilla docs "https://developer.mozilla.org/en-US/docs/Web/API/PositionError". *Note: my code does not catch the error, it simply displays: Uncaught (in promise) ReferenceError: PositionError is not defined Code getCurrentLocation() { return new Promise((resolve, reject) => { navigator.geolocation.getCurrentPosition

Android: How to: plot a real world latitude and longitude coordinates to still image with different angle?

为君一笑 提交于 2019-12-01 00:39:39
I have already the conversion of latitude and longitude coordinates (current) to pixel coordinates. Then I also successfully plotted the current into still image. But the problem is the still image angle is not proportionate to real world map. Here's the lat & long to pixel convertsion (Thanks to @Dan S , answered here mark a given lat long into still image ): public final static BigDecimal PI = BigDecimal.valueOf(Math.PI); public final static double OneEightyDeg = 180.0d; public final static double ImageSize = 512d; public double getCurrentPixelY(Location upperLeft, Location lowerRight,

Google/Yahoo alternatives to geocoding? [closed]

孤人 提交于 2019-12-01 00:14:45
Does anyone know of a good and accurate alternative web API for geocoding an address that is not Google or Yahoo? I want to input an address/city/state/zip and have it return to me the latitude and longitude. Ideally, I would involve it via a simple HTTP GET, e.g. http://example.com/?location=123 Main St, New York, NY and it would return JSON or XML with the latitude or longitude information. Geocoder.us is nice, and it is free (or cheap, depending on how you use it) NAVTEQ Geocoder can be your option. You may want to explorer mobile options too: http://developer.android.com Check this for