在react-map-gl上绘制图像叠加层

问题描述 投票:0回答:1

我想要一个平面图层,在mapbox上给出坐标。我正在使用react-map-gl。 (https://github.com/uber/react-map-gl)。如何在地图上绘制图像叠加层。你能引用一些例子或者什么吗?

reactjs mapbox mapbox-gl-js
1个回答
0
投票

您可以使用image类型的source覆盖图像。例如:

"sources": { "overlay": { "type": "image", "url": "https://www.mapbox.com/mapbox-gl-js/assets/radar.gif", "coordinates": [ [-80.425, 46.437], [-71.516, 46.437], [-71.516, 37.936], [-80.425, 37.936] ] } }, ...

从示例here

© www.soinside.com 2019 - 2024. All rights reserved.