-
Notifications
You must be signed in to change notification settings - Fork 330
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Static Data / GeoJSON Search Not Working #58
Comments
hi @seadour thank yooou for the alert I checked and actually does not work.. Now I do not have free time to understand what happened.. :( |
If I can figure it out, I'll definitely make a pull request for you. |
thank you @seadour! |
I have it working for geojson, but it ONLY works by starting from the first character. For example, if the wanted item is 8735 (which you can try on the map), if you type in 735 it will not show up. However, the searching from csv works this way, meaning it searches the entire field. I'm not sure why it's not working on the author's site with geojson. Although it is very rough, you can see a working geojson search here, not sure if I have the latest plugin version. Again try 8735, these are addresses. I changed the circle color to white, otherwise no changes were made. On another note I would like to know how to open the popup for the marker once it's found. |
@reyemtm when you say "searching from csv" -- do you mean json, using the 'callData' option? It looks like you are actually using a fork of Leaflet called CartoDB.js. (https://github.com/CartoDB/cartodb.js) Unfortunately I don't know enough about that project to help debug it with leaflet-search. There are a lot of other libraries in your example that could be causing other discrepancies, too. It would be helpful if you could try to reproduce your map through a stripped-down version with just leaflet/cartodb and leaflet-search. |
Here ya go. I've added the csv search as well, not too sure how to separate them. I added the csv using the omnivore plugin. I stripped out all the other plugins. The csv is the second search button, the layer are airports in the US so you have to zoom out to see them, but you can search on the entire field as I said above. |
<3! Thank you so much @stefanocudini!! |
It's only more simple bugfix... please starring and watch the repo.... and share! |
I was having trouble getting Leaflet-search to work correctly with static data or GeoJSON files, as in these examples:
http://labs.easyblog.it/maps/leaflet-search/examples/calldata.html
http://labs.easyblog.it/maps/leaflet-search/examples/geojson-layer.html
...but I just noticed that the examples actually aren't working either.
For the static data example, using callData, typing in any search term brings up the full list of values without matching your text to the correct item.
For the GeoJSON example, the 'spinner' animation appears but no matches are ever found. If you type 'enter' on a search term that should match (like 'Alabama'), it says "Location not found."
The text was updated successfully, but these errors were encountered: