Which code segment or segments should you use?

Posted by: Pdfprep Category: 70-480 Tags: , ,

DRAG DROP

You are developing an application for a retail store. The application will be used on mobile devices to provide real-time directions to the store.

You have the following requirements:

• The application must find out a user’s location.

• As the user moves, the application must update the screen with the new location.

• As the user moves, the application must display the user’s speed.

You need to develop the application to meet the requirements.

Which code segment or segments should you use? (To answer, drag the appropriate code segment or segments to the correct location in the work area. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.)

Answer:

Explanation:

* geolocation.watchPosition

watchPosition() – Returns the current position of the user and continues to return updated position as the user moves (like the GPS in a car).

* position data include:

/ coords.speed

The speed in meters per second

/ coords.accuracy (incorrect answer)

The accuracy of position

Etc.

* The getCurrentPosition() (incorrect)

The getCurrentPosition() method returns an object if it is successful. The latitude, longitude and accuracy properties are always returned. The other properties below are returned if available.

Reference: HTML5 Geolocation

Leave a Reply

Your email address will not be published.