Repository navigation
Clear StrategyMarkerController in the same order as the other controllers - #28
Merged
Merged
Conversation
…lers clear() only called strategy.clear(), which empties the manager. It never called onRemove or onPostProcess, unlike AbstractMarkerController and the five shape controllers. The GL renderers (MapLibre, Mapbox, Mappls, OMM) leave the map alone in onRemove and redraw the manager in onPostProcess, so markers drawn through a strategy stayed on the map after clear(), and renderer-side resources were never released. clear() now runs onRemove(everything), strategy.clear() (so the strategy's own reset, such as MarkerClusterStrategy's cluster state, is kept), then onPostProcess, inside the same permit as add/update. Markers queued before the first camera are dropped as well; they would otherwise be drawn on the first camera event after clear(). Nothing in the SDK calls this clear() today: clearOverlays() clears the providers' own controllers, not the strategy controllers that MarkerRenderingGroup registers. StrategyMarkerClearOrderTest fails on the old clear() (markers still drawn; queued markers drawn after clear) and passes now. Same test in js-sdk-core and ios-sdk-core.
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 系に限らず全プロバイダで残っていました。他のコントローラは #27、MapConductor/ios-sdk-core#27、MapConductor/js-sdk-core#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 の新しい版を必要としません)。