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

don't clear state on reload, just on setData #7129

Merged
merged 1 commit into from Aug 14, 2018
Merged

Conversation

mollymerp
Copy link
Contributor

@mollymerp mollymerp commented Aug 14, 2018

in #7043 we added a fresh state on source reload but reload is also called when a style property or layout property is changed that requires relayout, so we were inadvertently expunging the state whenever that happened. originally reported in #6289 (comment)

Launch Checklist

  • briefly describe the changes in this PR
  • write tests for all new functionality
  • document any changes to public APIs
  • manually test the debug page

@@ -75,6 +75,7 @@ class SourceCache extends Evented {
// for sources with mutable data, this event fires when the underlying data
// to a source is changed. (i.e. GeoJSONSource#setData and ImageSource#serCoordinates)
if (this._sourceLoaded && !this._paused && e.dataType === "source" && e.sourceDataType === 'content') {
if (this._source.type === "geojson") this.resetState();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: {}

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

Successfully merging this pull request may close these issues.

None yet

2 participants