-
Notifications
You must be signed in to change notification settings - Fork 119
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
Add option to config max width of scalebar. #1048
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about allowing developers to specify any arbitrary ratio or pixel width (out of which we'll calculate the ratio) instead of hardcoding a couple of values?
I have the same thoughts at first, the current implementation is based on the following reasons:
|
Being able to define a maxWidth configuration will be more flexible as it will cater to all use-cases / designs. I feel, if a user wants a scalebar of max 30 pixels, they should be able to configure that. |
@tobrun Consider of adaption for difficult devices, I believe use ratio is better than pixels. So, how about we let user set the a ratio in 0.1 ~ 1? |
Android view system is build up around pixels. To support variety of device screen sizes, we do have the concept of dp values but that is only used in xml resources. In code you always use pixels. I'm personally not seeing with using pixels. |
Hi, any update? |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
This pull request has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions. |
plugin-scalebar/src/main/java/com/mapbox/pluginscalebar/ScaleBarWidget.java
Show resolved
Hide resolved
@Chaoba can you resolve conflicting files, let's merge as is and revisit the pixel configuration later? |
b7593b5
to
fbbbb63
Compare
Resolves #1046
ratio is calculated according scalebar with / mapview width.
Currently we add support for HALF, THIRD and QUATER, may add more if needed in future.