| @@ -0,0 +1,963 @@ | |||
| # 材质 API 🌎 | |||
| 在真实世界里,每个物体会对光产生不同的反应。钢看起来比陶瓷花瓶更闪闪发光,一个木头箱子不会像钢箱子一样对光产生很强的反射。每个物体对镜面高光也有不同的反应。有些物体不会散射(Scatter)很多光却会反射(Reflect)很多光,结果看起来就有一个较小的高光点(Highlight),有些物体散射了很多,它们就会产生一个半径更大的高光。如果我们想要在 OpenGL 中模拟多种类型的物体,我们必须为每个物体分别定义材质(Material)属性。 | |||
| ## DC.ColorMaterialProperty | |||
| > 颜色材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.ColorMaterialProperty(DC.Color.RED) | |||
| ``` | |||
| ### creation | |||
| - **_constructor(color)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{DC.Color} color`:颜色 | |||
| - 返回值 `material` | |||
| ## DC.ImageMaterialProperty | |||
| > 图片材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.ImageMaterialProperty({ | |||
| image: '**/**.png', | |||
| transparent: true, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `material` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "image": "", // 图片地址 | |||
| "repeat": { "x": 1, "y": 1 }, // 图片重复 | |||
| "color": DC.Color.WHITE, // 图片颜色 | |||
| "transparent": false // 材质是否透明 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{String} image`:图片地址 | |||
| - `{Object} repeat`:图片重复 | |||
| - `{DC.Color} color`:图片颜色 | |||
| - `{Boolean} transparent`:材质是否透明 | |||
| ## DC.CircleBlurMaterialProperty | |||
| > 模糊圆材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.CircleBlurMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.CircleDiffuseMaterialProperty | |||
| > 扩散圆材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.CircleDiffuseMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.CircleFadeMaterialProperty | |||
| > 逐渐消逝圆材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.CircleFadeMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.CirclePulseMaterialProperty | |||
| > 脉冲圆材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.CirclePulseMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.CircleScanMaterialProperty | |||
| > 扫描圆材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.CircleScanMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.CircleSpiralMaterialProperty | |||
| > 螺旋圆材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.CircleSpiralMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.CircleVaryMaterialProperty | |||
| > 多彩圆材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.CircleVaryMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.CircleWaveMaterialProperty | |||
| > 波纹圆材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.CircleWaveMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10, // 速度 | |||
| "count": 5, //数量 | |||
| "gradient": 0.1 //强度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| - `{Number} count`:数量 | |||
| - `{Number} gradient`:强度 | |||
| ## DC.EllipsoidElectricMaterialProperty | |||
| > 电弧球材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.EllipsoidElectricMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.EllipsoidTrailMaterialProperty | |||
| > 轨迹球材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.EllipsoidTrailMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.PolylineDashMaterialProperty | |||
| > 虚线材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.PolylineDashMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 虚线颜色 | |||
| "gapColor": DC.Color.TRANSPARENT, // 间隔颜色 | |||
| "dashLength": 16.0 // 虚线片段长度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:虚线颜色 | |||
| - `{DC.Color} gapColor`:间隔颜色 | |||
| - `{Number} dashLength`:虚线片段长度 | |||
| ## DC.PolylineArrowMaterialProperty | |||
| > 箭头材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.PolylineArrowMaterialProperty(DC.Color.WHITE) | |||
| ``` | |||
| ### creation | |||
| - **_constructor(color)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{DC.Color} color`:箭头颜色 | |||
| - 返回值 `materialProperty` | |||
| ### properties | |||
| - `{DC.Color} color`:箭头颜色 | |||
| ## DC.PolylineOutlineMaterialProperty | |||
| > 边线材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.PolylineOutlineMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| outlineColor: DC.Color.BLACK, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "outlineColor": DC.Color.BLACK, // 边线颜色 | |||
| "outlineWidth": 1 // 边线宽度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{DC.Color} outlineColor`:边线颜色 | |||
| - `{Number} outlineWidth`:边线宽度 | |||
| ## DC.PolylineGlowMaterialProperty | |||
| > 光晕材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.PolylineGlowMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| glowPower: 0.25, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "glowPower": 0.25, // 发光强度,以总线宽的百分比表示 | |||
| "taperPower": 1 // 渐缩效果的强度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} glowPower`:发光强度 | |||
| - `{Number} taperPower`:渐缩效果的强度 | |||
| ## DC.PolylineFlickerMaterialProperty | |||
| > 闪烁线材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.PolylineFlickerMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.PolylineFlowMaterialProperty | |||
| > 流动线材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.PolylineFlowMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10, // 速度, | |||
| "percent": 0.3, // 比例 | |||
| "gradient": 0.1 // 透明程度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| - `{Number} percent`:比例, | |||
| - `{Number} gradient`:透明程度, | |||
| ## DC.PolylineImageTrailMaterialProperty | |||
| > 图片轨迹线材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.PolylineImageTrailMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| image: '**/*.png', | |||
| repeat: { x: 10, y: 1 }, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10, // 速度 | |||
| "image": "**/*.png", // 图片地址 | |||
| "repeat": { "x": 10, "y": 1 } //重复规则 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| - `{String} image`:图片地址 | |||
| - `{Object} repeat`:重复规则 | |||
| ## DC.PolylineLightingMaterialProperty | |||
| > 发光线材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.PolylineLightingMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE // 颜色 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| ## DC.PolylineLightingTrailMaterialProperty | |||
| > 颜色轨迹线材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.PolylineLightingTrailMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.PolylineTrailMaterialProperty | |||
| > 颜色轨迹线材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.PolylineTrailMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.RadarLineMaterialProperty | |||
| > 雷达线材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.RadarLineMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.RadarWaveMaterialProperty | |||
| > 波纹雷达材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.RadarWaveMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.WallImageTrailMaterialProperty | |||
| > 图片轨迹墙体材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.WallImageTrailMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| image: '**/*.png', | |||
| repeat: { x: 10, y: 1 }, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10, // 速度 | |||
| "image": "**/*.png", // 图片地址 | |||
| "repeat": { "x": 10, "y": 1 } //重复规则 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| - `{String} image`:图片地址 | |||
| - `{Object} repeat`:重复规则 | |||
| ## DC.WallTrailMaterialProperty | |||
| > 流动墙材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.WallTrailMaterialProperty({ | |||
| color: DC.Color.WHITE, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "color": DC.Color.WHITE, // 颜色 | |||
| "speed": 10 // 速度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} color`:颜色 | |||
| - `{Number} speed`:速度 | |||
| ## DC.WaterMaterialProperty | |||
| > 流动水材质 | |||
| ### example | |||
| ```js | |||
| let material = new DC.WaterMaterialProperty({ | |||
| baseWaterColor: DC.Color.WHITE, | |||
| normalMap: '**/**.png', | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor([options])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Object} options`:属性 | |||
| - 返回值 `materialProperty` | |||
| ```json | |||
| // 属性参数(可选) | |||
| { | |||
| "baseWaterColor": DC.Color.WHITE, // 水体颜色 | |||
| "blendColor": DC.Color.WHITE, // 混合颜色 | |||
| "specularMap": "", // 镜面图 | |||
| "normalMap": "", // 法线图 | |||
| "frequency": 1000, //波纹数量 | |||
| "animationSpeed": 0.03, // 动画速度 | |||
| "amplitude": 10, //水波振幅 | |||
| "specularIntensity": 10 //镜面反射强度 | |||
| } | |||
| ``` | |||
| ### properties | |||
| - `{DC.Color} baseWaterColor`:颜色 | |||
| - `{DC.Color} blendColor`:混合颜色 | |||
| - `{String} normalMap`:法线图 | |||
| - `{String} specularMap`:镜面图 | |||
| @@ -0,0 +1,171 @@ | |||
| # 标绘要素 🌎 | |||
| ## DC.AttackArrow | |||
| > 攻击箭头要素,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let attackArrow = new DC.AttackArrow('-90.0,32.0;-94.0,36.0;-94.0,38.0') | |||
| ``` | |||
| ### creation | |||
| - **_constructor(positions)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - 返回值 `attackArrow` | |||
| ### properties | |||
| - `{Array<Position>} positions`:坐标串 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Polygon](#dc-polygon) | |||
| - 返回值 `this` | |||
| ## DC.DoubleArrow | |||
| > 双箭头要素,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let doubleArrow = new DC.DoubleArrow('-90.0,32.0;-94.0,36.0;-94.0,38.0') | |||
| ``` | |||
| ### creation | |||
| - **_constructor(positions)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - 返回值 `doubleArrow` | |||
| ### properties | |||
| - `{Array<Position>} positions`:坐标串 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Polygon](#dc-polygon) | |||
| - 返回值 `this` | |||
| ## DC.FineArrow | |||
| > 直箭头要素,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let fineArrow = new DC.FineArrow('-90.0,32.0;-94.0,36.0') | |||
| ``` | |||
| ### creation | |||
| - **_constructor(positions)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - 返回值 `fineArrow` | |||
| ### properties | |||
| - `{Array<Position>} positions`:坐标串 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Polygon](#dc-polygon) | |||
| - 返回值 `this` | |||
| ## DC.GatheringPlace | |||
| > 聚集地要素,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let gatheringPlace = new DC.GatheringPlace('-90.0,32.0;-94.0,36.0') | |||
| ``` | |||
| ### creation | |||
| - **_constructor(positions)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - 返回值 `gatheringPlace` | |||
| ### properties | |||
| - `{Array<Position>} positions`:坐标串 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Polygon](#dc-polygon) | |||
| - 返回值 `this` | |||
| ## DC.TailedAttackArrow | |||
| > 聚集地,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let tailedAttackArrow = new DC.TailedAttackArrow('-90.0,32.0;-94.0,36.0') | |||
| ``` | |||
| ### creation | |||
| - **_constructor(positions)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - 返回值 `tailedAttackArrow` | |||
| ### properties | |||
| - `{Array<Position>} positions`:坐标串 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Polygon](#dc-polygon) | |||
| - 返回值 `this` | |||
| @@ -0,0 +1,790 @@ | |||
| # 图元要素 🌎 | |||
| ## DC.PointPrimitive | |||
| > 点位图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let position = new DC.Position(120, 20) | |||
| let point = new DC.PointPrimitive(position) | |||
| point.setStyle({ | |||
| pixelSize: 10, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor(position)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Position|Number|String|Object} position`:坐标 | |||
| - 返回值 `point` | |||
| ### properties | |||
| - `{Position|Number|String|Object} position`:坐标 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[PointGraphics](http://resource.dvgis.cn/cesium-docs/PointGraphics.html) | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "pixelSize": 1, //像素大小 | |||
| "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。 | |||
| "color": DC.Color.WHITE, //颜色 | |||
| "outlineColor": DC.Color.WHITE, //边框颜色 | |||
| "outlineWidth": 0, //边框大小, | |||
| "scaleByDistance": { | |||
| "near": 0, //最近距离 | |||
| "nearValue": 0, //最近距离值 | |||
| "far": 1, //最远距离值 | |||
| "farValue": 0 //最远距离值 | |||
| }, //根据距离设置比例 | |||
| "translucencyByDistance": { | |||
| "near": 0, //最近距离 | |||
| "nearValue": 0, //最近距离值 | |||
| "far": 1, //最远距离值 | |||
| "farValue": 0 //最远距离值 | |||
| }, //根据距离设置透明度 | |||
| "distanceDisplayCondition": { | |||
| "near": 0, //最近距离 | |||
| "far": Number.MAX_VALUE //最远距离 | |||
| }, //根据距离设置可见 | |||
| "disableDepthTestDistance": 0 // 深度检测距离,用于防止剪切地形,设置为零时,将始终应用深度测试。设置为Number.POSITIVE_INFINITY时,永远不会应用深度测试。 | |||
| } | |||
| ``` | |||
| ## DC.BillboardPrimitive | |||
| > 图标图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let position = new DC.Position(120, 20) | |||
| let billboard = new DC.BillboardPrimitive(position, '***/**.png') | |||
| billboard.size = [20, 20] | |||
| ``` | |||
| ### creation | |||
| - **_constructor(position,icon)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Position|Number|String|Object} position`:坐标 | |||
| - `{String} icon`:图标地址 | |||
| - 返回值 `billboard` | |||
| ### properties | |||
| - `{Position} position`:坐标 | |||
| - `{String} icon`:图标地址 | |||
| - `{Array<Number>} size`:图标大小 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Billboard](http://resource.dvgis.cn/cesium-docs/Billboard.html) | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。 | |||
| "scale": 1, //比例 | |||
| "pixelOffset": { "x": 0, "y": 0 }, //偏移像素 | |||
| "rotation": 0, //旋转角度 | |||
| "translucencyByDistance": { | |||
| "near": 0, //最近距离 | |||
| "nearValue": 0, //最近距离值 | |||
| "far": 1, //最远距离值 | |||
| "farValue": 0 //最远距离值 | |||
| }, //根据距离设置透明度 | |||
| "scaleByDistance": { | |||
| "near": 0, //最近距离 | |||
| "nearValue": 0, //最近距离值 | |||
| "far": 1, //最远距离值 | |||
| "farValue": 0 //最远距离值 | |||
| }, //根据距离设置比例 | |||
| "distanceDisplayCondition": { | |||
| "near": 0, //最近距离 | |||
| "far": Number.MAX_VALUE //最远距离 | |||
| }, //根据距离设置可见 | |||
| "disableDepthTestDistance": 0 // 深度检测距离,用于防止剪切地形,设置为零时,将始终应用深度测试。设置为Number.POSITIVE_INFINITY时,永远不会应用深度测试。 | |||
| } | |||
| ``` | |||
| ## DC.BounceBillboardPrimitive | |||
| > 跳动图标图元,继承于[BillboardPrimitive](#dc-billboardprimitive) | |||
| ### example | |||
| ```js | |||
| let position = new DC.Position(120, 20) | |||
| let billboard = new DC.BounceBillboardPrimitive(position, '***/**.png') | |||
| billboard.size = [20, 20] | |||
| ``` | |||
| ### creation | |||
| - **_constructor(position,icon)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Position|Number|String|Object} position`:坐标 | |||
| - `{String} icon`:图标地址 | |||
| - 返回值 `billboard` | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Billboard](http://resource.dvgis.cn/cesium-docs/Billboard.html) | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "maxOffsetY": 10, //垂直方向最大平移量 | |||
| "offsetAmount": 0.1 //垂直方向每帧平移量 | |||
| // 其他样式参考 BillboardPrimitive 样式 | |||
| } | |||
| ``` | |||
| ## DC.LabelPrimitive | |||
| > 标签图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let position = new DC.Position(120, 20) | |||
| let Label = new DC.LabelPrimitive(position, 'test') | |||
| ``` | |||
| ### creation | |||
| - **_constructor(position,text)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Position|Number|String|Object} position`:坐标 | |||
| - `{String} text`:文本 | |||
| - 返回值 `label` | |||
| ### properties | |||
| - `{Position|Number|String|Object} position`:坐标 | |||
| - `{String} text`:文本 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Label](http://resource.dvgis.cn/cesium-docs/Label.html) | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "font": "30px sans-serif", // CSS 字体设置 | |||
| "scale": 1, //比例 | |||
| "pixelOffset": { "x": 0, "y": 0 }, //偏移像素 | |||
| "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。 | |||
| "showBackground": false, //是否显示背景 | |||
| "backgroundColor": DC.Color.BLACK, //背景颜色 | |||
| "backgroundPadding": { "x": 0, "y": 0 }, //背景间隙 | |||
| "fillColor": DC.Color.BLACK, //文字颜色 | |||
| "outlineColor": DC.Color.WHITE, //边框颜色 | |||
| "outlineWidth": 0, //边框大小, | |||
| "scaleByDistance": { | |||
| "near": 0, //最近距离 | |||
| "nearValue": 0, //最近距离值 | |||
| "far": 1, //最远距离值 | |||
| "farValue": 0 //最远距离值 | |||
| }, //根据距离设置比例 | |||
| "translucencyByDistance": { | |||
| "near": 0, //最近距离 | |||
| "nearValue": 0, //最近距离值 | |||
| "far": 1, //最远距离值 | |||
| "farValue": 0 //最远距离值 | |||
| }, //根据距离设置透明度 | |||
| "distanceDisplayCondition": { | |||
| "near": 0, //最近距离 | |||
| "far": Number.MAX_VALUE //最远距离 | |||
| }, //根据距离设置可见 | |||
| "disableDepthTestDistance": 0 // 深度检测距离,用于防止剪切地形,设置为零时,将始终应用深度测试。设置为Number.POSITIVE_INFINITY时,永远不会应用深度测试。 | |||
| } | |||
| ``` | |||
| ## DC.BounceLabelPrimitive | |||
| > 跳动文本图元,继承于[LabelPrimitive](#dc-labelprimitive) | |||
| ### example | |||
| ```js | |||
| let position = new DC.Position(120, 20) | |||
| let label = new DC.BounceLabelPrimitive(position, 'test') | |||
| ``` | |||
| ### creation | |||
| - **_constructor(position,text)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Position|Number|String|Object} position`:坐标 | |||
| - `{String} text`:文本 | |||
| - 返回值 `label` | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Label](http://resource.dvgis.cn/cesium-docs/Label.html) | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "maxOffsetY": 10, //垂直方向最大平移量 | |||
| "offsetAmount": 0.1 //垂直方向每帧平移量 | |||
| // 其他样式参考 LabelPrimitive 样式 | |||
| } | |||
| ``` | |||
| ## DC.PolylinePrimitive | |||
| > 线图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let polyline = new DC.PolylinePrimitive('120,20;120,30') | |||
| polyline.setStyle({ | |||
| width: 10, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor(positions)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - 返回值 `polyline` | |||
| ### properties | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - `{Position} center`:中心点 **_`readonly`_** | |||
| - `{Number} distance`:距离,单位:米 **_`readonly`_** | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Polyline](http://resource.dvgis.cn/cesium-docs/Polyline.html) | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "width": 1, //线宽 | |||
| "material": DC.Color.WHITE, //材质 | |||
| "clampToGround": false, //是否贴地 | |||
| "shadows": 0, //阴影类型,0:禁用、1:启用 、2:投射、3:接受 | |||
| "distanceDisplayCondition": { | |||
| "near": 0, //最近距离 | |||
| "far": Number.MAX_VALUE //最远距离 | |||
| }, //根据距离设置可见 | |||
| "classificationType": 2, //分类 是否影响地形,3D切片或同时影响这两者。0:地形、1:3D切片、2:两者 | |||
| "zIndex": 0 //层级 | |||
| } | |||
| ``` | |||
| ## DC.TrailLinePrimitive | |||
| > 轨迹线图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let trailLinePrimitive = new DC.TrailLinePrimitive('120,20;120,30;122,30') | |||
| ``` | |||
| ### creation | |||
| - **_constructor(positions,[asynchronous])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - 返回值 `trailLine` | |||
| ### properties | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式 | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "speed": 5, //速度 | |||
| "color": DC.Color.WHITE //颜色 | |||
| } | |||
| ``` | |||
| ## DC.FlowLinePrimitive | |||
| > 流动线图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let flowLinePrimitive = new DC.FlowLinePrimitive('120,20;120,30;122,30') | |||
| ``` | |||
| ### creation | |||
| - **_constructor(positions,[asynchronous])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - 返回值 `flowLine` | |||
| ### properties | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式 | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "speed": 5, //速度 | |||
| "color": DC.Color.WHITE, //颜色 | |||
| "percent": 0.3, // 比例 | |||
| "gradient": 0.1 // 透明程度 | |||
| } | |||
| ``` | |||
| ## DC.ModelPrimitive | |||
| > 模型图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let position = new DC.Position(120, 20) | |||
| let model = new DC.ModelPrimitive(position, '**/**.glb') | |||
| ``` | |||
| ### creation | |||
| - **_constructor(position, modelUrl)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Position|Number|String|Object} position`:坐标 | |||
| - `{String} modelUrl`:模型地址 | |||
| - 返回值 `model` | |||
| ### properties | |||
| - `{Position|Number|String|Object} position`:坐标 | |||
| - `{String} modelUrl`:模型地址 | |||
| - `{Promise} readyPromise`:加载完成后的异步函数 **_`readonly`_** | |||
| ### methods | |||
| - **_getMaterial(name)_** | |||
| 设置材质 | |||
| - 参数 | |||
| - `{String} name`:节点名称 | |||
| - 返回值 `modelMaterial` | |||
| - **_getMesh(name)_** | |||
| 获取三角网 | |||
| - 参数 | |||
| - `{String} name`:节点名称 | |||
| - 返回值 `modelMesh` | |||
| - **_getNode(name)_** | |||
| 获取节点 | |||
| - 参数 | |||
| - `{String} name`:节点名称 | |||
| - 返回值 `modelNode` | |||
| - **_getNodes()_** | |||
| 获取所有节点 | |||
| - 返回值 `array<ModelNode>` | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[Model](http://resource.dvgis.cn/cesium-docs/Model.html) | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "scale": 1, //比例 | |||
| "minimumPixelSize": 0, //指定模型的最小像素大小,而不考虑缩放 | |||
| "maximumScale": 0, //指定模型的最大比例 | |||
| "heightReference": 0, //高度参照,0:位置无参照,位置是绝对的,1:位置固定在地形上 2:位置高度是指地形上方的高度。 | |||
| "shadows": 0, //阴影类型,0:禁用、1:启用 、2:投射、3:接受 | |||
| "silhouetteColor": DC.Color.RED, //轮廓颜色 | |||
| "silhouetteSize": 0, //轮廓宽度 | |||
| "lightColor": DC.Color.RED, //模型着色时指定灯光颜色 | |||
| "distanceDisplayCondition": { | |||
| "near": 0, //最近距离 | |||
| "far": Number.MAX_VALUE //最远距离 | |||
| } //根据距离设置可见 | |||
| } | |||
| ``` | |||
| ## DC.DiffuseWallPrimitive | |||
| > 扩散墙图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let position = new DC.Position(120, 20) | |||
| let wall = new DC.DiffuseWallPrimitive(position, 2000, 1000) | |||
| ``` | |||
| ### creation | |||
| - **_constructor(center, radius, height)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Position|Number|String|Object} center`:圆心 | |||
| - `{Number} radius`:半径 | |||
| - `{Number} height`:高度 | |||
| - 返回值 `wall` | |||
| ### properties | |||
| - `{Position|Number|String|Object} center`:圆心 | |||
| - `{Number} radius`:半径 | |||
| - `{Number} height`:高度 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式 | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "minRadius": 10, // 动画最小半径 | |||
| "minHeight": 30, // 动画最小高度 | |||
| "color": DC.Color.RED, // 墙体颜色 | |||
| "slices": 128, //边数 | |||
| "speed": 10 //速度 | |||
| } | |||
| ``` | |||
| ## DC.ElecEllipsoidPrimitive | |||
| > 电弧球图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let elecEllipsoid = new DC.ElecEllipsoidPrimitive('120,20',{x:2000,y:2000:z:2000}) | |||
| ``` | |||
| ### creation | |||
| - **_constructor(center,radius)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Position|Number|String|Object} center`:球心 | |||
| - `{Object} radius`:球半径 | |||
| - 返回值 `elecEllipsoid` | |||
| ### properties | |||
| - `{Position|Number|String|Object} center`:球心 | |||
| - `{Object} radius`:球半径 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式 | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "speed": 5, //速度 | |||
| "color": DC.Color.WHITE //颜色 | |||
| } | |||
| ``` | |||
| ## DC.LightCylinderPrimitive | |||
| > 光柱要素,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let position = new DC.Position(120, 20) | |||
| let cylinder = new DC.LightCylinderPrimitive(position, 1000, 1, 100) | |||
| ``` | |||
| ### creation | |||
| - **_constructor(position, length, topRadius, bottomRadius)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{Position|Number|String|Object} position`:坐标 | |||
| - `{Number} length`:长度 | |||
| - `{Number} topRadius`:上半径 | |||
| - `{Number} bottomRadius`:下半径 | |||
| - 返回值 `cylinder` | |||
| ### properties | |||
| - `{Position} position`:坐标 | |||
| - `{Number} length`:长度 | |||
| - `{Number} topRadius`:上半径 | |||
| - `{Number} bottomRadius`:下半径 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式 | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "color": DC.Color.BLACK //颜色 | |||
| } | |||
| ``` | |||
| ## DC.ScanCirclePrimitive | |||
| > 扫描圆图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let scanCirclePrimitive = new DC.ScanCirclePrimitive('120,20', 1000) | |||
| ``` | |||
| ### creation | |||
| - **_constructor(position,radius)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Position|Array|Object} position`:圆心 | |||
| - `{Number} radius`:半径 | |||
| - 返回值 `scanCircle` | |||
| ### properties | |||
| - `{String|Position|Array|Object} position`:圆心 | |||
| - `{Number} radius`:半径 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式 | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "speed": 5, //速度 | |||
| "color": DC.Color.WHITE //颜色 | |||
| } | |||
| ``` | |||
| ## DC.WaterPrimitive | |||
| > 水面图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let water = new DC.WaterPrimitive('120,20;120,30;122,30') | |||
| water.setStyle({ | |||
| baseWaterColor: DC.Color.AQUA.withAlpha(0.3), | |||
| normalMap: 'examples/images/icon/waterNormalsSmall.jpg', | |||
| frequency: 1000.0, | |||
| animationSpeed: 0.01, | |||
| amplitude: 10, | |||
| specularIntensity: 10, | |||
| }) | |||
| ``` | |||
| ### creation | |||
| - **_constructor(positions,[holes])_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - `{Array<Position|Number|String|Object>} holes`:洞面坐标 | |||
| - 返回值 `water` | |||
| ### properties | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| ### methods | |||
| - **_setStyle(style)_** | |||
| 设置样式 | |||
| - 参数 | |||
| - `{Object} style`:样式,详情参考:[PolygonGraphics](http://resource.dvgis.cn/cesium-docs/PolygonGraphics.html) | |||
| - 返回值 `this` | |||
| ```json | |||
| // 样式参数(可选) | |||
| { | |||
| "height": 1, //高度 | |||
| "extrudedHeight": 0, //拉升高度 | |||
| "stRotation": 0, //旋转角度 | |||
| "outline": false, //是否显示边框 | |||
| "closeTop": true, //顶面是否闭合 | |||
| "closeBottom": true, //底面是否闭合 | |||
| "classificationType": 2, //分类 是否影响地形,3D切片或同时影响这两者。0:地形、1:3D切片、2:两者 | |||
| "baseWaterColor": DC.Color.WHITE, // 水体颜色 | |||
| "blendColor": DC.Color.WHITE, // 混合颜色 | |||
| "specularMap": "", // 镜面图 | |||
| "normalMap": "", // 法线图 | |||
| "frequency": 1000, //波纹数量 | |||
| "animationSpeed": 0.03, // 动画速度 | |||
| "amplitude": 10, //水波振幅 | |||
| "specularIntensity": 10 //镜面反射强度 | |||
| } | |||
| ``` | |||
| ## DC.VideoPrimitive | |||
| > 视频图元,继承于[Overlay](./overlay-vector#dc-overlay) | |||
| ### example | |||
| ```js | |||
| let videoEl = new document.getElementById('video') | |||
| let videoPrimitive = new DC.VideoPrimitive('120,20;120,30;122,30', videoEl) | |||
| ``` | |||
| ### creation | |||
| - **_constructor(positions,video)_** | |||
| 构造函数 | |||
| - 参数 | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - `{Element} video`:视频节点 | |||
| - 返回值 `videoPrimitive` | |||
| ### properties | |||
| - `{String|Array<Position|Number|String|Object>} positions`:坐标串 | |||
| - `{Element} video`:视频节点 | |||
| @@ -0,0 +1,31 @@ | |||
| DC-SDK 是依赖于[`WebGL`](#webgl)运行的一套开发平台,需要开发或运行终端配置 `独立显卡` 和安装支持 `WebGL` 的浏览器,推荐使用 **_Chrome(谷歌)_**、**_Firefox(火狐)_** | |||
| # 运行环境 | |||
| ## 静态服务器 | |||
| 静态服务器主要用于发布地图瓦片、地形、模型数据等数据服务,如:**_Apache Http Sever_**、**_Tomcat_** 、**_Nginx_**,推荐使用 **_Nginx_** | |||
| ## 硬件配置 | |||
| > 硬件配置说明,建议使用如下的硬件配置进行三维场景的浏览和开发。 | |||
| <table style="width:100%"> | |||
| <tr><td colspan=3 style="text-align:center;background:#3eaf7c;">PC端</td></tr> | |||
| <tr><td>项目</td><td>标准配置</td><td>推荐配置</td></tr> | |||
| <tr><td>CPU</td><td>2.6GHz 64位 处理器</td><td>3.0GHz 64位 处理器</td></tr> | |||
| <tr><td>内存</td><td>8GB</td><td>32GB</td></tr> | |||
| <tr><td>显卡型号</td><td>NVIDIA GTX 1660 (或同级别)</td><td>NVIDIA RTX 2080 (或同级别)</td></tr> | |||
| <tr><td>显存</td><td>4GB</td><td>16G</td></tr> | |||
| <tr><td>最优分辨率</td><td>FHD - 1920 * 1080</td><td>4K QFHD - 3840 * 2160</td></tr> | |||
| <tr><td>操作系统</td><td colspan=2>64 位 Windows 8/10/11 或 64 位 Linux 桌面发行版,或 macOS 10.12.1以上版本</td></tr> | |||
| <tr><td>浏览器</td><td colspan=2>Google Chrome 或 Firefox 当前最新版本</td></tr> | |||
| </table> | |||
| <table style="width:92.8%"> | |||
| <tr><td colspan=3 style="text-align:center;background:#3eaf7c;">移动设备</td></tr> | |||
| <tr><td width="16%">平台</td><td>Android</td><td>Apple</td></tr> | |||
| <tr><td>设备</td><td>兼容 Android 操作系统的移动设备,2019年及以上的中高端型号</td><td>IPhone 11 及以上型号,IPad Pro 2019 及以上型号</td></tr> | |||
| <tr><td>操作系统</td><td>Android</td><td>IOS 或 IPadOS</td></tr> | |||
| <tr><td>浏览器</td><td colspan=2>支持 WebGL 的浏览器</td></tr> | |||
| </table> | |||