Skip to content

fix(terra-draw): fallback to default styling when style callbacks in select mode return undefined#832

Open
KWangechi wants to merge 3 commits intoJamesLMilner:mainfrom
KWangechi:fix/default-styling-fallback
Open

fix(terra-draw): fallback to default styling when style callbacks in select mode return undefined#832
KWangechi wants to merge 3 commits intoJamesLMilner:mainfrom
KWangechi:fix/default-styling-fallback

Conversation

@KWangechi
Copy link

Description of Changes

  • Added nullish coalescing (?? defaultValue) to the callback branch in getStylingValue() so that style functions returning undefined or null correctly fall back to Terra Draw default styles instead of propagating null to the adapter

  • Added tests for all geometry types verifying that style callbacks returning undefined default to Terra Draw styles

I am using MapLibre as the mapping library, but since this affects the main package, it should cut across all other mapping libraries and their corresponding adapters.

Link to Issue

Issue #831

PR Checklist

  • The PR title follows the conventional commit standard
  • There is a associated GitHub issue
  • If I have added significant code changes, there are relevant tests
  • If there are behaviour changes these are documented

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