Fix linestring hit detection bug
This commit is contained in:
@@ -798,7 +798,11 @@ ol.render.canvas.LineStringReplay.prototype.drawLineStringGeometry =
|
||||
ol.extent.extend(this.extent_, lineStringGeometry.getExtent());
|
||||
this.setStrokeStyle_();
|
||||
this.beginGeometry(lineStringGeometry);
|
||||
this.hitDetectionInstructions.push([ol.render.canvas.Instruction.BEGIN_PATH]);
|
||||
this.hitDetectionInstructions.push(
|
||||
[ol.render.canvas.Instruction.SET_STROKE_STYLE,
|
||||
state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin,
|
||||
state.miterLimit, state.lineDash],
|
||||
[ol.render.canvas.Instruction.BEGIN_PATH]);
|
||||
var flatCoordinates = lineStringGeometry.getFlatCoordinates();
|
||||
var stride = lineStringGeometry.getStride();
|
||||
this.drawFlatCoordinates_(
|
||||
@@ -822,8 +826,12 @@ ol.render.canvas.LineStringReplay.prototype.drawMultiLineStringGeometry =
|
||||
}
|
||||
ol.extent.extend(this.extent_, multiLineStringGeometry.getExtent());
|
||||
this.setStrokeStyle_();
|
||||
this.hitDetectionInstructions.push([ol.render.canvas.Instruction.BEGIN_PATH]);
|
||||
this.beginGeometry(multiLineStringGeometry);
|
||||
this.hitDetectionInstructions.push(
|
||||
[ol.render.canvas.Instruction.SET_STROKE_STYLE,
|
||||
state.strokeStyle, state.lineWidth, state.lineCap, state.lineJoin,
|
||||
state.miterLimit, state.lineDash],
|
||||
[ol.render.canvas.Instruction.BEGIN_PATH]);
|
||||
var ends = multiLineStringGeometry.getEnds();
|
||||
var flatCoordinates = multiLineStringGeometry.getFlatCoordinates();
|
||||
var stride = multiLineStringGeometry.getStride();
|
||||
|
||||
Reference in New Issue
Block a user