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

106
Vistas
Is there any way to access the locations for a vector layer in OpenLayers?

I created a vector layer called "locationGeoJSON" in OpenLayers using a GeoJSON file and I'm trying to use the .getSource() method to access the location data for the layer. I'm currently using a workaround where I access the location data with locationGeoJSON.getSource().Uu. But I feel like there's some get method that can be used to retrieve the data in a more appropriate manner. I've tried using locationGeoJSON.getSource().getFeatures(), but I just get an empty array in return. Can anyone give some insight into this issue? Here is the console output after I use .getSource() on my vector layer. How do I access the "Uu" property?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

locationGeoJSON.getSource().getFeatures() is correct, but you may have to wait for the geojson file to load before calling it.

locationGeoJSON.getSource().on('featuresloadend', function (evt) {
    console.log(evt.target.getFeatures());
});

The object in the console output already has the features because it is linked to the original object and refreshes whenever its state changes.

about 4 years ago · Juan Pablo Isaza Denunciar
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