HTML Questions & Answers – HTML Geolocation

This set of HTML Multiple Choice Questions & Answers (MCQs) focuses on “HTML Geolocation”.

1. Which navigator object property returns a geolocation object?
a) appVersion
b) geolocation
c) language
d) appCodeName
View Answer

Answer: b
Explanation: There are many navigator object properties, geolocation returns a geolocation object that can be used to locate user’s position, appVersion returns the version information of the browser, appCodeName returns the code name of the browser.

2. What returns the engine name of the browser?
a) product
b) userAgent
c) platform
d) onLine
View Answer

Answer: a
Explanation: Product property returns the engine name of the browser, userAgent returns user-agent header sent by the browser to the server, platform returns for which platform the browser is compiled. OnLine determines whether the browser is online or not.

3. Action box does not contains _______
a) tabs
b) geolocation buttons
c) search box
d) radio buttons
View Answer

Answer: d
Explanation: The action box contains tabs, a geolocation button, geoloaction options and search box, by the use of tabs we can switch between different kind of maps and search engines.
advertisement
advertisement

4. Which button let us move the map to the current position of the device?
a) currentPositionBtn
b) enableHighAccuracy
c) timeout
d) maximumAge
View Answer

Answer: a
Explanation: The geolocation HTML includes a currentPositionBtn which is used to move the map to the current position of the device, there are 3 inputs to let the user choose the geolocation options enableHighAccuracy, timeout, and maximumAge.

5. Search box does not contain __________
a) currentPositionBtn
b) search button
c) dropdown list
d) input field
View Answer

Answer: a
Explanation: Search box contains an input field in which we can insert the name of the place you are looking for, a search button or a dropdown list, depending on user experience provided by the search tool.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. How many kinds of map does Geo support?
a) 1
b) 2
c) 3
d) 4
View Answer

Answer: d
Explanation: Geo supports 3 different kinds of interactive map like OpenStreeMap, Google Maps, a hybrid map that is Google Map with OpenStreetMap tiles placed on it, these maps are loaded in 3 different HTML elements.

7. OpenStreetMap cannot extend map to implement __________
a) showMap
b) showPOIs
c) search
d) toProjection
View Answer

Answer: d
Explanation: The openStreetMap and GoogleMap objects extent Map to implement showPOIs, showMap, search and showPosition methods, which make use of Google Maps and OpenLayers library.
advertisement

8. Which is not a kind of error?
a) PERMISSION_UNAVAILABLE
b) PERMISSION_DENIED
c) TIMEOUT
d) POSITION_UNAVAIALBLE
View Answer

Answer: a
Explanation: Examples of error are POSITION_UNAVAIALBLE, PERMISSION_DENIED and TIMEOUT. PositionError is the object returned by Geolocation API in case of error.

9. getCurrentPosition does not take the argument?
a) successCallback
b) options
c) errorCallback
d) Timeout
View Answer

Answer: d
Explanation: getCurrentPosition method takes three arguments successCallbaack, errorCallback, options. A successCallback set to GetMap.showMap by MapSwitcher or to GeoMap.showPosition by GeolocationBox.
advertisement

10. Which of the following cancels an ongoing watchPosition call?
a) clearWatch
b) watchPosition
c) getCurrentPosition
d) getPositionUsingMethodName
View Answer

Answer: a
Explanation: clearWatch cancels an ongoing watchPosition call, watchPosition method retrieves periodic updates about a current geographic location of the device, getCurrentPosition retrieves current geographic location.

11. Which of the following specifies the time when location information was retrieved?
a) timestamp
b) cords.speed
c) cords.heading
d) cords.altitudeAccuracy
View Answer

Answer: a
Explanation: timestamp specifies the time when location information was retrieved and the position object created. cords. speed specifies device’s current ground speed in meters per second, cords.heading specifies the device’s current direction of movement in degrees.

12. The code marker option does not create ______
a) title
b) map
c) position
d) zoom
View Answer

Answer: d
Explanation: map object when the marker should appear, position is latlng position at which the marker should be displayed, title that should appear when we hover on the marker.

13. Which of the following is a global identifier for the item?
a) itemid
b) itemprop
c) itemref
d) itemtype
View Answer

Answer: a
Explanation: itemid attribute is a global identifier for the item, itemprop attribute defines a property of the item, itemref gives a list of additional elements to crawl to find name-value pairs of the item, itemtype is a valid URL that defines the item.

14. Which of the following is not a map display option?
a) zoom
b) center
c) mapTypeId
d) blur
View Answer

Answer: d
Explanation: zoom, center, mapTypeId are the three map display options. Zoom specifies the zoom level, center specifies that the map should be centered at the user location, mapTypeId can be satellite, roadmap or hybrid.

15. Which of the following specifies the expiry time for cached location information?
a) maximumAge
b) timeout
c) enableHighAccuracy
d) position_unavailable
View Answer

Answer: a
Explanation: maximumAge specifies the expiry time in milliseconds for cached location information, timeout property is the number of milliseconds the web application is willing to wait for a position.

Sanfoundry Global Education & Learning Series – HTML.

To practice all areas of HTML, here is complete set of 1000+ Multiple Choice Questions and Answers.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.