„Get out form smog” – get current location from user


Get out from smog – part VII

In a previous posts. I showed you how to calculate distance between points. It’s time to get current location from user. We will take care of this in our view.

We’ll use for this method getCurrentPosition from geolocation.

This simple script will pass two parametrs(lon,lat) to my controller. Later my application return the closest and least pulluted air – place within 100km. I showed it in ealier posts.

P.S Of course, we have to give consent to make localization available. 🙂


Link to the project.

Dodaj komentarz

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *