@@ -25,30 +25,34 @@ Here's a usage example:
2525 },
2626 };
2727
28- const flowMapLayer = new FlowMapLayer({
29- id: 'flow-map-layer',
30- colors,
31- locations: [...], // array of GeoJSON features of location areas
32- flows: [...], // array of Flow objects
33- getLocationId: l => l.id,
34- getLocationCentroid: l => l.properties.centroid,
35- getFlowOriginId: f => f.origin,
36- getFlowDestId: f => f.dest,
37- getFlowMagnitude: f => f.magnitude,
38- showTotals: true,
39- showLocationAreas: true,
40- locationCircleSize: 3,
41- showLocationAreas: true,
42- getFlowMagnitude: f => f.count,
43- varyFlowColorByMagnitude: true,
44- showTotals: true,
45- });
46-
47- return (
48- <MapGL {...viewport} width={width} height={height} mapboxApiAccessToken={mapboxAccessToken}>
49- <DeckGL {...viewport} width={width} height={height} layers={[flowMapLayer]} />
50- </MapGL>
51- );
28+ class MyFlowMap extends Component {
29+ render() {
30+ const flowMapLayer = new FlowMapLayer({
31+ id: 'flow-map-layer',
32+ colors,
33+ locations: [...], // array of GeoJSON features of location areas
34+ flows: [...], // array of Flow objects
35+ getLocationId: l => l.id,
36+ getLocationCentroid: l => l.properties.centroid,
37+ getFlowOriginId: f => f.origin,
38+ getFlowDestId: f => f.dest,
39+ getFlowMagnitude: f => f.magnitude,
40+ showTotals: true,
41+ showLocationAreas: true,
42+ locationCircleSize: 3,
43+ showLocationAreas: true,
44+ getFlowMagnitude: f => f.count,
45+ varyFlowColorByMagnitude: true,
46+ showTotals: true,
47+ });
48+
49+ return (
50+ <MapGL {...viewport} width={width} height={height} mapboxApiAccessToken={mapboxAccessToken}>
51+ <DeckGL {...viewport} width={width} height={height} layers={[flowMapLayer]} />
52+ </MapGL>
53+ );
54+ }
55+ }
5256
5357The full list of supported props:
5458
0 commit comments