I am trying to use a graphic style (in ysld format) to style a line feature. The end goal is to style the line as dashed line with a picture or a circle/times in the gaps of the dashes. I tried to use the code from the ysld cookbook example but it does not work. It shows the dashes as it should but the gaps do not have the picture symbol or even a circle/times symbol. Instead it just shows that as a small dash with default black color.

Is there something I am not doing right?

Here is the sample code I am using

title: 'YSLD Cook Book: Dash/Symbol line'
- name: name
  - symbolizers:
    - line:
        stroke-color: '#0000FF'
        stroke-width: 1
        stroke-dasharray: 10 10
    - line:
        stroke-color: '#000033'
        stroke-width: 1
        stroke-dasharray: 5 15
        stroke-dashoffset: 7.5
          size: 5
          - mark:
              shape: circle
              stroke-color: '#000033'
              stroke-width: 1

Layer Style Sample

The image above should be the result but instead I just get a black dash instead of the circles in the gaps.


I actually was able to make it work. Instead of using stroke-graphic-stroke: I had to use stroke-graphic:

  • please make a fix to the cookbook too – Ian Turton Sep 28 '18 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.