HTML5 Geolocation - MCQs

HTML5 Geolocation - MCQs


1) From the following which methods are provided by geolocation?

A) getCurrentPosition()
B) watchPosition()
C) clearWatch()
D) All the mentioned above
View Answer / Hide Answer

ANSWER: D) All the mentioned above




2) Which method retrieves periodic updates about the current geographic location of the device.

A) getCurrentPosition()
B) watchPosition()
C) clearWatch()
D) All the mentioned above
View Answer / Hide Answer

ANSWER: B) watchPosition()




3) Which method cancels an ongoing watchPosition call?

A) getCurrentPosition()
B) watchPosition()
C) clearWatch()
D) None of the above
View Answer / Hide Answer

ANSWER: C) clearWatch()




4) Geolocation methods getCurrentPosition() and getPositionUsingMethodName() specify the callback method that retrieves the location information.

A) True
B) False
View Answer / Hide Answer

ANSWER: A) True




5) In location property what specifies the geographic location of the device. The location is expressed as a set of geographic coordinates together with information about heading and speed.

A) coords.accuracy
B) coords.longitude
C) coords
D) coords.altitudeAccuracy
View Answer / Hide Answer

ANSWER: C) coords




6) Which methods make use of an error handler callback method which gives PositionError object.

A) getCurrentPosition()
B) watchPosition()
C) clearWatch()
D) Both A & B
E) Both B & C
View Answer / Hide Answer

ANSWER: D) Both A & B




7) The location of the device could not be determined,the error code is 2 then what will be the constant?

A) UNKNOWN_ERROR
B) PERMISSION_DENIED
C) POSITION_UNAVAILABLE
D) TIMEOUT
View Answer / Hide Answer

ANSWER: C) POSITION_UNAVAILABLE




8) In the position options which property specifies whether the widget wants to receive the most accurate location estimate possible. By default this is false.

A) maximumAge
B) timeout
C) enableHighAccuracy
D) None of the above
View Answer / Hide Answer

ANSWER: C) enableHighAccuracy




9) Geolocation is not complicated, and it is very much required to catch any error and handle it gracefully.

A) True
B) False
View Answer / Hide Answer

ANSWER: B) False




10) The following is a sample code to use for which of these methods?

function getLocation() {
var geolocation = navigator.geolocation;
geolocation.getCurrentPosition(showLocation,
errorHandler);
}

A) getCurrentPosition()
B) watchPosition()
C) clearWatch()
D) All the mentioned above
View Answer / Hide Answer

ANSWER: D) All the mentioned above



Post your comment