Skip to content

Latest commit

 

History

History
72 lines (49 loc) · 2 KB

mapstylesheet_combine_123662630.md

File metadata and controls

72 lines (49 loc) · 2 KB
-api-id -api-type
M:Windows.UI.Xaml.Controls.Maps.MapStyleSheet.Combine(Windows.Foundation.Collections.IIterable{Windows.UI.Xaml.Controls.Maps.MapStyleSheet})
winrt method

Windows.UI.Xaml.Controls.Maps.MapStyleSheet.Combine

-description

Combines the rules defined in two MapStyleSheet instances.

-parameters

-param styleSheets

The MapStyleSheet instances that you want to combine.

-returns

A MapStyleSheet instance that contains the combined rules defined in each MapStyleSheet instance that you passed to the styleSheets parameter.

-remarks

If both MapStyleSheet instances define the same rule, the last instance will override the rule defined in the first instance.

-see-also

-examples

The following example combines rules from two MapStyleSheet instances into one MapStyleSheet instance.

To learn more about the properties used in this example, see Map stylesheet reference.

string jsonString = @"{
  ""version"": ""1.*"",
  ""settings"": {
    ""rasterRegionsVisible"":true,
    ""spaceColor"":""#000000""
    },
  ""elements"":{
    ""majorRoad"":{
      ""labelColor"":""#490B7D"",
      ""labelScale"":1.5,
      ""font"": ""Comic Sans MS""
    }
  }
}";

string jsonString2 = @"{
  ""version"": ""1.*"",
  ""settings"":{
    ""landColor"":""#FFC8DD""
  }
}";

MapStyleSheet myCustomStyleSheet = MapStyleSheet.ParseFromJson(jsonString);
MapStyleSheet myCustomStyleSheet2 = MapStyleSheet.ParseFromJson(jsonString2);

List<MapStyleSheet> myList = new List<MapStyleSheet>();
myList.Add(myCustomStyleSheet);
myList.Add(myCustomStyleSheet2);

myMap.StyleSheet = MapStyleSheet.Combine(myList);