Repository navigation
Redraw markers after clearing them - #14
Merged
Merged
Conversation
The marker controller's clear() emptied the manager, but onRemove only drops icon references; the GeoJSON source is rewritten from the manager in onPostProcess, which clear() never called. The markers stayed on the map after clearOverlays(). Call it once the manager is empty, the same order the core controllers use.
This was referenced Nov 8, 2026
Clear overlays in the order remove, empty the manager, then post-process
MapConductor/js-sdk-core#26
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.
なぜ
clearOverlays()の後も、この地図ではマーカーが残っていました(Google / OMM では消えます)。マーカーが残る
MapplsMarkerController.clear()は core のclear()を上書きしていて、manager を空にしますがonPostProcessを呼んでいませんでした。この描画担当のonRemoveはアイコンの参照数を減らすだけで、GeoJSON ソースはonPostProcessが manager の中身から書き直します。呼ばれないので、前に描いたマーカーが残っていました。何を変えたか
clear()で、manager を空にしてタイルの経路を外した後にrenderer.onPostProcess()を呼ぶようにしました。core 側(android-sdk-core の同じ PR)でAbstractMarkerController.clear()も同じ順にそろえています。この PR は core が無くても単独で効きます。ただしポリライン・ポリゴン・GroundImage・ラスターの消え残りは core 側の修正で直るので、core と合わせて初めて
clearOverlays()が全部消えます。関連 PR(同じ修正の一式)
fix/overlay-clear-orderは次の 21 リポジトリにまたがります。1. core(3 本は互いに独立。先にマージ・公開してください)
2. Android プロバイダ(core が無くても単独で効く修正。ただしポリライン・ポリゴン・GroundImage・ラスターの消え残りは core 側で直るので、core と合わせて初めて clearOverlays() が全部消えます)
3. iOS プロバイダ(ios-sdk-core のマージ・公開の後。
clearOverlays()からコントローラのclear()を呼ぶ変更は、core の呼び順の修正が無いと GL 系で描き直しが起きて消えません)4. web プロバイダ(js-sdk-core の新しい版を npm に公開し、依存(今は
^0.3.1)を引き上げてから。理由は各 PR の本文に)マージの順番: core 3 本 → core の公開 → Android / iOS プロバイダ → js-sdk-core の npm 公開と依存の引き上げ → web プロバイダ。
検証
OverlayClearOrderTestに marker を足して固定しています。MapplsMarkerController$Companion.getTILE_REFRESH_COALESCEが載っていないという、develop の時点から同じ理由の失敗です(この PR の変更とは無関係なので触っていません)。refactor/polygon-controller、fix/mapview-teardown)とはgit merge-treeで衝突しないことを確かめました。実機・ブラウザでの確認(共通の手順)
同じ手順で、ポリゴン・ポリライン・サークル・GroundImage・ラスター・マーカーを出し、追加 → 更新(色・半径・不透明度)→ 一部削除(ポリゴン・サークル・ラスター)→ 戻す →
clearOverlays()→ clear 後に同じ state を in-place で書き換え → 同じ id・同じ内容の state を作り直して送り直す、の 7 段階をスクリーンショットで比べました。検証用のページはコミットしていません。追加・更新・削除・戻すの 4 段階の見た目は修正前と同じでした。clear 後の振る舞い(in-place の更新では戻らず、顔ぶれが変わるか作り直された state が来たら全部描き直す)は、3 プラットフォームの core の collector と同じです。
確認できていないもの
clearOverlays()は試していません。