Adapt styleFunction in synthetic-lines example
This commit is contained in:
@@ -37,17 +37,19 @@ for (i = 0; i < count; ++i) {
|
|||||||
startPoint = endPoint;
|
startPoint = endPoint;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var styleArray = [new ol.style.Style({
|
||||||
|
stroke: new ol.style.Stroke({
|
||||||
|
color: '#666666',
|
||||||
|
width: 1
|
||||||
|
})
|
||||||
|
})];
|
||||||
|
|
||||||
var vector = new ol.layer.Vector({
|
var vector = new ol.layer.Vector({
|
||||||
source: new ol.source.Vector({
|
source: new ol.source.Vector({
|
||||||
features: features
|
features: features
|
||||||
}),
|
}),
|
||||||
styleFunction: function(feature) {
|
styleFunction: function(feature, resolution) {
|
||||||
return new ol.style.Style({
|
return styleArray;
|
||||||
stroke: new ol.style.Stroke({
|
|
||||||
color: '#666666',
|
|
||||||
width: 1
|
|
||||||
})
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user