【解决办法】使用L.mapboxGL加载矢量瓦片,参考下方代码
var mapboxglMap = gl.getMapboxMap();
mapboxglMap.on('click',function (e){
var features = mapboxglMap.queryRenderedFeatures(e.point)
if(mapboxglMap.getLayer('ss') === undefined){
mapboxglMap.addLayer({
"id": "ss",
"type": "fill",
"source": features[0].source,
"source-layer": features[0].sourceLayer,
"paint":{
"fill-color":'rgba(255,0,0,1)',
"fill-opacity":0.6
}
})
}
mapboxglMap.setFilter("ss",["in", "$id", features[0].id])
})