在UWP中将Pushpin添加到MapControl

时间:2015-11-07 09:01:15

标签: c# xaml windows-runtime winrt-xaml uwp

我想在Windows 10应用程序中向MapControl添加一个Pushpin,但是自Windows 8.1以来,控件似乎已经消失了。

Pushpin

就这么简单:

<input type="radio" name="Owner" <?php if($row['Owner'] == "A") { echo "checked"; }?> value="A">

但是不再识别Pushpin类型......

1 个答案:

答案 0 :(得分:7)

地图控制在UWP中几乎没有变化 - 请查看Windows.UI.Xaml.Controls.Maps namespace

至于添加图钉(POI),您可以do it in couple of ways。例如:

// get position
Geopoint myPoint = new Geopoint(new BasicGeoposition() { Latitude = 51, Longitude = 0 });
//create POI
MapIcon myPOI = new MapIcon { Location = myPoint, NormalizedAnchorPoint = new Point(0.5, 1.0), Title = "My position", ZIndex = 0 };
// add to map and center it
myMap.MapElements.Add(myPOI);
myMap.Center = myPoint;
myMap.ZoomLevel = 10;

了解更多指南visit MSDN