I'm trying to figure out how to listen for pointer events on a MapView in my widget. I'm not getting very far... For example:
postInitialize() {
watchUtils.on(this, "view", "pointer-down", () => this._onPointerDown());
}
will fire the _onPointerDown method when the MapView is clicked on. However, what I'm really interested in are the properties of the pointer-down event. e.g., x, y, etc. : MapView | API Reference | ArcGIS API for JavaScript 4.3
Any advice is appreciated - I'm just looking for an opening TIA
Solved! Go to Solution.
You need to use the instance of MapView to add listener for the event like below.
mapView.on("pointer-down",() => this._onPointerDown());
You need to use the instance of MapView to add listener for the event like below.
mapView.on("pointer-down",() => this._onPointerDown());
Yep!
this.view.on("pointer-down",(evt:PointerEvent) => this._onPointerDown(evt));
and
private _onPointerDown(evt:PointerEvent) { // do something with the evt }
Brilliant!
My "this" keyword is not available.... Am I the only one? Using AngularJS.