Modify

Opened 11 years ago

Closed 10 years ago

Last modified 10 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 by AlfonZ, 11 years ago

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 by skyper, 11 years ago

Cc: imagic added

in reply to:  1 ; comment:3 by skyper, 11 years ago

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 ?

in reply to:  3 comment:4 by imagic, 11 years ago

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 by simon04, 10 years ago

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

comment:6 by simon04, 10 years ago

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 by simon04, 10 years ago

Milestone: 14.01

comment:8 by imagic, 10 years ago

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

comment:9 by simon04, 10 years ago

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

comment:10 by imagic, 10 years ago

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.

in reply to:  10 comment:11 by simon04, 10 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.