Skip to content

Conversation

@LukasPaczos
Copy link

Description

Attempts to improve #5687.

The problem is that when an alternative route changes, we clear its GeoJsonSource data and reset the expression to remove the vanishing portion. However, due to the async nature of the renderer, the expression that removes the vanishing portion (making all layer visible) is applied faster then the call that clears the source, briefly uncovering the whole geometry.

One factor here is the fact that by default Android Maps SDK parses the geometries on a worker thread, even if the geometry is empty, which unnecessarily adds a delay of context switching to the equation. In the current state of the branch I'm skipping the async parsing and setting the empty source directly.

Before:

device-2022-04-04-140840.mp4

After:

device-2022-04-11-133909.mp4

This by no means resolves the problem but does seem to improve it ever so slightly. It looks like we'd need an API that would allow us to batch both source and layer property updates together, similarly to existing setStyleSourceProperties and setStyleLayerProperties, something like setStyleProperties([{source ID, property}, {layer ID, property}]).

Opening this just as a POC, we can consider merging but don't really need to as we'd have to resolve the root cause anyway.

cc @cafesilencio @zmiao @alexshalamov @tobrun @kiryldz

@LukasPaczos LukasPaczos added the bug Defect to be fixed. label Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Defect to be fixed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant