deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

MVTLayer doesn't work as mask layer

Open mbarrenechea opened this issue 2 years ago • 2 comments

Description

I'm currently working with the MaskExtension, and I've encountered an issue. I'm trying to use a MVTLayer as the main mask layer, but it doesn't seem to be working. It masks out every pixel from every layer that has the maskId and the extension set.

You can see an example here => https://codepen.io/Miguel-Barrenechea/pen/wvOdjrY

Flavors

  • [ ] Script tag
  • [X] React
  • [ ] Python/Jupyter notebook
  • [ ] MapboxOverlay
  • [ ] GoogleMapsOverlay
  • [ ] CartoLayer
  • [ ] ArcGIS

Expected Behavior

Masked layers will be displayed only in places where they intersect with the MVTLayer.

Steps to Reproduce

  • Set a MVTLayer as the main mask layer.
  • Enable MaskExtension in other layer where you know it intersects with.
  • Nothing will show up in the map. Everything is filtered out

Environment

  • Framework version: [email protected]
  • Browser: Chrome Versión 120.0.6099.216
  • OS: IOS 12.6.3

Logs

No response

mbarrenechea avatar Jan 19 '24 15:01 mbarrenechea

It definitely can work, see this link. Note how I am using TileLayer and not mapStyle.

https://codepen.io/grahambates/pen/dyrWaKQ?editors=1111

image

grahambates-code avatar Jan 19 '24 19:01 grahambates-code

Yes, you are right!!! I didn't know you can just set the operation: 'mask' to the subLayers and the mask id to the parent. Thank you!!

mbarrenechea avatar Jan 22 '24 08:01 mbarrenechea