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

204
Views
Cómo agregar estilo a una característica

Uso vue3-openlayers y quiero agregar polígonos a una fuente vectorial.

Esta es una parte de la plantilla con la capa vectorial y el vector fuente.

 <ol-vector-layer> <ol-source-vector ref="source"></ol-source-vector> </ol-vector-layer>

La sección del guión:

 Feature = inject("ol-feature"); Geom = inject("ol-geom"); source = ref(null); mounted() { const coords = [[11.5647931, 47.2522687], [11.5649255, 47.2522687], [11.5649254, 47.2521789]]; const geometry = new this.Geom.Polygon([coords]); const feature = new this.Feature({ geometry: geometry, }); this.source.source.addFeature(feature); }

¿Cómo puedo agregar un ancho de trazo y un color de relleno a la función?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Después de crear una función, puede establecer el estilo en la función. Por ejemplo:

 const coords = [[11.5647931, 47.2522687], [11.5649255, 47.2522687], [11.5649254, 47.2521789]]; const geometry = new this.Geom.Polygon([coords]); const feature = new this.Feature({ geometry: geometry, }); feature.setStyle(myNewStyle); // This can be a single style object, an array of styles, or a functio this.source.source.addFeature(feature);

Puede leer más sobre eso aquí: https://openlayers.org/en/latest/apidoc/module-ol_Feature-Feature.html#setStyle

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!