Use style option in vector layer examples
Providing a styleFunction option still works because the layer property is still named styleFunction.
This commit is contained in:
@@ -17,7 +17,7 @@ var vectorLayer = new ol.layer.Vector({
|
||||
projection: 'EPSG:3857',
|
||||
url: 'data/geojson/countries.geojson'
|
||||
}),
|
||||
styleFunction: function(feature, resolution) {
|
||||
style: function(feature, resolution) {
|
||||
var text = resolution < 5000 ? feature.get('name') : '';
|
||||
if (!styleCache[text]) {
|
||||
styleCache[text] = [new ol.style.Style({
|
||||
|
||||
Reference in New Issue
Block a user