Watching the position continuously


show more Watching the position continuously provides you with in-depth training on Developer. Taught by Andy Olsen as part of the HTML5 Power Workshop show less
please wait ...

Watching the position continuously

HTML5 geo location has two ways of working. You can either make a one-off request, find your current position, or you can make a request to watch your position over a period of time. And get posted back information as you move around. So we're going to take a look at that latter mechanism here in this demo. The file is called watchingposition.html, and it's in your project files folder. Remember that you have to run it through a web server for it to work. So this is what happens. When I click the Watch Position button, it makes a call to a function called Watch Position on my geolocation object.

And that will continually call me back as my postion changes. Now display the position on the right hand side of our webpage here. Now, because I'm running this application on a desktop browser, and I'm sitting here in my office as opposed to walking around town. My location isn't actually changing. So we don't actually see in the location being updated here...

Watching the position continuously
Video duration: 6m 11s 3h 9m Intermediate

Viewers:

Watching the position continuously provides you with in-depth training on Developer. Taught by Andy Olsen as part of the HTML5 Power Workshop

Subjects:
Developer Web video2brain
Software:
HTML
Author:
please wait ...