react-native-mapbox-gl icon indicating copy to clipboard operation
react-native-mapbox-gl copied to clipboard

Cut/Clip/Crop Image (ImageSource) with ShapeSource

Open ksulia opened this issue 5 years ago • 2 comments

Is there a way to crop/clip an image (url) using ImageSource with a geoJSON shape in ShapeSource?

OR

A way to "fill" the geoJSON ShapeSource with the image (url) - not patterned the way fillPattern renders on zoom, but contained within some lat/lon bounds?

Thanks!

ksulia avatar May 10 '19 19:05 ksulia

Did you find any solution to this?

mnuriyumusak avatar Apr 28 '20 15:04 mnuriyumusak

@mnuriyumusak Unfortunately no. For the time being I am using the approach of just placing the uncropped image at the appropriate coordinates on the map, and then placing a massive geoJson (essentially wrapping the globe) on top with a hole cut out in the shape i want. This means, though, that for this particular layer the mapbox map is essentially hidden by the geoJson file (and state/country boundaries I then add on top). I would still love a solution to this, but have been busy with other things so haven't revisited.

Attached are some screenshots, one with the map as is with CircleLayer and the other as I describe.

IMG_2277

IMG_2278

ksulia avatar Apr 28 '20 16:04 ksulia