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

[ios]Add a maximumWidthRatio property to customize maximum width of scale bar. #65

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

m-stephen
Copy link
Contributor

@m-stephen m-stephen commented Nov 20, 2019

close: #52
This value is limited from 0.1 to 1.
Default value is 0.5

@m-stephen m-stephen requested review from a team and fabian-guerra November 20, 2019 08:00
@m-stephen m-stephen changed the title Add a maximumWidthRatio property to customize maximum width of scale bar. [ios]Add a maximumWidthRatio property to customize maximum width of scale bar. Nov 20, 2019
@m-stephen m-stephen added the ios label Nov 20, 2019
update change log
Copy link
Contributor

@fabian-guerra fabian-guerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi. Thank you for fixing this. I left some comments. Also please add tests to MGLMapViewScaleBarTests

platform/ios/src/MGLMapView.h Show resolved Hide resolved
platform/ios/src/MGLMapView.h Show resolved Hide resolved
@m-stephen m-stephen requested a review from tsuz December 17, 2019 10:17
@julianrex
Copy link
Contributor

I'm not sure this PR solves the problem in #52

e.g.

  • Set a width ratio of 0.3.
  • Run on iPad.
  • In portrait mode, scale bar is acceptable
  • In landscape, developer may consider it still to be too wide.

Does it?

What do you think about adding an optional absolute maximum width, measured in points?

Or are you suggesting that the developer modifies the ratio on rotation?

@m-stephen
Copy link
Contributor Author

m-stephen commented Dec 18, 2019

Does it?

What do you think about adding an optional absolute maximum width, measured in points?

Or are you suggesting that the developer modifies the ratio on rotation?

Since we cannot know developer's UI requirements, I think developer should modify the ratio manually. @julianrex

If developers display a map on a iPhone and support orientation, but one developer want a full screen width scale bar, but another want a half one. They both looks good in portrait mode, but when in landscape mode, if we make a limit absolute maximum width, it might be too short/long and out of expectations.

Copy link
Contributor

@fabian-guerra fabian-guerra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I added two minor comments. And please fix the conflict.

platform/ios/CHANGELOG.md Outdated Show resolved Hide resolved
platform/ios/src/MGLMapView.mm Show resolved Hide resolved
Copy link
Contributor

@julianrex julianrex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add a test (or add to the sample app) that checks the scenario of changing the ratio on device rotation. A view size change would also work here, so an integration test might be a good option here.

Copy link
Contributor

@tsuz tsuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@chloekraw
Copy link
Contributor

@m-stephen - is this ready for re-review?

@chloekraw chloekraw requested a review from 1ec5 February 25, 2020 14:33
@julianrex julianrex removed their request for review March 5, 2020 14:25
@jmkiley jmkiley changed the base branch from master to main September 30, 2020 19:26
Copy link

@habibahabiba77 habibahabiba77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please let me know when I can get my back account and how I do it my maps open location

Copy link

@habibahabiba77 habibahabiba77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lloydsheng
Copy link
Contributor

@knov @m-stephen has left. Does this function need to continue? I can take over the job.

/cc @julianrex

@tsuz
Copy link
Contributor

tsuz commented May 20, 2021

@m-stephen @lloydsheng Long over due. Does the scalebar adjust accordingly when it's in a SplitView?

@lloydsheng
Copy link
Contributor

Does the scalebar adjust accordingly when it's in a SplitView?

@tsuz Per #52 (comment) and code, It should self-adjust.

Copy link
Contributor

@tsuz tsuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lloydsheng 👍 Thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add scalebar width ratio and maximum width properties
7 participants