mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-18 15:54:22 +00:00
Fix FullScreenControl container (#1430)
This commit is contained in:
parent
066dd60009
commit
d5bd80a8ea
@ -51,9 +51,7 @@ function FullscreenControl(props) {
|
||||
const [mapboxFullscreenControl, createMapboxFullscreenControl] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
const container = props.container || context.container;
|
||||
|
||||
const control = new mapboxgl.FullscreenControl({container});
|
||||
const control = new mapboxgl.FullscreenControl();
|
||||
|
||||
createMapboxFullscreenControl(control);
|
||||
setShowButton(control._checkFullscreenSupport());
|
||||
@ -75,6 +73,7 @@ function FullscreenControl(props) {
|
||||
|
||||
const onClickFullscreen = () => {
|
||||
if (mapboxFullscreenControl) {
|
||||
mapboxFullscreenControl._container = props.container || context.container;
|
||||
mapboxFullscreenControl._onClickFullscreen();
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user