Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

地图 selected 状态维持的 bug #1720

Closed
pissang opened this issue Jun 25, 2015 · 0 comments

Comments

Projects
None yet
1 participant
@pissang
Copy link
Contributor

commented Jun 25, 2015

问题

地图中如果先对一个数据设置 selected: true。然后重新 setOption 的时候把该数据设成 selected: false 不起作用。

原因

地图每次setOption的时候对高亮区域是状态保持的,也就是说上次通过 selected: true 高亮的区域这次也仍会忽略数据的改变而继续高亮。这个状态保持应该是考虑到用户选择交互上的体验,但是没考虑到数据的变动。

方案

提高单个数据 selected 配置项的优先级,如果明确配置为 true 或者 false 的话每次 setOption 都会强制高亮或者取消高亮。
这个方案带来的问题可能是对于设置 selected 的数据每次 setOption 都不会保持之前用户交互的状态。这个问题可以通过在 MAP_SELECTED 事件中重新设置 selected 配置项解决。

@pissang pissang closed this in 1912b27 Jun 25, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.