leaflet-fusesearch
leaflet-fusesearch copied to clipboard
fusesearch not work properly with cluster groups
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 see also #11
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
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
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.
not. I also to created workaround for myself
I'm having the same issue - posting here in the hopes someone can share a fix?
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