You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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 Sourcetype)? Would this problem go away if we hit #3034?
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
changed the title
Improve the ease of extensibility of VectorTileSource for creating a custom source
Refactor "GeoJSONSource" as a composition "VectorTileSource"
Oct 7, 2016
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 customloadVectorTile
in its constructor. But on the main thread, the wholeVectorTileSource
has to be forked in order to add atype: '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 athis.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
The text was updated successfully, but these errors were encountered: