Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: increase drawMany label font size and default drawing point size #483

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/components/my-map/drawing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ function getVertices(drawColor: string) {
function styleFeatureLabels(drawType: DrawTypeEnum, feature: FeatureLike) {
return new Text({
text: feature.get("label"),
font: "80px inherit",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Realised "inherit" actually isn't supported here, so was just falling back to the OL default - hence 20px change is actually bigger than original 80px defined here 🙈

font: "20px 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: 3,
width: 4,
}),
});
}
Expand All @@ -91,7 +91,7 @@ function configureDrawingLayerStyle(
case "Point":
return new Style({
image: new Circle({
radius: 9,
radius: 12,
fill: new Fill({ color: drawColor }),
}),
text: drawMany ? styleFeatureLabels(drawType, feature) : undefined,
Expand Down