Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

120
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda