Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Allow MGLStyle.performsPlacementTransitions to be set on individual layers #303

Closed
ronyfadel opened this issue May 14, 2020 · 3 comments
Closed
Labels
archived enhancement New feature or request

Comments

@ronyfadel
Copy link

ronyfadel commented May 14, 2020

Currently it's possible to set performsPlacementTransitions on MGLStyle, but not on an individual layer. It seems that the API is all (layers) or nothing.

For our purposes, we want to set a shape on a source that is backed by a layer, but setting that shape is animating its icons on the map (a fade-in with duration style.transition.duration. For that particular layer, we want the icons to appear immediately (no fade).

If we set performsPlacementTransitions to false on the style, it works, but now all the style's layers adopt that behavior (no transition), including country names, roads, etc.. we want to keep on animating these other placements with a fade (style's default).

It seems that it is currently impossibly to configure performsPlacementTransitions per layer?

Mapbox SDK versions: 5.9.0
iOS/macOS versions: iOS 12.4
Device/simulator models: iPhone XR, iOS 12.4
Xcode version: Version 10.3 (10G8)

@captainbarbosa
Copy link
Contributor

Hi @ronyfadel - yes, performsPlacementTransitions only works on the whole style itself (introduced in mapbox/mapbox-gl-native#13565). I think you may be the first person to ask about allowing this on a per-layer basis, so I'll keep this ticket open to make sure your request is remembered. Thanks!

@captainbarbosa captainbarbosa changed the title Cannot set performsPlacementTransitions on individual layers Allow MGLStyle.performsPlacementTransitions to be set on individual layers May 14, 2020
@captainbarbosa captainbarbosa added enhancement New feature or request and removed status: triage labels May 14, 2020
@ronyfadel
Copy link
Author

Hi @captainbarbosa, in the meantime, is there a way to set a shape on a source, and have that setting/placement be non-animated, but have all other layers animate?

It seems that setting layer.isVisible is also animated?

@stale stale bot added the archived label Nov 15, 2020
@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

@stale stale bot closed this as completed Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants