AnsweredAssumed Answered

Clear Checkboxes and remove map click event

Question asked by tanguyen88 on Aug 4, 2015
Latest reply on Aug 5, 2015 by rscheitlin
Branched from an earlier discussion

Hi Robert!

 

Thank you! I added in a button that clears the graphics and I would like for it to uncheck the checkboxes as well.

I also tried to tweak onClose so that when you close the widget, and click on a feature, the buffer is still there, and you get a pop-up describing the feature. I haven't been able to figure how to get the original map.on(.'click') to be silent.

in Widget.html:

<div><button data-dojo-type="dijit/form/Button" type="button" data-dojo-attach-event="click:_clearall" id="clearGraphics">Clear Graphics</button></div>

 

in Widget.js:

  _clearall: function() {

            console.log("button clicked");

            this.map.graphics.clear();

            var n = query(".box");

            n.checked=false;

            },

//onClose is placed after startup()

        onClose: function(){

       console.log('onClose');

       var q = query(".box");

       q.forEach(domConstruct.destroy);

  

     }

Can you provide some tips? Thank you so much!

 

TA

Outcomes