getDeckGLMap([
new deck.GeoJsonLayer({
id: "county-shapes",
data: modified_geojson20211,
filled: true,
stroked: false,
extruded: true,
wireframe: true,
getElevation: d => d.properties["# of Food Insecure Persons Overall"],
getFillColor: d => {
const colorScale = d3.scaleSequential(d3.interpolateHslLong("purple", "orange"))
.domain([30, 1271040]);
return colorScale(d.properties["# of Food Insecure Persons Overall"] || 0);
},
getLineColor: d => [0, 0, 0],
getLineWidth: 1,
pickable: true,
autoHighlight: true,
highlightColor: [255, 0, 0],
onHover: ({ object, x, y }) => {
},
onClick: ({ object, x, y }) => {
},
updateTriggers: {
getPolygon: [data?.features?.geometry?.coordinates]
},
getPolygon: d => d.geometry.coordinates,
viewState: {
latitude: 0/* set latitude value */,
longitude: 0/* set longitude value */,
zoom: 20/* set zoom level */,
pitch: 5/* set pitch angle */,
bearing: 0/* set bearing angle */,
}
})
]);
// getttDeckGLMap([
// new deck.GeoJsonLayer({
// id: "county-shapes",
// data: modified_geojson20211,
// filled: true,
// stroked: false,
// extruded: true,
// wireframe: true,
// getElevation: d => d.properties["# of Food Insecure Persons Overall"], // Use this property for elevation
// getFillColor: d => {
// // Define a color scale mapping elevation values to colors
// const colorScale = d3.scaleSequential(d3.interpolateOranges)
// .domain([0, 100000]); // Set the domain based on the maximum elevation value
// // Calculate color based on elevation value
// return colorScale(d.properties["# of Food Insecure Persons Overall"] || 0);
// },
// getFillColor: d => [0, 0, 255], // Adjust the fill color as needed
// getLineColor: d => [0, 0, 0], // Adjust the line color as needed
// getLineWidth: 1,
// pickable: true,
// autoHighlight: true,
// highlightColor: [255, 0, 0],
// // onHover: ({ object, x, y }) => {
// // if (object) {
// // // Handle hover events if needed
// // console.log("Hovered Object:", object);
// // }
// // },
// onClick: ({ object, x, y }) => {
// // Handle click events if needed
// click(tooltip)
// },
// // Extract the polygonal coordinates from the "geometry" field
// updateTriggers: {
// getPolygon: [data?.features?.geometry?.coordinates] // Assuming all features have the same type of geometry
// },
// getPolygon: d => d.geometry.coordinates,
// // Adjust the camera position and view angle
// viewState: {
// latitude: 0/* set latitude value */,
// longitude: 0/* set longitude value */,
// zoom: 20/* set zoom level */,
// pitch: 5/* set pitch angle */,
// bearing: 0/* set bearing angle */,
// }
// })
// ]);