smeijer / leaflet-geosearch

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

map.on(click) #148

Closed netforce closed 3 years ago

netforce commented 7 years ago

Following #92, and reading #138 and #129 i got myself a working version with draggable markers, updating location variables and almost completely as i want, but..

I'd still like to have the ability to add a marker onto the same map without using the searchplugin.. When i implement map.on('click') the bug of a marker being placed when clicking inside the searchbar re-appears.

I guess the map.on('click') even bypasses the disableHandlers and restoreHandlers wich fixed #138 ? As i'v got this far in getting this to work i'd be ashamed for not getting this to work.

For my code see https://codepen.io/netforcenl/pen/xXQMrb or https://jsfiddle.net/netforcenl/0a4b3ufg/11/ Now i'm creating the jsfiddle from my original code i'm noticing that when i click the "close search results" x, i also lose my result (marker), and the searchbar does not close when selecting one result..

I'm seriously overlooking something it seems and any help is appreciated.

unpkg leaflet@1.2.0 unpkg leaflet-geosearch@2.6.0

hartman commented 6 years ago

I have this problem too. Quite annoying. Anyone figured out a solution ?

dgana commented 6 years ago

Any quick solution for this issue?

AceCat commented 6 years ago

Wanted to check in and see if anyone had found a solution for this issue, it's driving me crazy.

ppulwey commented 3 years ago

This is still the case. Any update on this?

smeijer commented 3 years ago

Is there an updated reproduction available?

smeijer commented 3 years ago

I'm unable to reproduce this. Please let me know if you're able to create a reproduction based on this pen, so we can reopen and fix if I'm missing something.

https://codepen.io/smeijer/pen/YzGveWN?editors=0010

ppulwey commented 3 years ago

I'm using Vue2Leaflet with this wrapper for your package: https://www.npmjs.com/package/vue2-leaflet-geosearch The npm version is outdated. I've installed latest version from Git-Repo. It's working fine now! Thanks for your effort! 👍