stefanocudini / leaflet-search

Search stuff in a Leaflet map
https://opengeo.tech/maps/leaflet-search/
MIT License
782 stars 334 forks source link

sourceData functionaliry broken (regression from last commit 9875037eda0986c110519fe820b8f10ca6e82c81) #266

Closed jbiermann closed 3 years ago

jbiermann commented 3 years ago

I have noticed that the sourceData option is not working. You can see that the example custom source data is broken.

The reason is that in the function _fillRecordsCache the if clause has been changed to "if(this._layer)" during this commit: https://github.com/stefanocudini/leaflet-search/commit/9875037eda0986c110519fe820b8f10ca6e82c81

This brakes the sourceData functionality since the _layer variable is initialised during Line 124. It is either the supplied layer or if the layer is null, the layer is a new empty layer. Now the changed if in the _fillRecordsCache function is always true, since the _layer variable is always an object.

ppete2 commented 3 years ago

see also #265

stefanocudini commented 3 years ago

solved from vedsion 3.0.0 published in npm