Set path style in layer, rather than per feature

This commit is contained in:
Adam Goldsmith 2018-07-21 12:08:21 -04:00
parent ae14553891
commit 146f9f7bd2

View File

@ -74,7 +74,10 @@ function pathStyle(feature) {
}
function plotPaths(packets) {
let vector_layer = new VectorLayer({source: new VectorSource()});
let vector_layer = new VectorLayer({
source: new VectorSource(),
style: pathStyle
});
map.addLayer(vector_layer);
packets
@ -98,8 +101,6 @@ function plotPaths(packets) {
hue: colorGen.get(map.size)
});
pathFeature.setStyle(pathStyle);
vector_layer.getSource().addFeature(pathFeature);
pathFeature.getGeometry().transform(new Projection({code: "EPSG:4326"}),
tile_layer.getSource().getProjection());