geolocation

gmaps.js, find the nearest point

时光总嘲笑我的痴心妄想 提交于 2019-12-06 13:14:50
I have a array of point with latitude and longitude. Next, I add all points to my map. I need solution/algorithm to move user to the nearest point from my array using geoloation on page load. (if geolocation success of course) This should do the trick. I combined both HTML5 geolocation to find the user's current location and Haversine function to calculate distances from a set of locations and the user's current location. The set of locations is defined in the JS array 'locations'. <!DOCTYPE html> <html> <head> <title>Google Map Template with Marker at User's Position</title> <script src=

iOS 5 Region Monitoring: Can new regions be created based on users current coordinates from coreLocation?

陌路散爱 提交于 2019-12-06 13:13:42
My question is regarding the creation of regions for regionMonitoring in iOS 5. Can new regions be created based on user of the app's current location? Or do all regions need to be predefined by the developer in the applications binary? I know you can have certain regions register based on the users current location, because the os puts a limit on the number of regions that the phone/app can be monitoring at one time, and you should only register the regions within close proximity to the users current location... but can a region (previously undefined) be created on the fly based on the users

Android Location not returning Location from Custom Class

岁酱吖の 提交于 2019-12-06 12:38:49
问题 I have my own location class. I have an odds result that when I search for the GPS location using my class, I get 0, 0 back. Whereas if I search the getLastKnown function in location manager for GPS, I get the forced value: public Location getGPSloc(Context c){ isGPSavailable(c); if(gps_enabled) lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 5000, 0, locationListenerGps); timerGPS = new Timer(); timerGPS.schedule(new GetLastLocationGPS(), 45000); return gpsLoc; } This is the class

Background location tracking not working on physical device swift

橙三吉。 提交于 2019-12-06 12:20:44
问题 I followed this tutorial (https://www.raywenderlich.com/92428/background-modes-ios-swift-tutorial) to create an app that maps the user's location in the background. It asks to follow the user's location even when the app is closed, the user presses yes, and it tracks location in the background, updating every second or so. It works perfectly in the simulator, but sideloaded onto a physical iPhone 6, it stops checking the user's location in the background. 回答1: I solved this. If your

Getting user location on Facebook page tab

别来无恙 提交于 2019-12-06 12:13:10
问题 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? 回答1: 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

How to translate a given coordinate into a bounding box of “diameter” x?

て烟熏妆下的殇ゞ 提交于 2019-12-06 11:17:19
For example, I have a latitude and longitude in decimal format (as opposed to Degrees-Hours-Minutes like lat=44.1° 9.5' 30''). To search for nearby objects, I must specify the search "radius" as a rectangle with four values: north = 44.1; south = -9.9; east = -22.4; west = 55.2; Is there a formula or rule of thumb how to convert decimal lat/long values into a rectangular bounding box, such that the given latitude/longitude is in the center of that box? Must I fiddle around myself with a WGS84 ellipsoid algorithm or are there open solutions to the problem? I had exactly this problem and the

Find the intersection between two geographical data points

徘徊边缘 提交于 2019-12-06 11:00:42
问题 I have two pairs of lat/lon (expressed in decimal degrees) along with their radius (expressed in meters). What I am trying to achieve is to find if an intersect between these two points exits (of course, it is obvious that this doesn't hold here but the plan is to try this algorithm in many other data points). In order to check this I am using Shapely's intersects() function. My question however is how should I deal with the different units? Should I make some sort of transformation \

Implementing Triangulation in android

旧时模样 提交于 2019-12-06 10:54:42
问题 Hi Guys: I am new to android. I am developing an application in android 2.2 to identify location of user by means of any available resources (GPS , Networks etc). I have done finding location through GPS and using SIM network along with internet. Now problem is want to locate device when no GPS and no internet is available. In this case I have to implement Triangulation. I know theory of concept of triangulation but to implement is realy a biggggggg deal to me. Will any body kindly guide me

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

为君一笑 提交于 2019-12-06 10:18:38
问题 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

WatchPosition Time Out In Geolocation

三世轮回 提交于 2019-12-06 10:11:38
问题 I am working on Ionic App and want to fix issue for Geolocation Watch Position. I want to get data after every 1 minutes not after 5 sec. My code is as following, var opti = { enableHighAccuracy: false, timeout:60000, maximumAge: 0 }; navigator.geolocation.watchPosition(success_loc, error_loc, opti); I am using timeout 60000 for giving result after 1 minutes but it is giving result in 5 sec(default time). Need help to fix this problem. 回答1: You need to set the maximumAge to 60000. As per the