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

Add option to config max width of scalebar. #1048

Merged
merged 3 commits into from
Mar 11, 2020
Merged

Conversation

Chaoba
Copy link
Contributor

@Chaoba Chaoba commented Sep 4, 2019

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.

@Chaoba Chaoba self-assigned this Sep 4, 2019
Copy link
Contributor

@LukasPaczos LukasPaczos left a 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?

@Chaoba
Copy link
Contributor Author

Chaoba commented Sep 4, 2019

I have the same thoughts at first, the current implementation is based on the following reasons:

  1. The defined values is more clear and straightforward.
  2. No need to add checks to insure the passed in param is valid.
  3. Prevent the corner scenarios like text overlapping.

@tobrun
Copy link
Member

tobrun commented Sep 16, 2019

The defined values is more clear and straightforward.

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.

@Chaoba
Copy link
Contributor Author

Chaoba commented Sep 16, 2019

@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?

@tobrun
Copy link
Member

tobrun commented Sep 25, 2019

Consider of adaption for difficult devices, I believe use ratio is better than pixels.

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.

@virtuoso80
Copy link

Hi, any update?

@stale
Copy link

stale bot commented Dec 17, 2019

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.

@stale stale bot added the archived Archived by Stale bot. label Dec 17, 2019
@stale
Copy link

stale bot commented Dec 17, 2019

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.

@stale stale bot closed this Dec 17, 2019
@langsmith langsmith reopened this Dec 18, 2019
@stale stale bot removed the archived Archived by Stale bot. label Dec 18, 2019
@tobrun
Copy link
Member

tobrun commented Mar 10, 2020

@Chaoba can you resolve conflicting files, let's merge as is and revisit the pixel configuration later?

@Chaoba Chaoba force-pushed the kl-scalebar-width branch from b7593b5 to fbbbb63 Compare March 10, 2020 08:55
@Chaoba Chaoba merged commit e2cd42a into master Mar 11, 2020
@Chaoba Chaoba deleted the kl-scalebar-width branch March 11, 2020 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add fixed width option to scale bar
5 participants