[Bug] CollisionBehavior and conditional rendering for AdvancedMarker
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 38/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- react, typescript
- 领域
- frontend
调研方向
首先,使用 CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY,并在缩放变化后切换 showMarkers 标志,复现 issue 中描述的条件 AdvancedMarker 渲染。观察初始渲染和后续的碰撞更新;当标记出现时,重叠的标记会立即隐藏,且没有报告中的可见延迟,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Description
Hi,
I noticed unexpected behavior for Advanced Markers with collision behavior OPTIONAL_AND_HIDES_LOWER_PRIORITY.
<AdvancedMarker
key={id}
position={{ lat: latValue, lng: lngValue }}
zIndex={800}
collisionBehavior={CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY}
>
In my particular case I render an array of markers for when zoom is within given level (showMarkers is set to true)
showMarkers && <Markers>
When markers are not visible and then zoom changes to certain level and they should be rendered, at first ALL Markers are visible and after short amount of time (less than 1 s) the overlapping markers are hidden.
Expected behavior: only not-overlapping markers should be visible from the beginning.
Steps to Reproduce
Render array of Advanced Marker with CollisionBehavior.OPTIONAL_AND_HIDES_LOWER_PRIORITY with optional rendering based on Boolean flag.
When they rendered after flag is set to true ALL markers are visible for max 1s, then overlapping markers disappear.
Environment
- Library version: 1.1.0
- Google maps version: weekly
- Browser and Version: Chrome 126.0.6478.127 (Official Build) (64-bit)
- OS: Windows 10
Logs
No response
- 主要语言
- TypeScript
- 星标
- 1.9k
- 派生
- 195
- 平均合并
- 2 天 11 小时
- 30 天内合并 PR
- 14
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
visgl/react-google-maps 的其他 Issue
-
bug needs more info
难度 3/5 1-2 天 新手友好度 45/100
visgl/react-google-maps#1039 · 1 条评论 ·
维护者通常 2 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 35/100
visgl/react-google-maps#918 · 9 条评论 ·
维护者通常 2 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 45/100
visgl/react-google-maps#905 ·
维护者通常 2 天内回复
-
google maps issue
难度 3/5 1-2 天 新手友好度 45/100
visgl/react-google-maps#889 · 1 条评论 ·
维护者通常 2 天内回复
-
bug
难度 3/5 1-2 天 新手友好度 35/100
visgl/react-google-maps#884 · 1 条评论 ·
维护者通常 2 天内回复
查看 visgl/react-google-maps 的全部 Issue
相似的 Issue
-
triage
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
mermaid-js/mermaid-live-editor#2053 ·
维护者通常 1 天内回复
-
factory
难度 2/5 1-3 小时 新手友好度 82/100
jessepollak/home#1455 ·
维护者通常 1 天内回复
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
难度 1/5 1 小时以内 新手友好度 95/100
lingdojo/kana-dojo#31227 · 1 条评论 · 5 个 reaction ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 92/100
appandflow/stim#1838 ·
维护者通常 1 天内回复