dvela

Esri.symbol.fromJson does not support CartographicLineSymbol toJson ouput

Discussion created by dvela on Mar 27, 2013
var sym = esri.symbol.fromJson({                        "color" : [255, 0, 0, 128],
                        "width" : 6,
                        "type" : "esriCLS",
                        "style" : "esriSLSSolid",
                        "cap" : "esriLCSRound",
                        "join" : "esriLJSRound"
                    });

This returns a null.

Update
As a work around I tested for the "cap" property since CartographicLineSymbol is the only one
that has it.

function GetSymbol(jsonSymbol) {        
    if (jsonSymbol.cap)            
      return new esri.symbol.CartographicLineSymbol(jsonSymbol);        
    else            
     return esri.symbol.fromJson(jsonSymbol);    
}

Outcomes