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

Handle rotation in plugins #396

Closed
moovida opened this issue Aug 19, 2019 · 4 comments · Fixed by #719
Closed

Handle rotation in plugins #396

moovida opened this issue Aug 19, 2019 · 4 comments · Fixed by #719

Comments

@moovida
Copy link
Contributor

moovida commented Aug 19, 2019

I was wondering what the best practice would be in a plugin, to keep the graphics on screen even if the map rotates. For example the scalebar rotates with the map and therefore disappears.

I thought it would be simple as rotating back the drawing canvas of the same amount as the map.rotation, but it didn't work as expected.

Any hint? Thanks a ton.

@fluttercid
Copy link

I also want what you want.
There is any progress about it.
Thank you.

@moovida
Copy link
Contributor Author

moovida commented Aug 8, 2020

I assume this pull request will take care of it: #719

Well, most probably we will need a procedure that allows us to counter-rotate the plugins to have them kept right.

Also touch events will be an issue, if they are issued in plugins.

Most probably we will get (or we will implement :-) ) a rotation transformation from the map context to do this.

@maRci002
Copy link
Contributor

#719 now implements this behavior: able to mix rotate and non rotate layers with a flag

Note: onTap, onLongPress still gives back the LatLng according to rotation.

I think I'll refactor to specify separately non rotate and rotate layers so rotate layers will be always the bottom one because rotating the whole layer tree is much faster than rotate one by one.

@maRci002
Copy link
Contributor

PR updated now there are layers / nonRotatedLayers and children / nonRotatedChildren examples updated too.

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

Successfully merging a pull request may close this issue.

3 participants