Before reading this article, please go through the following article.
In this article, you will learn how to use Button Control, TextBlock control, and TextBox Control in Visual C# environment. Also, you will be able to develop a simple arithmetic calculation app in Universal Windows Apps development, using XAML and Visual C#.
The following important tools are required for developing a UWP application,
- Windows 10 (Recommended).
- Visual Studio 2015 Community Edition (It is a free software available online).
Now, we can discuss the step by step App development.
If you are new to Map control component, I suggest you learn the following article.In this article we will see about how to set a street view experience
Step 1: Open the already created project called "Mapsample" that is created and deployed in your machine or create a new Universal application by following the above link.
Step 2: Open MainPage.Xaml.cs and add the following code as shown below for creating an Aerial.
Aerial 3D code is given below,
- Mapsample.Style = MapStyle.Aerial3D;
- private async void Mapsample_Loaded(object sender, RoutedEventArgs e)
- {
- var center =
- new Geopoint(new BasicGeoposition()
- {
- Latitude = 11.66509,
- Longitude = 78.154587
- });
- await Mapsample.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(center, 3000));
- Mapsample.Center =
- new Geopoint(new BasicGeoposition()
- {
- Latitude = 11.66509,
- Longitude = 78.154587
- });
- Mapsample.ZoomLevel = 16;
- //check for 3D support
- if (Mapsample.Is3DSupported)
- {
- //set style to 3D
- Mapsample.Style = MapStyle.Aerial3D;
- //create a mapscene for lat and long
- //facing East (90 deg) and pitched 45 deg
- var mapScene = MapScene.CreateFromLocationAndRadius(Mapsample.Center, 500, 90, 45);
- await Mapsample.TrySetSceneAsync(mapScene);
- }
- }
- using System;
- using System.Collections.Generic;
- using System.IO;
- using System.Linq;
- using System.Runtime.InteropServices.WindowsRuntime;
- using Windows.Devices.Geolocation;
- using Windows.Foundation;
- using Windows.Foundation.Collections;
- using Windows.UI.Xaml;
- using Windows.UI.Xaml.Controls;
- using Windows.UI.Xaml.Controls.Maps;
- using Windows.UI.Xaml.Controls.Primitives;
- using Windows.UI.Xaml.Data;
- using Windows.UI.Xaml.Input;
- using Windows.UI.Xaml.Media;
- using Windows.UI.Xaml.Navigation;
- // The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
- namespace Mapsample
- {
- /// <summary>
- /// An empty page that can be used on its own or navigated to within a Frame.
- /// </summary>
- public sealed partial class MainPage : Page
- {
- public MainPage()
- {
- this.InitializeComponent();
- Mapsample.Loaded += Mapsample_Loaded;
- }
- private async void Mapsample_Loaded(object sender, RoutedEventArgs e)
- {
- var center =
- new Geopoint(new BasicGeoposition()
- {
- Latitude = 11.66509,
- Longitude = 78.154587
- });
- await Mapsample.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(center, 3000));
- Mapsample.Center =
- new Geopoint(new BasicGeoposition()
- {
- Latitude = 11.66509,
- Longitude = 78.154587
- });
- Mapsample.ZoomLevel = 16;
- //check for 3D support
- if (Mapsample.Is3DSupported)
- {
- //set style to 3D
- Mapsample.Style = MapStyle.Aerial3D;
- //create a mapscene for lat and long
- //facing East (90 deg) and pitched 45 deg
- var mapScene = MapScene.CreateFromLocationAndRadius(Mapsample.Center, 500, 90, 45);
- await Mapsample.TrySetSceneAsync(mapScene);
- }
- }
- }
- }


Vignesh ManiPosted Aug 11, 2016, 11:37 AM
Good one
Pradip PandeyPosted Aug 11, 2016, 12:16 AM
Nicely explained for map control