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

227
Views
Vector layer being drawn before the Openlayers map?

this is my code for the drawing

 const drawLines = () => {

    const points = [[-89.8802, 32.5804], [44.419834, -97.568073]];

    const featureLine = new Feature({
      geometry: new LineString(points),
    });

    const vectorLine = new VectorSource({});
    vectorLine.addFeature(featureLine);

    const vectorLineLayer = new VectorLayer({
      source: vectorLine,
      style: new Style({
        fill: new Fill({ color: 'red', weight: 10 }),
        stroke: new Stroke({ color: 'red', width: 10 }),
      }),
    });
    mapReference.addLayer(vectorLineLayer);

  };

however I see that my drawing happens before my map is actually displayed and my map sits on top of it. breakpoint for when drawing is done

How can I make sure that my drawing is done after my map is displayed?

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!