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

Refactor "GeoJSONSource" as a composition "VectorTileSource" #3051

Open
anandthakker opened this issue Aug 23, 2016 · 3 comments
Open

Refactor "GeoJSONSource" as a composition "VectorTileSource" #3051

anandthakker opened this issue Aug 23, 2016 · 3 comments

Comments

@anandthakker
Copy link
Contributor

See the instructions in this comment for a description of what would currently be required to create a custom variation of VectorTileSource.

On the worker side, it's not bad at all: VectorTileWorkerSource is designed to accept a custom loadVectorTile in its constructor. But on the main thread, the whole VectorTileSource has to be forked in order to add a type: 'my-custom-source-type-name' property to any params sent to the worker (so that messages go to the custom worker source rather than the core VectorTileWorkerSource).

If VectorTileSource just kept a this.type property from its constructor options and sent it along in all its worker requests, this would simplify a custom source author's job significantly.

cc @lucaswoj

@lucaswoj
Copy link
Contributor

Sounds like you're having trouble plumbing a custom Source with its worker. Would this problem go away if we had a WorkerSource per Source (rather than a WorkerSource per Source type)? Would this problem go away if we hit #3034?

@anandthakker
Copy link
Contributor Author

Would this problem go away if we had a WorkerSource per Source (rather than a WorkerSource per Source type)? Would this problem go away if we hit #3034?

Yep, good point. And, as the custom source interface is still not public, I don't see any reason not to wait and take care of this as part of #3034

@lucaswoj lucaswoj changed the title Improve the ease of extensibility of VectorTileSource for creating a custom source Refactor "GeoJSONSource" as a composition "VectorTileSource" Oct 7, 2016
@lucaswoj
Copy link
Contributor

lucaswoj commented Oct 7, 2016

I just changed the title of this ticket to preserve the original intent and make the goal more clearly defined 😄

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

No branches or pull requests

2 participants