leaflet-fusesearch icon indicating copy to clipboard operation
leaflet-fusesearch copied to clipboard

fusesearch not work properly with cluster groups

Open denvut opened this issue 9 years ago • 7 comments

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 :)

denvut avatar Feb 20 '16 06:02 denvut

@denvut see also #11

jo-pol avatar Feb 21 '16 12:02 jo-pol

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

denvut avatar Feb 24 '16 06:02 denvut

@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

jo-pol avatar Feb 24 '16 08:02 jo-pol

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.

corinat avatar Oct 26 '16 08:10 corinat

not. I also to created workaround for myself

denvut avatar Oct 26 '16 14:10 denvut

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

wdamon avatar Nov 28 '16 20:11 wdamon

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

DemevengDerrick avatar Jan 04 '19 14:01 DemevengDerrick