Skip to content

Conversation

@Yeom-JinHo
Copy link
Contributor

Description

This PR adds an optional overlay rendering API to DottedMap so consumers can render custom marker overlays (e.g., image/label badges) on top of the existing marker circles while keeping the current behavior as-is.

Changes

  • Generic markers (backward compatible): Updated DottedMapProps / DottedMap to support markers?: M[] with M extends Marker and a default type parameter (M = Marker).
  • Overlay render hook: Added renderMarkerOverlay?: (args) => ReactNode to render custom SVG overlay content using projected coordinates (x, y) and radius (r).
  • Projected marker typing: Introduced MapMarker<M> = M & { x: number; y: number } for projected markers returned from addMarkers.

Motivation

  • Keep the base marker circle unchanged while enabling richer marker visuals (flags, labels, badges, etc.).
  • Allow consumers to pass overlay-specific payload via the marker type and render it in a type-safe way.

Breaking Changes

  • None intended.
    • renderMarkerOverlay is optional.
    • Generic defaults preserve existing usages without requiring explicit type arguments.

Screenshots

스크린샷 2025-12-31 오전 1 51 58 스크린샷 2025-12-31 오전 1 52 11

@vercel
Copy link

vercel bot commented Dec 30, 2025

@Yeom-JinHo is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

@Yeom-JinHo
Copy link
Contributor Author

@dillionverma
The new dotted-map looks like it can be used in a lot of places. Thanks for building it!

While integrating it, I realized that having an overlay option would be really helpful for cases like displaying countries (e.g., flags/labels) on top of markers, so I added this feature.

@Yeom-JinHo
Copy link
Contributor Author

Just a heads-up: Some files weren’t properly formatted, so I fixed them in #859 and opened a PR. Before reviewing this PR, I’d appreciate it if you could review #859 first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant