Closed benesche1 closed 3 years ago
I can confirm this problem. Since some weeks this Leaflet plugin is not working anymore. I used it as Geocoder for Nominatim.
The problem can be reproduced:
In contrast - if you open the same example at Stefano's site https://opengeo.tech/maps/leaflet-search/examples/geocoding-nominatim.html and enter somthing in the search field you'll notice that it works on his site.
I think I found the reason why the easyblog.it site is working and the github example not. There's 1 code line different:
Within "/src/leaflet-search.js" line 755 has to be changed from
if(this._layer)
to if(this.options.layer)
The same should be done within the distribution files "/dist/leaflet-search.min.js" and "/dist/leaflet-search.src.js"
solved from version 3.0.0 just published on npm
cheers!
Expected Behavior
After typing something in the search box:
NOTE: This works in my Setup with leaflet-search 2.9.8
Current Behavior
If I type something in the Search Box nothing happens. When i press enter "Location not found" is displayed
Steps to Reproduce
Context (Environment)
I build an nodejs express application. Leaflet-serach is "imported" through require and then everything is translated through browserify. It worked on my first test 3 weeks ago (version 2.9.8) and now I started over and installed the latest version of leaflet-search (2.9.9). I suspected my code is broken (i switched from no template engine to handlebarsjs) but then I forced installing the previous version and everything worked fine. So I suspect the version is somehow flawed.
Edit: I use leaflet 1.7.1
Detailed Description
Through my debugging process I compared the behavior of version 2.9.9 vs 2.9.8 and I observed that both choose different paths at the first if-statement in the '_fillRecordsCache' function (Line 760). 2.9.9 jumps into the if part an 2.9.8 into the else one
I'm sorry if everything is not that detailed. I'm new to the JavaScript world and don't really know which information is useful. So pls ask if there is anything missing.