Skip to content

Instantly share code, notes, and snippets.

@iamgeoknight
Created February 6, 2021 12:33
Show Gist options
  • Save iamgeoknight/3c701280156276596b4ac826e4592db9 to your computer and use it in GitHub Desktop.
Save iamgeoknight/3c701280156276596b4ac826e4592db9 to your computer and use it in GitHub Desktop.
/*
Create Vector Layer
*/
class VectorLayer{
//Constructor accepts title of vector layer and map object
constructor(title, map) {
this.layer = new ol.layer.Vector({
title: title,
source: new ol.source.Vector({
projection:map.getView().projection
}),
style: new ol.style.Style({
stroke: new ol.style.Stroke({
color: '#0e97fa',
width:4
})
})
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment