openstreetmap/iD

Osmose layer white icons race condition

开放

#7,610 创建于 2020年5月17日

 (3 条评论) (0 个反应) (0 位负责人)JavaScript (1,449 个派生)github user discovery
bughelp wantedmap-renderer

仓库指标

星标
 (3,818 个星标)
PR 合并指标
 (平均合并 29天 14小时) (30 天内合并 82 个 PR)

描述

This is a very minor rendering issue that can occur when the Osmose layer is first enabled. Opening this ticket just to track that it's known. Copied from #7609:

So there's currently a bit of a race condition when first enabling the Osmose layer:

  1. Issue details (strings and colours) are all requested from the API upon first toggling the layer.
  2. Independently, the rendering begins to tell the Osmose service to request issue tiles from the API as needed to cover the viewport.
  3. If any issue tile requests are resolved before all of the detail requests resolve, then it's possible for issues to be rendered (in white) before their appropriate colour is known.

I've looked into forcing the layer rendering to wait for all the detail promises (requests) to resolve in the past and seem to remember finding it wasn't trivial because of the way data layers are implemented currently. If I'm not mistaken it's not so simple to implement logic to delay a specific layer from being shown, you'd need to tweak the framework to allow for that first.

User can force re-rendering of the icons (pan viewport or toggle the layer) to correct this once the colour requests are resolved.

贡献者指南