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

redoPlacement is broken for GeoJSON sources #3365

Closed
jfirebaugh opened this issue Oct 13, 2016 · 2 comments · Fixed by #3366
Closed

redoPlacement is broken for GeoJSON sources #3365

jfirebaugh opened this issue Oct 13, 2016 · 2 comments · Fixed by #3366
Assignees

Comments

@jfirebaugh
Copy link
Contributor

The 'redo placement' message does not include a type key, so when the worker receives the message, it defaults to 'vector' and calls redoPlacement on the wrong WorkerSource object.

@lucaswoj @anandthakker Advice on fixing this? Tile#redoPlacement is passed a SourceCache (the parameter name is misleading) and I don't immediately see a way to get the source type from that.

@anandthakker
Copy link
Contributor

@jfirebaugh oof. At one point I'd thought to require each Source to expose a type property, but nixed it because I thought it was an unnecessary complication. Perhaps I should have kept it.

Given that the custom source API will undergo heavy development/revision (especially w/r/t workers), I'd propose tabling the general question for now. For the immediate-term fix, note that GeoJSONSources do expose type, so Tile#redoPlacement could get it by digging into the SourceCache's inner Source.

@jfirebaugh jfirebaugh self-assigned this Oct 13, 2016
@jfirebaugh
Copy link
Contributor Author

Actually it looks like Tile#redoPlacement is normally called with a Source as the argument, not a SourceCache. This is the exception; I'll try changing it to pass this._source.

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