Modify

Opened 8 months ago

Last modified 7 months ago

#8071 reopened enhancement

mapcss concat() and cond()

Reported by: Polyglot Owned by: team
Priority: normal Component: Core
Version: Keywords: mapcss support
Cc:

Description (last modified by Polyglot)

This works:

text: rcn_ref;

or:

text: tag(rcn_ref);

When the name tag is present, this also works:

text: concat(tag(rcn_ref), " ", tag(name));

Without a name tag, no text is shown, though.

So I tried this:

text: name?rcn_ref:concat(tag(rcn_ref), " ", tag(name));

and this:

text: cond(name,rcn_ref,concat(tag(rcn_ref), " ", tag(name)));

Would it be possible to simply add a blank string in concat() if the tag is not available.

That would be the most intuitive.

cond() doesn't work as I would expect it either.

Polyglot

Attachments (0)

Change History (7)

comment:1 Changed 8 months ago by Polyglot

  • Description modified (diff)

comment:2 Changed 8 months ago by Polyglot

  • Description modified (diff)

comment:3 Changed 8 months ago by Polyglot

The following works:

  text: concat(tag(rcn_ref),cond(has_tag_key(name), concat(" ", tag(name)),""));

This too:

  text: cond(has_tag_key(name),concat(tag(rcn_ref), " ", tag(name)),tag(rcn_ref));

It would be a lot simpler if empty tags were simply replaced by an empty string though.

Polyglot

comment:4 Changed 7 months ago by Polyglot

  • Resolution set to fixed
  • Status changed from new to closed

I found an easier way to solve the problem: using different ::layers to show the different tags instead of trying to concatenate them.

comment:5 Changed 7 months ago by bastiK

  • Resolution fixed deleted
  • Status changed from closed to reopened

please keep open

comment:6 Changed 7 months ago by Polyglot

Oh, I'm sorry. It wasn't clear to me whether it was appropriate to have reported it, since there was no reaction (except a more or less negative one, questioning whether it was supposed to work the way I expected it to work) and I managed to solve my problem in another way.

cond() is fine though.

comment:7 Changed 7 months ago by bastiK

I implemented it this way, but it kind of bothers me too.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as reopened .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team. Next status will be 'new'.
Next status will be 'needinfo'.The owner will change to Polyglot
as duplicate The resolution will be set to duplicate. Next status will be 'closed'.The specified ticket will be cross-referenced with this ticket
Author


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

 
Note: See TracTickets for help on using tickets.