mapbox获取点栅格层颜色

发布于 2025-02-08 05:04:31 字数 477 浏览 3 评论 0原文

除了地图外,我想显示一个传奇滑块,以显示悬停区域的自定义栅格层的颜色。因此,我需要在光标所在的位置获取图层像素颜色。

我找到了一个解决方案,可以在地图上获得像素的颜色如何在Mapbox上获取像素的颜色,但是,如果我们悬停了道路或名称,则会阅读另一种颜色。

有没有办法在特定地图点上读取图层颜色?

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凶凌 2025-02-15 05:04:31

是道路和放置标签被烘烤到栅格中,还是覆盖为矢量数据采购的层?

除了查询画布外,我不确定另一种方法,在这种情况下,一个选项是隐藏矢量层,查询,然后重新发出。但这可能不会导致您想要的互动?

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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文