mapbox / mapbox/mapbox-gl-js

Pattern scale reset

Open
#6,296 8 comments 9 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cross-platform :tv: feature :green_apple:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

**Current Issue**
In order for fill patterns to scale with tile sizes between zoom level integers, patterns are scaled up to 200%. If a map designer wants to use a fill pattern, they must be okay with a large range of pattern scaling for their map (_a_). If the map comes to rest in-between integer zoom levels, the patterns can be way off the intended map design (_b_).

**Proposed Solution**
Reset the pattern scale to 100% when the map is at rest. “Rest” could be defined by 200ms of no zooming, but this should be tested. If a user is zooming in and out with a high frequency of stops, a constant resetting of pattern scale could be visually distracting. Currently, place-labels and other symbol layers are being re-rendered when the map is ‘at rest,’ so perhaps resetting the pattern scale would go unnoticed. I could see this enhancement being beneficial for line patterns as well.

_a: scaling range of fill-patterns for one zoom level_
![proposal1-1](https://user-images.githubusercontent.com/16616543/37106884-2b2105ce-2233-11e8-86ab-1228f860e2ab.png)

_b: visual difference between scale polars_
![proposal1-2](https://user-images.githubusercontent.com/16616543/37106886-2e8a0d82-2233-11e8-9713-3c048a3bf556.png)

cc @ansis @kkaefer @eschow @nickidlugash

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

The issue names no files or tests; start by tracing fill-pattern scaling and the existing at-rest rerender path in mapbox-gl-js. Test stops between integer zoom levels, including rapid repeated stops, and consider the work done when fill and possibly line patterns reset to the intended scale without distracting flicker.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.