Merge pull request #7668 from ahocevar/hit-detect-text-background

Hit detect text background
This commit is contained in:
Andreas Hocevar
2018-01-01 18:04:00 +01:00
parent e065c851de
commit 61245fb83a
4 changed files with 38 additions and 14 deletions

View File

@@ -263,8 +263,10 @@ ol.render.canvas.TextReplay.prototype.drawText = function(geometry, feature) {
this.beginGeometry(geometry, feature);
if (textState.backgroundFill || textState.backgroundStroke) {
this.setFillStrokeStyle(textState.backgroundFill, textState.backgroundStroke);
this.updateFillStyle(this.state, this.applyFill, geometry);
this.updateFillStyle(this.state, this.createFill, geometry);
this.hitDetectionInstructions.push(this.createFill(this.state, geometry));
this.updateStrokeStyle(this.state, this.applyStroke);
this.hitDetectionInstructions.push(this.createStroke(this.state));
}
this.drawTextImage_(label, begin, end);
this.endGeometry(geometry, feature);