geolocation

Why does CLLocationManager returns null locations on the iphone SDK 4 beta in the Simulator?

烈酒焚心 提交于 2019-12-04 06:16:09
问题 I have this piece of code: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSLog(@"Manager did update location!!"); self.currentLocation = newLocation.description; } I have this code inside a class that conforms to the CLLocationManagerDelegate . I tested earlier in sdk 3.0 and works nice (on both simulator and device). I'm testing this class on the SDK 4, in the simulator, but it gives null as a

Why is Geolocation in Mobile Safari way less accurate than the location in a native App?

人走茶凉 提交于 2019-12-04 06:15:24
I'm using the Geolocation API (often referred to as "HTML5 Geolocation") to get the current position of the user. It is updated automatically if you move (checked every second). Primarily targeted (and currently tested) at iPhones, but should work on other mobile devices too. You can see an example here: http://jsbin.com/uyoyey/ The accuracy, which you can see in each line after the pipe, is around 3000 (meters) when I'm testing (outside). Which is quite bad obviously. The native Maps-App on my iPhone is way more precise. Approximately around 10 to 30 Meters (by looking at the map and where I

How to calculate geography bounding box in iOS?

你离开我真会死。 提交于 2019-12-04 06:08:57
I'd like to make a Geographic Bounding box Calculation in iOS. It can be aprox. Input Parameters: Current Location (Example: 41.145495, −73.994901) Radius In Meters: (Example: 2000) Required Output: MinLong: (Example: 41.9995495) MinLat: (Example: −74.004901) MaxLong: (Example: 41.0005495) MaxLat: (Example: −73.004901) Requirement: No Network Call Any Ideas? Mapkit / CoreLocation does not seem to offer this type of thing? Any other Geographic SDK that i could use? Thanks I think you can use standard MapKit functions: MKCoordinateRegionMakeWithDistance , this will return a MKCoordinateRegion ,

Geolocation without Prompt

 ̄綄美尐妖づ 提交于 2019-12-04 05:58:40
I know about the HTML5 way to do geolocation, but the caveat is that it has to prompt the user for permission. navigator.geolocation.getCurrentPosition It gets particularly annoying when I would like to do geolocation right at the home page to serve customized content based on location: no one likes to get a prompt every time he or she visits your site. The idea is to use external services to do geolocation based on IP address or something similar to get a less accurate estimate of the user's location and give the user a prompt only when that location is really off. Are there any good

Appcelerator Could not find method android.app.Activity.checkSelfPermission

假装没事ソ 提交于 2019-12-04 05:53:25
问题 I cant seem to get geo location to work on Android just seem to get the following bug. [INFO] : dalvikvm: Could not find method android.app.Activity.checkSelfPermission, referenced from method ti.modules.titanium.geolocation.GeolocationModule.hasLocationPermissions [WARN] : dalvikvm: VFY: unable to resolve virtual method 32: Landroid/app/Activity;.checkSelfPermission (Ljava/lang/String;)I [INFO] : dalvikvm: Could not find method android.app.Activity.requestPermissions, referenced from method

MyLocationOverlay or LocationManager for updating current location

ⅰ亾dé卋堺 提交于 2019-12-04 05:20:37
I am using MapView to show current location of a user on a Map. To update the location while the user is on the move, I have to a choice: I can use MyLocationOverlay to draw the current location and extend it to allow tracking of the users location on the move and to have custom marker. The problem with MyLocationOverlay is that I cannot control the frequency with which the device requests the location from GPS. I am worried about the battery drain here. I can use Location Manager and subscribe using requestLocationUpdates to get location from GPS. Here I have more control over the frequency

How do I enter an “empty” POINT() geometry value into a MySQL field of type POINT?

纵然是瞬间 提交于 2019-12-04 05:16:58
I have a table with a POINT geometry field. I enter latitude/longitude points into it like this: INSERT INTO table( point ) VALUES( POINT( lon_value, lat_value ); Sometimes I do not have lat/lon values to enter. I am unable to enter a blank, a NULL, or an empty POINT() ... since POINT(0,0) is actually a location on the globe, that won't work either. What is the solution here? I would use coordinates of North Pole INSERT INTO table( point ) VALUES( POINT(0.0000,90.0000); If the actual coordinates of the pole may be an issue i would change the lon value from 0.0000. 来源: https://stackoverflow.com

getFromLocationName error, Service not available. Have been working, stopped

笑着哭i 提交于 2019-12-04 05:03:22
In my app I am using the getFromLocationName, and it has been working in the app until recently, now all of a sudden I am getting is "Service not available". The exception says: Geocoder.getFromLocationName(Geocoder.java:178) This is the code I am using: Geocoder coder = new Geocoder(this); List<Address> address = null; try { address = coder.getFromLocationName(navAddr,5); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } To be honest I do not know if has stopped working after I have switched to release build. I hope someone can point me to what I can do to

Allowing location access inside UIWebView

假装没事ソ 提交于 2019-12-04 04:44:27
I have a webview based application and when I access http://maps.google.com , my webview is not passing the location as Safari does. I know CLLocationManager is needed, but do I get a callback when a webpage (maps.google.com) wants access to my device location? How do I respond back with the coordinates to the webpage from my WebView? The webview will start monitoring the location automatically, however since iOS 8 location access requires the NSLocationWhenInUseUsageDescription description in your info plist to be set. If this has been done, it will prompt the user automatically to allow

Meteor.js reactive html5 geolocation position.coords

自作多情 提交于 2019-12-04 04:27:27
I'm a meteor.js nuub, but I did spend quite a bit of time trying to figure this one out. I'm trying to reactively update my UI based on the HTML5 geolocation API callback passed into getCurrentPosition. However, the UI is not updating with my current code. Can you offer suggestions and/or a solution? Here are the details: Basics: meteor server is running, serving other data to/from mongo via collections successfully I have a main page (main.html): <head> <title>Geolocation</title> </head> <body> <div class="container"> <header class="navbar"> <div class="navbar-inner"> <a class="brand" href="/