Skip to content

Commit 7d1885e

Browse files
author
Savina Shen (Manpower Services Taiwan Co Ltd)
committed
fix cluster aggregates
1 parent 5a64095 commit 7d1885e

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

src/stories/DataVisualization/ClusterAggregates/ClusterAggregate.mdx

+7-5
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ Clustered points have four properties;
1212
- `point_count` - The number of points the cluster contains.
1313
- `point_count_abbreviated` - A string that abbreviates the point_count value if it is long. (i.e. 4,000 becomes 4K)
1414

15+
For more information on clustering, see the tutorial [here](https://learn.microsoft.com/en-us/azure/azure-maps/clustering-point-data-web-sdk).
16+
1517
You can observe the clusters by zooming in and out on the map.
1618

1719
<ClusterAggregates showBubbles showNumbers/>
1820

1921
In this example, we use a **Bubble Layer** to render the clusters as circles and a **Symbol Layer** to render the number of points in each cluster.
20-
For the bubble layer, we set the radius and the color to change based on the number of points in the cluster.
22+
For the bubble layer, we set the radius and the color to change based on the numbers of points in the clusters.
2123

2224
<Source code={`
2325
const bubbleLayerOptions = {
24-
//Scale the size of the clustered bubble based on the number of points inthe cluster.
26+
//Scale the size of the clustered bubble based on the number of points in the cluster.
2527
radius: [
2628
'step',
2729
['get', 'point_count'],
@@ -47,7 +49,7 @@ const bubbleLayerOptions = {
4749
};
4850
`}/>
4951

50-
For the symbol layer, we set the text to be the point_count_abbreviated property of the cluster.
52+
For the symbol layer, we set the text to be the `point_count_abbreviated` property of the cluster.
5153

5254
<Source code={`
5355
const symbolLayerOptions = {
@@ -71,11 +73,11 @@ import {
7173
AzureMapsProvider,
7274
} from 'react-azure-maps';
7375
74-
const ClusterAggregates = ({ showBubbles, showNumbers }: ClusterAggregatesProps) => {
76+
const ClusterAggregates = () => {
7577
7678
return (
7779
<AzureMapsProvider>
78-
<AzureMap options={your_option}>
80+
<AzureMap options={...your_options, center: [-97, 39], zoom: 1.5, view: 'Auto',}>
7981
<AzureMapDataSourceProvider
8082
id="ClusterAggregates DataSourceProvider"
8183
dataFromUrl="https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.geojson"

src/stories/DataVisualization/ClusterAggregates/ClusterAggregates.tsx

+2-6
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,15 @@ import {
55
AzureMapsProvider,
66
IAzureMapOptions,
77
} from 'react-azure-maps';
8-
import { AuthenticationType } from 'azure-maps-control';
9-
import { key } from '../../../key';
8+
import { mapOptions } from '../../../key';
109

1110
export interface ClusterAggregatesProps {
1211
showBubbles: boolean;
1312
showNumbers: boolean;
1413
}
1514

1615
const option: IAzureMapOptions = {
17-
authOptions: {
18-
authType: AuthenticationType.subscriptionKey,
19-
subscriptionKey: key,
20-
},
16+
...mapOptions,
2117
center: [-97, 39],
2218
zoom: 1.5,
2319
view: 'Auto',

0 commit comments

Comments
 (0)