Turfjs / turf

A modular geospatial engine written in JavaScript and TypeScript

Home Page:https://turfjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to change the outline of the masked area in a polygon?

alamenai opened this issue · comments

I have seen this example of using mask function , however I would know if that's possible to change the color of the masked area using turf and mapbox.

Example

As you see in the image below , we have a rectangle and th masked area but they have the same outline color ( black ) but I would it in another color ( ex: red ).

Current

image

Desired

c07a4df1-a41c-4fbf-b998-1f3df5bb2419

This question doesn't specifically relate to Turf.js and would probably be better placed on Stack Overflow. I say this as you could have this polygon come from any source and not just be generated by Turf.js (i.e. polygon could come from anywhere and you'd have the same issue).

There is some guidance on styling Polygons on the Mapbox GL website: https://docs.mapbox.com/mapbox-gl-js/example/geojson-polygon

I am not a Mapbox GL expert, but I'm not sure if you can style the hole differently to the outline of the main polygon. That might be best place on the Mapbox GL GitHub, or again Stack Overflow.

Thank you @JamesLMilner , I'll move the issue to mapboc GL.