geolocation

Android: How to initialize a variable of type “Location” (other than making it equal to null)

痞子三分冷 提交于 2019-12-05 08:20:22
问题 I'm looking to test some code I've written and to do so I need to construct a variable of type Location and to give it a long / lat value but I'm unsure how I would do so. Any ideas? 回答1: The API documentation is quite clear on this. First create a new Location instance: Location loc = new Location("dummyprovider"); And then use the setter methods to set the location parameters you need, e.g.: loc.setLatitude(20.3); loc.setLongitude(52.6); 回答2: Location object = new Location("service Provider

Custom message for geolocation

五迷三道 提交于 2019-12-05 08:06:38
I am looking for a way in which i can display a custom message when the geolocation script asks for the user to either allow or deny access to their location. At the moment it displays a message asking weather the user wants to allow or deny access to their location. Instead of it saying the default "Allow website.com to access your location" I want to be able to change it to my own text such as "Allow location access to display better results". I will look forward to your responses. This cannot be done. Otherwise a user may not know what it is that they might be agreeing to. There is no

Smart location form field

落花浮王杯 提交于 2019-12-05 07:15:26
问题 I have a single text field on a user registration form for location . I would essentially like this field to be validated against Google Maps (or equivilent) - only allowing valid locations to pass (ideally in a format something like Waterloo, London or London, England ). Requirements : As well as a location name, I also would like to return co-ordinates (lat, lng) for the center of that location (even if broad e.g. London, England ) as I will be cross referencing this to serve relevent

HTML5 offline mode and geolocation

喜夏-厌秋 提交于 2019-12-05 07:05:53
Is it possible to still use the geolocation features when you are in offline mode in HTML5? It appears that when I am online (navigator.onLine = true), the geolocation works fine. But when I go offline (navigator.onLine = false), I get thrown to my error callback and the error indicates geolocation not available. It's going to depend on how the GeoLocation in that particular browser is wired up. In Firefox, GeoLocation depends on Google Location Services which works by sending some network information to a web service - obviously this is not going to work when you're offline as the web service

Find nearest places by latitude and longitude

谁说我不能喝 提交于 2019-12-05 06:57:26
问题 I have this website that stores latitude and longitude of some places and I want to display the nearest places (lets say, in a radius of 10km) of a specific place. How do I search on my MySQL table for these places? 回答1: I answered this kind of question some years ago at Google Answers and again more recently at Uclue. I should note that the preferred technical convention is to represent longitudes in the West as negative values, but this is sometimes not observed. It won't make much

Ip to country, city, lat, lang javascript service [closed]

给你一囗甜甜゛ 提交于 2019-12-05 05:36:40
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . What the best/accurate/free service to convert the IP from the following script to country/city/lat/long? $.getJSON("http://jsonip.appspot.com?callback=?", function(data){ alert( "Data Returned: " + data.ip); }); 回答1: As it goes I was researching this the other day. Couple of potential options: FreeGeoIP IP Info

Checking if location services are enabled using react native

半世苍凉 提交于 2019-12-05 04:49:57
I am currently working on an app using react native that requires location services to be on for some of its features. I have been researching if there is a simple way to test if the user has them turned on or not so I can display a different view if they aren't. I have not found any results other than ones that are specific to IOS or Android. Has anyone else found a solution to this? Use the "react native android location services dialog box" module for android https://www.npmjs.com/package/react-native-android-location-services-dialog-box install npm install react-native-android-location

webservice for autosuggest on city names / postal codes including long-lat coordinates?

∥☆過路亽.° 提交于 2019-12-05 04:03:57
问题 i'm looking for a webservice, to be used for an autocomplete field, where people can fill in either a postal code / city name or both this service will need all cities in Europe , so we can use it for all country websites. and in a later stadium we want to keep the world open for asia and america so this would be a plus. preferably it would also return the long-lat coordinates for the locations, Now it is a free textfield, after leaving the field, we hit the google geocoding service, to find

How to get last known location for Location manager in Android?

不想你离开。 提交于 2019-12-05 03:25:52
I am using simple location manager object to get lastKnownLocation() of device but getting null object in return can any one tell me why ? Code : public Location getLocation() { LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); if (locationManager != null) { Location lastKnownLocationGPS = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if (lastKnownLocationGPS != null) { return lastKnownLocationGPS; } else { Location loc = locationManager.getLastKnownLocation(LocationManager.PASSIVE_PROVIDER); System.out.println("1::"+loc)

How to track the GPS coordinates as user walks, from xamarin.forms for ios platform

我与影子孤独终老i 提交于 2019-12-05 02:57:27
问题 I just went through this link to track GPS co-ordinates of current location as User walks with a xamarin.forms app (iOS platforms) But I could not find how to do it, as I am born new to xamarin.forms, Can we do this in xamarin.forms or should I Create a xamarin ios project? Any links/tutorials to track the user location through xamarin.forms for iOS platfomrs would be appreciated, thanks in advance. 回答1: We used Xamarin-Forms-Labs to do this. Works perfect with Xamarin.Forms on all platforms.