Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create CircleLayers with a Physical Unit Radius #2178

Open
seizler opened this issue May 7, 2024 · 1 comment
Open

Create CircleLayers with a Physical Unit Radius #2178

seizler opened this issue May 7, 2024 · 1 comment

Comments

@seizler
Copy link

seizler commented May 7, 2024

New Feature

Instead of screen units that change scale with the zoom of the map, please add the ability to define the circle radius in units such as meters or feet or miles or whatever. I need to encompass a certain radius around my features on the map and am having a hard time.

Why

This solves so much headache of converting a point feature geojson into a massive amount of coordinates to draw a fill layer perimiter.

@persidskiy
Copy link
Contributor

persidskiy commented May 13, 2024

@seizler Hi, a way to go here is to create a polygon with Turf and use the fill layer. https://mapbox.github.io/turf-swift/2.8.0/Structs/Polygon.html#/s:4Turf7PolygonV6center6radius8verticesACSo22CLLocationCoordinate2DV_SdSitcfc

// The radius is in meters here
let polygon = Polygon(center: coord, radius: 10000, vertices: 30)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants