8 |
Interactive GeoJSON
9 |
10 | Map showing median household income by state in year {year}. Hover over a state to
11 | see details.
12 |
13 |
14 | Data source: US Census Bureau
15 |
16 |
24 |
25 |
26 |
27 |
28 | props.onChange(evt.target.value)}
35 | />
36 |
37 |
38 | );
39 | }
40 |
41 | export default React.memo(ControlPanel);
42 |
--------------------------------------------------------------------------------
/examples/viewport-animation/src/control-panel.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 |
3 | import CITIES from '../../.data/cities.json';
4 |
5 | function ControlPanel(props) {
6 | return (
7 |
8 |
Camera Transition
9 |
Smooth animate of the viewport.
10 |
18 |
19 |
20 | {CITIES.filter(city => city.state === 'California').map((city, index) => (
21 |
22 | props.onSelectCity(city)}
28 | />
29 |
30 |
31 | ))}
32 |
33 | );
34 | }
35 |
36 | export default React.memo(ControlPanel);
37 |
--------------------------------------------------------------------------------
/docs/table-of-contents.json:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "type": "category",
4 | "label": "Overview",
5 | "items": [
6 | "README",
7 | "whats-new",
8 | "upgrade-guide",
9 | "contributing"
10 | ]
11 | },
12 | {
13 | "type": "category",
14 | "label": "Developer Guide",
15 | "items": [
16 | "get-started/get-started",
17 | "get-started/mapbox-tokens",
18 | "get-started/state-management",
19 | "get-started/adding-custom-data",
20 | "get-started/tips-and-tricks"
21 | ]
22 | },
23 | {
24 | "type": "category",
25 | "label": "API Reference",
26 | "items": [
27 | "api-reference/map",
28 | "api-reference/attribution-control",
29 | "api-reference/fullscreen-control",
30 | "api-reference/geolocate-control",
31 | "api-reference/layer",
32 | "api-reference/map-provider",
33 | "api-reference/marker",
34 | "api-reference/navigation-control",
35 | "api-reference/popup",
36 | "api-reference/scale-control",
37 | "api-reference/source",
38 | "api-reference/use-control",
39 | "api-reference/use-map",
40 | "api-reference/types"
41 | ]
42 | }
43 | ]
--------------------------------------------------------------------------------
/examples/side-by-side/src/control-panel.tsx:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import {useCallback} from 'react';
3 |
4 | export type Mode = 'side-by-side' | 'split-screen';
5 |
6 | function ControlPanel(props: {mode: Mode; onModeChange: (newMode: Mode) => void}) {
7 | const onModeChange = useCallback(
8 | evt => {
9 | props.onModeChange(evt.target.value as Mode);
10 | },
11 | [props.onModeChange]
12 | );
13 |
14 | return (
15 |