more options for vector tile sources #177
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Sorry for the issue-less PR.
This PR extends the
RLayers
support for options supported by the OL SourceVectorTile constructor. I.e. you can now specify a lot more options when usingRLayerVectorTile
.My original motivation was that OL vector tile layers don't really support overzooming.
E.g. if a vector tile source only supports tiles up to zoom level 15 the only way to allow zooming past that level is to provide a custom loader function. There's also an OL example which is referenced in a lot of the overzooming Github issues.
Passing this loader function to the OL tile source is not possible at the moment.
I also added the other options supported by the source, e.g.
tileGrid
,tileSize
etc.Open points up for debate:
I moved some of the options directly to the base props in
RLayerProps
(wrapX
,cacheSize
), they seem to be supported by most sources. We had this discussion before :-) If you're ok with it I can propagate the more common options to the supported sources.I saw there's an intermediate interface
RLayerBaseVectorProps
which supports some of the missing options. But extending this interface instead ofRLayerProps
gives a few errors which I didn't dare to fix. I can give it a shot if you'd rather have the vector specific props there.