Set path style in layer, rather than per feature
This commit is contained in:
parent
ae14553891
commit
146f9f7bd2
@ -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());
|
||||
|
Loading…
Reference in New Issue
Block a user