Select to view content in your preferred language

4.3 TypeScript ScreenPoint supplied parameters do not match any signature of call target

1469
3
03-23-2017 09:19 AM
DirkVandervoort
Frequent Contributor

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

0 Kudos
3 Replies
JohnGrayson
Esri Alum
private _onPointerDown(evt:PointerEvent) {
    const screenPoint:ScreenPoint = new ScreenPoint({x:evt.x, y:evt.y}); 
}

I believe this should work.

ReneRubalcava
Esri Frequent Contributor

Johns right, the properties? parameter is actually an object with the x/y property values.

0 Kudos
DirkVandervoort
Frequent Contributor

Thank you, I missed the parameter as an object. Funny thing is, I had just solved another problem using that pattern.

0 Kudos