No need for rules if no rules have filter

This commit is contained in:
Tim Schaub
2013-08-15 15:25:39 -04:00
parent dd72408a88
commit 7ccc45b276
2 changed files with 22 additions and 22 deletions

View File

@@ -6,8 +6,7 @@ goog.require('ol.layer.Vector');
goog.require('ol.parser.GeoJSON');
goog.require('ol.source.TiledWMS');
goog.require('ol.source.Vector');
goog.require('ol.style.Fill');
goog.require('ol.style.Rule');
goog.require('ol.style.Stroke');
goog.require('ol.style.Style');
@@ -23,15 +22,14 @@ var vector = new ol.layer.Vector({
parser: new ol.parser.GeoJSON(),
url: 'data/countries.geojson'
}),
style: new ol.style.Style({rules: [
new ol.style.Rule({
symbolizers: [
new ol.style.Fill({
color: '#bada55'
})
]
})
]}),
style: new ol.style.Style({
symbolizers: [
new ol.style.Stroke({
color: '#33cc66',
width: 2
})
]
}),
transformFeatureInfo: function(features) {
return features.length > 0 ?
features[0].getFeatureId() + ': ' + features[0].get('name') : ' ';