To start with, we will create a view with a simple map that is centered on the position of the user. Let's set this up by going through the following steps:
- In the MeTracker project, create a new folder called Views.
- In the Views folder, create a XAML-based ContentPage and name it MainView:
The Xamarin.Forms package has no map controls, but there is an official package from Microsoft and Xamarin that can be used to show maps in a Xamarin.Forms app. This package is called Xamarin.Forms.Maps, and we can install it from NuGet by following these steps:
- Install Xamarin.Forms.Maps in the MeTracker, MeTracker.Android, and MeTracker.iOS projects.
- Add the namespace for Xamarin.Forms.Maps to MainView using the following code:
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:map="clr-
...