How to make a halo around the line of one pixel using OpenLayers?
For example, the line (vector) has a blue color and its frame (one pixel) has a black color.
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.
Sign up to join this communityHow to make a halo around the line of one pixel using OpenLayers?
For example, the line (vector) has a blue color and its frame (one pixel) has a black color.
Use strokeWidth : 1
and strokeColor: '#000000'
on the vector's style
Actually, after testing what I said, turns out it's not that simple.
Looks like lines don't use the fill
property at all and instead only use stroke
.
So the only way I was able to do it was by cloning the feature and modifying the style. So you have 2 features.
Here's the DEMO
Demo LINK UPDATE