AnsweredAssumed Answered

Problem with PictureFillSymbol in 4.2

Question asked by jon.crain on Feb 27, 2017
Latest reply on Mar 2, 2017 by khutchins-esristaff

I'm having issues with PictureFillSymbol.  

 

Using this code

 

var polygon = new Polygon({
    rings: [
        [
            [-97.06138, 32.837, 0],
            [-100.06133, 35.836, 0],
            [-100.06124, 32.834, 0],
            [-97.06138, 32.837, 0]
        ], [
            [0, 0, 0],
            [0, 0, 0],
            [0, 0, 0],
            [0, 0, 0]
        ]
    ],
    hasZ: false,
    hasM: false,
    spatialReference: { wkid: 4326 }
});

// This works
// var fillSymbol = new SimpleFillSymbol({
//   color: new Color([227, 139, 79, 0.8]),
//   outline: { // autocasts as new SimpleLineSymbol()
//     color: new Color([255, 255, 255]),
//     width: 1
//   }
// });

// This gives an error
var fillSymbol = new PictureFillSymbol({
    url: url,
    width: 12,
    height: 12,
    xoffset: 0,
    xscale: 1,
    yoffset: 0,
    yscale: 1,
    outline: {
        color: new Color([255, 255, 255]),
        width: 1
    }
});

var polygonGraphic = new Graphic({
    geometry: polygon,
    symbol: fillSymbol
});

layer.add(polygonGraphic);

 

I get this error

 

Uncaught TypeError: Right-hand side of 'instanceof' is not an object
    at b.l._getParentSurface (MapView.js:333)
    at b.l._setFillObject (MapView.js:333)
    at b.l.setFill (MapView.js:330)
    at Object.m.styleShape (MapView.js:381)
    at f.render (MapView.js:368)
    at d.renderChild (MapView.js:364)
    at d.renderChildren (MapView.js:259)
    at d.render (MapView.js:255)
    at m.renderChild (MapView.js:290)
    at m.d.renderChildren (MapView.js:259)

 

I've tried this with a couple different pictures including locally hosted ones and external ones, same error.  I've logged all the objects and they all seem to be created fine, there's just this error on render.

Outcomes