浏览器版本低!无法浏览完整内容,建议升级或更换浏览器。

文档全面上新

更科技的视觉体验,更高效的页面结构,快前往体验吧!

体验新版
 
第23行: 第23行:
 
| 暂无
 
| 暂无
 
|}
 
|}
</div></div><div class="header"><div class="active">核心代码</div></div><div class="pre-wrap"><div class="pre-wrap-w pre-wrap-w-and"><pre class="prettyprint prettyprinted pre-and">            var bd1 = new BMapGL.Boundary();
+
</div></div><div class="header"><div class="active">核心代码</div></div><div class="pre-wrap"><div class="pre-wrap-w pre-wrap-w-and"><pre class="prettyprint codestyle">            var bd1 = new BMapGL.Boundary();
 
             bd1.get('北京市', function (rs) {
 
             bd1.get('北京市', function (rs) {
 
                 let count = rs.boundaries.length; // 行政区域的点有多少个
 
                 let count = rs.boundaries.length; // 行政区域的点有多少个
第55行: 第55行:
 
             });
 
             });
 
         </pre>
 
         </pre>
<div class="pre-btn"><div class="pre-btn-copy-and">复制</div><div class="pre-btn-cb-and">深色</div></div><div class="success">复制成功</div></div></div></div></div>
+
</div></div></div></div>

2020年10月9日 (五) 16:49的最后版本

3D棱柱覆盖物展示
功能场景
该示例介绍如何在地图上添加3D棱柱,以及棱柱的鼠标交互。
DEMO
https://bj.bcebos.com/v1/mapopen/api-demos/video/3D棱柱.mp4
3D棱柱覆盖物
核心接口

接口 描述 参考文档
Prism new BMapGL.Prism(path, height, opts) 创建3d棱柱 暂无
Prism addEventListener('mouseover',function) 给3d棱柱添加鼠标事件 暂无
Prism map.addOverlay(prism) 将3D棱柱添加到地图上 暂无
核心代码
            var bd1 = new BMapGL.Boundary();
            bd1.get('北京市', function (rs) {
                let count = rs.boundaries.length; // 行政区域的点有多少个
                for (let i = 0; i < count; i++) {
                    let path = [];
                    let str = rs.boundaries[i].replace(' ', '');
                    let points = str.split(';');
                    for (let j = 0; j < points.length; j++) {
                        let lng = points[j].split(',')[0];
                        let lat = points[j].split(',')[1];
                        path.push(new BMapGL.Point(lng, lat));
                    }
                    let prism = new BMapGL.Prism(path, 5000, {
                        topFillColor: '#5679ea',
                        topFillOpacity: 0.5,
                        sideFillColor: '#5679ea',
                        sideFillOpacity: 0.9
                    });
                    map.addOverlay(prism);
                    prism.addEventListener('mouseover', function (e) {
                        document.getElementById('city').innerHTML = '北京市';
                        this.setTopFillColor('#f00');
                        console.log(this.getTopFillColor());
                    });
                    prism.addEventListener('mouseout', function (e) {
                        console.log(this.getTopFillColor());
                        e.target.setTopFillColor('#ccc');
                        console.log(e.target.getTopFillColor());
                    });
                }
            });
        
  • 文档根本没法用

  • 文档水平很差

  • 文档水平一般

  • 文档不错

  • 文档写的很好

如发现文档错误,或对此文档有更好的建议,请在下方反馈。问题咨询请前往反馈平台提交工单咨询。

提交反馈

拖动标注工具

添加矩形标注

添加箭头标注

完成

取消