Skip to content
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

Closed
MattSidor opened this issue Mar 25, 2015 · 8 comments
Closed

Static Data / GeoJSON Search Not Working #58

MattSidor opened this issue Mar 25, 2015 · 8 comments

Comments

@MattSidor
Copy link

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."

@stefanocudini
Copy link
Owner

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.. :(

@MattSidor
Copy link
Author

If I can figure it out, I'll definitely make a pull request for you.

@stefanocudini
Copy link
Owner

thank you @seadour!

@reyemtm
Copy link

reyemtm commented Mar 26, 2015

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.

@MattSidor
Copy link
Author

@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.

@reyemtm
Copy link

reyemtm commented Mar 26, 2015

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.

stefanocudini added a commit that referenced this issue Jul 12, 2015
@MattSidor
Copy link
Author

<3! Thank you so much @stefanocudini!!

@stefanocudini
Copy link
Owner

It's only more simple bugfix... please starring and watch the repo.... and share!
bye!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants