Converts input json into a symbol, returns null if the input json represents an unknown or unsupported symbol type. The input json argument typically comes from one of the following:
- Calling the symbol.toJson() method
var duplicate = esri.symbol.fromJson(simpleMarkerSymbol.toJson());
- Symbol object returned from REST.
When you create a MarkerSymbol, SimpleMarkerSymbol or PictureMarkerSymbol from a JSON object, you may specify a property angle to rotate the symbol. Be aware that the angle in the JSON is different from MarkerSymbol.angle. The angle in the JSON follows the traditional ArcGIS specification and is rotated counter-clockwise, whereas the angle in the symbol is rotated clockwise.
For example, the following code with angle=-30 in the JSON will create a symbol rotated -30 degrees counter-clockwise; that is, 30 degrees clockwise, which symbol.angle=30 would also produce.
var symbol = jsonUtils.fromJson({
"angle": -30,
"xoffset": 0,
"yoffset": 0,
"type": "esriPMS",
"url": "http://www.esri.com/careers/profiles/~/media/Images/Content/graphics/icons/socialmedia/pinterest1.png",
"width": 18,
"height": 18
});