perliedman / leaflet-routing-machine

Control for routing in Leaflet
https://www.liedman.net/leaflet-routing-machine/
Other
1.06k stars 347 forks source link

Set waypoint name to an empty string on drag. #655

Open vnmedeiros opened 2 years ago

vnmedeiros commented 2 years ago

Hi there! is there any reason to update the waypoint name to an empty string, when end drag the point on the map?

https://github.com/perliedman/leaflet-routing-machine/blob/04e899ea765cadae033d941e9de13846540ce69b/src/plan.js#L251

Is that an expected behavior? Thank you!

vnmedeiros commented 2 years ago

https://github.com/perliedman/leaflet-routing-machine/pull/610

curtisy1 commented 2 years ago

Sorry for getting back to you this late @vnmedeiros I agree with the use case in the PR you linked. I'm thinking how we could integrate both approaches so it's up to the user to either clear or keep the waypoint name. Maybe some kind of setting would be ideal?

I'll try to spin something up in the coming days or on the weekend when I find some time

curtisy1 commented 2 years ago

I added a new option to clear the waypoint name on drag.

Will be available in the next major release. If you need this to be backported to version 3 of this plugin, please let me know