隐藏正在加载图块动画叠加Bing V8

时间:2018-11-09 09:09:08

标签: bing-maps bing bing-api

是否可以在Bing V8上隐藏加载图块动画叠加层?请帮忙。

Loading tile animation overlay

1 个答案:

答案 0 :(得分:1)

将动画图块图层的loadingScreen属性设置为不显示任何内容的自定义叠加层。试试这个:

//Define a custom overlay class that inherits from the CustomOverlay class.
MyCustomOverlay.prototype = new Microsoft.Maps.CustomOverlay();

//Define a constructor for the custom overlay class.
function MyCustomOverlay() {
}

MyCustomOverlay.prototype.onAdd = function () {
    //Logic to perform when adding overlay to map.
};

MyCustomOverlay.prototype.onLoad = function () {
    //Logic to perform after overlay has been added to the map.
};

MyCustomOverlay.prototype.onRemove = function () {
    //Logic to perform when overlay has been removed from the map.
};

//Implement the new custom overlay class.
var overlay = new MyCustomOverlay();

var animatedLayer = new Microsoft.Maps.AnimatedTileLayer({ mercator: tileSources, loadingScreen: overlay});
map.layers.insert(animatedLayer);