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

159
Views
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
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!