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

162
Vistas
Openlayers Layers are populated but Features don't show

The application is svelte, but I don't think svelte is the cause of this problem.

What the application is doing:

  1. Check local dexie.js cache for graph data
  2. Check with server if graph is correct and current (If it's the wrong graph, fetch the right one, if it's not current, fetch the diff, if everything is up-to-date, be happy)
  3. Update svelte stores (reactive arrays), which triggers everyting else reactively
  4. Transform data into several ol.Source objects containing ol.Feature objects (done via svelte derived stores; think reactive .map functions)
  5. Show features in map

What's the problem?

If the graph is correct and current and one of these other cases is present

  1. directly opening the application on the server
  2. running the frontend locally and delaying the data websocket connection until after startup

step 5 will not happen for some reason. All features are created correctly and the sources are loaded into their corresponding layers, but those layers don't show up visually.

  • The features data is there ( I can jump to their location via view.animate(), I can programmatically select them into a selection layer, where they show up correctly )
  • I have checked Layer visibility, and they report correctly
  • The layer's styleFunction is never called!

The current workaround is to just wait for svelte to finish its current update cycle with await tick(), and then update the svelte stores again. While this works fine, I'm not statisfied with the solution. All the data is already there before. Completely reloading ~5k features to get the map to refresh seems very overkill. (event if it's resonably fast)

What else have I tried?

  • Calling .changed() on anything and everything
  • Toggling Layer visibility
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