Add vectorContext.setStyle() method

This commit is contained in:
Tim Schaub
2016-03-18 01:01:29 -06:00
parent 109bda60d0
commit 8f0f278832
2 changed files with 46 additions and 0 deletions

View File

@@ -461,6 +461,20 @@ ol.render.canvas.Immediate.prototype.drawCircleGeometry = function(circleGeometr
};
/**
* Set the rendering style. Note that since this is an immediate rendering API,
* any `zIndex` on the provided style will be ignored.
*
* @param {ol.style.Style} style The rendering style.
* @api
*/
ol.render.canvas.Immediate.prototype.setStyle = function(style) {
this.setFillStrokeStyle(style.getFill(), style.getStroke());
this.setImageStyle(style.getImage());
this.setTextStyle(style.getText());
};
/**
* Render a feature into the canvas. In order to respect the zIndex of the
* style this method draws asynchronously and thus *after* calls to