smeijer / leaflet-geosearch

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

fix: use marker layer instead of layer key #248

Closed tirli closed 3 years ago

tirli commented 3 years ago

Problem: current code fails on leaflet 1.7+ when you try to search more than once with error leaflet-src.js:69 Uncaught (in promise) TypeError: Cannot create property '_leaflet_id' on string '582' because now leaflet doesn't support number-like strings. It was missed since TypeScript was suppressed here.

Proposed changes:

  1. use getLayers function instead of a private field
  2. Remove ts suppression
smeijer commented 3 years ago

Thanks @tirli! This is looking great.

smeijer commented 3 years ago

@all-contributors please add @tirli for code

allcontributors[bot] commented 3 years ago

@smeijer

I've put up a pull request to add @tirli! :tada:

smeijer commented 3 years ago

Released as 3.0.7 :tada:

tirli commented 3 years ago

Awesome! Thanks for the fast reaction :+1: