mirror of
https://github.com/visgl/react-map-gl.git
synced 2025-12-08 20:16:02 +00:00
25 lines
712 B
JavaScript
25 lines
712 B
JavaScript
// import {useMap} from 'react-map-gl/mapbox';
|
|
|
|
export default function Controls2() {
|
|
/**
|
|
* ## This is how `useMap` works:
|
|
* This component does nothing. It's purpose is to demo `useMap`.
|
|
* When a component is a child of `<Map>`, `useMap` has a `current` field that references the containing map.
|
|
* See https://visgl.github.io/react-map-gl/docs/api-reference/use-map
|
|
* See https://visgl.github.io/react-map-gl/docs/api-reference/types#mapref
|
|
* ```
|
|
* const maps = useMap();
|
|
* console.log('Controls2 useMap()', maps);
|
|
* ```
|
|
* ### First render:
|
|
* ```
|
|
* {
|
|
* "current": {...}, // this is the same as `mymap`
|
|
* "mymap": {...}
|
|
* }
|
|
* ```
|
|
*/
|
|
|
|
return null;
|
|
}
|