From 3173ddbb5fb9fa6ea6b6aa0fa00160a4876ef52b Mon Sep 17 00:00:00 2001 From: Paul Spencer Date: Wed, 16 Oct 2013 08:59:35 -0400 Subject: [PATCH] Fix a bug when frameState is null which occurs in offline mobile devices --- src/ol/map.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ol/map.js b/src/ol/map.js index 90a4bf488b..36526aba47 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -733,14 +733,15 @@ ol.Map.prototype.handlePostRender = function() { if (!tileQueue.isEmpty()) { var maxTotalLoading = 16; var maxNewLoads = maxTotalLoading; + var tileSourceCount = 0; if (!goog.isNull(frameState)) { var hints = frameState.viewHints; if (hints[ol.ViewHint.ANIMATING] || hints[ol.ViewHint.INTERACTING]) { maxTotalLoading = 8; maxNewLoads = 2; } + tileSourceCount = goog.object.getCount(frameState.wantedTiles); } - var tileSourceCount = goog.object.getCount(frameState.wantedTiles); maxTotalLoading *= tileSourceCount; maxNewLoads *= tileSourceCount; if (tileQueue.getTilesLoading() < maxTotalLoading) {