Skip to content

Latest commit

 

History

History
40 lines (27 loc) · 1.17 KB

mapelement3d.md

File metadata and controls

40 lines (27 loc) · 1.17 KB
-api-id -api-type
T:Windows.UI.Xaml.Controls.Maps.MapElement3D
winrt class

Windows.UI.Xaml.Controls.Maps.MapElement3D

-description

Represents a 3D element displayed on a MapControl.

-remarks

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.

-see-also

-examples

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);