554 CHAPTER 14 Making your HTML location-aware
Answers
This section contains the answers to the lesson review questions in this chapter.
Lesson 1
- Correct answer: C
A. Incorrect: The watchPosition() method continuously returns the current location.
B. Incorrect: The watchLocation() method does not exist.
C. Correct: The getCurrentPosition() method retrieves the current location a single
time.
D. Incorrect: The getCurrentLocation() method does not exist. - Correct answer: D
A. Incorrect: The error callback function is a valid paramete.
B. Incorrect: The position options object is a valid parameter.
C. Incorrect: The success callback function is a valid parameter.
D. Correct: The use GPS only parameter is not valid.
Lesson 2
- Correct answer: A
A. Correct: The watchPosition() method continuously returns the current location.
B. Incorrect: The watchLocation() method does not exist.
C. Incorrect: The getCurrentPosition() method retrieves the current location a single
time.
D. Incorrect: The getCurrentLocation() method does not exist. - Correct answer: A
A. Correct: The haversine formula calculates spherical distance.
B. Incorrect: You use the Pythagorean theorem to calculate the hypotenuse of a right
triangle.
C. Incorrect: You use the quadratic formula to solve ax^2 + bx + c = 0 for x.
D. Incorrect: Hyperbolic functions are analogs of the ordinary trigonometric, or circu-
lar, functions.