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

fusesearch not work properly with cluster groups #12

Open
denvut opened this issue Feb 20, 2016 · 7 comments
Open

fusesearch not work properly with cluster groups #12

denvut opened this issue Feb 20, 2016 · 7 comments

Comments

@denvut
Copy link

denvut commented Feb 20, 2016

Hi! i try use your great plugin with this plugin https://github.com/VincentDS/Leaflet.markercluster
And find what:
fusesearch not work properly with cluster groups - all markers who grouped in cluster don't find in result list.

but i find what:
one guy some correct your js-script:
https://github.com/KoGor/Streets-of-Valour-and-Victory/blob/master/js/leaflet.fusesearch2.js
and they work not only with single markers
may bee it's help

sorry for my bad english :)

@jo-pol
Copy link
Contributor

jo-pol commented Feb 21, 2016

@denvut see also #11

@denvut
Copy link
Author

denvut commented Feb 24, 2016

Hm, some new info: if use without options

   var fuseSearchCtrl = L.control.fuseSearch();
    fuseSearchCtrl.indexFeatures(data.features, ['name', 'loc', 'hardware_id']);
    map.addControl(fuseSearchCtrl);

then in search result - show all right answers, but clickable only single marker, if result in cluster group - i can't selected item.

if use with options, example:

var options = {
        position: 'topright',
        title: 'Ub-ran',
        placeholder: 'Find on map',
        maxResultLength: 7,
        threshold: 0.2,
        showInvisibleFeatures: false,
        showResultFct: function (feature, container) {
            var props = feature.properties,
                name = L.DomUtil.create('b', null, container);
            name.innerHTML = props.name;
            container.appendChild(L.DomUtil.create('br', null, container));
            container.appendChild(document.createTextNode(props.loc));
            container.appendChild(L.DomUtil.create('br', null, container));
            container.appendChild(document.createTextNode(props.hardware_id));
        }
    };
    var fuseSearchCtrl = L.control.fuseSearch(options);

in search result show only single markers

@jo-pol
Copy link
Contributor

jo-pol commented Feb 24, 2016

@denvut
showInvisibleFeatures: false explains the different behaviour. In #11 I reported the same problem. @naomap knows how to solve it but says "Unlikely to find the time to publish that in the next couple of weeks" So let us be patient.

For the time being I worked around it with a searchable and clustered mode of my map

@corinat
Copy link

corinat commented Oct 26, 2016

Does the issue with maker cluster has been solved? I tried to read all the comments and the links from the comments but couldn't really figure it out if the problem was solved or not.

@denvut
Copy link
Author

denvut commented Oct 26, 2016

not. I also to created workaround for myself

@wdamon
Copy link

wdamon commented Nov 28, 2016

I'm having the same issue - posting here in the hopes someone can share a fix?

@DemevengDerrick
Copy link

good afternoon, please i have been trying in vain for long now to pass my geojason data to my searchcontrol.indexFeature and am getting the following results. please can someone help?

Uncaught TypeError: jsonFeatures.map is not a function
at e.indexFeatures (leaflet.fusesearch.js:230)
at javascriptRGC.js:144

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

5 participants