Nicer caps and joins
As mentioned in the TODOs, caps and joins should be user configurable on the symbolizers.
This commit is contained in:
@@ -139,6 +139,8 @@ ol.renderer.canvas.Renderer.prototype.renderLineStringFeatures_ =
|
|||||||
context.globalAlpha = symbolizer.opacity;
|
context.globalAlpha = symbolizer.opacity;
|
||||||
context.strokeStyle = symbolizer.strokeStyle;
|
context.strokeStyle = symbolizer.strokeStyle;
|
||||||
context.lineWidth = symbolizer.strokeWidth * this.inverseScale_;
|
context.lineWidth = symbolizer.strokeWidth * this.inverseScale_;
|
||||||
|
context.lineCap = 'round'; // TODO: accept this as a symbolizer property
|
||||||
|
context.lineJoin = 'round'; // TODO: accept this as a symbolizer property
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
for (i = 0, ii = features.length; i < ii; ++i) {
|
for (i = 0, ii = features.length; i < ii; ++i) {
|
||||||
geometry = features[i].getGeometry();
|
geometry = features[i].getGeometry();
|
||||||
@@ -240,6 +242,8 @@ ol.renderer.canvas.Renderer.prototype.renderPolygonFeatures_ =
|
|||||||
if (strokeStyle) {
|
if (strokeStyle) {
|
||||||
context.strokeStyle = symbolizer.strokeStyle;
|
context.strokeStyle = symbolizer.strokeStyle;
|
||||||
context.lineWidth = symbolizer.strokeWidth * this.inverseScale_;
|
context.lineWidth = symbolizer.strokeWidth * this.inverseScale_;
|
||||||
|
context.lineCap = 'round'; // TODO: accept this as a symbolizer property
|
||||||
|
context.lineJoin = 'round'; // TODO: accept this as a symbolizer property
|
||||||
}
|
}
|
||||||
if (fillStyle) {
|
if (fillStyle) {
|
||||||
context.fillStyle = fillStyle;
|
context.fillStyle = fillStyle;
|
||||||
@@ -330,6 +334,8 @@ ol.renderer.canvas.Renderer.renderCircle_ = function(circle) {
|
|||||||
if (strokeStyle) {
|
if (strokeStyle) {
|
||||||
context.lineWidth = strokeWidth;
|
context.lineWidth = strokeWidth;
|
||||||
context.strokeStyle = strokeStyle;
|
context.strokeStyle = strokeStyle;
|
||||||
|
context.lineCap = 'round'; // TODO: accept this as a symbolizer property
|
||||||
|
context.lineJoin = 'round'; // TODO: accept this as a symbolizer property
|
||||||
}
|
}
|
||||||
|
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
|
|||||||
Reference in New Issue
Block a user