geolocation

Getting user location on Facebook page tab

∥☆過路亽.° 提交于 2019-12-04 15:13:57
Coca-Cola seems to have nailed it pretty well. Even before any user interaction, they manage to know where you are at their Facebook page : This works in IE, so no HTML5 involved (and after all, Facebook won't recognize the navigator object in Javascript). How do they do this? First of all, I don't think it can be done using javascript. Here's how you can do it using a server side language, like PHP. If you take a closer look of the page you provided (coca cola landing tab) you can see that selection of the country works even if the user is not logged in with facebook. When you set up a

Network location provider at 'https://www.googleapis.com/' : Returned error code 403 in Webapp

旧时模样 提交于 2019-12-04 15:01:09
问题 I am using Geolocation.watchPosition() and I get the following error on callback Network location provider at 'https://www.googleapis.com/' : Returned error code 403. This seems to be only happening in chrome desktop browser. firefox seems to be fine. This is also just started happening today, I have never come across this error before within my web app using the Geolocation.watchPosition() . Update: bug https://bugs.chromium.org/p/chromium/issues/detail?id=753242 回答1: This happened to me too

Django : is GeoDjango a Good Fit for my Website?

谁都会走 提交于 2019-12-04 14:55:10
问题 I'm building a real estate site in Django and have a Home model, which stores various information including the address. Database backend is using MySQL. Want to create a Yelp like search. A search where users can enter in zip code or city name, then get Home results in that area. Users can also choose the radius(5 mi, 10 mi...) from the point and get more/less results. Search results will be on google map and users can zoom in/out to get new search results within the map. Is Geo Django a

Geospatial Indexing with Redis & Sinatra for a Facebook App

匆匆过客 提交于 2019-12-04 14:50:17
I'm rebuilding Lovers on Facebook with Sinatra & Redis, and I want: Set operations for managing requests & relationships between users Geospatial indexing to display nearby app users Current Redis Implementation Each user has two Redis ordered sets ( reqSent & reqRecv ) that store uids. The SCORE that we order the requests by is the time (UNIX timestamp) the request was made. I am using ordered sets instead of lists because a user may only make The request type (rid) is encoded as a number and prepended to the uid. (rid|uid) E.g., for the user with uid=100, we might have: 100:reqSent => ["1

Find all nearby customers within a given distance using longitude and latitude

大兔子大兔子 提交于 2019-12-04 14:41:38
I have a db contain customers longitude and latitude, I have a search form in which the user will enter log/lat and distance dropdown contain 50miles, 100miles,.... and when the user click search I want to write a linq query to get all customers from the db which are in this distance radius. How to make this using C# and linq? Update: I found this https://stackoverflow.com/a/1654365/20126 but this gives a square not radius Fung A little modification of my answer to a similar question : // radius is the distance in meters var center = new GeoCoordinate(latitude, longitude); var result =

How or where does foursquare gets its geodata from?

故事扮演 提交于 2019-12-04 14:35:12
问题 I've been trying to answer this myself but I can't find it, would any of you know? 回答1: Truth is they probably scraped it from someone else initially. See Yelp, Maps (Gmail,Yahoo,Bing,etc), Citysearch, etc. Yahoo has some flexible GeoData APIs. Some of the above also have APIs (including FourSquare) which would make this easier, but is most likely against their terms of service (TOS). Please post back if you find out otherwise, or a viable solution. 回答2: Users generate/add the locations 来源:

Retrieving Keys From GeoFire within Radius in Swift

不问归期 提交于 2019-12-04 14:29:10
I have the following Firebase Database JSON data structure: { "Post List" : { "-KUlvg8mCEGfY5ZSKCou" : { "addedByUser" : "7llQbPdy2NV7aO337h7ap0qLOhC3", "content" : "Post1", "cost" : "$450", "duration" : "Daily", "latitude" : "25.0879721592719", "longitude" : "55.1487715855458", "number" : "01234567890", "timestamp" : "Posted on: Sun 23 Oct" } }, "Post Locations" : { "-KUlvg8mCEGfY5ZSKCou" : { ".priority" : "thrnwznh58", "g" : "thrnwznh58", "l" : [ 25.0879721592719, 55.1487715855458 ] } }, "User Locations" : { "7llQbPdy2NV7aO337h7ap0qLOhC3" : { ".priority" : "thrnwypqu9", "g" : "thrnwypqu9",

Swift: Geofencing / geolocations near user location

一世执手 提交于 2019-12-04 14:14:46
Problem: I'm trying to make it so that it uses the user's location all the time and constantly checks to see if it is within 5 miles of the CLLocationCoordinate2D points I have set. If so, it sends a alert if the app is open or a notification if the app is closed. Useful Information: In my project I have 4 swift files: Locations.swift holds the CLLocationCoordinate2D points. Utilities.swift holds a simple alert. UserLocation.swift retrieves and updates the user's location GeoLocationViewController.swift monitors the locations Note: Some code may not be in the right place or relevant, I was

How do I calculate distance between GPS co-ordinates on a processor with poor floating point support?

允我心安 提交于 2019-12-04 14:14:37
I need to calculate the distance between GPS co-ordinates to calculate distance traveled. I've tried both the Haversine and Vincenty algorithms, which work fine on my desktop PC, but when I port the code to the dsPIC, they return 0 for points that are close (within several meters) due to a lack of floating point precision and poor implementations of sin and cos. For my use case, my points will be no more than 10 meters apart and will all fall within 10km of each other. I've tried the following algorithm and the results seem ok: double dist(double latA, double lonA, double latB, double lonB) {

Ruby On Rails - Geocoder - Near with condition

落爺英雄遲暮 提交于 2019-12-04 14:10:32
问题 I'm using GeoCoder in my application. Now I need to search for objects in my database which are close to a position OR have specific attribute set. I would like to perform this action in one database query, because the database is realy huge. I would like to have something like Spot.near([lat,long],distance).where("visited = ?",true). The distance and the visited attribute should be combined with an OR, not with an AND. Does anyone have an idea how to do this? Thank you! 回答1: Based off of