How to use "setFeatureState" from hover #1810
Answered
by
Pessimistress
CaliforniaLuv
asked this question in
Q&A
-
Hello, I am trying to give a hover effect to the "Circle" element created through "Layer". It is implemented well in mapbox, but not in React-map-gl.
return (
<>
<Source type="geojson" data={data}>
<Layer {...countiesLayer}/>
</Source>
</>
) export const countiesLayer = {
id: 'sanfrancisco',
type: 'circle',
source: 'states',
paint: {
'circle-color': '#ffb300',
'circle-radius': [
'case',
['boolean', ['feature-state', 'hover'], false],
[
'interpolate',
['linear'],
['get', 'capacity'],
1000, 13
],
[
'interpolate',
['linear'],
['get', 'capacity'],
1000, 8
]
],
'circle-stroke-width': 2,
'circle-stroke-color': '#fff'
}
}
|
Beta Was this translation helpful? Give feedback.
Answered by
Pessimistress
Apr 4, 2022
Replies: 1 comment
-
Call |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
CaliforniaLuv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Call
mapRef.setFeatureState()
.