leaflet-fusesearch
leaflet-fusesearch copied to clipboard
result-items not clickable
I went over the code of your example with Nantes again and again but don't see what I'm missing.
The search seems to work fine until I try to click a result item. Debugging with the browser it appears to lack the class clickable.
A pull request on my own project shows what I tried: https://github.com/lacemap/lacemap/pull/1
Live demo without fuse search: http://lacemap.github.io/
First I've clarified where and how should be used the statement : feature.layer = layer; Next your code uses a MarkerCluster, and I'm yet to let the plugin deal with markers in cluster...
From your Nantes I example I figured out where you placed feature.layer = layer;
as you can see in my pull request it does not make a difference in my situation. https://github.com/lacemap/lacemap/pull/1/files But it is good to have it in your readme for other users.
In the mean time I forked my own project so you can see a live demo of my attempt http://jo-pol.github.io/lacemap/
Does "I'm yet to let the plugin deal with markers in cluster..." mean you are in the process of changing your plugin? That would be very kind.
I wish I had the time to work on it ! Your request is an incentive to find the time though ...
As another incentive a simple example for your readme: http://lacemap.github.io/lacemap/searchable.html
Copy it to your own gh-pages branch, then you will have your demo on http://naomap.github.io/leaflet-fusesearch/searchable.html
Strip the popup and you get down at 50 lines, this popup came with the quick start example and I have a use case for it.
I found another plugin that could help to fix this issue: https://github.com/ghybs/Leaflet.MarkerCluster.Freezable
This plugin provides a disAbleClustering and enableClustering. If available these should be called when opening and closing the search popup.
My idea (and I had a prototype working) is to zoom to the level where the cluster is exploded. Seems more useful to me than disabling the cluster. Unlikely to find the time to publish that in the next couple of weeks :-(
Your solution sounds much better, I try to be patient.
Yes I know this is 2 years old... That being said jo-pol, do you still have a more simple example of the implementation of this search? I am new to coding and I can get the search to the point of pulling up a list but cannot get it to let me click on one. Having trouble understanding the section
L.geoJson(data, { onEachFeature: function (feature, layer) { feature.layer = layer; } });