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.

854
1
07-29-2016 08:08 AM
kyleknoche
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(this.map, "onclick", function (evt)

         {

             alert("map clicked");

         });

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

Kyle,

  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 = this.map.on("click", function(){

alert("map clicked"):

});

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