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

How to always center the marker on the polygon, regardless of zoom level #1160

Closed
raycastsant opened this issue Feb 14, 2022 · 4 comments
Closed

Comments

@raycastsant
Copy link

Hi, I'm using flutter_maps to display the polygons of a building plan.
Each polygon is a department. I have added a layer of polygons and 1 layer of Markers with the names of the polygons.
The problem is that I need the department names to always be centered. In the initial zoom each name looks good, like in this image:
1

Since I have calculated the center of each polygon and that is the position that I have assigned to the corresponding Marker. But when zooming in/out, the name scrolls:
2
3

Is there any way to recalculate the position of the marker so that it is always in the center?

Thanks in advance for any assistance!

@JaffaKetchup
Copy link
Member

JaffaKetchup commented Feb 14, 2022

Hi there,
Thanks for your question. I'm a bit busy at the moment, so I can't help you much, but #800 (edited, sorry for the wrong number) may be of interest to you in the future. I hope to merge this soon!
If you still want help, I can try, but probably not for a couple of days.
Thanks.

@raycastsant
Copy link
Author

Hello, thanks for the answer. Good idea that you implemented. Now I´m trying to adapt it to my project through MapPlugin.
I also need to make some changes for it to become NullSafety. I'll let you know later if I made any progress.
Thanks!

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Mar 18, 2022
@github-actions
Copy link

This issue was closed because it has been stalled for 5 days with no activity.

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