fix: name new point layer using label if provided (follow-up) - #3297
Conversation
There was a problem hiding this comment.
Pull request overview
This PR is a follow-up to PR #3296 that addresses an issue where point layers created from lat/lng field pairs were defaulting to the name "point" instead of using the dataset label. The change removes the hardcoded fallback to 'point' in the findPointFieldPairs function, allowing the label fallback chain in point-layer to work correctly.
Changes:
- Removed the
|| 'point'fallback when settingdefaultNameinfindPointFieldPairs, allowing empty string values to fall through to the label fallback logic
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…gl#3297) Signed-off-by: bdjulbic <bdjulbic@foursquare.com>
This is a follow-up PR for fix: name new point layer using label if provided #3296
The
pair.defaultNamewill be default to 'point' for cases like arc layer, and this will makes the change in previous PR not working:label: pair.defaultName || (typeof label === 'string' && label.replace(/\.[^/.]+$/, '')) || 'Point'here is the update change in this pr:
label: pair.defaultName && pair.defaultName !== 'point' ? pair.defaultName : (typeof label === 'string' && label.replace(/\.[^/.]+$/, '')) || 'Point' };