CHAPTER 12

image

Location and Maps in Windows Apps

Developers who build Windows apps can utilize the capabilities of the Windows device to integrate the location and maps in their apps. In this chapter, you will look at recipes on how to use the location API in Universal Windows Runtime apps.

12.1 Get the Current Location

Problem

You don’t know where you are. The Windows app needs to determine and display your current location.

Solution

Use the getGeopositionAsync method of the Geolocator class defined in the Windows.Devices.Geolocation namespace to get the current location from the devices powered by Windows 10.

How It Works

  1. Create a new Universal ...

Get Windows 10 Development Recipes: A Problem-Solution Approach in HTML and JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.