<!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>