Skip to content

Commit

Permalink
style: Improve legibility of dot labels (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianjon3s authored Oct 23, 2024
1 parent fcedda9 commit f938a93
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/components/my-map/drawing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,11 @@ function getVertices(drawColor: string) {
function styleFeatureLabels(drawType: DrawTypeEnum, feature: FeatureLike) {
return new Text({
text: feature.get("label"),
font: "20px Source Sans Pro,sans-serif",
font: "bold 19px Source Sans Pro,sans-serif",
placement: drawType === "Point" ? "line" : "point", // "point" placement is center point of polygon
fill: new Fill({
color: "#000",
}),
stroke: new Stroke({
color: "#fff",
width: 4,
}),
});
}

Expand All @@ -93,8 +89,12 @@ function configureDrawingLayerStyle(
case "Point":
return new Style({
image: new Circle({
radius: 12,
fill: new Fill({ color: drawColor }),
radius: hideDrawLabels ? 10 : 12,
fill: new Fill({ color: "#fff" }),
stroke: new Stroke({
color: drawColor,
width: hideDrawLabels ? 6 : 2,
}),
}),
text:
drawMany && !hideDrawLabels
Expand Down

0 comments on commit f938a93

Please sign in to comment.