I am trying to build a web map (using leaflet) that shows the location and extent of orienteering maps owned by a number of clubs/organisations in my state. Each club/organisation has a layer that is populated with their maps. To make finding these maps easier, the ability to search by name is required.
To be able to search all layers at once I have grouped them into a layerGroup (as suggested in this answer). This does not produce a result when I attempt to search for a map (the developer console throws the error
TypeError: a.getLatLng is not a function in relation to leaflet-search.js). Searching with only one layer does produce a satisfactory result (and doesn't throw an error).
How can this error be solved? Is there a better method to search through multiple layers?