我想显示一个进度条时,直到层加载在打开层3.9.0,任何提示或方向将有所帮助。
发布于 2015-09-21 20:50:52
应该是这样的:
var
tile_loading = 0,
tile_loaded = 0,
tiles_loaded_all = false
;
yourTileLayer.getSource().on('tileloadstart', function(evt){
++tile_loading;
});
yourTileLayer.getSource().on('tileloadend', function(evt){
++tile_loaded;
if(tile_loaded === tile_loading){
tile_loading = 0;
tile_loaded = 0;
tiles_loaded_all = true;
}
});官方例子- http://openlayers.org/en/v3.9.0/examples/tile-load-events.html
https://stackoverflow.com/questions/32700140
复制相似问题