Skip to content

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

Merged
mollymerp merged 1 commit into
masterfrom
state-reload-fix
Aug 14, 2018
Merged

mollymerp merged 1 commit into
masterfrom
state-reload-fix

Conversation

@mollymerp

@mollymerp mollymerp commented Aug 14, 2018 •

Copy link
Copy Markdown
Contributor

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

// 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
Copy Markdown
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.

2 participants