Remove applyDefaultStyle method

This commit is contained in:
Tim Schaub
2013-08-15 08:26:05 -04:00
parent a670e225cd
commit a5991aee03
3 changed files with 7 additions and 16 deletions

View File

@@ -397,7 +397,7 @@ ol.layer.Vector.prototype.groupFeaturesBySymbolizerLiteral =
// layer style second
literals = style.createLiterals(feature);
} else {
literals = ol.style.Style.applyDefaultStyle(feature);
literals = ol.style.Style.defaults.createLiterals(feature);
}
}
numLiterals = literals.length;

View File

@@ -50,16 +50,6 @@ ol.style.Style.prototype.createLiterals = function(feature) {
};
/**
* @param {ol.Feature} feature Feature.
* @return {Array.<ol.style.Literal>} Default symbolizer literals for
* the feature.
*/
ol.style.Style.applyDefaultStyle = function(feature) {
return ol.style.Style.defaults.createLiterals(feature);
};
/**
* The default style.
* @type {ol.style.Style}

View File

@@ -33,17 +33,18 @@ describe('ol.style.Style', function() {
});
describe('ol.style.Style.applyDefaultStyle()', function() {
describe('ol.style.Style.defaults.createLiterals(feature)', function() {
var feature = new ol.Feature();
it('returns an empty array for features without geometry', function() {
expect(ol.style.Style.applyDefaultStyle(feature).length).to.be(0);
expect(ol.style.Style.defaults.createLiterals(feature))
.to.have.length(0);
});
it('returns an array with the Shape default for points', function() {
feature.setGeometry(new ol.geom.Point([0, 0]));
var literals = ol.style.Style.applyDefaultStyle(feature);
var literals = ol.style.Style.defaults.createLiterals(feature);
expect(literals).to.have.length(1);
var literal = literals[0];
@@ -59,7 +60,7 @@ describe('ol.style.Style', function() {
it('returns an array with the Line default for lines', function() {
feature.setGeometry(new ol.geom.LineString([[0, 0], [1, 1]]));
var literals = ol.style.Style.applyDefaultStyle(feature);
var literals = ol.style.Style.defaults.createLiterals(feature);
expect(literals).to.have.length(1);
var literal = literals[0];
@@ -72,7 +73,7 @@ describe('ol.style.Style', function() {
it('returns an array with the Polygon default for polygons', function() {
feature.setGeometry(new ol.geom.Polygon([[[0, 0], [1, 1], [0, 0]]]));
var literals = ol.style.Style.applyDefaultStyle(feature);
var literals = ol.style.Style.defaults.createLiterals(feature);
expect(literals).to.have.length(1);
var literal = literals[0];