@guardian/interactive-component-library 0.1.0-alpha.44 → 0.1.0-alpha.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6510,30 +6510,33 @@ class FeatureRenderer {
|
|
|
6510
6510
|
this.style = style2;
|
|
6511
6511
|
}
|
|
6512
6512
|
render(frameState, feature, context) {
|
|
6513
|
+
if (!this.style) {
|
|
6514
|
+
return;
|
|
6515
|
+
}
|
|
6513
6516
|
const {
|
|
6514
6517
|
projection,
|
|
6515
6518
|
transform,
|
|
6516
6519
|
pixelRatio
|
|
6517
6520
|
} = frameState.viewState;
|
|
6521
|
+
const {
|
|
6522
|
+
stroke,
|
|
6523
|
+
fill
|
|
6524
|
+
} = this.style;
|
|
6518
6525
|
this.drawingFunction.context(context);
|
|
6519
6526
|
context.beginPath();
|
|
6520
6527
|
const geometries = feature.getProjectedGeometries(projection);
|
|
6521
6528
|
for (const geometry of geometries) {
|
|
6522
6529
|
this.drawingFunction(geometry);
|
|
6523
6530
|
}
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
fill
|
|
6527
|
-
}
|
|
6531
|
+
if (fill) {
|
|
6532
|
+
context.fillStyle = fill.getRgba();
|
|
6533
|
+
context.fill();
|
|
6534
|
+
}
|
|
6528
6535
|
if (stroke) {
|
|
6529
6536
|
context.lineWidth = stroke.width * pixelRatio / transform.k;
|
|
6530
6537
|
context.strokeStyle = stroke.getRgba();
|
|
6531
6538
|
context.stroke();
|
|
6532
6539
|
}
|
|
6533
|
-
if (fill) {
|
|
6534
|
-
context.fillStyle = fill.getRgba();
|
|
6535
|
-
context.fill();
|
|
6536
|
-
}
|
|
6537
6540
|
}
|
|
6538
6541
|
}
|
|
6539
6542
|
const textPadding = {
|
|
@@ -6666,6 +6669,13 @@ class Style {
|
|
|
6666
6669
|
this.fill = options == null ? void 0 : options.fill;
|
|
6667
6670
|
this.text = options == null ? void 0 : options.text;
|
|
6668
6671
|
}
|
|
6672
|
+
clone() {
|
|
6673
|
+
return new Style({
|
|
6674
|
+
stroke: this.stroke,
|
|
6675
|
+
fill: this.fill,
|
|
6676
|
+
text: this.text
|
|
6677
|
+
});
|
|
6678
|
+
}
|
|
6669
6679
|
}
|
|
6670
6680
|
function memoise(fn) {
|
|
6671
6681
|
let called = false;
|