smeijer / leaflet-geosearch

A geocoding/address-lookup library supporting various api providers.
https://smeijer.github.io/leaflet-geosearch/
MIT License
1.03k stars 273 forks source link

Error using Algolia provider from CDN #235

Closed Emmaqm closed 3 years ago

Emmaqm commented 4 years ago

Hi, I'm trying to use geosearch with Algolia as the provider. I can't use imports so I have to pull the library from the cdn. I'm using the code below, but I'm getting the following error: Cannot read property 'lng' of undefined

const provider = new GeoSearch.AlgoliaProvider({ params: { hitsPerPage: 5, countries: 'uy', } }); let results = provider.search({ query: 'Ombues' });

image

smeijer commented 4 years ago

Is it a specific query that causes this? It looks like a property on the algolia response that doesn't exist.

Can you replicate this in codepen / jsfiddle?

yznts commented 3 years ago

@Emmaqm, seems like that issue was fixed in minor versions somehow. Errors presents in 3.0.0, but 3.0.5 works good.

smeijer commented 3 years ago

Thanks @yuriizinets! I'm going to close this issue. Please let me know if the issue still persists.