Merge remote-tracking branch 'openlayers/master' into vector-api

This commit is contained in:
Tom Payne
2014-01-10 15:00:27 +01:00
3 changed files with 91 additions and 4 deletions

View File

@@ -1034,12 +1034,27 @@ ol.Map.prototype.renderFrame_ = function(time) {
return;
}
/**
* Check whether a size has non-zero width and height. Note that this
* function is here because the compiler doesn't recognize that size is
* defined in the frameState assignment below when the same code is inline in
* the condition below. The compiler inlines this function itself, so the
* resulting code is the same.
*
* @param {ol.Size} size The size to test.
* @return {boolean} Has non-zero width and height.
*/
function hasArea(size) {
return size[0] > 0 && size[1] > 0;
}
var size = this.getSize();
var view = this.getView();
var view2D = goog.isDef(view) ? this.getView().getView2D() : undefined;
/** @type {?ol.FrameState} */
var frameState = null;
if (goog.isDef(size) && goog.isDef(view2D) && view2D.isDef()) {
if (goog.isDef(size) && hasArea(size) &&
goog.isDef(view2D) && view2D.isDef()) {
var viewHints = view.getHints();
var obj = this.getLayerGroup().getLayerStatesArray();
var layersArray = obj.layers;