AnsweredAssumed Answered

Map click events and related WAB documentation

Question asked by hesscorp on Jan 22, 2015
Latest reply on Sep 1, 2017 by andrew.davis_DallasGIS

So i'm just kicking off my first WAB widget and immediately running into an issue trying to set map click handlers when the widget is opened. Looking through the esri coordinate widget i found this...


this.own(on(, "click", lang.hitch(this, this.onMapClick)));


But I just can't get it to register the event, here's my full code...


function(declare, BaseWidget) {
  //To create a widget, you need to derive from BaseWidget.
  return declare([BaseWidget], {
    // Custom widget code goes here 

      baseClass: 'jimu-widget-customwidget',

      startup: function() {
  //this.mapIdNode.innerHTML = 'map id:' + String(;
   onOpen: function(){
  this.own(on(, "click", lang.hitch(this, this.onMapClick)));
   onMapClick: function(event) {
  window.alert('map click');
     this.mapIdNode.innerHTML = 'map id:' + String(event.mapPoint.x);


I'm very confused why this isn't working.


Also does anyone know where i can find better documentation specific to the WAB? i also found this in the measurement widget and trying to work out the differences is giving me a headache, there seems to be a lot of methods/functions not found in the JSAPI and it would be nice to know what they are.


if ( && {
          var handler =;
          if (handler) {
   = null;


Thanks all!