var myIconInfo = new BMap.Icon("../static/img/grey.png", new BMap.Size(80, 80), {
anchor: new BMap.Size(25, 42)
});
anchor設置的是定位點距離圖片左上角的偏移量。如果設置anchor參數的話,API會自動獲取圖片中心點作爲anchor位置。
var myIconInfo = new BMap.Icon("../static/img/grey.png", new BMap.Size(80, 80), {
anchor: new BMap.Size(25, 42)
});
anchor設置的是定位點距離圖片左上角的偏移量。如果設置anchor參數的話,API會自動獲取圖片中心點作爲anchor位置。