mirror of
https://github.com/visgl/react-map-gl.git
synced 2026-01-18 15:54:22 +00:00
36 lines
893 B
JavaScript
36 lines
893 B
JavaScript
export const clusterLayer = {
|
|
id: 'clusters',
|
|
type: 'circle',
|
|
source: 'earthquakes',
|
|
filter: ['has', 'point_count'],
|
|
paint: {
|
|
'circle-color': ['step', ['get', 'point_count'], '#51bbd6', 100, '#f1f075', 750, '#f28cb1'],
|
|
'circle-radius': ['step', ['get', 'point_count'], 20, 100, 30, 750, 40]
|
|
}
|
|
};
|
|
|
|
export const clusterCountLayer = {
|
|
id: 'cluster-count',
|
|
type: 'symbol',
|
|
source: 'earthquakes',
|
|
filter: ['has', 'point_count'],
|
|
layout: {
|
|
'text-field': '{point_count_abbreviated}',
|
|
'text-font': ['DIN Offc Pro Medium', 'Arial Unicode MS Bold'],
|
|
'text-size': 12
|
|
}
|
|
};
|
|
|
|
export const unclusteredPointLayer = {
|
|
id: 'unclustered-point',
|
|
type: 'circle',
|
|
source: 'earthquakes',
|
|
filter: ['!', ['has', 'point_count']],
|
|
paint: {
|
|
'circle-color': '#11b4da',
|
|
'circle-radius': 4,
|
|
'circle-stroke-width': 1,
|
|
'circle-stroke-color': '#fff'
|
|
}
|
|
};
|