openlayers-3 - 开放层 : How to detect the map view is completely loaded?

标签 openlayers-3

我正在使用 OpenLayers 3 实现 map 导出功能。

但是有一个问题:无法确定 map View 是否已完全加载或还缺少一些瓦片。

似乎没有这样的 API 或事件。最接近的是 tileloadstart - tileloadend 对。但是 OpenLayers 异步加载图块,并且在图块实际加载之前,不会触发 tileloadstart - 也就是说,在图块队列中排队的图块在实际加载之前不会触发事件。

Hot 我可以检测到 map View 已完全加载吗?

最佳答案

渲染后 事件似乎可以解决问题,如下所示:

map.once('postrender', function(event) {
    doyourmagic();
});

至少从 OpenLayers 3.8.2 开始工作。有好答案there关于主题。

关于openlayers-3 - 开放层 : How to detect the map view is completely loaded?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34311461/

相关文章:

javascript - Open Layers 3 中的样式向量

javascript - 根据用户在 Openlayers 3 中的输入在 map 上绘制图标

javascript - 从图层名称访问图层属性

openlayers-3 - 如何以编程方式缩放 map Openlayers 3?

javascript - 打开图层 3 缩放 map 事件处理程序

javascript - OpenLayers 从 map 中删除图层

javascript - 添加功能事件

javascript - ol3 - 计算 epsg 3857 中的实际米数

javascript - 我如何最好地构建一个以大型重型非 Angular 库为中心的 Angular 应用程序(本例为 : openlayers map)

javascript - 如何获得 map 边界?