react-leaflet icon indicating copy to clipboard operation
react-leaflet copied to clipboard

Support custom control containers

Open davetapley opened this issue 1 year ago • 0 comments

This issue would be more compelling if ⬇️ was merged, but I wanted to document while it's in my head.

  • https://github.com/Leaflet/Leaflet/pull/4518

Per the comment there:

This update allows a control to be added to the map even if it does not fall into one of the 4 control corner containers. When a control is added without a defined corner container, the map will now append the control after the existing corner containers allowing for custom containers to be added to the map.

This is actually already 'supported' if you are prepared to just attach a portal to .leaflet-control-container, but as https://github.com/Leaflet/Leaflet/pull/4518 proposes it would probably be nicer if it was 'officially' supported.


For react-leaflet specifically we already use type ControlOptions, that gives a position which can already be undefined.

So from a type signature perspective the use case in https://github.com/Leaflet/Leaflet/pull/4518 already 'appears' to be be supported, but AFAICT isn't supported by react-leaflet yet.

Is that assumption correct? And if so is it something which could be supported?

davetapley avatar Jul 20 '22 18:07 davetapley