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

Whats the easiest way to draw an area of influence around a point? lets say draw a circle 5000 meters radius around those coordinates? #503

Open
ember11498 opened this issue Apr 21, 2024 · 3 comments

Comments

@ember11498
Copy link

lets say I have this coordinates lat: 39, lon: -9.

How can I draw something like this?

image

or this:

image

@maios
Copy link
Contributor

maios commented Apr 22, 2024

Hi @ember11498, you can add a CircleAnnotation at the given coordinate to achieve what you want, please take a look at this example

@ember11498
Copy link
Author

ember11498 commented Apr 22, 2024

@maios thank you for the reply. But can I make the circle 5km radius from my coordinates? Does it have that parameter? it has a circleRadius parameter but isnt that in pixels?

Cannot see anywhere explicitly saying what exactly is the circleRadius. meters? km? pixels?

@maios
Copy link
Contributor

maios commented Apr 23, 2024

my bad, we are indeed lack of documentation on this SDK on that part, we will add it as soon as we can. Anyway, the unit of circle-radius is in pixels as stated in this style-spec
Our CircleAnnotationsManager unfortunately do not support Expressions, they only support values as constant for now. You can however use low-level Style API to add a layer and set its layer properties to the style.
However, with your use case the expression will be quite tricky, we have a similar example in iOS where we calculate the radius based on zoom level here

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