mapbox / mapbox/mapbox-maps-ios
[Question] Is it possible to draw buffer around layer?
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 601
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
Hello.
I am using Xamarin wrapper for your library, but my question is related to your SDK.
In the code below you can see that I am trying to add one more style for the layer, which should show a buffer around my polygon with a gap 50 (I hope it's meters).
But when I zoom in/out the gap changes.
Maybe you can propose another way to draw a dashed line/buffer around my polygon?
var lineLayer = new MGLLineStyleLayer(layerId + LAYER_DEVIATION_THRESHOLD_SUFFIX, source)
{
LineDashPattern = NSExpression.FromFormat(@"{2, 1.5}"),
LineWidth = NSExpression.FromConstant(FromObject(2.0f)),
LineColor = NSExpression.FromConstant(layerFillColor),
LineGapWidth = NSExpression.FromConstant(FromObject(50.0f))
};
Also how to do only the Outer gap line?


Best regards
Oleksandr
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the MGLLineStyleLayer configuration and its LineGapWidth and LineDashPattern properties shown in the issue. Determine whether the SDK supports a scale-independent buffer or an outer-only gap, then confirm the expected behavior with a minimal map example; done means a supported approach or limitation is clearly identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- swift
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100