Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10014 closed defect (fixed)

[Patch] Add support for canvas{fill-color}, deprecate canvas{background-color}

Reported by: simon04 Owned by: team
Priority: normal Milestone: 14.05
Component: Core mappaint Version:
Keywords: mapcss Cc: bastiK, skunk@…


According to, the "official" tag for setting the background color using MapCSS is

  fill-color: #abcdef;

instead of

  background-color: #abcdef;

Therefore, I suggest to support the standard and deprecate the current implementation.

  • src/org/openstreetmap/josm/gui/mappaint/mapcss/

    diff --git a/src/org/openstreetmap/josm/gui/mappaint/mapcss/ b/src/org/openstreetmap/josm/gui/mappaint/mapcss/
    index 0855a69..1e30485 100644
    a b public class MapCSSStyleSource extends StyleSource { 
    203203    private void loadCanvas() {
    204204        Cascade c = constructSpecial("canvas");
    205         backgroundColorOverride = c.get("background-color", null, Color.class);
     205        backgroundColorOverride = c.get("fill-color", null, Color.class);
     206        if (backgroundColorOverride == null) {
     207            backgroundColorOverride = c.get("background-color", null, Color.class);
     208            if (backgroundColorOverride != null) {
     209                Main.warn("Detected deprecated canvas{background-color} which will be removed shortly.");
     210            }
     211        }
    206212    }
    208214    private Cascade constructSpecial(String type) {

Attachments (0)

Change History (4)

comment:1 Changed 6 years ago by bastiK

Good idea!

comment:2 Changed 6 years ago by simon04

Resolution: fixed
Status: newclosed

In 7110/josm:

fix #10014 - MapCSS: Add support for canvas{fill-color}, deprecate canvas{background-color}

comment:3 Changed 6 years ago by Don-vip

In 7127/josm:

see #10014 - use fill-color instead of background-color in P2 mapcss style

comment:4 Changed 6 years ago by anonymous

The background colour of power=pole icons (in the Potlatch2 style) has disappeared! :-(

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment

E-mail address and name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.