Giving vector layers the style they deserve
Now vector layers can have a style. ol.Style instances have an apply method to get the symbolizer literals for a feature. If the layer does not have a style defined, there is also a static applyDefaultStyle function on ol.Style to get the default symbolizer literals for a feature. The vector layer also got a groupFeaturesBySymbolizerLiteral method, which returns an array with features grouped by symbolizer, as needed by the canvas renderer.
This commit is contained in:
@@ -57,6 +57,19 @@ ol.style.ShapeLiteral = function(config) {
|
||||
goog.inherits(ol.style.ShapeLiteral, ol.style.PointLiteral);
|
||||
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
ol.style.ShapeLiteral.prototype.equals = function(shapeLiteral) {
|
||||
return this.type == shapeLiteral.type &&
|
||||
this.size == shapeLiteral.size &&
|
||||
this.fillStyle == shapeLiteral.fillStyle &&
|
||||
this.strokeStyle == shapeLiteral.strokeStyle &&
|
||||
this.strokeWidth == shapeLiteral.strokeWidth &&
|
||||
this.opacity == shapeLiteral.opacity;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {{type: (ol.style.ShapeType),
|
||||
* size: (number|ol.Expression),
|
||||
|
||||
Reference in New Issue
Block a user