SnowLayer
Example
Example Source Code
tsx
import React, { useEffect, useRef, useState } from 'react'
import ReactDOM from 'react-dom'
import { MbMap, MbTiandituLayer } from '@mapbox-react/core'
import { MbSnowLayer } from '@mapbox-react/env-layers'
const App = () => {
const [mapCenter] = useState([116, 39])
const [zoom, setZoom] = useState(10)
const [pitch, setPitch] = useState(0)
const mapInst = useRef<any>()
return (
<div className="map-wrapper">
<MbMap ref={mapInst} center={mapCenter} zoom={zoom} pitch={pitch}>
<MbSnowLayer />
</MbMap>
</div>
)
}
ReactDOM.render(<App />, document.querySelector('#root'))
API
PROPS
Name | Description | Type | Default |
---|---|---|---|
id | Layer ID | string | - |
EVENTS
Name | Description | Parameters |
---|---|---|
onCreated | Initialization complete event | - |
METHODS
Name | Description | Definition |
---|