mapbox / mapbox/mapbox-gl-js

Decouple fading for symbol collision from layer on/off

Open
#9,439 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

## Motivation

I'm working on [an app](https://findmyschool.vic.gov.au) where users may rapidly cycle between layers, which get shown/hidden with the `visible` property.

Each time, by default, the symbols of the new layer fade in over maybe 300ms. It's a bit tedious.

If I set it to 0 with `fadeDuration: 0`, that works - but it also affects symbols fading in/out during collision calculation for zooming, which I liked better with the default setting.

Hence I would like to be able to provide different settings for these two things.

### Mock-Up

Does it makes sense to treat `visible` as transitionable, and hence have a `visible-transition` property? I'm not sure.

Alternatively, simply being able to disable fading for visible on/off would be fine:

`.transitionVisibility: false`

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 by tracing how the visible property and fadeDuration are handled in the mapbox-gl-js codebase. Compare fading when layers are shown or hidden with fading during symbol collision calculation while zooming. Done means those behaviors can be configured independently, with coverage for both settings.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.