Skip to content

Show duplicates in search#107

Open
zvirja wants to merge 2 commits into
theborderland:mainfrom
zvirja:fix-duplicate-search
Open

Show duplicates in search#107
zvirja wants to merge 2 commits into
theborderland:mainfrom
zvirja:fix-duplicate-search

Conversation

@zvirja

@zvirja zvirja commented Jun 15, 2026

Copy link
Copy Markdown

Allow to render duplicates (which happens for big camps), so it's easier to navigate:

image

Tested and it seems to work!

@zvirja zvirja force-pushed the fix-duplicate-search branch from f58e63e to dc2b63c Compare June 15, 2026 12:47
@zvirja zvirja force-pushed the fix-duplicate-search branch from dc2b63c to c87bafa Compare June 15, 2026 12:47
@bobinush

bobinush commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Cool!
I get it, but doesn’t it make more sense to name your camps uniquely (e.g. camp 1, camp 2 camp 3)?

I’m not sure I have time to test until after the weekend but here’s a question: the “[1]” etc in the result list, is that added by the map (when there are multiple duplicates) or just from your testing data?
Because don’t like the idea of the map to change the name of camps, I’d rather show the names as they are.

@zvirja

zvirja commented Jun 15, 2026

Copy link
Copy Markdown
Author

@bobinush It's not my camp :) Reality is that we have a lot of camps having duplicate names - so those are effectively unreachable by search. I just wanted to fix that. I do agree that you shall not have duplicate names in the first place - yet those happen.

the “[1]” etc in the result list, is that added by the map (when there are multiple duplicates) or just from your testing data?

I do render the real data (npm run dev), so it's rendered by map.

Because don’t like the idea of the map to change the name of camps, I’d rather show the names as they are.
Pushed a fix to render same name. Agree it's less confusing.

image

@zvirja zvirja force-pushed the fix-duplicate-search branch from d2174ff to e39390c Compare June 15, 2026 14:09
@bobinush

Copy link
Copy Markdown
Collaborator

I had a look on my computer now, works well!

2 thoughts:

  1. Would it make sense to filter on the name already in the sourceData so formatData function only gets a subset?
  2. Or somehow save/cache away the result in formatData? Because now layer.getBounds().getCenter() will happen for all entities for every search (or even worse: every key stroke if you're not typing fast enough when the search function runs).

I don't think the search function is used so much that a bit slower search is any loss tbh, but just wondering what you think about it?

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.

2 participants