naomap / leaflet-fusesearch

A plugin for Leaflet to search features in a GeoJSON layer using Fuse.js
MIT License
94 stars 33 forks source link

TypeError: jsonFeatures.map is not a function #2

Closed ghost closed 9 years ago

ghost commented 9 years ago

Hi, I follow the steps that you put in readme, and got this error:

TypeError: jsonFeatures.map is not a function

Can you help me?

Thanks!

naomap commented 9 years ago

I see. Currently indexFeatures() expects the array of features, not the json layer. I should fix the doc, or better let the method accept the json layer or the features array. In the meantime just pass your jsonLayer.features to indexFeatures().

ghost commented 9 years ago

Awsome, works perfectly. Thank man!

naomap commented 9 years ago

Le 08/01/2015 19:19, thiagoalencargit a écrit :

Awsome, works perfectly. Thank man!

— Reply to this email directly or view it on GitHub https://github.com/naomap/leaflet-fusesearch/issues/2#issuecomment-69223406.

You're welcome ! I've actually fixed the doc, however I shall let the code take care of this and accept either a GeoJSON FeatureCollection or an array of Feature's. Will do that when I get some time ...

Cheers, Antoine.

ghost commented 9 years ago

So, I'm a beginner in code and JS. If not for that I would be happy to help you. Keep up with the good work. It is a very good and useful tool.

Cheers, Thiago

naomap commented 9 years ago

Fixed by commit ac689f3859ddb9a6afc0217b57f805b1e925ffd8

JonahKE commented 8 years ago

Having a similar problem. See details here: http://gis.stackexchange.com/questions/174212/typeerror-jsonfeatures-map-is-not-a-function-using-fuse-search-in-leaflet-js