summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue1755.cs
blob: 850764158e4bbfaba752c32b9d115319feb28f4d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Xamarin.Forms.CustomAttributes;
using Xamarin.Forms.Internals;
using Xamarin.Forms.Maps;

namespace Xamarin.Forms.Controls
{
	[Preserve (AllMembers=true)]
	[Issue (IssueTracker.Github, 1755, "Initializing a map with a different MapType other than default has no effect", PlatformAffected.WinPhone)]
	public class Issue1755
		: ContentPage
	{
		public Issue1755()
		{
			var map = new Map (MapSpan.FromCenterAndRadius (new Position (54.767683, -1.571671), Distance.FromMiles (5))) {
				IsShowingUser = false,
				HeightRequest = 100,
				WidthRequest = 960,
				VerticalOptions = LayoutOptions.FillAndExpand, 
				MapType = MapType.Hybrid
			};

			var switchMapTypeButton = new Button { Text = "Switch to hybrid" };
			switchMapTypeButton.Clicked += (sender, args) => map.MapType = map.MapType == MapType.Hybrid ? MapType.Street : MapType.Hybrid;

			var stack = new StackLayout { Spacing = 0 };
            stack.Children.Add(map);
            stack.Children.Add(switchMapTypeButton);
            Content = stack;
		}
	}
}