Modify

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10421 closed enhancement (fixed)

User-settings for mapcss mappaint styles

Reported by: bastiK Owned by: team
Priority: normal Milestone: 14.08
Component: Core mappaint Version:
Keywords: Cc:

Description (last modified by bastiK)

We could allow the user to customize the rendering of a style in a more user friendly way. There would be one or more additional entries in the right click menu of the style (in the mappaint toggle dialog). This entry would bring up a new window, where settings can be customized, or a simple boolean value could be done in a submenu entry.

We'd also need a language to specify and use these settings in the mapcss style. Here is a draft:

/* simple boolean value yes/no */
setting::highway_casing {
  type: boolean;
  label: tr("Show highway casing");
  default: false;
}

/* a list of options where exactly one option is selected */
setting::zoom_behavior {
  type: list_selection;
  label: tr("Zoom");
  option-keys: list(zoom_auto, zoom_show_all);
  option-labels: list(tr("Auto (hide icons at low zoom)"), tr("Fixed (show all icons and labels)"));
  default: zoom_auto;
}

/* a color value */
setting::motorway_color {
  type: color;
  label: tr("Motorway");
  default: #809bc0;
}

/* float, int, ... */

/* show casing if setting is true */
way.highway_casing[highway] {
  casing-width: 1;
  casing-color: gray;
}

/* hide nodes at z0-15 if zoom is auto */
node|z-16.zoom_auto {
  icon-image: none;
}

/* show motorway with corresponding color */
way[highway=motorway] {
  width: 3;
  color: prop("motorway_color");
}

Attachments (0)

Change History (12)

comment:1 Changed 5 years ago by bastiK

Description: modified (diff)

comment:2 Changed 5 years ago by bastiK

Description: modified (diff)

comment:3 Changed 5 years ago by Klumbumbus

That would be great. Currently with JOSM_pref() it is not very user friendly.

comment:4 Changed 5 years ago by skyper

Yes, please. Would be a major enhancement.
Some external styles would need the same feature.

Maybe, same map style with different settings make sense, as a middle layer between full featured default and wire frame. We need to have short cuts to switch, though.

comment:5 Changed 5 years ago by Don-vip

Milestone: 14.08

comment:6 Changed 5 years ago by bastiK

Resolution: fixed
Status: newclosed

In 7450/josm:

fixed #10421 - User-settings for mapcss mappaint styles

  • only boolean setting for now
  • no shortcut support so far

comment:7 Changed 5 years ago by bastiK

syntax:

setting::highway_casing {
  type: boolean;
  label: tr("Draw highway casing");
  default: true;
}

way[highway][setting("highway_casing")] {
  casing-width: 2;
  casing-color: white;
}

comment:8 Changed 5 years ago by Klumbumbus

Great. Would it be possible to release 7450 as latest now, so we can test this today?

comment:9 Changed 5 years ago by bastiK

Sure can do.

comment:10 Changed 5 years ago by Klumbumbus

Thanks. Seems to work perfectly fine :)

comment:11 Changed 5 years ago by Klumbumbus

First use of this in default style, see ticket:10363#comment:64
Second use of this in Styles/Coloured_Streets

Last edited 5 years ago by Klumbumbus (previous) (diff)

comment:12 in reply to:  4 Changed 5 years ago by skyper

Replying to skyper:

Yes, please. Would be a major enhancement.
Some external styles would need the same feature.

Maybe, same map style with different settings make sense, as a middle layer between full featured default and wire frame. We need to have short cuts to switch, though.

See #10435

Modify Ticket

Change Properties
Set your email in Preferences
Action
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.