Skip to content

Instantly share code, notes, and snippets.

@Pessimistress
Created April 12, 2018 06:11
Show Gist options
  • Save Pessimistress/1fd054d5422ab3fe7b66429b50111d13 to your computer and use it in GitHub Desktop.
Save Pessimistress/1fd054d5422ab3fe7b66429b50111d13 to your computer and use it in GitHub Desktop.
// Make a layer interactive: set `pickable` to `true`
new deck.ScatterplotLayer({
// ...
pickable: true
});
// You can confirm that it works by turning on autoHighlight.
// The circles should change color when hovered over:
new deck.ScatterplotLayer({
// ...
pickable: true,
autoHighlight: true
});
// To subscribe to pointer events, supply callback functions to onHover and/or onClick:
new deck.ScatterplotLayer({
// ...
pickable: true,
onHover: info => console.log('scatterplot layer hovered', info.object),
onClick: info => console.log('scatterplot layer clicked', info.object)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment