Allow literal from symbolizer without feature

This commit is contained in:
Tim Schaub
2013-03-06 00:52:48 +01:00
parent 95f3fe535a
commit c0c8faaf9f
4 changed files with 19 additions and 7 deletions
+6 -2
View File
@@ -143,8 +143,12 @@ ol.style.Shape = function(options) {
* @inheritDoc
* @return {ol.style.ShapeLiteral} Literal shape symbolizer.
*/
ol.style.Shape.prototype.createLiteral = function(feature) {
var attrs = feature.getAttributes();
ol.style.Shape.prototype.createLiteral = function(opt_feature) {
var attrs,
feature = opt_feature;
if (goog.isDef(feature)) {
attrs = feature.getAttributes();
}
var size = this.size_.evaluate(feature, attrs);
goog.asserts.assertNumber(size, 'size must be a number');