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.

貢獻者指南