高德地图 JS API示例-Object3D 图形- ›立体 Mesh- › 垂面 Wall

高德地图 JS API示例-Object3D 图形- ›立体 Mesh- › 垂面 Wall

<!DOCTYPE HTML>
<html>
<head>
    <meta name="viewport" content="width=device-width initial-scale=1.0 maximum-scale=1.0 user-scalable=0">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>垂直地面的面</title>
    <style>
        body, html, #container { margin: 0; width: 100%; height: 100% }
    </style>
</head>
<body>
<div id="container"></div>
<script src="//webapi.amap.com/maps?v=1.4.15&key=您申请的key值&plugin=Map3D,AMap.DistrictSearch"></script>
<script>
    var map = new AMap.Map('container', {
        center: [116.472804, 39.995725],
        viewMode: '3D',
        labelzIndex: 130,
        pitch: 40,
        zoom: 9
    });

    var object3Dlayer = new AMap.Object3DLayer({ zIndex: 1 });
    map.add(object3Dlayer);

    var opts = {
        subdistrict: 0,
        extensions: 'all',
        level: 'city'
    };

    //利用行政区查询获取边界
    var district = new AMap.DistrictSearch(opts);
    district.search('北京市', function (status, result) {
        var bounds = result.districtList[0].boundaries;
        var height = 30000;
        var color = '#0088ffcc';//rgba
        var wall = new AMap.Object3D.Wall({
            path: bounds,
            height: height,
            color: color
        });
        wall.backOrFront = 'both';
        wall.transparent = true;
        object3Dlayer.add(wall);
    });
</script>
</body>
</html>
0 0 投票数
文章评分
订阅评论
提醒
0 评论
内联反馈
查看所有评论
0
希望看到您的想法,请您发表评论x