Repository navigation
Clear StrategyMarkerController in the same order as the other controllers - #27
Merged
Merged
Conversation
…lers clear() called onRemove and emptied the strategy but never onPostProcess. On the web every provider hands strategies a CollectorMarkerOverlayRenderer, which stages adds and removals and commits them to the marker collector in onPostProcess, so the removals were never committed and the markers stayed on the map (checked in the browser on maplibre, mapbox, mappls, tomtom and longdo). The GL renderers on android and iOS draw from the manager in onPostProcess, which has the same effect. clear() now runs onRemove(everything), strategy.clear() (so a strategy's own bookkeeping, such as the cluster state, is still reset), then onPostProcess, under the same lock as add/update. Markers queued before the first camera are dropped too; they would otherwise appear on the first camera event after clear(). Nothing in the SDK calls this clear() today (clearOverlays() clears the providers' own controllers only), so the visible effect is for code that drives a StrategyMarkerController directly. StrategyMarkerClearOrder.test.mjs, matching the android-sdk-core and ios-sdk-core tests.
This was referenced Nov 8, 2026
Merged
Stop resync from rewriting sources and layers that did not change
MapConductor/react-for-maplibre#27
Merged
Merged
Stop resync from rewriting sources and layers that did not change
MapConductor/react-for-maptiler#18
Merged
Merged
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.
なぜ
StrategyMarkerController.clear()(クラスタリングなどの Strategy でマーカーを描くコントローラ)は、Strategy の中身を空にするだけで、描画担当のonRemoveもonPostProcessも呼んでいませんでした。そのため clear しても、描画済みのマーカーが地図に残っていました。web の Strategy 用レンダラ(CollectorMarkerOverlayRenderer)はonPostProcessで初めて確定するので、web では GL 系に限らず全プロバイダで残っていました。他のコントローラは MapConductor/android-sdk-core#27、MapConductor/ios-sdk-core#27、#26 で「onRemove(全部) → manager を空にする → onPostProcess」の順にそろえています。
何を変えたか
StrategyMarkerController.clear()を、add / update と同じ permit(web は lock)の中で「onRemove(全部) → strategy.clear() → onPostProcess」の順にしました。strategy.clear()は残しているので、クラスタ状態のリセットなど Strategy 固有の後片付けはそのままです。StrategyMarkerControllerが actor でないため、pendingStatesは permit の中でだけ触っています。公開 API の変更はありません。
検証
StrategyMarkerClearOrder(Android / iOS / web)を足しました。直す前に落ち、直した後に通ることを確かめています。core の全テストも通過しました(Android 310、iOS 349(シミュレータ)、web 235)。確認できていないもの: Android MapLibre と web MapTiler の Strategy マーカーは、検証用ページの問題で直す前・後とも描かれず、確かめられていません。
なお、
clearOverlays()が Strategy コントローラを clear するようにする変更は、別の PR(fix/clear-strategy)で出す予定です。関連 PR(
fix/clear-followupsの一式)それぞれ独立していて、マージの順番の制約はありません(web の変更は js-sdk-core の新しい版を必要としません)。