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

refresh and clearLayers #39

Open
dreamfalcon opened this issue Dec 15, 2015 · 1 comment
Open

refresh and clearLayers #39

dreamfalcon opened this issue Dec 15, 2015 · 1 comment

Comments

@dreamfalcon
Copy link

Hi,
Currently the refresh function calls clearLayers and then gets the data, but is possible to call the clearLayers after the data is loaded and not before?

I'm asking this because during the refresh there is second where the map is empty of data.

Already tried changing the code but with no luck.

Thanks

@dreamfalcon
Copy link
Author

This appears to be working because for now I only need one URL.

  clearLayers2: function () {
    //this.urls = [];
    L.GeoJSON.prototype.clearLayers.call(this);
    return this;
  },
  clearUrls: function () {
    this.urls = [];
refresh: function (url) {
    url = url || this.urls;
    //this.clearLayers();
    this.clearUrls();
    this.addUrl(url);
  },
var data = self.ajaxParams.middleware(d);
self.clearLayers2();
self.addData(data);

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

No branches or pull requests

1 participant