AnsweredAssumed Answered

Creating PictureFillSymbol using JSON - use pixels instead of points

Question asked by vygintasc on Oct 6, 2014
Latest reply on Oct 7, 2014 by rscheitlin

I've noticed that when PictureFillSymbol is created from a JSON object, width and height are defined in points. This is an issue because when I read PictureFillSymbol width and height properties after it has been created, they both return pixels.

 

Here is an excerpt from the API documentation (http://https://developers.arcgis.com/javascript/jsapi/picturefillsymbol-amd.html) :

 

Note that when specifying symbol width and height using JSON the values should be entered in points, the JavaScript API then converts the point values to pixels.

 

Sample code:

 

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

 

Is there any way to avoid this conversion? Alternatively, is there functionality convert pixels back to points?

Outcomes