geolocation

Can I access the geoNear functionality of mongo via the ruby driver?

隐身守侯 提交于 2019-12-23 19:39:31
问题 I'm retrieving results from mongo based on a geo query using the ruby driver. I'd like the results to be returned with their respective distances. That facility is available at the shell using geoNear command: db.runCommand( { geoNear : "places", near : [50,50], num : 10 } ); How do I do this via the ruby API? 回答1: where db is the connection to your db you can use #command : db.command({'geoNear' => "places", 'near'=>[50,50], 'num' => 10}) This has to be an OrderedHash in ruby 1.8, hashes are

Cordova geolocation plugin getCurrentPosition deprecated

ぐ巨炮叔叔 提交于 2019-12-23 17:44:53
问题 I have an ionic app that is trying to use geolocation exactly as shown in the docs. var posOptions = {timeout: 10000, enableHighAccuracy: true}; $cordovaGeolocation.getCurrentPosition(posOptions) .then(function (position) { // do something }, function(err) { console.log(err); // error }); But now it has stopped working and in the console gives me this warning. getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the future. You should

Ionic hybrid app geolocation blocked on iOS10

只谈情不闲聊 提交于 2019-12-23 17:31:40
问题 Since iOS 10 came out and I updated my iPhone 6 navigator.geolocation.getCurrentPosition() is not working. Address and port: 192.168.0.16:8100 Since geolocation API is considered as unsecured origin it would work only with SSL but can I do it in a Hybrid application where I don't know what will be the address on each phone? I've already tried what's mentioned here: Geolocation is blocked in iOS10 Editing in XCode was not helping Editing the Info.plist in text editor was not helping I have

Google Maps Native App - Map Links

主宰稳场 提交于 2019-12-23 15:47:32
问题 I want to open the native google maps application on a mobile device from my mobile website. Currently I am using the URL http://maps.google.com/maps?q=The%20Diner,%2027%20Main%20Street,%20The%20Village%20@55.7665863,-4.1455545, which works for one location. What I am looking to do is show multiple locations with a different coloured marker. Is this possible. 回答1: Well i found when you use the non-secure url and post a list of postcodes it works fine you can add more postcodes by adding

Why does geolocation not work on mobile browsers?

江枫思渺然 提交于 2019-12-23 15:31:55
问题 I am trying to get the location of the user with HTML5 geolocation . On Desktop it works great, but on all my mobile devices (Samsung note, Samsung galaxy S4 And Iphone 6) its not working and not showing the error object. this is my code: function showPosition(position) { var coor = position.coords.longitude+", "+position.coords.latitude; alert(coor); } function errorPosition(error) { alert(error); } function toggleGeolocation() { navigator.geolocation.watchPosition(showPosition,errorPosition

html geolocation: Unknown error acquiring position

和自甴很熟 提交于 2019-12-23 12:29:16
问题 I am trying to use HTML geolocation to get my position. Funny thing is, it was working brilliantly until some seemingly random point in the day when it just stopped working. Now all I get is the error callback with a message: Unknown error acquiring position This happened on the day I first started to develop the app. It is a web app built in Node/Express. The browser I am using is Firefox v53 64-bit. Location is allowed, and I have also tried a fix that I found online which involves going to

What exactly does TelephonyManager.getNetworkCountryIso() return?

断了今生、忘了曾经 提交于 2019-12-23 10:26:04
问题 I want to find out which country the user is currently in, in the event that a data connection is not available (so Geocoder doesn't work). I think I can do this on phones (not tablets) by using TelephonyManager.getNetworkCountryIso , but I find the documentation is not quite clear enough for me. The documentation says: Returns the ISO country code equivalent of the current registered operator 's MCC (Mobile Country Code). Availability: Only when user is registered to a network. Result may be

Get my current address using javascript

青春壹個敷衍的年華 提交于 2019-12-23 10:12:15
问题 I was interested in getting my current address using Javascript and just figured this out by assembling some other SO threads (1,2) so wanted to post this question and answer. Please see answer below. 回答1: Here's the HTML: <script src="http://maps.google.com/maps/api/js?sensor=false"></script> <p id='latitudeAndLongitude'></p> <p id='address'></p> Here's the JS: var latitudeAndLongitude=document.getElementById("latitudeAndLongitude"), location={ latitude:'', longitude:'' }; if (navigator

geolocation doesn't work with Firefox

浪尽此生 提交于 2019-12-23 09:36:28
问题 So, i use this code : var options = { enableHighAccuracy: true, timeout: 2000, maximumAge: 100 }; navigator.geolocation.getCurrentPosition(localizeMe, errorLocalize, options); On the callback localizeMe, i do some success things, and errorLocalize show me an alert when this code doesn't work. When i try this code on Chrome, it's ok, i haven't problem. But on firefox, i always have my alert error when i'm trying this code, the callback error is always call... Do you have any ideas ? 回答1:

phonegap geolocation, Code 3 - timeout expired keeps popping up on some Android Devices

我的未来我决定 提交于 2019-12-23 09:04:23
问题 I am using the PhoneGap API for geolocation. I have set the enableHighAccuracy Option to "true". Code 3, time out expired option keeps popping up, but only on some android devices and more than once while using the application. Please help me... Why is this so that it fails only on some android devices. If I set the accuracy to false, how much difference will I get in retrieving the coordinates... 回答1: Managed to resolve my issue with the code below: var options = {maximumAge: 0, timeout: