Frage

I am stuck in problem with user current location.

I have an app in which i show events which occur near by of user current location. Everything is fine till now but from now i have to implement the functionality to change city. If i change city then near by events will also change respectively. I want to know that will i be able to change my current location within from app. Or in other words can i change the location in settings of phone within from my app. Any suggestion would be helpful.

Thanks

War es hilfreich?

Lösung

You can't change Your current location from settings.

If you want to save selected city as your current location then save selected city's longitude and latitude and pass it as your current location to method that gets the near by events so it should work as your current location.

You can save your selected city lat n long in Preference file (or .plist). and when Location updates itself you can check if user have selected city then you pass the lat and long of selected city otherwise your current location lat long. so it will be easier for you.

Hope it Helps!!

Andere Tipps

If you have lat long of the new city then you can set the lat long to location coordinates ....and then you can update events also..

You can not change you current location but you can do this by getting lat long of city.

http://maps.googleapis.com/maps/api/geocode/json?address=jaipur&sensor=false  

Using this you can get lat long of other city and pass it as your current location to get the near by events .

Here is nice links related to map Link

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top