-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 option to disable map styles #969
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.
I don't think it makes sense to make an attribute for each map. I think one attribute with a list should do it. And also it should probably be server-only attribute.
When you say "one attribute with a list", are you thinking of a string attribute with comma separated values or a list of maps linked to a bool attribute (like I did here)? You are right that the attributes should be server-only, I'm still familiarising myself with the entire codebase, how do I set it server only? is there a |
Comma-separated list of disabled maps.. or maybe enabled. You don't need to use |
I was also initially considering a list, thought bools would be easier since I can include it in the common attributes so that it can autofill, but since this would be a server setup it does not require autofill for each style. I agree with you and will change it to a list instead. I think the list needs to be a disabled list. Most instances will enable everything by default but then this is the option to disable. Otherwise we complicate existing instances. Looking at the code for |
Is there an common/attributes for server only attributes or must it be included in attributes/useCommonUserAttributes.js? |
Yes. We don't want to pollute user configuration. And also "force server settings" is a flag that's disabled by default. Common attributes are common for server and user. Instead you should create a separate one for server. Similar to how we have |
Made changes as discussed and create a new PR #970 |
I want to disable certain map styles server wide, therefore I included attributes for each provider as well as an option to construct the styles array based on the attributes. To limit the attributes, I created it on provider level; we can change it to individual level, to allow disabling of individual styles.
I would like to hear thoughts and possible improvements