openlayers / openlayers/openlayers

Dashed line performance

Open
#10,139 12 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
12.6k
Forks
3.2k
Avg merge
2d 17h
Merged PRs (30d)
21

Description

Describe the bug
Long dashed lines reduce render performance by a lot.
See also #5520 and #5645

To Reproduce

  1. Go to https://codesandbox.io/s/flamboyant-paper-sjb3m
  • Checkbox changes styles from dashed to continuous line
  • Select input switches different features
  1. Compare zooming in / out with the different options
  • Non-dashed lines are fine.
  • Subdividing the line into multiple segments doesn't help.
  • Using a MultiLineString (as suggested in one of the linked issues) with multiple short line segments instead of a LineString with multiple segments doesn't seem to help either.
  • Using multiple Features with short lines helps, though the dashes are no longer continuous, which looks bad especially on low zoom levels.

Does openlayers simplify the subdivided geometry again?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the CodeSandbox reproduction linked in the issue and compare zooming performance for dashed and continuous lines across the listed geometry and feature options. Read the related issues #5520 and #5645 for prior investigation. Done means identifying and addressing the dashed-line performance problem without losing continuous dash rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.