smeijer / leaflet-geosearch

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

Not load Destination after click search result #275

Closed Mansoun closed 3 years ago

Mansoun commented 3 years ago

Hi. I have a question and an issue due use this library. first, every i tried the box shown top of the map , i failed and every time this appears beside the map as bar. second, when i choose one of address shows by search input, the map going to freez and only zoom bottum works unti refresh page! there is an error : Uncaught (in promise) TypeError: Cannot convert undefined or null to object on line 423: e = Object.keys(this.markers.t);

please help me. thanks sir.

Dak0r commented 3 years ago

I can confirm that I also get this error when selecting a search result if using version 3.0.0 from unpkg which is linked in some examples.

Uncaught (in promise) TypeError: can't convert undefined to object
    showResult SearchControl.ts:412
    onSubmit SearchControl.ts:404
    promise callback*onSubmit SearchControl.ts:401
    handleClick SearchControl.ts:218
    ....

Using the latest vesrion 3.3.2 works fine:

      <!-- Search -->
        <link
        rel="stylesheet"
        href="https://unpkg.com/leaflet-geosearch@3.3.2/dist/geosearch.css"
        />
        <!-- Make sure you put this AFtER leaflet.js, when using with leaflet -->
        <script src="https://unpkg.com/leaflet-geosearch@3.3.2/dist/geosearch.umd.js"></script>
smeijer commented 3 years ago

Closing, as this should be fixed in the latest version.

kennankole commented 2 years ago

Thanks!! @smeijer It fixed it for me.