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

Implement map rotation #116

Closed
vinicentus opened this issue Sep 20, 2018 · 12 comments
Closed

Implement map rotation #116

vinicentus opened this issue Sep 20, 2018 · 12 comments
Labels
feature This issue requests a new feature

Comments

@vinicentus
Copy link
Contributor

It would be nice to be able to rotate the map.

Take a look at flutter/flutter#17345.

The mapOptions could also take an optional argument allowMapRotation, that would default to true. Maybe everyone doesn't need or want map rotation...

@johnpryan
Copy link
Collaborator

johnpryan commented Sep 20, 2018

I think the challenge here will be to determine what "box" the map tiles need to render in. (e.g. rotating the map may result in tiles in the viewport not being fetched)

kinda similar to this problem: https://stackoverflow.com/questions/10392658/calculate-the-bounding-boxs-x-y-height-and-width-of-a-rotated-element-via-jav/11771163 except the blue rectangle needs to be large enough such that the red rectangle (the viewport) is covered.

i think Flutter supports rotation so i don't see that piece being a huge effort.

@vinicentus
Copy link
Contributor Author

Ok, I see. What info do we get? The coordinates of the viewport and the rotation?

Then we probably also want to filter out the tiles that are colored in the picture, since they are not needed.

img_20181001_130744
(apologies for the large and ugly picture)

@johnpryan
Copy link
Collaborator

Yes exactly. Thanks for making an illustration. I'm going to mark this as "help wanted" since this is a slightly challenging problem!

@johnpryan johnpryan added feature This issue requests a new feature help wanted labels Nov 19, 2018
@ibrierley
Copy link
Collaborator

Just thinking about this, rotation would be nice, but what about things like text on a tile, wouldn't that mean it's now upside down if we rotate 180, would that be a bad experience ? Would it only be useful for tiles without text, or vector tiles or something ?

@vinicentus
Copy link
Contributor Author

vinicentus commented Dec 21, 2018

@ibrierley I think it would still be useful even with text on tiles. Humans are pretty good at reading stuff that is rotated.

I have noticed that google maps automatically rotates street names (maybe it's a separate layer or something?). That is of course the optimal solution but I don't think many free map providers offer this? (Correct me if I'm wrong)

@johnpryan
Copy link
Collaborator

Yes I suspect that is one of the reasons Leaflet does not support rotation.

@escamoteur
Copy link
Contributor

We will need this functionality in our project. So I will have a closer look at this.

@escamoteur
Copy link
Contributor

Not sure if that is enough for you needs. It only allows to rotate the map from the App side.

@johnpryan
Copy link
Collaborator

This issue still isn't fully resolved AFAICT. There's still work to be done to make sure that tiles on the edge of the viewport are displayed

@escamoteur
Copy link
Contributor

That is strange because I haven't seen that when I tested it can you show me an example? Flutter_map has sometimes a problem not to fill the whole space.

@github-actions
Copy link

github-actions bot commented Apr 3, 2021

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 Apr 3, 2021
@github-actions
Copy link

github-actions bot commented Apr 8, 2021

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
feature This issue requests a new feature
Projects
None yet
Development

No branches or pull requests

4 participants