mapbox-maps-flutter icon indicating copy to clipboard operation
mapbox-maps-flutter copied to clipboard

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

Open ember11498 opened this issue 10 months ago • 5 comments

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

How can I draw something like this?

image

or this:

image

ember11498 avatar Apr 21 '24 12:04 ember11498

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

maios avatar Apr 22 '24 07:04 maios

@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?

ember11498 avatar Apr 22 '24 08:04 ember11498

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

maios avatar Apr 23 '24 12:04 maios

I just wanted to say that this is a blocker for our project and a reason why we keep using flutter_map and not Mapbox's solution

Albert221 avatar Oct 07 '24 14:10 Albert221

it is hard to use.

usenameI avatar Oct 12 '24 03:10 usenameI