smrender icon indicating copy to clipboard operation
smrender copied to clipboard

Captions on ways (polylines)

Open sikmir opened this issue 3 years ago • 3 comments

According to doc captions on ways (polylines) are not supported yet: https://github.com/rahra/smrender/blob/955955139505a7972929e0844b42ddad6cbf994f/doc/smrender.html#L1015-L1018 Is there any workaround to get captions on ways? Or is it planned to support?

sikmir avatar Mar 24 '22 13:03 sikmir

Yes, there is a workaround. What exactly would you like to do?

rahra avatar Mar 28 '22 06:03 rahra

I would like to render names for rivers, is it possible now?

sikmir avatar Mar 28 '22 07:03 sikmir

What you have to do is to let smrender insert nodes at a specific distance and then render the captions on the nodes. The following rules would do exactly that:

   <way>
      <tag k='waterway' v='river'/>
      <tag k='_action_' v='ins_eqdist:distance=3'/>
   </way>
   <node>
      <tag k='waterway' v='river'/>
      <tag k='_action_' v='cap:font=serif;size=2;key=name;color=blue;anglekey=bearing;angle=90'/>
   </node>

It's not perfect but better than nothing. Actually I forgot that I did never implement it. I'll put it on my list.

rahra avatar Mar 28 '22 08:03 rahra