Skip to content

Instantly share code, notes, and snippets.

@iamgeoknight
Last active January 9, 2022 05:37
Show Gist options
  • Save iamgeoknight/71ec974c69ed58d11550b917ed87bf25 to your computer and use it in GitHub Desktop.
Save iamgeoknight/71ec974c69ed58d11550b917ed87bf25 to your computer and use it in GitHub Desktop.
Static Style
// Defining Static Style
let staticStyle = new ol.style.Style({
// Line and Polygon Style
stroke: new ol.style.Stroke({
color: '#0e97fa',
width: 4
}),
fill: new ol.style.Fill({
color: 'rgba(0, 153, 255, 0.2)'
}),
// Point Style
image: new ol.style.Circle({
radius: 10,
fill: new ol.style.Fill({
color: [0, 153, 255, 1],
}),
stroke: new ol.style.Stroke({
color: [255, 255, 255, 1],
width: 5
}),
})
});
//Set static style for vector layer
vector_layer.setStyle(staticStyle);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment