MapStyleSheet.TryParseFromJson(String, MapStyleSheet) MapStyleSheet.TryParseFromJson(String, MapStyleSheet) MapStyleSheet.TryParseFromJson(String, MapStyleSheet) MapStyleSheet.TryParseFromJson(String, MapStyleSheet) Method

Definition

Creates stylesheet by parsing a JSON markup string that defines a set of custom rules.

public : static Platform::Boolean TryParseFromJson(Platform::String styleAsJson, MapStyleSheet styleSheet)
static bool TryParseFromJson(winrt::hstring styleAsJson, MapStyleSheet const& styleSheet) const;
public static bool TryParseFromJson(String styleAsJson, MapStyleSheet styleSheet)
Public Shared Function TryParseFromJson(styleAsJson As String, styleSheet As MapStyleSheet) As bool

Parameters

styleAsJson
String String

A JSON markup string that defines a set of custom rules.

styleSheet
MapStyleSheet MapStyleSheet MapStyleSheet MapStyleSheet

The MapStyleSheet that will represent the rules defined in JSON markup string.

Returns

bool bool

true if the operation completed successfully; otherwise, false.

Remarks

To learn more about the properties that you can use in your JSON string to define styles, see Map stylesheet reference.

If there's an error in the JSON markup string, this method does not throw an exception. Instead, it returns false.