FullscreenControl
Example
Example Source Code
tsx
import React, { useState } from 'react'
import ReactDOM from 'react-dom'
import { MbFullscreenControl, MbMap, MbTiandituLayer } from '@mapbox-react/core'
const App = () => {
const [mapCenter] = useState([116.38745, 39.91266])
const [zoom, setZoom] = useState(2)
return (
<div className="map-wrapper">
<MbMap center={mapCenter} zoom={zoom}>
<MbTiandituLayer types={['vec']} />
<MbFullscreenControl position="top-right" />
</MbMap>
</div>
)
}
ReactDOM.render(<App />, document.querySelector('#root'))
API
PROPS
Name | Description | Type | Default |
---|---|---|---|
position | Position | string('top-left' , 'top-right' , 'bottom-left' ,'bottom-right') | top-right |
EVENTS
Name | Description | Parameters |
---|---|---|
onCreated | Map initialization completed event | - |
METHODS
Name | Description | Definition |
---|