Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const H3ClusterLayerExample = {
layer: H3ClusterLayer,
props: {
data: ['882830829bfffff'],
getHexagons: d => h3.kRing(d, 6),
getLineWidth: 100,
stroked: true,
filled: false
}
};
const H3HexagonLayerExample = {
layer: H3HexagonLayer,
props: {
// data: h3.kRing('891c0000003ffff', 4), // Pentagon sample, [-143.478, 50.103]
data: h3.kRing('882830829bfffff', 4), // SF
getHexagon: d => d,
getColor: (d, {index}) => [255, index * 5, 0],
getElevation: d => Math.random() * 1000
}
};
const TripsLayerExample = {
layer: TripsLayer,
propTypes: {
currentTime: {
type: 'range',
step: 12,
min: 0,
max: 1200
},
trailLength: {
})
],
goldenImage: './test/render/golden-images/h3-hexagon.png'
},
{
name: 'h3-hexagon-layer-high-precision',
viewState: {
latitude: 50.103,
longitude: -143.478,
zoom: 13,
pitch: 0,
bearing: 0
},
layers: [
new H3HexagonLayer({
data: h3.kRing('891c0000003ffff', 4),
opacity: 0.8,
getHexagon: d => d,
getFillColor: (d, {index}) => [255, index * 5, 0],
getElevation: (d, {index}) => index * 10
})
],
goldenImage: './test/render/golden-images/h3-hexagon-high-precision.png'
},
{
name: 'h3-hexagon-layer-flat',
viewState: {
latitude: 37.78,
longitude: -122.45,
zoom: 12,
pitch: 0,
bearing: 0
getHexagons: d => h3.kRing(d, 6),
getLineWidth: 100,
})
],
goldenImage: './test/render/golden-images/h3-hexagon-flat.png'
},
{
name: 'h3-hexagon-layer-flat-high-precision',
viewState: {
latitude: 37.78,
longitude: -122.45,
zoom: 12,
pitch: 0,
bearing: 0
},
layers: [
new H3HexagonLayer({
data: h3.kRing('882830829bfffff', 4),
opacity: 0.8,
getHexagon: d => d,
extruded: false,
stroked: true,
highPrecision: true,
getFillColor: (d, {index}) => [255, index * 5, 0],
getLineColor: [255, 255, 255],
lineWidthMinPixels: 2
})
],
goldenImage: './test/render/golden-images/h3-hexagon-flat.png'
},
{
name: 'h3-hexagon-layer-low-zoom',
viewState: {
latitude: 0,
getHexagons: d => h3.kRing(d, 6),
getLineWidth: 100,