geolocation

How reliable is LocationManager's getLastKnownLocation and how often is it updated?

非 Y 不嫁゛ 提交于 2019-11-29 09:35:28
I am building an app that can use a user's current location on certain actions. Location is more of a benefit to the user rather than a critical part of the process. I'm only interested in very rough accuracy and it can be off by 5 or even 10 miles and still be of value. General plan was to see if the network provider was enabled and then just do locationManager.getLastKnownLocation(LocationManager.NETWORK_PROVIDER) Assuming that no other apps are running, will the phone automatically periodically update the network location? I.e. there will likely always be a value returned by this code which

CLLocation returning negative speed

北城以北 提交于 2019-11-29 09:28:56
I'm starting a new app which uses the coreLocation and the mapkit frameworks. My problem is trying to get the current speed always returns me a negative value, i have take my iPhone with me to places with a good 3g signal and it doesn't matter, location.speed value is always -1. here is the code which matters: #define kRequiredAccuracy 1500.0 //meters #define kMaxAge 60.0 //seconds in the init method: self.locationManager=[[CLLocationManager alloc] init]; self.locationManager.delegate=self; self.locationManager.desiredAccuracy=kCLLocationAccuracyNearestTenMeters; then didUpdateToLocation: -

How to prevent double prompt for geolocation in Phonegap app?

混江龙づ霸主 提交于 2019-11-29 09:26:37
问题 I created a PhoneGap app for iPhone that uses geolocation via JavaScript inside webview. When I run the app the first time, it'll prompt me to allow geolocation for this app. When I hit "ok", it'll prompt me again with the same question but this time it states that "index.html" wants permission to use geolocation. That makes sense because iOS probably wants permission to allow geolocation for the app itself for the first time and the 2nd time the browser wants permission. However, since doesn

Phonegap GPS without internet

青春壹個敷衍的年華 提交于 2019-11-29 09:21:28
I m trying to make an android app which count the distance traveled from log,lan values with phonegap.But phonegap GPS work only when internet or wifi in ON condition.How can get log ,lan values without internet by using geolocation api.Thanks in advance . See the PhoneGap API Docs for Geolocation under the geoLocationOptions: Android Quirks The Android 2.x simulators will not return a geolocation result unless the enableHighAccuracy option is set to true. { enableHighAccuracy: true } Enabling that option will allow the Android device to get the location even with the WIFI option disabled. 来源:

DbGeography.PointFromText() throws 'Latitude values must be between -90 and 90 degrees' for Japan

↘锁芯ラ 提交于 2019-11-29 09:11:09
Google tells me that Japan's lat/long values are (36,138) but .NET throws the error 24201: Latitude values must be between -90 and 90 degrees. Any ideas why? David I have had the same issue as you, I was using DbGeography.PointFromText("Point(lat lng)") when the lat & lng arguments are expected the other way around. The complete answer is this: // From Google, Japan's latitude: 36; longitude: 138 var lat = 36; var lng = 138; var location = DbGeography.PointFromText($"Point({lng} {lat})"); 来源: https://stackoverflow.com/questions/16546598/dbgeography-pointfromtext-throws-latitude-values-must-be

How to find the geoip location for all users in Nodejs

喜夏-厌秋 提交于 2019-11-29 08:48:17
I have a requirement where i have to find the geoip location of the users. I have used the code where i store the address of the user in database and then display the geoip location of that user.Now suppose the users changed his location to some other place.If the user now logs in from that region or country, how should i display the geoip of that user. The code that i use is: geo.geocoder(geo.google, address, sensor,function(formattedAddress, latitude, longitude) { console.log("Formatted Address: " + formattedAddress); console.log("Latitude: " + latitude); console.log("Longitude: " +

How to detect Location Provider ? GPS or Network Provider

五迷三道 提交于 2019-11-29 08:47:57
I'm using Fused Location Provider for location updates in my app. According to Fused Location Provided documentation, it uses all available resources (e.g. Wifi, GPS, Cell tower, etc..) to optimize location. But i want to know, is there any way to detect that current location update is from GPS Provider or Network provider, in Location update receiver ? nipun kumar You can check the location provider by location.getProvider() from the location you are getting. Either you are using fused location api or a previous one, you will get the location from locationManager.getLastKnownLocation or

JS Geolocation wait until success before return value

♀尐吖头ヾ 提交于 2019-11-29 07:38:16
I tried developing browser geolocation, but it seems geolocation quickly return a value when it is still searching for my location. Example of my script: function updateCoordinate() { navigator.geolocation.getCurrentPosition( function (position) { setTimeout(function() { var returnValue = { latitude: position.coords.latitude, longitude: position.coords.longitude } var serializeCookie = serialize(returnValue); $.cookie('geolocation', serializeCookie); return serializeCookie; }, 5000); }, function () { alert('Sorry, we are failed to get your location') }, {timeout: 5000} ) } If we execute this

Add more than 20 regions to geofencing ios

旧巷老猫 提交于 2019-11-29 07:26:32
I want to add 100 of regions to geofencing.(apple limit it to 20)any one have better idea for it.please help me. currently im using significant location change.when significant location change, - (void) locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation method i call API with current location and get the nearest region set and add into geofencing.This method works.But i heard from web significant location change fire depend on the cell towers.If there less cell towers then it will be problem.Other thing is when

In solr dih import two double in one location

柔情痞子 提交于 2019-11-29 07:12:48
What I have now is the two double filds: <field name="x_geo_x_coordinate" type="double" indexed="true" stored="true" default="0"/> <field name="x_geo_y_coordinate" type="double" indexed="true" stored="true" default="0"/> and what I want: the 2 double value in one location field: <field name="x_geo" type="location" indexed="true" stored="true" default="0.0,0.0"/> What I tried so far and does't work: <copyField source="*_coordinate" dest="x_geo"/> <copyField source="x_geo_str" dest="x_geo"/> Any simple solution? Thanks in advance! Well, you where right @nikhil500. ScriptTransformer is one answer