Creating multiple sublayers within MVTLayer #6543
-
Hello, I have an MVTLayer based on an MBTiles file that has multiple layers. I'd like to render these MBTiles layers as separate GeoJSONLayers within renderSubLayers. This raises two interesting problems:
Some pseudo-code:
Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
That's an interesting feature request we're considering for the next version. I think we should make MVTLayer more flexible to allow specify the SubLayer to use per each layer at the MVT. Try to use compositeLayer.getSubLayerProps to set a different id for each geojsonLayer. To filter the data you'll need need to set |
Beta Was this translation helpful? Give feedback.
-
@alasarr I have an mvt layer of clusters, and I want to render the points as both circles and text labels with the count property. If I add 2 mvt layers, I'm requesting the tiles twice. Is there a way to reuse the data for the two types of layers? |
Beta Was this translation helpful? Give feedback.
That's an interesting feature request we're considering for the next version. I think we should make MVTLayer more flexible to allow specify the SubLayer to use per each layer at the MVT.
Try to use compositeLayer.getSubLayerProps to set a different id for each geojsonLayer.
To filter the data you'll need need to set
binary:false
to get the geojson version of the tile