Repository navigation
Conversation
Overlays removed from a MapTiler map - a polygon, circle, raster layer, ground image or polyline taken out of the composition, or everything after clearOverlays() - did not come back when added again with the same id. MTStyle remembers every source and layer it added, by id, and refuses to add the same id again (SourceAlreadyExists / LayerAlreadyExists, which the renderers caught and logged). removeSourceById / removeLayerById only remove them from the page and leave that record behind; removeSource / removeLayer clear it too. Remove by object everywhere the renderers take a source or layer out, falling back to the id when MTStyle has no record of it (its add records asynchronously). The same applies to the background layer the vector-style mutation target adds and removes. A raster layer whose source changes is removed and re-added under the same ids, so that path was broken too. MapTilerStyleRemovalTest drives a real MTStyle through a recording command executor: removing by id leaves the id recorded; removing by object lets the same id be added again.
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.
なぜ
MapTiler の地図から外したオーバーレイ(ポリゴン・サークル・ラスター・GroundImage・ポリライン、または
clearOverlays()の後のすべて)を、同じ id で足し直しても地図に戻りませんでした。MTStyle は addLayer / addSource したものを id で覚えていて、同じ id をもう一度足そうとすると
LayerAlreadyExists/SourceAlreadyExistsを投げます(レンダラはそれを catch してログに出すだけでした)。removeLayerById/removeSourceByIdはページ(MapLibre GL JS)から消すだけで、この記録を残します。removeLayer(layer)/removeSource(source)は記録も消してからページへ渡します。何を変えたか
MapTilerStyleRemoval.ktのremoveLayerAndForget/removeSourceAndForget)。MTStyle に記録が無いとき(add の記録は SDK のコルーチンで遅れて入る)は id でページから消します。MapTilerStyleRemovalTest: 本物の MTStyle を、記録を取る command executor で動かします。id で外すと記録が残り、オブジェクトで外すと同じ id をもう一度足せることを確かめます。検証
2026-11-08 に develop の上に載せ直してから確かめています。
MapTilerStyleRemovalTestは直す前に落ち、直した後に通ります。単体ビルドで全テストが通りました。fix/clear-strategy+fix/overlay-stacking-orderと合わせた APK で、clearOverlays → 送り直し の後に 6 種類すべてが戻ることを実機で確かめました。確認できていないもの
関連
fix/overlay-stacking-orderの Android MapTiler の PR は、この PR の上に載せています(#16)(同じ削除処理を両方が書き換えたため)。この PR を先にマージしてください。 この PR は単独でマージでき、core の変更を必要としません。