MapStyleSheet.TryParseFromJson(String, MapStyleSheet) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.