改变容器Size后,刷新地图大小。

You need to call the API to update map size.

http://dev.openlayers.org/docs/files/OpenLayers/Map-js.html#OpenLayers.Map.updateSize

Here's how we do it

window.onresize = function()
{
  setTimeout( function() { map.updateSize();}, 200);
}

You can see we did a slight delay, and honestly I don't remember the exact reason why, but we had to give it a slight wait before calling API to resize itself.

posted @ 2018-08-06 09:42  googlegis  阅读(583)  评论(0编辑  收藏  举报

坐标合肥,非典型GIS开发人员 GitHub