deckgl = {
const rand = gen('deck');
const data = geojson2h3.h3SetToFeatureCollection(hexes, hex => ({count: rand.random()}));
return new deck.DeckGL({
map: mapboxgl,
container: mapContainer,
mapboxApiAccessToken: 'pk.eyJ1IjoibnJhYmlub3dpdHoiLCJhIjoiY2pua3dmMjF3MWVwazNycTludm9yZTRvNyJ9.sicn67fHLmMKN-Dt5F32SQ',
mapStyle: 'mapbox://styles/mapbox/light-v9',
longitude: -122.4,
latitude: 37.7923539,
zoom: 12,
layers: [
new deck.GeoJsonLayer({
id: 'geojson',
data,
opacity: 0.4,
stroked: false,
filled: true,
fp64: true,
getFillColor: f => ([200, Math.floor(f.properties.count * 255), 200])
})
]
});
}