首页 / 浏览问题 / WebGIS / 问题详情
超图FAQ:请问,通过mapbox-gl-leaflet在leaflet上加载矢量切片服务,使用queryRenderedFeatures查不到数据是为什么呀,请问有用过的吗
54,252EXP 2024年07月22日
请问,通过mapbox-gl-leaflet在leaflet上加载矢量切片服务,使用queryRenderedFeatures查不到数据是为什么呀,请问有用过的吗

1个回答

【问题原因】两个原因导致查不到数据:1)参数bbox格式传的有误 2)查询图层名称给得有误 【解决办法】1、bbox正确的格式如下: var bbox=[minX,minY,maxX,maxy]:// 定义一个地理范围的边界框 var features = map.queryRenderedFeatures(bbox, layers:['my-layer-name’]// 指定要査询的图层名称 }); 2、查询图层名称可以通过vectorstyles资源(如:http://ip:8090/iserver/services/map-mvt-china Province Inchina2/rest/maps/China_Province _In@China2/tileFeature/vectorstyles?type=MapBox_GL)中搜索id获取
54,252EXP 2024年07月22日
热门文章
关注我们
...