AnsweredAssumed Answered

Map click on/off through button.

Question asked by endlessdsire on Jun 13, 2016
Latest reply on Jun 13, 2016 by endlessdsire



I have a toggle button that i need to use for handling the map click. I have the following code but i cannot disable the map click for some reason.

I searched already in the working with events page and i dont know what im missing.


My code is:


    var map = this.props.themap;
    var map_click_handle;

//enable the map click and get the geometry point
    if (this.state.toggleCliente =='OFF'){
      this.setState({toggleCliente: 'ON'});

      map_click_handle = dojo.connect(map, 'onClick', (g)=>{
        console.log("My click", g);
    //disable the map click to not get the geometry point.
      this.setState({toggleCliente: 'OFF'});