I’m trying to draw a polygon that crosses the International Dateline. I am using an ExtentPrimitive to do this. However, this fails; I get an “Invalid arguments” on this line in ExtentGeometry.cs (line number 344 in b22):
var positions = (vertexFormat.position) ? new Float64Array(size * 3) : undefined;
It turns out, size is negative. Size is calculated here (line number 779 in b22):
var size = width * height;
And width comes from (line number 715 in b22):
var width = Math.ceil((extent.east - extent.west) / granularity) + 1;
Which I think is where the problem is. Since my box cross the IDL, my east value is negative and my west value is positive, thus giving me a negative width, which leads to a negative size, causing the above error. If I reverse east and west, the image will draw, but it’s wrapping around the wrong side of the globe (basically, going in the wrong direction). Given that Extent requires east and west to be between -PI and +PI, I don’t really see other options. I’m hoping the fix is as simple as an absolute value on the above line of code. Or is there something I can do on my end to make this work?