-
I'm trying to get a specific layer to have a pointer instead of grab cursor. Is there anyaway to have
There may have been a similar issue here, with a solution that was a dead end link. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
have you enabled the pop-up for that layer ? i have tried like this but i am neither able to hover the layer nor to enable the popup }} } >
<Layer className="layeee"
id={"deliverylineLayer"+index}
type="line"
source={"deliverylineLayer"+index}
layout={{
"line-join": "round",
"line-cap": "round"
}}
paint={{
"line-color": "#0033cc",
"line-width":10
}} >
</Layer>
|
Beta Was this translation helpful? Give feedback.
-
I found a work-around for my problem. I was not using any popups, but see if this is useful to you. I changed the cursor manually by listening for when the mouse hovered over the specific layer. Here, set the normal pointer:
The id of my layerStyle is 'points'. This is the function that the ReactMapGL calls when any part/layer of the map is hovered:
Then in the render (where the Source and Layer parts are still the same):
And that changes the cursor from a grab to pointer, whenever you hover over the 'points' layer. |
Beta Was this translation helpful? Give feedback.
I found a work-around for my problem. I was not using any popups, but see if this is useful to you.
I changed the cursor manually by listening for when the mouse hovered over the specific layer.
Here, set the normal pointer:
The id of my layerStyle is 'points'.
This is the function that the ReactMapGL calls when any part/layer of the map is hovered: