Better styling in example

This commit is contained in:
Antoine Abt
2014-01-09 16:04:46 +01:00
parent c8e7c9f64e
commit 58d90e31ff
+8 -7
View File
@@ -16,6 +16,12 @@ var raster = new ol.layer.Tile({
}) })
}); });
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({ var styleArray = [new ol.style.Style({
fill: new ol.style.Fill({ fill: new ol.style.Fill({
color: 'rgba(255, 255, 255, 0.6)' color: 'rgba(255, 255, 255, 0.6)'
@@ -23,14 +29,9 @@ var styleArray = [new ol.style.Style({
stroke: new ol.style.Stroke({ stroke: new ol.style.Stroke({
color: '#319FD3', color: '#319FD3',
width: 1 width: 1
})
})];
var vector = new ol.layer.Vector({
source: new ol.source.TopoJSON({
url: 'data/topojson/world-110m.json'
}), }),
styleFunction: function(feature, resolution) { zIndex: (feature.getGeometry().getType() !== 'MultiPolygon') ? 2 : 1
})];
return styleArray; return styleArray;
} }
}); });