clicking base map throws error

554
4
08-31-2017 09:51 AM
EvonFranklin
New Contributor III

After clicking anywhere on the base map I get an error in console saying 

Uncaught TypeError: Cannot read property 'position' of undefined
at Object.b.hitTest (MapView.js:699)
at Object.c.hitTest (MapView.js:694)
at MapView.js:735
at Array.map (<anonymous>)
at Object.c.hitTest (MapView.js:735)
at Object._clickHandler (init.js:2063)
at init.js:49
at a._callback (MapView.js:625)
at c._handleEvent (MapView.js:560)
at Object.eventCallback (MapView.js:556)

I have a MapView.on('click',callback()) attached to the mapview however even after I comment out this entire code block I still get the error when clicking anywhere on the base map.

Tags (1)
0 Kudos
4 Replies
KenBuja
MVP Esteemed Contributor

It would help if you posted your code.

0 Kudos
ThomasSolow
Occasional Contributor III

Also, in the sample you posted, you're invoking the callback when you really want to pass it in as an argument.  Try removing the ().

0 Kudos
EvonFranklin
New Contributor III

MapView.on("click", function(evt){
                                             if(view.zoom < 12){
                                                   return;

                                               }

});

Funny thing, even if I comment out this code I still get that error in console. 

0 Kudos
KenBuja
MVP Esteemed Contributor

So what else is in your code? What are the require modules and function arguments, for example? You could have a mismatch between them.

0 Kudos