-
Notifications
You must be signed in to change notification settings - Fork 25
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
Get scale_bar from locale #1068
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.
@RobAndrewHurst Tested this and it works all good when you provide either metric
or imperial
.
However, I tested this using a bogus term test
and it fails with an error on Invalid Units. I wonder if this should be using a ternary or checking that the scaleBar
value is either metric
or imperial
to guard against this.
Please could you also update the Config Docs to explain this is a new option available? Thanks! 🙂
@simon-leech I have made the changes! |
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.
Looks good on my end
Thanks @RobAndrewHurst - good with me! |
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.
The scalebar line can be completely removed from the default view script.
The scalebar should not be there by default but only if configured in the locale.
Please check if you are happy with the changes.
I still think we need a check if the config has a bogus unit provided. ie something not 'metric' or 'imperial' |
mapview.locale.scalebar && mapview.Map.addControl(new ol.control.ScaleLine({
units: mapview.locale.scalebar === 'imperial' ? 'imperial' : 'metric',
})) @dbauszus-glx Also should |
That's all good points. If changing the name I would probably opt for matching the OL dictionary, ie. ScaleLine I think there is only the options for imperial or metric. A check if ScaleLine === 'imperial' ? 'imperial' : 'metric' could work. |
Ok cool! I am happy to change to ScaleLine. I have already added in that check! 👍 |
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Pull Request: Get
scale_bar
from locale 🌐📏Description
This pull request addresses the need to retrieve the
scale_bar
information from the locale. The changes aim to improve the localization of the scale bar in our application, enhancing the user experience by dynamically obtaining this information based on the user's locale.Changes Made
scale_bar
property in the default mapview to take thescaleBar
property from the locales configuration. 🗺️🔄Testing Done