#22469 closed enhancement (worksforme)
MapCSS user defining variable Key/Value input
| Reported by: | nmak | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Core mappaint | Version: | latest |
| Keywords: | MapCSS, | Cc: |
Description (last modified by )
It is possible to let the user make a variable in JOSM, using settings:
setting::key {
type: string;
label: tr("Key");
default: "";
}
I was wondering if it is possible to use the users input to style lines.
I tried a few things including underneath, but it did not work. At this point I don't think it is possible. Can someone confirm?
way[setting("key")]{
color: setting("linecolor");
}
If it doesn't work, it would be a nice feature to have.
Thanks in advance.
Attachments (0)
Change History (3)
comment:1 by , 3 years ago
| Description: | modified (diff) |
|---|
follow-up: 3 comment:2 by , 3 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
comment:3 by , 3 years ago
Replying to taylor.smock:
We have a specific setting type for color variables. See wiki:Help/Styles/MapCSSImplementation#Settingsoftypecolor . We also have settings for
doubleandbooleanvalues.
Besides that, if you want to check and see if the
wayhas the variable fromkey, try[has_tag_key(setting("key"))]. Take a look at wiki:Help/Styles/MapCSSImplementation#Evalexpressions for more expressions that you can use.
Thanks, appreciated!



We have a specific setting type for color variables. See wiki:Help/Styles/MapCSSImplementation#Settingsoftypecolor . We also have settings for
doubleandbooleanvalues.Besides that, if you want to check and see if the
wayhas the variable fromkey, try[has_tag_key(setting("key"))]. Take a look at wiki:Help/Styles/MapCSSImplementation#Evalexpressions for more expressions that you can use.