mapbox / mapbox/mapbox-plugins-android
Problem with dragging points and updating lines in the newest version of the annotation plugin
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 242
- 派生
- 116
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hi!
I'm a developer working on GetODK in our mobile app we use Mapbox and the annotation plugin which we wanted to update to the newest version 9:0.9.0 but we discovered regression.
In our app we allow selecting points on a map and we draw lines between them (it's geo shape or geo trace). We also allow dragging those points and redrawing those lines while dragging so that everything is smooth:

The problem is that after updating to 9:0.9.0. The dragging process is terminated immediately after starting when we update lines (calling AnnotationManager.update(T annotation).
The implementation is here https://github.com/getodk/collect/blob/master/collect_app/src/main/java/org/odk/collect/android/geo/MapboxMapFragment.java#L914
we override onAnnotationDrag to update points and lines.
The problem seems to be in updating lines because when we call
AnnotationManager.update(T annotation) -> updateSource() -> draggableAnnotationController.onSourceUpdated() -> stopDragging(draggedAnnotation) and as result our dragging process is immediately stoped.
It wasn't the case in v9:0.8.0. Could someone explain why this behavior changed and why when we want to update lines the dragging process is terminated?
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 collect_app/src/main/java/org/odk/collect/android/geo/MapboxMapFragment.java 第914行附近开始,这里 onAnnotationDrag 会更新点和线。跟踪 AnnotationManager.update 经过 updateSource 和 draggableAnnotationController.onSourceUpdated 的流程,然后比较 plugin 版本 9:0.8.0 和 9:0.9.0 之间的行为。完成标准是更新线不再立即终止点的拖动。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- android, java
- 领域
- mobile-dev
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100