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

180
Views
Bucle infinito de Openlayers llamado cuando está claro ()

Creé la función que permite la selección de funciones del mapa, con 2 funciones que se llaman cuando hago clic en la función o cuando hago clic en el mapa (sin función seleccionada)

P.EJ

 select = new ol.interaction.Select({ toggleCondition: this.isMultipleSelectionEnable ? null : ol.events.condition.never, style: selectedStyle }) this.select = select map.addInteraction(select) this.selectedFeatures = select.getFeatures()

Aquí están mis funciones

this.selectedFeatures.on(['add'] function() {} // add feature to map) y this.selectedFeatures.on(['remove']function(){this.map.clear())

Esto funciona bien cuando hago clic en mi mapa, pero cada vez que llamo a la función clear() para borrar las selectedFeatures de otro componente, automáticamente llama a la función 'eliminar' de OL, creando un bucle infinito.

¿Cómo puedo resolver esto? ¿Cómo podemos borrar las características seleccionadas del mapa sin activar la función "eliminar" de OL? ¿O podemos llamar directamente a 'eliminar' de otro componente?

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!