Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

165
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda