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

294
Vistas
Arc.js not drawing line in OpenLayers 6

my code is

    const testSource = new VectorSource({
      loader: () => {
        const start2 = { x: 43.449928, y: 39.956589 };
        const end2 = { x: 55.606186, y: 49.278728 };

        const generator = new arc.GreatCircle(start2, end2);


        const line = generator.Arc(100, { offset: 10 });
        const features = [];
        line.geometries.forEach((geometry) => {
          const line = new LineString(geometry.coords);
          line.transform('EPSG:4326', 'EPSG:3857');
          const style = new Style({
            stroke: new Stroke({
              color: '#EAE911',
              width: 2,
            }),
          });

          features.push(new Feature({ geometry: line }));

          features.forEach((feature) => {
            feature.setStyle(style);
            testSource.addFeature(feature);
          });
        });
      },
    });

    const vectorLineLayer = new VectorLayer({
      className: 'drawing-layer',
      source: testSource,
    });
    mapReference.addLayer(vectorLineLayer);

I can see that the source exists inside my layer but it will not draw no matter what I do, any ideas? It's not a zIndex issue because I have my vectorLayer CSS set zIndex.

EDIT 5/2/2022 turns out this line was giving me issues,

line.transform('EPSG:4326', 'EPSG:3857');

it was somehow turning my flat coordinates into insane lat/lon. deleting it now shows my curved lines

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