react-map-gl/docs/api-reference/fullscreen-control.md
Ivad Yves HABIMANA 08d4f52d5d
Update fullscreen-control source code link (#2363)
* Update fullscreen-control source code link

---------

Co-authored-by: Chris Gervang <chrisgervang@users.noreply.github.com>
2024-12-13 11:48:05 -08:00

2.0 KiB

FullscreenControl

React component that wraps the base library's FullscreenControl class (Mapbox | Maplibre).

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

import * as React from 'react';
import Map, {FullscreenControl} from 'react-map-gl';

function App() {
  return <Map
    mapboxAccessToken="<Mapbox access token>"
    initialViewState={{
      longitude: -100,
      latitude: 40,
      zoom: 3.5
    }}
    mapStyle="mapbox://styles/mapbox/streets-v9"
  >
    <FullscreenControl />
  </Map>;
}
import * as React from 'react';
import Map, {FullscreenControl} from 'react-map-gl/maplibre';

function App() {
  return <Map
    initialViewState={{
      longitude: -100,
      latitude: 40,
      zoom: 3.5
    }}
    mapStyle="https://api.maptiler.com/maps/streets/style.json?key=get_your_own_key"
  >
    <FullscreenControl />
  </Map>;
}

Properties

Reactive Properties

style: CSSProperties

CSS style override that applies to the control's container.

Other Properties

The properties in this section are not reactive. They are only used when the component first mounts.

containerId: string

Id of the DOM element which should be made full screen. By default, the map container element will be made full screen.

position: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'

Default: 'top-right'

Placement of the control relative to the map.

Source

fullscreen-control.ts