geolocation

Locations in Core Data sorted by distance via NSFetchedResultsController?

孤人 提交于 2019-11-28 00:20:16
问题 I have a set of entity objects in my iOS Core Data database that describe something at a location. Let's call the entity Location. I have implemented this by having two attributes on Location that refer to the location - latitude and longitude, both doubles. There are other elements, like name. I am using a NSFetchedResultsController to bind the entities to a UITableViewController. What I would like to do is have the results sorted by distance to a given CLLocationCoordinate2D. In an really

Unable to get GPS coordinates using Javascript on browser in Android

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 23:13:25
I am very new to android, java and javascript coding. I am trying to get current GPS co-ordinates and track it thereafter on an Android device. I am using webview and the majority of the code is written in javascript. I have searched a lot for a few days and tried many different ways but I am unable to get GPS co-ordinates on the android device. Please have a look at the code and hel pme figure out why I am not getting the GPS location. A few things to point are - 1. I downloaded and checked other sensor apps and can see the current GPS co-ordinates being shown (so the GPS is working on the

Geolocation in Safari 5

久未见 提交于 2019-11-27 22:58:07
I have a application which reports my location using HTML5 geolocation. The application works correct on Firefox and Chrome, but on Safari 5, it says that Safari does not support Geolocation. From what I read, Safari 5 does support Geolocation. What am I missing? Thanks for your time. Sunil Looks like Safari geolocation only works when connected with wifi. When connected with a wired connection Safari calls the error callback from the geolocation functions. To test this, try this in the web console: navigator.geolocation.getCurrentPosition( function(){console.log("success")}, function()

ask for geolocation permission again if it was denied

风流意气都作罢 提交于 2019-11-27 22:41:32
im building an app through phonegap, with a geolocation button. if a user denies permission for geolocation the first time, how can i ask for permission again when they click the geolocation button again? my code structure at the moment is: function getLocation() { if(navigator.geolocation) { navigator.geolocation.getCurrentPosition(showPosition, positionError); } else { hideLoadingDiv() showError('Geolocation is not supported by this device') } } function positionError() { hideLoadingDiv() showError('Geolocation is not enabled. Please enable to use this feature') } You can't. The only thing

Find a Location within a stored Circle

妖精的绣舞 提交于 2019-11-27 22:37:43
I have data in MongoDB representing a Circle as follows: { "_id" : ObjectId("54c1dc6506a4344d697f7675"), "location" : [ 23.027573, 72.50675800000001 ], "radius" : 500 } I want to query with lat & long to determine whether the location is withing stored lat&long and radius. I tried following query but unable to execute: db.test.find({location:{ $geoWithin: { $center: [ [ -74, 40.74 ] , "$radius"] } }}) How can we used stored radius in geoWithin query? Even more optimal than the original, you can now use $expr within a $match stage after the initial $geoNear : db.collection.aggregate([ { "

Get user's location (latitude, longitude) with Bing or Google Maps API

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-27 22:24:40
is there a way to retrieve a latitude & longitude of the user using Bing Maps API or Google Maps API. I think I saw an code snippet where a "autolocate me" feature was used to mark user on the Map itself: var geoLocationProvider = new Microsoft.Maps.GeoLocationProvider(map); geoLocationProvider.getCurrentPosition(); But that function doesn't return any data, it simply set location on the map, whereas I need that location to perform some calculations, namely calculate which of predefined list of places is the closest to current user location. Apart from that, does any of this API's can

Simulate a click in a Google Map

余生颓废 提交于 2019-11-27 22:12:57
问题 I'm trying to simulate a user click on a Google Map, using API v3, after I geolocate their position when they write down their address. I used to do: google.maps.event.trigger(map, 'click', { latLng: new google.maps.LatLng(lat, lng) }); But now I got an error: Uncaught TypeError: Cannot read property 'wa' of undefined main.js:727 I need to simulate the click because I'm using Drupal with a CCK field, and it's doing this on clicks under the hood that are not triggered if I add the location

phonegap geolocation always fail on timeout

北战南征 提交于 2019-11-27 22:07:31
I'm using sencha-touch 2.0 and phonegap 2.0.0 in my app to retrieve user's location. When runing on my locahost, everything works just fine. However, when loading the .apk to my android 15 api's device (using eclipse and the adt plugin), every call to getCurrentLocation or watchPosition never returns... here is my code: geoOn: function(){ var geoReady = navigator.geolocation || undefined; var onSuccess = function(position){ Top5.app.alert('Geolocation success '+String(position.coords.latitude) + ' ' + String(position.coords.longitude),'Geolocation'); var scope = Ext.getCmp('nestedList'); scope

How to prevent WKWebView to repeatedly ask for permission to access location?

流过昼夜 提交于 2019-11-27 21:43:34
问题 I have a WKWebView in my app and when I start browsing www.google.com or any other website that requires location service, a pop up window appears, asking for the permission to access the location of the device even if I have already accepted to share my location. The only thing I did to manage this location stuff is that I added the NSLocationWhenInUseUsageDescription attribute in my info.plist . I couldn't find any answers on the web so any idea would be really appreciated. 回答1: Turns out

GeoLocation API [closed]

亡梦爱人 提交于 2019-11-27 21:38:41
I have just come across this great API: http://ipinfodb.com/ip_location_api.php However, I would like to also retrieve the continent. Is this even possible as I can not find it. Maybe there is another API that is freely available that will offer city, country and continent? I have tried Googles AJAX API but they don't offer continent either. Maybe I going to have to just convert what I already have into continents, how?! I hope this isn't too subjective! Thanks all Why don't you map each CountryCode XX CountryCode to the respective continent? Shouldn't be too hard since there are only about