#19574 closed enhancement (fixed)
[PATCH] Add a color setting for MapCSS
Reported by: | taylor.smock | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | 20.08 |
Component: | Core mappaint | Version: | |
Keywords: | Cc: |
Description (last modified by )
Subpart of #10435.
Possibly significant modifications for plugins:
- NamedColorProperty extends
AbstractToStringProperty<Color>
. I'm waiting for afind
to get all the instances ofNamedColorProperty
in plugins, but it is taking awhile (find . -name '*.java' -exec grep -li "NamedColorProperty" {} \;
). I don't know if this will require a recompile of any plugins.
Notes:
- Overrode
storeDefaultValue
to avoid an NPE. This is required since requiredfinal
variables are not yet set (a different fix would be to make them non-final). - Color boxes are not in the same column as the check marks (I'm not certain this is possible without a lot of work, or even desirable -- there might be a case for a
colorboolean
setting in the future, for example).
Attachments (2)
Change History (10)
by , 5 years ago
Attachment: | 10435.colors.patch added |
---|
comment:1 by , 5 years ago
Description: | modified (diff) |
---|
It looks like there are no binary compatibility issues. Or the published Mapillary/UtilsPlugin2 jars didn't throw errors anyway.
Plugins that use NamedColorProperty:
- splinex
- FastDraw
- Mapillary
- graphview
- CommandLine
- cadastre-fr
- mapwithai
- utilsplugin2
- routing
- buildings_tools
- MicrosoftStreetside
- livegps
- improveway
comment:2 by , 5 years ago
Milestone: | → 20.08 |
---|
comment:4 by , 5 years ago
@taylor.smock, can you please update Help/Styles/MapCSSImplementation#Stylesettings – thanks!
comment:5 by , 5 years ago
comment:6 by , 5 years ago
By a color setting a key is created in the color preferences in the format:
"Paint style" + file name + key used for displaying
Could it use the same format as the "traditional" colors of mappaint styles, i.e. the style name from the preferences instead of the file name?
"Paint style" + style name + key used for displaying
comment:7 by , 5 years ago
I've copied the logic from https://josm.openstreetmap.de/browser/josm/trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj?rev=16843#L1165 (mostly). I'm doing a null check on the title
variable (SourceEntry
may initialize title
as null
-- this.title = "".equals(title) ? null : title;
by , 5 years ago
Attachment: | 19574.style_pref_consistency.patch added |
---|
Use logic from MapCSSParser
to create the NamedColorProperty
Initial colors setting for mapcss