Created
July 5, 2015 09:28
-
-
Save matsukurou/c8cc8fbff1589603a602 to your computer and use it in GitHub Desktop.
Xamarin.Formsでマップを表示するためのページ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Maps; | |
namespace MapSample | |
{ | |
public class MapPage : ContentPage | |
{ | |
public MapPage() | |
{ | |
// マップの中心座標の設定(渋谷駅の緯度経度を設定してある) | |
var centerPosition = new Position(35.658517, 139.701334); | |
// 中心座標からの表示距離(マップの縮尺)を設定 | |
var distanceFromCenter = Distance.FromKilometers(0.5); | |
// マップスパンの生成 | |
var mapSpan = MapSpan.FromCenterAndRadius(centerPosition, distanceFromCenter); | |
// 設定した内容でマップを生成 | |
var map = new Map(mapSpan); | |
Content = map; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment