I try to make an application with Xamarin.Forms.Maps. I tried to use an official example and I did this:
public MapPage ()
{
InitializeComponent();
var map = new Map(MapSpan.FromCenterAndRadius(new Position(55, 37), Distance.FromKilometers(1)))
{
IsShowingUser = true,
HeightRequest = 100,
WidthRequest = 960,
VerticalOptions = LayoutOptions.FillAndExpand
};
var stack = new StackLayout { Spacing = 0 };
stack.Children.Add(map);
Content = stack;
}
It's a constructor of my MapPage which inherits a ContentPage. But when an application is running it doesn't change an active form to my MapPage. If I comment something and StackLayout doesn't have a map in Children, the form is shown. I show the form from previous on by calling this:
Navigation.PushModalAsync(new MapPage(), true);
Can somebody give me some advice, please?