According to the API reference ScreenPoint | API Reference | ArcGIS API for JavaScript 4.3
In my custom widget I have a method that does something with a ScreenPoint. Below are two attempt at the method:
private _onPointerDown(evt:PointerEvent) {
const xx:Number = Number(evt.x);
const yy:Number = Number(evt.y);
const screenPoint:ScreenPoint = new ScreenPoint('esri.folder.className', xx, yy); // Errors at TSC with: Supplied parameters do not match any signature of call target.
// but still transpiles successfully
// do something with the screenPoint
}
private _onPointerDown(evt:PointerEvent) {
const xx:Number = Number(evt.x);
const yy:Number = Number(evt.y);
const screenPoint:ScreenPoint = new ScreenPoint(xx, yy); // Errors at TSC with: Supplied parameters do not match any signature of call target.
// but still transpiles successfully
// do something with the screenPoint
}
Both tsx files expose this problem
'Error'message: 'Supplied parameters do not match any signature of call target.'
yet both compile to JavaScript the execute correctly.
In the name of a clean build, how can I remove that problem from my build?
TIA
private _onPointerDown(evt:PointerEvent) {
const screenPoint:ScreenPoint = new ScreenPoint({x:evt.x, y:evt.y});
}
I believe this should work.
Johns right, the properties? parameter is actually an object with the x/y property values.
Thank you, I missed the parameter as an object. Funny thing is, I had just solved another problem using that pattern.