Closed answerquest closed 1 year ago
Got it! Have to give a function for filterData
option param and just return the allRecords array.
function mapSearchFunc(textSearch, allRecords) {
// console.log('textSearch:',textSearch, 'allRecords:',allRecords);
return allRecords;
}
// ref: https://github.com/stefanocudini/leaflet-search
map.addControl( new L.Control.Search({
sourceData: searchByAjax,
text:'Searh a stop...',
markerLocation: true,
minLength: 3,
filterData: mapSearchFunc
})
);
Hi, thank you for making this great plugin.
I have all searching functionalities well taken care of in my backend api that is being called. I'd like the results list as-is to be displayed. But instead I'm seeing that this plugin is doing one more level of filtering on those results, and this is messing up the functionality. Is there a way we can prevent this additional filtering that's happening?