Repository navigation
Conversation
Every layer this SDK adds now goes in with the beforeId from overlayLayerBeforeId() (js-sdk-core overlayStackBeforeId), so the stack is raster < ground image < polygon < circle < polyline < marker whatever order overlays were added in, re-sent in after clearOverlays(), or put back in after a style swap. Before: - circles went in before the polygon fill, so under the polygons; - ground images and polylines were appended at the top, so a ground image added (or re-sent after clearOverlays()) after the polygons covered them and the polyline; - a raster went under the first basemap label only, not under our layers when those sat below the labels. Rasters keep going under the basemap labels as well (unchanged), and are ordered by zIndex among themselves; a zIndex change moves the layer. Marker tiles, mounted as a raster, sit with the markers. Labels stay under the ground images, shapes and markers (unchanged). OverlayStackOrder.test.mjs drives the real layer classes on a fake GL map: all 120 insertion orders, a ground image and raster re-sent after the others, a style swap, raster zIndex. It fails on the old code (circles under polygons, the re-sent ground image on top) and passes now. Needs the js-sdk-core release with overlayStackBeforeId (fix/overlay-stacking-order).
This was referenced Nov 8, 2026
Open
Open
Open
Open
Open
Open
Open
Open
This was referenced Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
なぜ
利用者の決定で、すべてのプロバイダ・3 プラットフォームで、オーバーレイを下から次の順に重ねます。
追加した順・送り直した順(clearOverlays の後など)・デザイン変更の後に左右されません。帯の中は zIndex、同じ zIndex なら渡された順です。
プロバイダごとに重なり順がばらばらでした(TomTom のラスターがポリゴンを覆う、送り直した GroundImage がポリゴンより上に来る、GL 系でサークルがポリゴンの下になる、など)。
何を変えたか
SDK が足すすべてのレイヤーを
overlayLayerBeforeId()(js-sdk-core のoverlayStackBeforeId)の beforeId で入れるようにしました。前の並び: サークルがポリゴンの塗りより前に入りポリゴンの下、GroundImage とポリラインは一番上に追加され、ポリゴンの後に足した(clearOverlays の後に送り直した)GroundImage がポリゴンとポリラインを覆っていました。ラスターはベースマップの最初のラベルの下に入るだけで、ラベルより下にある自分のレイヤーの下にはなっていませんでした。
ラスターは今までどおりラベルの下で、ラスターどうしは zIndex の順です。マーカータイルはマーカーと一緒です。
OverlayStackOrder.test.mjsが偽の GL map の上で本物のレイヤークラスを動かし、120 通りの追加順・送り直し・スタイルの差し替え・ラスターの zIndex を確かめます(前のコードでは落ちます)。地図のラベルとの関係(今のまま)
今のままです。GL 系(MapLibre・Mapbox・MapTiler・Mappls・TomTom・Longdo)は、ラスターがベースマップのラベルの下、GroundImage・図形・マーカーはラベルの上(変更なし)。ラスターの帯を一番下にする決定とは矛盾しません(ラスターは自分の他のレイヤーより下で、かつラベルの下)。ラベルの扱いを変えるなら別の判断が必要です。
検証
2026-11-08 に develop(fix/mapview-teardown、fix/geodesic-polygon-fill、fix/clear-followups、refactor/polygon-controller などのマージ後)の上に載せ直してから確かめています。
OverlayStacking.test.mjs(追加順 5040 通り)、GL 系 6 本のOverlayStackOrder.test.mjs(120 通り・送り直し・スタイルの差し替え)が通ります。test/PolygonController.test.mjsの偽の地図にgetLayersOrder()を 1 行足しました(stacking は今のレイヤー順を読んで beforeId を決めるため。本物の地図にはある API で、テストの期待する並びは変えていません)。確認できていないもの
関連 PR(
fix/overlay-stacking-orderの一式)マージの順番:
fix/clear-strategyの一式(先に入れる想定。衝突はしないことをgit merge-treeで確認済み)fix/maptiler-overlay-restoreの上に載せています(同じ削除処理を両方が書き換えたため)。先に restore の PR(Remove style layers and sources by object so they can come back android-for-maptiler#17)を入れてください。