Repository navigation
Make clearOverlays() clear the overlay controllers - #12
Merged
Merged
Conversation
clearOverlays() only removed native annotations (or map items, or did nothing at all), leaving every MapConductor overlay on the map and in its manager. It now calls clear() on the marker, polyline, polygon, ground image, circle and raster layer controllers, as android-sdk does. The controllers live in the host, so the host hands the view controller a handler when it creates them.
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.
なぜ
iOS の
clearOverlays()は、ネイティブの annotation などを外すだけ(あるいは何もしない)で、MapConductor のオーバーレイのコントローラのclear()を呼んでいませんでした。オーバーレイは地図にも manager にも残っていました。何を変えたか
clearOverlays()から、マーカー・ポリライン・ポリゴン・GroundImage・サークル・ラスターの各コントローラのclear()を呼ぶようにしました(android-sdk と同じ)。コントローラはホストが持っているので、ホストがビューのコントローラへハンドラを渡します。GL 系の描画担当では、core 側(ios-sdk-core の同じ PR)の呼び順の修正が無いと、
clear()を呼んでも描き直しで残ります。ios-sdk-core のマージ・公開の後にマージしてください。関連 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 プロバイダ。
検証
scripts/api-surface.sh check: 差分なし。実機・ブラウザでの確認(共通の手順)
同じ手順で、ポリゴン・ポリライン・サークル・GroundImage・ラスター・マーカーを出し、追加 → 更新(色・半径・不透明度)→ 一部削除(ポリゴン・サークル・ラスター)→ 戻す →
clearOverlays()→ clear 後に同じ state を in-place で書き換え → 同じ id・同じ内容の state を作り直して送り直す、の 7 段階をスクリーンショットで比べました。検証用のページはコミットしていません。追加・更新・削除・戻すの 4 段階の見た目は修正前と同じでした。clear 後の振る舞い(in-place の更新では戻らず、顔ぶれが変わるか作り直された state が来たら全部描き直す)は、3 プラットフォームの core の collector と同じです。
確認できていないもの