Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#14098 closed enhancement (worksforme)

Josm mapcss, own style and visualisation

Reported by: Allroads Owned by: team
Priority: normal Milestone:
Component: External mappaint style Version:
Keywords: mapcss Cc:


copy of this page:
Version 10966, not the latest because a plugin do not work with this latest.

I want two icons next to each other or partly over each other. Icons are 30x30px.

Tags placed on the same node. wpt=yes fee=no

This in the mapcss.

node|z14-[wpt=yes] { icon-offset-x:0;

icon-offset-y:0; icon-image: "wptn.png"; }

node|z14-[wpt=yes] { icon-offset-x:30;

icon-offset-y:0; icon-image: "feen.png"; }

Just a example for tags.

I do not want to make feen.png 60x30 px and leave one half transparent. I did see the trafficsign finish mapcss example.

I want the fee icon(30x30) next to wpt icon(30x30).

If you have icon-offset-x set on both, it uses the last one in the table to set both icons off. They stay always over each other, I think.

Edit: When one node and two icons, 1 appears, the last one writing in line on the mapcss file. I want to see them both.

The same problem with text 1 node with multiple tags, from two tags I want to see the value's. 1 tag, I want the value number above the node. 1 tag, I want the value under the node. when using

  1. text-offset-x: -30; text-offset-y: 10;
  1. text-offset-x: -30; text-offset-y: -10;

for two tags on the same node.

Here also the last one in the table, appears.

What am I doing wrong. Or is it a bug?

Attachments (0)

Change History (6)

comment:1 Changed 6 years ago by Klumbumbus

With your second rule you overwrite your first rule.
When you want to display multiple icons or texts you need to use layers. See the docu at Help/Styles/MapCSSImplementation#LayerIdentifier

Code could be:

node|z14-[wpt=yes] {              /* when omitting the layer identifier it uses the default layer */
    icon-image: "wptn.png";

node|z14-[wpt=yes]::my_feen_layer {
    icon-offset-x: 30;
    icon-image: "feen.png";

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

comment:2 Changed 6 years ago by Allroads

Resolution: fixed
Status: newclosed

Thanks, this works.

comment:3 Changed 6 years ago by Klumbumbus

Resolution: fixedworksforme

comment:4 Changed 6 years ago by Allroads

As non nativ english, I saw this page with, MapCSSImplementation#LayerIdentifier, before I openend this ticket.
I could not visualize this text as a solution for my problem.

comment:5 Changed 6 years ago by Klumbumbus

I added one more example. I hope this makes it more clear.

comment:6 in reply to:  5 Changed 6 years ago by Allroads

Replying to Klumbumbus:

I added one more example. I hope this makes it more clear.

Yes, before, after you mentioned it here with your example, I tried it myself to figure it out, see what i get, then I understand it. But with example pic in the info it is more clear. The visualisation. Maybe, I got it the first time.
Hope others benefit from it.

This is a common difficulty, there is much more possible, but plain text does not always express enough, what is possible.

Thanks for your effort.

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.