-api-id | -api-type |
---|---|
T:Windows.UI.Xaml.Controls.Maps.MapElement3D |
winrt class |
Represents a 3D element displayed on a MapControl.
To display the 3D object on a map control, add the MapElement3D to the MapElements collection of a MapElementsLayer. Then, add the MapElementsLayer to the Layers collection of the map.
This example places a 3D element on the center of the map.
map3dSphereStreamReference = RandomAccessStreamReference.CreateFromUri
(new Uri("ms-appx:///Assets/trainengine.3mf"));
var myModel = await MapModel3D.CreateFrom3MFAsync(map3dSphereStreamReference,
MapModel3DShadingOption.Smooth);
var my3DElement = new MapElement3D();
my3DElement.Location = myMap.Center;
my3DElement.Model = myModel;
var myLayer = new MapElementsLayer();
myLayer.MapElements.Add(my3DElement);
myMap.Layers.Add(myLayer);