如何从导出的Tileset获取所查询要素的feature_id

问题描述

Mapbox数据集功能具有unique generated IDs feature_id。可以从创建为该数据集导出的Tileset中获得此map.addSource('roads',{ type: 'vector',url: 'mapbox://user.t9c4q9043xd4rd5209592740953-2icq9',// Tileset }); map.on('click',(e) => { const features = map.queryRenderedFeatures(e.point,{ layers: ['my-layer-name'],}); for (const feature of features) { console.log(feature); // there is no feature_id inside } }); 吗?

feature_id

我还尝试直接使用包含那些map.addSource('roads',{ type: 'geojson',data: 'https://api.mapbox.com/datasets/v1/user/t9c4q9043xd4rd5209592740953/features?access_token=pk.xxxxx',// Dataset }); map.on('click',}); for (const feature of features) { console.log(feature); // there is no feature_id inside } }); 的数据集GeoJSON,但无法使用JS API访问它。

<MapboxGL.MapView   
        style={styles.map} 
        rotateEnabled>

          <MapboxGL.RasterSource {...rasterSourceProps} >
                <MapboxGL.BackgroundLayer id="background"  sourceLayerID="iranMap" style={{ backgroundColor:"#f2efea"} } />
                <MapboxGL.RasterLayer
                    id="iranMapLayer"
                    sourceLayerID="iranMap"
                    minZoomLevel= {1}
                    maxZoomLevel= {19}   
                    style={{rasterOpacity: 1,rasterFadeDuration: 100}}               
                />           
          </MapboxGL.RasterSource>
          <MapboxGL.Camera zoomLevel={3} centerCoordinate={coordinates} />
          <MapboxGL.PointAnnotation coordinate={coordinates} id="Test" />        
        </MapboxGL.MapView>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...