Skip to content

Bordered Polyline #15750

Answered by ahocevar
karussell asked this question in Q&A
Apr 16, 2024 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

No need to create another feature. Just return an array of styles instead of a single style from your style function, or configure the layer's style with a static array of two styles.

Change your code to the following, and you're all set:

const layer = new VectorLayer({
    source: new VectorSource({
        features: [new Feature(lineString)],
    }),
    style: [borderStyle, style]
})

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@karussell
Comment options

Comment options

You must be logged in to vote
1 reply
@karussell
Comment options

Answer selected by karussell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants