Modify

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#9191 closed enhancement (fixed)

MapCSS: Add option to include colour preferences of external styles

Reported by: skyper Owned by: team
Priority: normal Milestone: 14.01
Component: Core Version:
Keywords: style color preferences MapCSS Cc: imagic

Description

It is possible to nicely define the colours of the internal style under preferences.

What I ask for is an option to also include external styles under the color tab within display preferences.

Attachments (0)

Change History (11)

comment:1 Changed 9 years ago by AlfonZ

Colours specified in external xml-based styles are showing up in Display preferences.
Adding the style

<?xml version="1.0" encoding="UTF-8"?>
<rules description="Xml test style" shortdescription="XmlTestStyle">
    <rule>
        <condition k="test" v="foo"/>
        <line width="10" colour="testcolour1#88DD22"/>
    </rule>
</rules>

adds the colour testcolour1.

Looking at MapCSS specification, I don't see a way to add a custom name for a hex value.

color: blue
color: #0000FF
color: rgb(0.0, 0.0, 1.0)

comment:2 Changed 9 years ago by skyper

Cc: imagic added

comment:3 in reply to:  1 ; Changed 9 years ago by skyper

Replying to AlfonZ:

Colours specified in external xml-based styles are showing up in Display preferences.

Does this also work with wiki:Styles/Lane_and_Road_Attributes for example ?

comment:4 in reply to:  3 Changed 9 years ago by imagic

Replying to skyper:

Replying to AlfonZ:

Colours specified in external xml-based styles are showing up in Display preferences.

Does this also work with wiki:Styles/Lane_and_Road_Attributes for example ?

This style is based on MapCSS and not on XML, therefore this can't work.

But I certainly do miss the possibility to make some properties configurable in MapCSS. If you have a look at the beginning of the style, you'll see a section called "Global settings and initialization" with various settings. Especially the opacity settings and the setting for left-hand/right-hand traffic have to be easy configurable. Currently the user has to save a copy of the style and edit it manually.

I suggest using comments to make MapCSS properties configurable, e.g. something like this:
boolean someProperty=false; /* configurable: name="Name of property", description="Description of property", values="true","false" */
The comment has to start right after the property in the same line.

comment:5 Changed 8 years ago by simon04

Keywords: MapCSS added
Summary: option to include colour preferences of external stylesMapCSS: Add option to include colour preferences of external styles

comment:6 Changed 8 years ago by simon04

Resolution: fixed
Status: newclosed

In 6740/josm:

fix #9191 - MapCSS: Add option to include colour preferences of external styles

The syntax is the same as for the XML styles: name#123456

comment:7 Changed 8 years ago by simon04

Milestone: 14.01

comment:8 Changed 8 years ago by imagic

Actually how can I use this now in a MapCSS style? Any examples?

comment:9 Changed 8 years ago by simon04

*[foo=bar] {
  color: supercolor#123456; /* supercolor is the preference name */
}

comment:10 Changed 8 years ago by imagic

Is there any way to specify a color including opacity? If I use color: name#123456; it shows in the preferences. If I try instead color: name#12345678; it doesnt.

I want to make the opacity of some elements configurable.

comment:11 in reply to:  10 Changed 8 years ago by simon04

Please do not silently use a closed ticket of a reached milestone. I created #9633.

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.