Skip to content

Commit d2433d5

Browse files
committed
refactor: update the getStyleFunction
1 parent 9df5176 commit d2433d5

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/core/utils/markers.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,24 @@ const memoizeStyle = (getMarker: GetMarkerFunction): GetMarkerFunction => {
142142
: memoizedStyle(style, count, displayFeatureCount)
143143
}
144144

145+
const getStyleFunction: GetMarkerFunction = (
146+
style,
147+
count,
148+
displayFeatureCount
149+
) =>
145150
new Style({
146151
image: new Icon({
147-
src: (multi ? makeMultiMarker : makeMarker)(style),
152+
src:
153+
count > 1
154+
? makeMultiMarker(
155+
{
156+
...style,
157+
displayedText: count,
158+
},
159+
displayFeatureCount,
160+
getSVGConfig(String(count))
161+
)
162+
: makeMarker(style),
148163
anchor,
149164
}),
150165
})

0 commit comments

Comments
 (0)