geolocation

How do I request permission for Android Device Location in React Native at run-time?

六眼飞鱼酱① 提交于 2019-11-29 03:12:53
I have been trying to use React Native 's GeoLocalisation for an Android App. The poorly documentated module is found here https://facebook.github.io/react-native/docs/geolocation.html . According to the documentation, you handle location permissions on Android using the following code in the AndroidManifest.xml file <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> However, my online research suggests that the above line of code is useless for versions of ANDROID >= 6.0 As my implementation of GeoLocation is not currently working, I have no other reason but to believe

allow to use geolocation for a website for which I previously refused it

余生颓废 提交于 2019-11-29 02:39:48
问题 Once I refused a website to get my geolocation info, but right now I would like it to do this. How can I allow this? I tried to find it in webbrowser settings, but with no success. Basically I need this for Chrome, but I would be nice (for other users) to see a solution for other browsers. 回答1: Chrome Version 23.0.1271.64 should show you a location denied icon to the right of the address bar, which when clicked will show you clear options. Alternatively you can find the setting under settings

HTML5 mobile app running while phone screen is off?

筅森魡賤 提交于 2019-11-29 02:13:27
问题 I'm interested in creating an HTML5 geolocation-based web app that could still be operating when the phone screen is off (say, tracking how far you've been running when your phone is in your pocket). Is there any way to keep the app running but have the screen be off, or have the app run in the background while other apps are being used? Is this possible at least on some of the popular mobile devices out there (newer iOS and Android devices in particular?) 回答1: My music app is HTML5 and also

Get current location during app launch

不问归期 提交于 2019-11-29 02:09:44
Good Day! I am working on an android app which monitors user location. I am using LocationManager to get users location, using the following method public void onLocationChanged(Location theLocation) {} Through the above method, whenever there was a user movement, I am receiving location coordinates. But, now I am planning to get user's location immediately after their app login. Is there any way through LocationManager through which I can manually get the location coordinates after my app launch? Use this technique : LocationManager locManager = (LocationManager)getSystemService(Context

java io ioexception unable to parse response from server geocoder

[亡魂溺海] 提交于 2019-11-29 01:53:13
I am using this code to get geographical addresses: private String getAddress(Location location) { try{ List<Address> addresses = new Geocoder(this,Locale.getDefault()).getFromLocation(location.getLatitude(), location.getLongitude(), 1); if(addresses!=null) { String address="Address not available"; for(int i=0;i<addresses.size();i++) { Address addre=addresses.get(i); String street=addre.getAddressLine(0); if(null==street) street=""; String city=addre.getLocality(); if(city==null) city=""; String state=addre.getAdminArea(); if(state==null) state=""; String country=addre.getCountryName(); if

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

こ雲淡風輕ζ 提交于 2019-11-29 01:53:05
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. Alexander Vasenin Turns out it's quite hard, but possible to do. You have to inject JavaScript code which intercepts

Rails + PostGIS errors migrating database

我怕爱的太早我们不能终老 提交于 2019-11-29 01:26:30
问题 I was following Daniel Azuma's talk on geospatial analysis with rails but I am having difficulty whenever I run rake db:migrate in the second project. The details of my setup are as follows: I am running Postgresql using Postgres.app which gives me version 9.1.3 of Postgres and 2.0.0 of PostGIS. I run into a few issues with the database.yml file, and running migrations. ( I have added the relevant gems and required their info in application.rb) My database.yml file looks like this:

How to know Geographic location from an IP address

你说的曾经没有我的故事 提交于 2019-11-29 00:43:26
I have created a login application in jsp/servlet in my web project and I want to know about the geographic locations of different users those access my login page. How can I know that a person is accessing my login page from where? For example: If a person is accessing a page from Canada then a record will be inserted into my database such as : IP: 20.4.9.134 and location: Canada. Hans Wassink I use this: http://freegeoip.net/xml/122.169.8.137 Or http://www.geoplugin.net/xml.gp?ip=xx.xx.xx.xx Easy call and it throws you an xml with everything you need to know Edit: New location for geoip

MySQL - selecting near a spatial point

こ雲淡風輕ζ 提交于 2019-11-29 00:37:42
I've based my query below to select points near a spatial point called point on the other SO solution , but I've not been able to get it to return any results, for the past few hours, and I'm a bit edgy now... My table lastcrawl has a simple schema: id (primary int, autoinc) point (spatial POINT) (Added the spatial key via ALTER TABLE lastcrawl ADD SPATIAL INDEX(point); ) $query = sprintf("SELECT * FROM lastcrawl WHERE MBRContains(LineFromText(CONCAT( '(' , %F + 0.0005 * ( 111.1 / cos(%F)) , ' ' , %F + 0.0005 / 111.1 , ',' , %F - 0.0005 / ( 111.1 / cos(%F)) , ' ' , %F - 0.0005 / 111.1 , ')' )

Get PHP Timezone Name from Latitude and Longitude? [duplicate]

不羁岁月 提交于 2019-11-29 00:13:55
问题 This question already has answers here : How to get a time zone from a location using latitude and longitude coordinates? (14 answers) Closed 2 years ago . Is there a way get the timezone of a user by their latitude and longitude? And not just the offset, but the actual timezone they're in. Essentially, I'm searching for the polar opposite of DateTimeZone::getLocation which returns the latitude and longitude for a certain timezone. 回答1: Geonames should do the job nicely: http://www.geonames