Give vector image source a style option

This commit is contained in:
Tim Schaub
2014-02-07 12:32:42 -07:00
parent 1072f6dfa7
commit b309c44020
4 changed files with 41 additions and 18 deletions

View File

@@ -11,16 +11,6 @@ goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
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 map = new ol.Map({
layers: [
new ol.layer.Tile({
@@ -32,9 +22,15 @@ var map = new ol.Map({
projection: 'EPSG:3857',
url: 'data/geojson/countries.geojson'
}),
styleFunction: function(feature, resolution) {
return styleArray;
}
style: 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
})
})
})
})
],