with one click
minemap-events-and-picking
MineMap 事件订阅模型、图层事件代理、once/off 管理、矢量与三维对象拾取。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
MineMap 事件订阅模型、图层事件代理、once/off 管理、矢量与三维对象拾取。
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
MineMap 3D 公告板(Billboard)专题。覆盖 BillboardMaterial / BillboardGeometry / BillboardInstance 动画、拾取高亮、动态纹理更新与轨迹对象联动;不与 DOM 覆盖物 Marker 混淆。
MineMap 云与大气渲染链。用于启用体积云(多层 CloudLayer)、单片实例化云(map.cloudCollection)、大气散射与太阳 / 天空辐照度,重点说明主分支公开参数与禁用字段。
MineMap 热力图(heatmap)专题。用于二维 / 三维热力图、贴地热力、聚合权重、热力色阶与 3D 显示模式,重点说明 paint/layout 参数边界与典型失败场景。
MineMap KML 数据源。用于加载 KML / KMZ 文件,解析 LineStyle / IconStyle / LabelStyle / PolyStyle 等样式继承,并把 KML 属性映射为 line / circle / fill / symbol 派生图层。
MineMap 材质与着色规范。覆盖 `StandardMaterial`、`PhongMaterial`、`PhysicalMaterial`、`LambertMaterial`、`PolylineMaterial` 等主流材质的选型与调参。
MineMap 渲染后端(auto/webgpu/webgl2/webgl1)选择、降级策略、特效开关与性能调优。
| name | minemap-events-and-picking |
| description | MineMap 事件订阅模型、图层事件代理、once/off 管理、矢量与三维对象拾取。 |
map.on("click", "poi-layer", (e) => {
const f = e.features?.[0];
if (!f) return;
new minemap.Popup()
.setLngLat(e.lngLat)
.setHTML(f.properties?.name || "-")
.addTo(map);
});
map.on(type, listener)map.on(type, layerId|layerIds, listener)map.once(...)map.off(...)常见:click、mousemove、mouseenter、mouseleave、load、style.load、data、idle。
e.featuresfeaturesmap.getFeatureByGPUPick(point) 可用于三维对象/tileset 拾取allowPick 关闭)onLayerOrModel)map.on("mousemove", "building-layer", (e) => {
const fid = e.features?.[0]?.id;
if (fid == null) return;
map.setFeatureState({ source: "building", id: fid }, { hover: true });
});
offqueryRenderedFeatures从多个 demo 看,二维图层交互的稳定做法是:
map.queryRenderedFeatures(e.point, { layers: [...] })适合:
业务上不要用 GPU 拾取替代所有二维图层查询。
getFeatureByGPUPick大量 demo 已采用:
map.getFeatureByGPUPick(e.point)map.getFeatureByGPUPickAsync(e.point)适合:
SceneModelSceneTilesetPrimitive如果目标是三维对象,不要先走 queryRenderedFeatures。
getFeatureByGPUPickgetFeatureByGPUPickAsync两者不要在同一点击链路里无意义重复调用。
mousemove)里避免重计算queryRenderedFeatures 必须传 layers 限定范围mouseenter/leave 优于每帧全量命中检测layers 就直接 queryRenderedFeatures,导致结果范围过大allowPick 的三维对象仍然期待 GPU 拾取结果mousemove 中同时做 queryRenderedFeatures 和 getFeatureByGPUPick,导致重复开销demo/html/GeoJSONWithHover.htmldemo/html/GridBoxSelect.htmldemo/html/SymbolPick.htmldemo/html/3DTilesNextPick.htmldemo/html/ParticleSystemClick.htmldemo/html/AnimationTrack.htmlminemap-style-and-dataminemap-scene-components