Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For some reason, duplicate propertyName matches are removed from the search results. #261

Open
just-Addict opened this issue Sep 30, 2020 · 2 comments

Comments

@just-Addict
Copy link

just-Addict commented Sep 30, 2020

My data happens to contain a few 'user provided' entries which have the same content in the propertyName: 'Title' for different locations.

Now, if I do a search on this propertyName: 'Title' in the marker layers to be searched in, I only get 1 result listed even though others exist.

I am not fluent enough in Javascript to determine where, let alone even why, filtering is applied.

Duplicate names for locations is something that is a real-world occurence (supermarket chains for instance) and I honestly cannot understand why the search control even does filtering. It should never filter but simply return what exists in the data, duplicate propertyName or not...

If this cannot be fixed I am forced to search for a replacement control (and it was already difficult enough to find one that searches in the existing marker data instead of real world locations)
or, heaven forbid, struggle to write my own custom control...

@marczenko
Copy link

Bumping the thread, has there been found any solution for this?

@rdanziger
Copy link

rdanziger commented Jul 30, 2022

Using Leaflet 1.8.0. Data: OSM geoJSON.
Workaround:
Desired search field is a person name, but there are duplicates.
Added new property to geoJSON features (in this particular case, the person name concatenated to separator string (" - ") and then to the name of the street of residence (as all data points come from one municipality only).
Used this new property for search control.
Specific to my data ... but perhaps a hint to others.
(Thanks to: https://jsfiddle.net/nathansnider/oe61fkg0/ for the example.)
All this said, a change for duplicate handling by search control author is obviously still most desirable

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

No branches or pull requests

3 participants