使用TileLayer.Satellite添加衛星圖到地圖上。
貼代碼
var satellite = new AMap.TileLayer.Satellite();
this.map = new AMap.Map(this.map_container.nativeElement, {
view: new AMap.View2D({//創建地圖二維視口
zoom:14, //設置地圖縮放級別
rotateEnable: true,
showBuildingBlock: true,
center: [116.397428, 39.90923],//設置地圖中心點座標
layers: [satellite], //設置圖層,可設置成包含一個或多個圖層的數組
mapStyle: 'amap://styles/whitesmoke', //設置地圖的顯示樣式
viewMode: '2D', //設置地圖模式
lang:'zh_cn', //設置地圖語言類型
}),
});
沒有效果
於是看着官網實例改了一下
var satellite = new AMap.TileLayer.Satellite();
var roadNet = new AMap.TileLayer.RoadNet();
this.map = new AMap.Map(this.map_container.nativeElement, {
zoom:14, //設置地圖縮放級別
rotateEnable: true,
showBuildingBlock: true,
center: [116.397428, 39.90923],//設置地圖中心點座標
layers: [satellite], //設置圖層,可設置成包含一個或多個圖層的數組
mapStyle: 'amap://styles/whitesmoke', //設置地圖的顯示樣式
viewMode: '2D', //設置地圖模式
lang:'zh_cn', //設置地圖語言類型
});