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

Map view rotation feature #2

Closed
srbhagwatsrb opened this issue Nov 24, 2019 · 11 comments
Closed

Map view rotation feature #2

srbhagwatsrb opened this issue Nov 24, 2019 · 11 comments
Labels
enhancement New feature or request

Comments

@srbhagwatsrb
Copy link

I am building a POC for Indoor navigation and i came across TIleview as well as MapView. I would like to use Kotlin version. But i did not find demo on having a rotatable map. Is it possible to rotate the map?

What i want is that in my indoor navigation app, based on magnetic field directions, map should get adjusted/rotated in order to show FPP view. (First person perspective view). Do you have any info on how this can be achieved?

@p-lr
Copy link
Owner

p-lr commented Nov 24, 2019

I would use the setRotation method available on every View since api level 11. Apply to the MapView or one of it's parent view in your app.
Link to doc: https://developer.android.com/reference/android/view/View.html#setRotation%28float%29

@srbhagwatsrb
Copy link
Author

Hmm but I need something like Google map rotation. On drag and rotate on a zoompanlayout. Could you please guide?

@p-lr
Copy link
Owner

p-lr commented Nov 24, 2019

In the meantime, I had more time to think about it.
The proper way to support this would require some adaptations of the library. Indeed, the rotated map needs to update the visible tiles, which cannot be achieved by simply rotating the MapView.
So MapView currently doesn't support this feature. Although it might be added the future, either when I have time to do this or someone makes a PR.

@p-lr p-lr added the enhancement New feature or request label Nov 24, 2019
@srbhagwatsrb
Copy link
Author

srbhagwatsrb commented Nov 25, 2019

RIght i was thinking about the same. It's really a good feature to add. And may be i will have to use an old version of tileview (2.x) where someone have done this. I do not want to use an old version again. Any chance this feature can be implemented soon in this also?

@p-lr
Copy link
Owner

p-lr commented Nov 25, 2019 via email

@srbhagwatsrb
Copy link
Author

Thanks @peterLaurence Do try to add this soon as it will be extremely good to use. This map view is already in production grade. So with rotatable map it will work great in all real time apps. Great work on this library.

@p-lr
Copy link
Owner

p-lr commented Jan 5, 2020

I have a very promising proof of concept of rotating map in my rotation branch. But it's not ready yet.
Will you be available to beta test when it's done? (I hope soon)

@shriharsha-bhagwat
Copy link

Sure i will be ready to test it out. Let me know.

@p-lr
Copy link
Owner

p-lr commented Jan 8, 2020

Perfect. I'm making progress - paths rotation and a few optimizations need to be done.
I let you know. Thanks

@p-lr
Copy link
Owner

p-lr commented Jan 30, 2020

@android-bash
It has been harder and longer than I thought.
I've published the version 2.0.0-beta04

The API around map rotation is stable (although I might make slight changes before final release).
2.x.x is a major shift from 1.x.x as it enables map rotation. It's only an opt-in feature, while configuring the MapView, using enableRotation(). The RotatingMapFragment from the demo is an example.

Beware that there are some breaking changes. Most of the time, it's just a package name change.
The ScaleChangeListener interface has been removed. If you relied on this, I can explain how to do the equivalent in 2.x.x

@p-lr
Copy link
Owner

p-lr commented Feb 8, 2020

Implemented in 2.0.0

@p-lr p-lr closed this as completed Feb 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants