Give vector image source a style option
This commit is contained in:
@@ -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
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user