OpenStreetMap logo OpenStreetMap

Things I Learned Today About Mapnik

asciipip ಅವರಿಂದ 3 ಮೇ 2010 ರಂದು English ನಲ್ಲಿ ಪೋಸ್ಟ್ ಮಾಡಲಾಗಿದೆ

In Mapnik rendering of LineSymbolizers, using a stroke-dasharray is incompatible with a stroke-linecap of "round". If you try to combine the two, Mapnik will ignore the stroke-dasharray and, if you're me, leave you very confused as to what's happening.

Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Discussion

Andy Allanಅವರಿಂದ 10:25 ರಲ್ಲಿ 4 ಮೇ 2010ರಂದು ಅಭಿಪ್ರಾಯ

I don't think that's correct - but you need to be careful on how the gap between dashes compares to the width of the line. So if you have a width of 2px, you'll need a gap between strokes of 5px to see a 1px gap. Each little dash gets rounded, and the round ends aren't counted as being part of the length of the stroke.

asciipipಅವರಿಂದ 11:33 ರಲ್ಲಿ 4 ಮೇ 2010ರಂದು ಅಭಿಪ್ರಾಯ

Ah, that makes sense. I was using a 4,2 dasharray, so there wasn't room for the gaps to show up.

Interestingly, that means I could make a line of circles if I wanted to.

Thanks for pointing that out!

ಲಾಗಿನ್ ಅಭಿಪ್ರಾಯ ತಿಳಿಸಲು