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 missing layers in layer menu on refresh #374

Closed
crisner opened this issue Jan 30, 2020 · 2 comments · Fixed by #375
Closed

Fix missing layers in layer menu on refresh #374

crisner opened this issue Jan 30, 2020 · 2 comments · Fixed by #375

Comments

@crisner
Copy link
Contributor

crisner commented Jan 30, 2020

There was a change I made on one of my previous PRs that fixed some errors by adding a check to when the 'moveend' event was triggered. This seems to have affected how the layers were displayed in the layers menu when the page was refreshed. Sometimes there were layers missing from the layers menu when it should have been there.

map.on('moveend', function() { // Update layer list on map movement
if (isPageRefreshed < 2 && window.performance.navigation.type !== 1) {
isPageRefreshed++; // Track page moveend events to prevent errors on map.removeLayer when a page is reloaded
}
if(isPageRefreshed > 1) {
self._hideElements(obj, data, layerName, elements, true);
}
});

@jywarren
Copy link
Member

Ah, is it possible this was related to #376 ?Thank you!

@crisner
Copy link
Contributor Author

crisner commented Jan 31, 2020

This was not implemented into the one-liner usage in the version used in plots2. Also, this deals with overlays and does not affect baselayers. 😃

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

Successfully merging a pull request may close this issue.

2 participants