Select to view content in your preferred language

Esri.symbol.fromJson does not support CartographicLineSymbol toJson ouput

805
0
03-27-2013 10:17 AM
DonnyVelazquez
Frequent Contributor
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);    
}
0 Kudos
0 Replies