MapElement.MapStyleSheetEntry MapElement.MapStyleSheetEntry MapElement.MapStyleSheetEntry MapElement.MapStyleSheetEntry Property

Definition

Gets or sets the name of an entry in the map's style sheet that you'd like to apply to this MapElement.

public : Platform::String MapStyleSheetEntry { get; set; }
winrt::hstring MapStyleSheetEntry();

void MapStyleSheetEntry(winrt::hstring mapstylesheetentry);
public string MapStyleSheetEntry { get; set; }
Public ReadWrite Property MapStyleSheetEntry As string

Property Value

string string

The name of the entry in the map's style sheet that you'd like to apply to this MapElement. This name may be an existing map element (see remarks) that acts like an existing base map element of that type. Or the name may be an extension that is not used by the base map but is set by the style sheet creator and can be changed without affecting the base map (see the example code).

Additional features and requirements

Device family
Windows 10 Fall Creators Update (introduced v10.0.16299.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v5)

Examples

string myStyleSheetJson = @"{""version"": ""1.*"",
  ""elements"":{
    ""foodPoint"":{
      ""iconColor"":""#FF000000""}},
  ""extensions"":{
    ""myNamespace"":{
      ""myFoodPoint"":{
        ""parent"":""foodPoint"",
        ""scale"":2}}}}";

myMap.StyleSheet = MapStyleSheet.ParseFromJson(myStyleSheetJson);
myMap.MapElements.Add(new MapIcon
{
  Location = new Geopoint(new BasicGeoposition { Latitude = 50, Longitude = -120 }),
  MapStyleSheetEntry = MapStyleSheetEntries.FoodPoint,
});
myMap.MapElements.Add(new MapIcon
{
  Location = new Geopoint(new BasicGeoposition { Latitude = 44, Longitude = -120 }),
  MapStyleSheetEntry = "myNamespace.myFoodPoint",
});

Remarks

Set this property to a string or to any of the property values available in the MapStyleSheetEntries class.

To learn more about entries in a map style sheet, see Map style sheet reference.