Skip to content

Commit

Permalink
Finished the geolocation waypoint. Ready for QA and copy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
benmcmahon100 committed Oct 5, 2015
1 parent 4e33b35 commit 5b771e1
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions seed/challenges/json-apis-and-ajax.json
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,22 @@
"difficulty": 3.19,
"description": [
"",
"Be descriptive!"
"We can access the users current location by using the built in navigator in the browser.",
"The navigator will get the users current longitude and latitude with a decent level of accuracy.",
"<code>",
"if (navigator.geolocation) {",
" navigator.geolocation.getCurrentPosition(function(position){",
" // Do something in here with the coordinates!",
" ",
" console.log(\"latitiude\", position.coords.latitude);",
" console.log(\"longitude\", position.coords.longitude);",
" ",
" });",
"}",
"</code>"
],
"tests": [
"/*Be Assertive*/')"
"assert(editor.match(/navigator\\.geolocation\\.getCurrentPosition/gi), 'you should make use of the <code>navigator.geolocation</code> to access the users current location')"
],
"challengeSeed": [
"var json = {",
Expand Down

0 comments on commit 5b771e1

Please sign in to comment.