Jaa


MapStyleSheet.TryParseFromJson(String, MapStyleSheet) Method

Definition

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

public:
 static bool TryParseFromJson(Platform::String ^ styleAsJson, [Out] MapStyleSheet ^ & styleSheet);
 static bool TryParseFromJson(winrt::hstring const& styleAsJson, [Out] MapStyleSheet const& & styleSheet);
public static bool TryParseFromJson(string styleAsJson, out MapStyleSheet styleSheet);
Public Shared Function TryParseFromJson (styleAsJson As String, ByRef styleSheet As MapStyleSheet) As Boolean

Parameters

styleAsJson
String

Platform::String

winrt::hstring

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

styleSheet
MapStyleSheet

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

Returns

Boolean

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.

Applies to