Windows 10 is here, and it’s everywhere! Amongst many other features, one special facet of Windows 10 is the mapping platform that’s built right into Windows. With Windows 10, the map control and geospatial platform go beyond mapping basics with several new capabilities including advanced imagery & offline. With a few lines of code, developers can make their Universal apps more engaging as they bring them to Windows 10.
With previous versions of Windows we have been able to build and partner with many in the industry to feature best-in-class mapping capabilities. For example, we have fantastic offline mapping capabilities that are a part of the Windows Phone platform, and advanced imagery from Bing.
With Windows 10, we’ve integrated these pieces into a powerful, easy-to-use Map platform that lets you take these elements and reuse them in your apps on phones, tablets, desktop PCs, and beyond. Not only does the included Windows Map App benefit from these capabilities, but any Universal Windows application can benefit from them as well. In this article we’ll explore how to take advantage of these features to build more engaging map apps.
We’ll be using a code sample to help explore some of the concepts. You can download the complete code sample for this blog from the MSDN Code Gallery here.
Streetside
Streetside imagery lets you view a location through a series of panoramic views. Users of Streetside can virtually ‘walk down a street’ and look in all directions (360 degrees) around them. It can really help give you a sense of “being there’ – in locations that you have never been before.
You can incorporate stunning, 360 degree imagery in your app.
With Windows 10, developers can take advantage of Streetside in their applications. Streetside imagery makes a great complement to traditional mapping scenarios. For example, let’s say you were displaying the location of a restaurant on a map. By adding Streetside, you can view the storefront of that restaurant and the surrounding area.
Streetside doesn’t need to be tied into a map, however. Streetside is designed so that it can be used independently of maps. For example, a traditional business application is Customer Relationship Management (CRM). Just about every company has a set of customers they want to track, because knowing your customer can be the key to business success. Traditionally CRM applications are big repositories of data on customers, but they may need to help business owners really understand their customers. Adding Streetside to a CRM view can help staff better visualize your customers’ environment and workplace from the outside. You can literally see where your customers are coming from!
In the screenshot of a sample application below, you can see how we’ve extended a simple customer display form to geocode the customers’ address and show a Streetside view of the location.
Screenshot: Before and After; Extending a Customer List App with a Streetside Preview to help you visualize customers. You can quickly see that “Let’s Stop n Shop” is situated in a downtown environment.
The code for this is fairly straightforward; in the case of the CRM App, it is as follows:
StreetsidePanorama sp = await StreetsidePanorama.FindNearbyAsync(geolocatedPoint); if (sp != null) { StreetsideExperience streetsideExperience = new StreetsideExperience(sp); streetside.CustomExperience = streetsideExperience; streetside.Visibility = Visibility.Visible; }
3D Imagery
The Windows 10 Developer experience also features stunning Aerial 3D imagery for over 250 cities. This 3D Imagery was captured using Microsoft’s stellar Ultracam cameras, flown aboard aircraft that make multiple passes over cities. We take this imagery and assemble it into 3D reconstructions, through a process called photogrammetry. For a 3D city, you see everything in detail from buildings to things the size of a small car.
Downtown San Francisco, rendered in 3D
As with Streetside, this capability is full available to developers to use within their Windows 10 apps. Indeed, using it only requires one simple line of code:
map.Style = MapStyle.Aerial3DWithRoads;
One complexity of 3D is that finding your way in the world is a little trickier compared to traditional mapping apps. With a 2D top-down map, specifying a map center + zoom level is often “good enough” for displaying any location in the world on a map. But with 3D, things get trickier. For example, say you want to show off the Golden Gate Bridge in San Francisco. Knowing how to position the “camera”, or the user’s perspective, may not be immediately obvious when trying to show off the most attractive view of the bridge. There are some steep hills near the Golden Gate Bridge, so if you’re not careful, your camera could end up behind a hill!
To help with this, we’ve added Scene APIs which streamline the process of getting the best view. Developers can simply feed the Map API the center point of their view, as well as a radius around the center point they want to show and the Windows Map platform will take care of the rest. It will automatically avoid having hills or buildings get in your way, and choose the most optimum animation to take the user from their current view point to the next. Easy! Optionally you can also specify a preferred heading and angle (pitch) to show off the view.
Offline
Windows also features offline maps. To download maps for offline use, go into Windows Settings, under System Settings, where there is an option for selecting maps to take offline. You can select as many of the various regions available as you’d like. Since these offline map sets are device-wide, all of your map apps will benefit from taking data offline.
Screenshot: Offline Maps download settings panel in Windows 10
This handy capability makes it easy to build applications that can work as users travel the world, even in areas where they might not have an available data plan for retrieving maps as they go. Offline support also makes sense in cases where overall connectivity is limited, such as more rural areas.
One small caveat, though: offline maps only applies to Road-style maps, not to Aerial and Streetside. Aerial and Streetside, as you might imagine, take up significantly more space for a region compared to the vector-based road maps, making them a bit impractical to use offline.
As a developer, you don’t need to do anything special to take advantage of Offline Maps – if the user has taken a location offline, then your application should ‘just work’ when it comes to displaying road maps, irrespective of whether a user’s device has a network connection or not.
Wrapping Up
Mapping in Windows 10 really brings together a number of useful capabilities, from great map fundamentals, to imagery, to offline. We hope you take advantage of maps in Windows 10 to the fullest to make your data and your app really shine, and we look forward to seeing your creations!
Download the complete code sample for this blog from the MSDN Code Gallery here.
– Mike Ammerlaan, Senior Program Manager, Bing Maps