How do you get default "onclick" behavior from the map object using webappbuilder? Currently i'm using the main.js file to hook up the events.

07-29-2016 08:08 AM
New Contributor

I have built sites before using the JS API but am new to webappbuilder.

I'm having difficulty finding any documentation on how to set up the "onClick" behavior of the map object.  Currently i'm using something like this :

clickeventhandler = dojo.connect(, "onclick", function (evt)


             alert("map clicked");


0 Kudos
1 Reply
MVP Legendary Contributor


  You should add your map click event in the MapManager.js or a custom Widget.js, depending on what you are wanting to do:

clickeventhandler ="click", function(){

alert("map clicked"):


You need to stay away from using dojo.connect as it has been superseded by "on"