diff --git a/src/map.js b/src/map.js index 6c905f1..231aa0b 100644 --- a/src/map.js +++ b/src/map.js @@ -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());