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

Remove dataview method does not stop fetching data from dataChanged event #2119

Closed
oriolbx opened this issue May 17, 2018 · 2 comments
Closed
Labels
Milestone

Comments

@oriolbx
Copy link
Contributor

oriolbx commented May 17, 2018

Context

The remove dataview event, removes the dataview from the client element, but it does not stop fetching data when there is the dataChanged event.

You need to use the disable() method to stop fetching data from the dataview after remove it from the client.

This leads to confusion when using these methods on CARTO.js to deal with dataviews.

Steps to Reproduce

  1. Create a map with one dataview that contains the dataChanged event
  2. Apply the removeDataview method, the dataview is removed from the client, but it still keeps fetching data when you move around the map or change the zoom level.
  3. If you add the disable() method, then the dataview stops being updated when the map position or zoom changes.

Expected result

The dataview should stop being updated once it is removed from the client using the removeDataview() method.

There should be no need to add the disable() method after applying the removeDataview() method.

I'm adding an HTML example with this issue:

test_rm_dataview.html.zip

cc @Jesus89

@oriolbx oriolbx added the bug label May 17, 2018
@Jesus89
Copy link
Member

Jesus89 commented May 17, 2018

Thanks for the feedback!

This should be an easy one. Just adding dataview.disable() to the client.removeDataview() function:

Client.prototype.removeDataview = function (dataview) {

@ivanmalagon ivanmalagon added this to the v4.1 milestone Jun 14, 2018
@rubenmoya rubenmoya self-assigned this Jun 26, 2018
@rubenmoya rubenmoya removed their assignment Jun 26, 2018
@rubenmoya
Copy link
Contributor

Fixed in version 4.0.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants