Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Add scalebar width ratio and maximum width properties #52

Open
julianrex opened this issue Oct 31, 2019 · 6 comments · May be fixed by #65
Open

Add scalebar width ratio and maximum width properties #52

julianrex opened this issue Oct 31, 2019 · 6 comments · May be fixed by #65
Assignees
Labels
archived enhancement New feature or request ios

Comments

@julianrex
Copy link
Contributor

julianrex commented Oct 31, 2019

The scale bar's maximum width is currently 1/2 of the view's width. We should

  • Make this ratio configurable (a property?)
  • Limit the width to some maximum (another configurable property). For example, with a default of 0.5 the scale bar on iPad could be considered too long.
  • Decide how the scale bar's margins should affect this maximum width.
@julianrex julianrex added enhancement New feature or request ios labels Oct 31, 2019
@julianrex
Copy link
Contributor Author

cc @chloekraw

@m-stephen
Copy link
Contributor

m-stephen commented Nov 8, 2019

Some suggestions:

  1. This ratio should have a minimum value. After testing, suggest 0.2 is a best one.
  2. Don't suggest any limitation of maximum width for a specific value, it should be decided by users. Consider some developers may need this scale bar with full screen width at bottom of map view.
  3. Margins should only affect the maximum width when the view's max X probably out of the screen. If we let margin always affect final width, consider when developer set this value to 0.5 and margin to (20,20), the width should be mapView.bounds.width/2 - margin.x * 2, it is out of expectation and hard to understand at first when the margin affect the final width. We should return an accurate width and let developers change the margin or ratio by themselves.

@julianrex
cc: @chloekraw

@tsuz
Copy link
Contributor

tsuz commented Dec 13, 2019

@m-stephen

In one scenario, if the ratio is set to 0.5 but then it is loaded in a SplitView where the width becomes 100px, in this case, the width of the scale bar should be close to 100px. If I set the maximum ratio to 1, would it dynamically update the width of the scale bar from 50px to 100px?

@m-stephen
Copy link
Contributor

m-stephen commented Dec 16, 2019

Sorry for late reply. @tsuz

In one scenario, if the ratio is set to 0.5 but then it is loaded in a SplitView where the width becomes 100px, in this case, the width of the scale bar should be close to 100px. If I set the maximum ratio to 1, would it dynamically update the width of the scale bar from 50px to 100px?

Correct. After this PR, the scale bar's width will be changed dynamically based on map view's frame when you set the maximum ratio.

@tsuz
Copy link
Contributor

tsuz commented Dec 16, 2019

@m-stephen

Thanks for confirming!

@stale stale bot added the archived label Jul 29, 2020
@stale
Copy link

stale bot commented Jul 29, 2020

This issue 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 as completed Jul 29, 2020
@julianrex julianrex reopened this Aug 31, 2020
@stale stale bot removed the archived label Aug 31, 2020
@stale stale bot added the archived label Mar 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived enhancement New feature or request ios
Projects
None yet
3 participants