Skip to content

Commit

Permalink
Fix FullScreenControl container (#1430)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Apr 13, 2021
1 parent 066dd60 commit d5bd80a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/fullscreen-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -75,6 +73,7 @@ function FullscreenControl(props) {

const onClickFullscreen = () => {
if (mapboxFullscreenControl) {
mapboxFullscreenControl._container = props.container || context.container;
mapboxFullscreenControl._onClickFullscreen();
}
};
Expand Down

0 comments on commit d5bd80a

Please sign in to comment.