Many devices allow you use geolocation to get your current position in the form of latitude and longitude. We'll look at how we to use one of the device APIs, Geolocation, to request our current position in our application from our current device.
- [Voiceover] We are going to implement geolocation…into our application.…What we want to do is we want to find out our latitude…and longitude so that eventually we can look that up…and get a friendly name or address…for that actual location.…To use geolocation, we need to define the geolocator…and then ask it to get the position…and listen to those updates.…We are going to work in the ad.js.…Ad.js is where we add the room, and so we are…probably going to also want to store…the information of where we were at when we added it.…
At the very top I'm going to declare a variable…called locator.…I'm just setting it to null so that I can check…to see if it's been created, and if it hasn't…then I will go and create it.…What I want to do in this ready function…is I can get rid of this console log,…I'm going to comment it out.…And I can call a function called getloc.…And now we need to define that.…Now what I'm going to do in this getloc function…is I'm going to say if a locator hasn't been instantiated…or initialized, let's do that.…
Watch to gain an understanding of the Universal Windows Platform and the application life cycle. Learn to create adaptive layouts with WinJS controls. Discover how to store and share data, capture a variety of input, and explore the unified Microsoft-specific APIs: Windows Core and Geolocation. Stacey Mulcahy, a Windows evangelist, provides developers with everything they need to start building Universal Windows apps and break into cross-device development.
- Setting up your development environment
- Coding in WinJS
- Creating page objects
- Animating page transitions
- Implementing responsive design principles and UI patterns
- Working with layout controls
- Using APIs: Windows Core and Geolocation
- Saving and reading data
Skill Level Beginner
1. Getting Started with Universal Windows Applications
3. Layouts and Controls
4. Utilizing APIs
5. Managing Data and Storage
Next steps1m 56s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.