<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>细线 ThinLine</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: 30,
zoom: 6.5,
center: [116.185474, 38.764656]
});
var object3Dlayer = new AMap.Object3DLayer({ zIndex: 1 });
map.add(object3Dlayer);
var opts = {
subdistrict: 0,
extensions: 'all',
level: 'province'
};
//利用行政区查询获取路径
var district = new AMap.DistrictSearch(opts);
district.search('河北省', function (status, result) {
var bounds = result.districtList[0].boundaries;
// rgba
var color = '#0055ff';
for (var i = 0; i < bounds.length; i += 1) {
var line = new AMap.Object3D.ThinLine({
path: bounds[i],
color: color
});
object3Dlayer.add(line)
}
});
</script>
</body>
</html>