Better styling in example

This commit is contained in:
Antoine Abt
2014-01-09 16:04:46 +01:00
parent c8e7c9f64e
commit 58d90e31ff

View File

@@ -16,21 +16,22 @@ var raster = new ol.layer.Tile({
})
});
var styleArray = [new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
color: '#319FD3',
width: 1
})
})];
var vector = new ol.layer.Vector({
source: new ol.source.TopoJSON({
url: 'data/topojson/world-110m.json'
}),
styleFunction: function(feature, resolution) {
var styleArray = [new ol.style.Style({
fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.6)'
}),
stroke: new ol.style.Stroke({
color: '#319FD3',
width: 1
}),
zIndex: (feature.getGeometry().getType() !== 'MultiPolygon') ? 2 : 1
})];
return styleArray;
}
});