Uncaught TypeError: toolbar.on is not a function

2154
5
02-01-2016 10:10 PM
NoorAlabdulmohsin
New Contributor

Hi all,

I am new to ArcGIS, and I just started with letting my app able to draw on the map various shapes. I keep getting this error that toolbar.on is not a function when I run Google Chrome debugger. I will appreciate any help! Thank you

Capture.PNG

0 Kudos
5 Replies
MiriamBrockmann
Occasional Contributor

Hi!

have you try it this way?

          on(drawToolbar, "DrawEnd", function(evt){....});

Regards

0 Kudos
NoorAlabdulmohsin
New Contributor

it did work by it self, but now I am trying to let the tool draw multiple shapes and I am using the switch statement to activate the tool and it seems like it doesn't go through the switch at all! Thank you so much for helping me out!

0 Kudos
KenBuja
MVP Honored Contributor

What is the order of the modules in your "require" section and the arguments in your "function" section? Check to see whether "Draw" is in the correct order as the ""esri/toolbars/draw"

0 Kudos
NoorAlabdulmohsin
New Contributor

it did work by it self, but now I am trying to let the tool draw multiple shapes and I am using the switch statement to activate the tool and it seems like it doesn't go through the switch at all! Thank you so much for helping me out!

0 Kudos
NoorAlabdulmohsin
New Contributor

But yes you were right in a point, I had the library for Buttons duplicated in my function which caused the program to crash

0 Kudos