idolevi

Creating Symbol from JSON issue

Discussion created by idolevi on May 23, 2013
Hi,
I'm using JS API 3.4, I get a JS exception when I create renderer from string that I parsed to JSON.
I succeed to isolate the problem, and discovered that the problem is actually in the symbol that was created from JSON.

I took an example from the API Reference and succeed to reproduce the problem, this is the code snippet i took from the API Reference:

var symbol =  new esri.symbol.PictureMarkerSymbol({
  "url":"graphics/redArrow2.png",
  "height":20,
  "width":20,
  "type":"esriPMS"
});

until here all's good, but now I want to convert it back again to JSON (when I do this, I get the same exception as I get from the renderer):

symbol.toJson();

UPDATE:
The JS code in init.js try to use private members from this.constructor, but it's empty if creating the symbol from JSON so I get exception.

If the symbol is created by passing all parameters and not by JSON, this.constructor contains the private members.

Any Idea?

Outcomes