核心代码
// 背景图
const imageLayerr = new AMap.ImageLayer({
url: "https://cdaipython.com/jinmahe/a5ccb26807c8dcb7c335176677151c0.png",
bounds: new AMap.Bounds(
[103.618909, 30.628971],
[103.919771, 30.76384]
),//图片矩形范围
zooms: [2, 20],
});
//底图
const imageLayerr2 = new AMap.ImageLayer({
url: "https://cdaipython.com/jinmahe/42eb89720732779259634eeb36644dc.png",
bounds: new AMap.Bounds(
[103.718909, 30.728971],
[103.819771, 30.66384]
),//图片矩形范围
zooms: [2, 20],
});
//轨迹
const imageLayer3 = new AMap.ImageLayer({
url: "https://cdaipython.com/jinmahe/0fa29c20566a521b7473f96b1f2d815.png",
bounds: new AMap.Bounds(
[103.752805, 30.714917],
[103.775697, 30.686815]
),//图片矩形范围
zooms: [2, 20],
});
this.map = new AMap.Map("container", {
rotateEnable: true,
pitchEnable: true,
zoom: 13.8,
zooms: [5, 20],
center: [103.762273, 30.697175],
resizeEnable: true, //是否监控地图容器尺寸变化
showLabel: false,//是否显示标注
mapStyle: "amap://styles/darkblue",//地图样式
layers: [AMap.createDefaultLayer(), imageLayerr, imageLayerr2, imageLayer3],//叠加图层
});
效果图