Join Bill Weinman for an in-depth discussion in this video A simple Google map with current location, part of HTML5: Geolocation in Depth.
This is a simple example of using HTML5 geolocation data with the Google Maps API.…This is in the Chapter 3 folder in your exercise files, and it's…01-geoLocMap.html. And we're not actually going to be editing it, so I am not…making a working copy.…Let's just take a quick look at here.…We will get into a lot of detail in the code in the next movie, but you can see…that it uses the Google Maps API, and that's called in right here on line 26.…And just before that, we have a little bit of CSS that's just for making sure…that the map shows full screen, and then we've got some global variables,…we have some position options, the GeoLocation function, which is the same as…we've seen before for testing for the presence of the geolocation object.…
Show_map (position) is little bit changed because now we are using the Google…Maps API to show the location, and the geo_error is the same.…stopWatching and startWatching are just a little bit different because we don't…have that button anymore. And the onload function, all the init is rolled into…
- Understanding how geolocation works
- Detecting geolocation support
- Getting coordinates
- Continuous tracking with watchPosition()
- Integrating geolocation with Google Maps