-1

I want to display a legend slider besides the map to show the color of the custom raster layer, of the hovered territory. Therefore, I need to get the layer pixel color where the cursor is.

I have found a solution to get the color of a pixel on the map How to get the color of pixels on mapbox, however, if we hover roads or names, another color gets read.

Is there a way to read the layer color on a specific map point?

Mapbox Map with custom raster layer

1 Answers1

0

Are the roads and place labels baked into the raster, or overlaid as vector data sourced layers?

I'm not sure of another method besides querying the canvas, in which case one option would be to hide the vector layers, query, then reshow. But that may not result in the interaction you want?