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

feat: add leaflet control option to not update map view #230

Closed CodeWithCory closed 3 years ago

CodeWithCory commented 4 years ago

@smeijer & maintainers I have a Pull Request for your review.

For the Leaflet SearchControl I've added an updateMap option to not center the map at all.

This is a very useful option because it works well in conjunction with the geosearch/showlocation event. It frees up developers to use the convenience of the built-in Leaflet Control without restricting them to forced map centering.

I have a use-case for an app I'm building where instead of moving the map to the specific location searched, I will use the location from the event to instead zoom to the county that the location is in. This feature would give me the freedom to use your Leaflet Control while writing my own map centering.

I hope you like this feature and please let me know if there's anything I can/should change. I picked "updateMap" as the option name but if there's a better name for that option then please let me know and/or edit.

CodeWithCory commented 4 years ago

@smeijer To the maintainers: Though small, this is my first Pull Request to an open source project! Please let me know if there's anything else I need to do, or any customs/practices I should be aware of. Thanks much!

smeijer commented 3 years ago

@CoryLR I'm very sorry. This one totally slipped my mind. It's looking great! Thanks.

smeijer commented 3 years ago

@all-contributors please add @CoryLR for ideas, code

allcontributors[bot] commented 3 years ago

@smeijer

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

smeijer commented 3 years ago

Published as v3.1.0.

CodeWithCory commented 3 years ago

Thanks much @smeijer ! I'm excited to pull this update into my COVID-19-Watch project later. If I have any other recommendations / ideas I'll submit a PR.

I'm a bit new to the dynamic of open source projects so I just have a couple quick questions:

  1. What is "all-contributors"?
  2. Is there any other documentation I can/should assist in updating or is is it all sourced from the readme?

Thanks!

smeijer commented 3 years ago

That sounds great. Feel free to share a link to your project in #216.

  1. all-contributors is a bot that helps me maintain the contributors' table in the readme. That message above, triggered the bot to create a PR, which add's you to that table. It's a small sign of appreciation to all the contributors this project has.

    Ideas, because you came up with this feature suggestion. And code, because you contributed code.

  2. Documentation is partially extracted from the typescript definitions.

    The line here:

    https://github.com/smeijer/leaflet-geosearch/blob/2423e23aad6d5bf39203a38469f308551273fd19/src/SearchControl.ts#L52

    has been extracted, and placed in the table here: https://smeijer.github.io/leaflet-geosearch/leaflet-control#properties

So not everything is sourced, but the basic property tables are. More specific things like code snippets, are manually maintained in the various .mdx files that you can find in this repo.

Documentation is something that can always be improved. We currently have 8 open issues labeled with docs. But I don't think this PR requires more documentation then what has been done automatically. Unless you really want to of course. Contributions are always appreciated.