layer = {
const layer = new deck.GeoJsonLayer({
id: `geojson-${Date.now()}`,
data: sfBuildings,
extruded: true,
filled: true,
getElevation: 30,
getFillColor: [160, 160, 180, 200],
getLineColor: (f) => {
const hex = f.properties.color;
return hex
? hex.match(/[0-9a-f]{2}/g).map((x) => parseInt(x, 16))
: [0, 0, 0];
},
getLineWidth: 20,
getPointRadius: 4,
getLineWidth: 20,
getPointRadius: 4,
getText: (f) => f.properties.name,
getTextSize: 12,
pointRadiusUnits: "pixels",
pointType: "circle+text",
stroked: false,
pickable: true
});
return layer;
}