首页 / 浏览问题 / WebGIS / 问题详情
超图FAQ:【iClient】MapboxGL添加点数据时,如何使用外部图片进行渲染?
64,468EXP 2023年04月11日
【iClient】MapboxGL添加点数据时,如何使用外部图片进行渲染?

1个回答

【解决办法】可调用map的loadImage以及addImage引入图片,最后设置icon-image即可,具体代码如下: // 1.填写图片的地址 map.loadImage('./image/ss.png',(error, image) => { if (error) throw error; // 2.添加图片到style中,并命名id为“supermap” map.addImage('supermap', image); // 3.将添加的图片设置为点的icon-image map.addLayer({ 'id': 'points', 'type': 'symbol', 'source': 'point', 'layout': { 'icon-image': 'supermap', 'icon-size': 0.25 } }); });
64,468EXP 2023年04月11日
热门文章
关注我们
...