Question: Code a function named getLocation that receives a parameter named position. Then, move the statements that declare the URL and display the map within this

Code a function named getLocation that receives a parameter named position. Then, move the statements that declare the URL and display the map within this function.

Code a statement at the beginning of the ready event handler that calls the getCurrentPosition method of the navigator.geolocation object. If an error occurs when this method is executed, the errorHandling function should be called. Otherwise, the getLocation function should be called.

Modify the URL for the Google Maps API so it uses the latitude and longitude that are passed to the getLocation function. In addition, change the zoom level for the map to 15, and change the width of the map to 600 pixels. (The size is specified as width x height.)

Add code to the getLocation function that displays the latitude, longitude, and accuracy of the position in the

element with position as its id as shown above.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!