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
Added scalebar option to ol.control.scaleline #9013
Conversation
Thanks for the contribution @weskamm! My suggestions above are mostly about shorter option names. I'm curious what you and others think about making the default style look a bit more like the current scaleline style. Also wondering if it is possible to keep the bar shorter for longer. |
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.
Thanks @weskamm. I share @tschaub's concerns about the length of the scale bar. Regarding the style, I also agree that it should look a bit more like the style of the other controls. However, we could also think this the other way around and make the default theme for other controls look more black/white/grey.
I'm not sure to understand the purpose of this PR as "ol-ext" has already an extension for this e.g http://viglino.github.io/ol-ext/examples/canvas/map.canvas.control.html |
I like that idea. Probably best for a separate PR. |
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.
A very nice PR, and a nice set of comments / suggestions.
I am 👍 on merging, once the remarks are adressed.
Thx.
Thanks for the reviews! Regarding the length of the scalebar: I use a non-default minWidth in the example, because the default width of 64 pixels is a bit small for a scalebar (but ok for scaleline). Thats why the sizes differ. I just reduced the width in the example to get more similar results Regarding the style: I would like to keep the current black and white look, as this is the way a scalebar typically looks like. |
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.
Thanks for the great contribution @weskamm.
This adds an option to show scalebars instead of a scaleline in the
ScaleLine
control.Example and API doc have been adjusted.