Repository navigation
fix: getMarker() がテンプレートを当てた POI を返すようにする - #161
Merged
Merged
Conversation
マーカーの描画と getMarker が、祖先の poiTemplate・iconTemplate を当てる 同じ 1 つの関数を通るようにした。getMarker は clickMarker の detail と同じ形の 複製を返し、格納している POI には html を焼き付けない。updateMarker は 格納している POI を直接書き換える。 Closes #150 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
症状
poiTemplateで本文を作る POI は、地図上のマーカーを押したとき(clickMarker)だけテンプレートが当たり、@maplat/uiのopenMarker()・マーカー一覧・状態 URL(om:)から開くと本文が空になっていた。この 3 つの開き方はgetMarker(id)で POI を引くが、getMarkerは格納しているデータをそのまま返していた。直し方
applyPoiTemplates)にし、マーカーの描画とgetMarkerの両方がそれを通る。createIconSet・createHtmlFromTemplateの呼び手はこの関数だけになったgetMarkerはclickMarkerの detail と同じ形の複製を返す。格納している POI にはhtmlを焼き付けないので、updateMarkerなどで値が変わっても呼ぶたびに評価し直すupdateMarkerは格納している POI を直接書き換える(getMarkerの戻り値には依存しない)findPoiEntryはモジュールの関数で、MaplatAppのメソッドは増えない@maplat/uiは変更不要(3 つの開き方は既にgetMarkerに集まっている)契約の JSDoc(
getMarker・MaplatPoi)、docs/api/maplat-app.md・.ja.md、CHANGELOG の Fixed を更新。distは別 commit。試験
spec/get-marker-template.spec.ts(新規): アプリの層・地図の層でのテンプレート適用、実体にhtmlが付かないこと、iconTemplate・iconの優先、POI 自身のhtml、updateMarker後の再評価、旧い記法の警告が 1 回、selectMarker、無い iddatumとgetMarkerの戻り値が deep-equal(アプリの層・地図の層)Closes #150
🤖 Generated with Claude Code