anchor.diff:  image::graphics/locationcapture_basic.gif[title="Location capture user interface"]
   
   ****
  -Notice the stylesheet link in the <head> makes the app prettier and mobile-friendly by adding the Bootstrap CSS to the page. The app will work fine without it though.
  +NOTE: Notice the stylesheet link in the <head> makes the app prettier and mobile-friendly by adding the Bootstrap CSS to the page. The app will work fine without it though.
   ****
   
   ==== Acquiring location
  
positive.code: That function takes two arguments -- the function to call when the position is updated, and the function to call when there's an error. It also returns an ID that can be used later to stop requesting the device's position, which we do in the stopWatch function with the command `navigator.geolocation.clearWatch`.
  
  ****
  *Respect your user's battery:* Requesting location _only when you really need it _is crucial with mobile apps so you don't drain the user's battery by keeping the GPS on constantly to service your location requests when you're not going to make use of it.
  ****
  
  When the `navigator.geolocation.watchPosition` function runs, your browser will ask you if you agree to have your location shared with this web page. Different browsers will present different user interfaces for this, but here's what it looks like in Firefox:
  
negative.code: |*coords.speed*|double or null|meters/second
  |*timestamp*|DOMTimeStamp|like a Date() object
  |===
  Now let's take a close look at the `doWatch` function.  
  
  As with most things in life, be it sports, house painting, or coding, the hard work is in the preparation, while the flashy stuff is easy. We've paid our dues with a lot of prep work learning how to make a CouchApp, laying out the UI properly, and handling error conditions. Now in doWatch (Listing 3) it all pays off as we get to work with the actual real coordinates of where the device is located.  
  
  