Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
Supress on click event in react

This is an on-click function for the identifier button. This function will trigger a popup design function when the user clicks on some feature on the map. I want this click functionality on that feature to be suppressed when the user clicks the identifier button a second time. This means the identifier button should act like a start-stop switch.

$("#IdentifierClick").on("click",function () {
            console.log("working");
            // clicktimes = clicktimes+1;
            // console.log("Button click times ",clicktimes)
                
                if((enableIdentify == false))
                {
                        initialMap.on('singleclick', function (evt) 
                        {
                            console.log(evt, "printevt");
                            var myLayerChecked;
                            console.log(layerlist, "printlayerlist");
                            for (let i = 0; i <= 4; i++) 
                            {
                                layerlist[1].values_.layers.array_[i].values_.layers.array_.forEach(arrayItem => {
                                    myLayerChecked = arrayItem.state_.visible;
                                    console.log("myLayerChecked", myLayerChecked);
                                    // console.log(layerlists,"printlayerlist");
                                    if (myLayerChecked == true) {
                                        document.getElementById('popup-content').innerHTML = '<p class="identifier_p"><b>Identifier Details</b></p>';
                                        console.log("My Array Data", arrayItem.values_.source)
                                        designHtml(evt, arrayItem.values_.source, arrayItem.values_.title);
                                        enableIdentify = true;
                                    }
                                    else 
                                    {
                                        console.log("No Layer is checked");
                                    }

                                });
                            }
                        })
                }
                else {
                    
                }
                
        });

The intialMap.on('singleclick',function()) should be enabled and disabled by #IdentifierClick function. Please help me achieve this task.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!