react-map-interaction
react-map-interaction copied to clipboard
Is it possible to auto center from mount?
Right now the element we use is just aligned on top left of its container, it would be nice to be able to use a full screen container while still be able to center the zoomable element inside of it automtically.
This is because the transform-origin is set to top left (0 0). There isn't an option to set this, but you can override it if you give the <MapInteractionCSS> a parent div, with a class name, and then drill into where the transform origin is set.
.mag-page > div > div > div {
transform-origin: center center !important;
}
NOTE: We had some issues with vertical center working, so went with top center.