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

Ajax doesn't work. #338

Open
virtuPIC opened this issue Oct 25, 2024 · 1 comment
Open

Ajax doesn't work. #338

virtuPIC opened this issue Oct 25, 2024 · 1 comment

Comments

@virtuPIC
Copy link

Setting URL to an address that delivers valid JSON doesn't work. As in the demo, you'll only get some 'undefined' stuff. Debugging turned out the following error in line 736 of file src/leaflet-search.js:

self._recordsCache = self._formatData(self, data)
should be
self._recordsCache = self._formatData(data)

@M2oMark
Copy link

M2oMark commented Dec 19, 2024

I had the same problem and i guess a better fix is to use .call() on self._formatData passing self.

self._recordsCache = self._formatData.call(self, data)

This also fixes the "Ajax by jQuery" example and maybe more.

Greets

Edit: There's already a PR fixing this issue: #326

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

2 participants