원클릭으로
minemap-scene-components
MineMap 三维场景组件体系:SceneModel、SceneTileset、SceneObject(Earth/Skybox/AirLine 等),重点补全 glTF/glb 与 3D Tiles 参数边界。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
MineMap 三维场景组件体系:SceneModel、SceneTileset、SceneObject(Earth/Skybox/AirLine 等),重点补全 glTF/glb 与 3D Tiles 参数边界。
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
MineMap 3D 公告板(Billboard)专题。覆盖 BillboardMaterial / BillboardGeometry / BillboardInstance 动画、拾取高亮、动态纹理更新与轨迹对象联动;不与 DOM 覆盖物 Marker 混淆。
MineMap 云与大气渲染链。用于启用体积云(多层 CloudLayer)、单片实例化云(map.cloudCollection)、大气散射与太阳 / 天空辐照度,重点说明主分支公开参数与禁用字段。
MineMap 事件订阅模型、图层事件代理、once/off 管理、矢量与三维对象拾取。
MineMap 热力图(heatmap)专题。用于二维 / 三维热力图、贴地热力、聚合权重、热力色阶与 3D 显示模式,重点说明 paint/layout 参数边界与典型失败场景。
MineMap KML 数据源。用于加载 KML / KMZ 文件,解析 LineStyle / IconStyle / LabelStyle / PolyStyle 等样式继承,并把 KML 属性映射为 line / circle / fill / symbol 派生图层。
MineMap 材质与着色规范。覆盖 `StandardMaterial`、`PhongMaterial`、`PhysicalMaterial`、`LambertMaterial`、`PolylineMaterial` 等主流材质的选型与调参。
| name | minemap-scene-components |
| description | MineMap 三维场景组件体系:SceneModel、SceneTileset、SceneObject(Earth/Skybox/AirLine 等),重点补全 glTF/glb 与 3D Tiles 参数边界。 |
map.on("load", () => {
map.addSceneComponent({
id: "building-gltf",
type: "3d-model",
data: "https://example.com/building.glb",
position: new minemap.Math.Vector3(116.39, 39.9, 0),
rotation: [90, 0, 0],
scale: [1, 1, 1],
allowPick: true
});
map.addSceneComponent({
id: "city-tiles",
type: "3d-tiles",
urls: [{ url: "https://example.com/tileset.json", name: "city" }],
maximumScreenSpaceError: 8,
maximumMemoryUsage: 512
});
});
map.addSceneComponent() 是三维对象推荐入口,内部按 type 分发:
3d-model -> SceneModel3d-tiles -> SceneTilesetscene-object -> 场景对象(如 Earth、Skybox、Panorama、AirLine)addSource(type="3d-model" | "3d-tiles") + addLayer(...) 是历史路径最近 master 补充的一个重要现实情况是:
addSource + addLayer(type='3d-model') 路径在当前版本仍被修复维护demo/html/GLBAddSourceOfficialStyle.html 就是专门补给这条历史路径的 shipped demo因此文档应写成:
addSceneComponent()addSource + addLayer(type='3d-model') 不是“理论兼容而已”,当前 master 仍在修复其实际加载问题推荐统一用:
map.addSceneComponent()map.getSceneComponent()map.removeSceneComponent()SceneModel:
SceneTileset:
source/index.js 还导出了:
Sun、Earth、Skybox、PanoramaAirLine、BeiDouGrid、GradientLine、GaussianSplatting、AdminDivisionTerrainLeveling、ModelInstance、ModelInstanceCollectionClippingPlane、ClippingPlaneCollection这一节以 source/style/SceneModel.js 为准。
推荐场景:
iddata:glTF JSON、glb URL,或可被内部 loader 解析的数据map源码和注释都很明确,优先级必须按下面理解:
matrix 存在时,position / rotation / scale / quaternion 都被忽略matrix 时,用 TRS 组合rotation 和 quaternion 同时给时,优先 rotation因此推荐:
position + rotation + scalematrixposition:模型锚点位置,顺序 XYZscale:XYZ 缩放rotation:欧拉角旋转,顺序 XYZquaternion:四元数旋转matrix:完整变换矩阵modelFolder:模型外部贴图、资源文件夹地址minimumPixelSize:最小屏幕像素尺寸,默认 0visibility:默认 visibleallowPick:默认 trueminzoom:默认 0maxzoomopacitybackCullinglightingModelclassificationTypecastShadowreceiveShadowallowWaterRefractallowWaterReflect源码实现上的关键点:
lightingModel 实际取 LightingModelType.PBRclassificationType 默认 ClassificationType.NONEcastShadow 默认 truereceiveShadow 默认 trueclassificationType 的重要边界:
IGNORECLASSIFICATION 和 NONEIGNORECLASSIFICATION 用在地形下挖、标绘场景较多IGNORECLASSIFICATION 后,不再接受 layer / primitive 的矢量贴地叠加activeAnimation:是否激活 glTF 自带动画,默认 trueaccurateBounding:是否按动画实时刷新精确包围体,默认 falseloaded:加载完成回调使用建议:
accurateBoundingclippingPlanesdistanceDisplayCondition源码里非常关键的一点:当传入 positions 时,会进入实例化模型路径。
实例化相关字段:
positionsrotationsscalesshowscolorsinstanceNames推荐场景:
不推荐:
addSceneComponent({type:'3d-model'})showEmbeddedWireframe:显示模型内置线框,默认 truegenerateWireframe:是否生成折痕线框,默认 falseshowGeneratedWireframe:默认跟随 generateWireframewireframeCreaseThreshold:默认 0.05235988 弧度这套参数的意义:
_wireframe / _crease_edge最近 master 需要补充的一条行为是:
_crease_edge 已被明确纳入内置线框尾缀识别_wireframe,带 _crease_edge 的内置数据也会进入这套兼容逻辑对应 demo:
demo/html/ModelCreaseEdgeWireframeRender.html因此当前版本更准确的表述是:
_wireframe / _crease_edgeshowEmbeddedWireframegenerateWireframeproperties这不是渲染参数,而是给业务层挂附加信息的容器,常用于点击后弹面板、三维查询结果识别。
map.addSceneComponent({
id: "building-gltf",
type: "3d-model",
data: "https://example.com/building.glb",
modelFolder: "https://example.com/assets/",
position: [116.39, 39.9, 0],
rotation: [90, 0, 0],
scale: [1, 1, 1],
allowPick: true,
castShadow: true,
receiveShadow: true
});
map.addSceneComponent({
id: "tree-instance",
type: "3d-model",
data: "https://example.com/tree.glb",
modelFolder: "https://example.com/assets/",
positions,
rotations,
scales,
shows,
colors,
instanceNames
});
这一节以 source/style/SceneTileset.js 为准。
推荐场景:
pntsidmapurlurls推荐:
urls 思维理解,因为 MineMap 明确支持多份 tileset 组合show:默认 truetranslation:沿模型局部坐标平移,单位米minzoommaxzoomopacitybackCullingmaximumScreenSpaceErrormaximumMemoryUsage源码真实默认值:
maximumScreenSpaceError = 16maximumMemoryUsage = 256说明:
maximumScreenSpaceError 越小越清晰,网络和内存开销越大loadSiblingsskipLevelOfDetailbaseScreenSpaceErrorskipLevelsskipScreenSpaceErrorFactorimmediatelyLoadDesiredLevelOfDetailschedulingPolicy源码默认值:
loadSiblings = falseskipLevelOfDetail = falsebaseScreenSpaceError = 1024skipLevels = 1skipScreenSpaceErrorFactor = 16immediatelyLoadDesiredLevelOfDetail = falseschedulingPolicy = BALANCED使用建议:
immediatelyLoadDesiredLevelOfDetail 会忽略 skip 相关因素,只拉目标精度 tile,移动相机时常更慢,不是普遍优化开关pointSizecustomizedColor说明:
pointSize 只对点云生效,默认 1customizedColor 目前只对点云生效allowPick:默认 trueclassificationTypelightingModel:默认 LightingModelType.NONEsourceLoadedsourceLoaded 和 SceneModel.loaded 不同:
sourceLoaded 更偏 source / tileset 加载完成后的回调flyTo({ target: tileset })geoBoundsOptions这是 MineMap 特有、而且很实用的参数:
{ index: 0, combine: false }作用:
urls 同时挂了多份 3D Tiles 时,指定飞行对准哪一份规则:
index,combine 就不会再参与合并逻辑clippingPlanescastShadowreceiveShadowallowWaterRefractallowWaterReflectshowEmbeddedWireframegenerateWireframeshowGeneratedWireframewireframeCreaseThreshold源码默认值:
castShadow = truereceiveShadow = falseallowWaterRefract = falseallowWaterReflect = trueshowEmbeddedWireframe = truegenerateWireframe = falsesubIPs:多服务地址并发方案,不建议常规使用debugFreezeFrame:调试用,慎用flowOptions:流动纹理参数useCompTexMipmapsGenerate:压缩纹理解压后生成 mipmaps,容易吃内存,尤其倾斜摄影慎开map.addSceneComponent({
id: "city-tiles",
type: "3d-tiles",
urls: [{ url: "https://example.com/tileset.json", name: "city" }],
maximumScreenSpaceError: 8,
maximumMemoryUsage: 512,
allowPick: true,
sourceLoaded: (tileset) => {
map.flyTo({ target: tileset, duration: 1500, range: 0 });
}
});
map.addSceneComponent({
id: "multi-tiles",
type: "3d-tiles",
urls: [
{ url: "https://example.com/a/tileset.json", name: "A" },
{ url: "https://example.com/b/tileset.json", name: "B" }
],
geoBoundsOptions: { index: 0, combine: false }
});
const tileset = map.getSceneComponent("city-tiles");
if (tileset) {
map.flyTo({ target: tileset, duration: 1500 });
}
map.removeSceneComponent("city-tiles");
复杂姿态建议先算 modelMatrix(Transforms.cartographicToFixedFrame + 自定义旋转缩放),再作为 matrix 传入;这时就不要再同时依赖 position / rotation / scale。
const clippingPlanes = new minemap.ClippingPlaneCollection({
enabled: true,
planes: [
new minemap.ClippingPlane({
normal: new minemap.Math.Vector3(1, 0, 0),
distance: 0
})
]
});
sceneModel.clippingPlanes = clippingPlanes;
适用对象:
SceneModelSceneTileset注意:demo 中有直接改内部 _planes 的调试写法,技能库不把它当正式推荐 API。
addSource/addLayer 的旧 3D Tiles 路径3d-model,优先实例化extrusion 当 glTF 替代品allowPickadaptTerrain 和 “贴 3D Tiles / 贴模型”混为一谈ThreeLayer 融合层和原生 SceneModel / SceneTileset 当成同一套对象体系demo/html/GLBAddSourceOfficialStyle.htmldemo/html/ModelCreaseEdgeWireframeRender.html常见业务 demo 已经普遍采用 scene component 作为主入口,尤其是:
demo/html/3DTiles.htmldemo/html/3DTilesLoaded.htmldemo/html/3DGS-3DTiles.htmldemo/html/BeiDouGridSceneObject.htmldemo/html/AirLine.htmlmaximumScreenSpaceError(常见 8~16)maximumMemoryUsage 不要只看注释旧值,要按数据体量实测urls 聚合管理allowPickminemap-threejs-integration
minemap-2d-3d-overlay-and-classification
minemap-transforms
minemap-math-foundations
minemap-lighting-and-shadows
minemap-water-surface-and-refraction
minemap-primitives-and-materials
minemap-terrain-and-analysis
minemap-performance-and-backend