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

fix(bmap): bmap event moveend is always triggered when dragging or zoomend. #12558

Merged

Conversation

plainheart
Copy link
Member

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

Fix bugs:

    1. bmap event moveend is always triggered when dragging
    1. bmap event moveend is triggered when zoomend

Details

Before: What was the problem?

When you added an event listener moveend on bmap, and then try to drag or zoom the map, the moveend event will be always triggered unexpectedly.

Code to Reproduce

var bmap = myChart.getModel().getComponent('bmap').getBMap();
 bmap.addEventListener('moveend', function(e) {
    console.log(e.type);
 });              

Unexpected Result

image

After: How is it fixed in this PR?

In the file BMapCoordSys.js, before chart layout and render, don't set center and zoom of bmap if both center and zoom are not changed in BMapCoordSys.

Code to Fix
image

Expected Result

image

Usage

Related test cases or examples to use the new APIs

Refer to test/bmap2.html

Merge some commits from apache/master
Merge some commits from apache/master.
Merge some commits from apache/master.
Merge some commits from apache/master
Merge some commits from apache/master
@echarts-bot
Copy link

echarts-bot bot commented May 3, 2020

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

@pissang pissang merged commit 57914fb into apache:master Aug 4, 2020
@echarts-bot
Copy link

echarts-bot bot commented Aug 4, 2020

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

@plainheart plainheart deleted the fix-bmap-moveend-triggered-when-moving branch April 28, 2021 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants