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

219
Views
¿Cómo limito el número de polígonos en una capa?

Mi código actualmente le permite al usuario tener la capacidad de crear muchos polígonos a la vez. En su lugar, me gustaría borrar el vector anterior cada vez que el usuario decide crear uno nuevo.

 let drawSource = new VectorSource({wrapX: false}); let drawLayer = new VectorLayer({source : drawSource,}) this.map.addLayer(drawLayer); let draw = new Draw({ source : drawSource, type : GeometryType.POLYGON, style : new Style({ stroke: new Stroke({ color: "#f00", width: 1, }), fill: new Fill({ color: "#300", }) }) }); this.map.addInteraction(draw)
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Borrar la fuente cuando se inicia un nuevo dibujo

 draw.on('drawstart', function() { drawSource.clear(); });
about 4 years ago · Juan Pablo Isaza Report
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!