diff options
author | Struan Donald <struan@exo.org.uk> | 2019-04-02 17:54:47 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2019-05-28 11:34:19 +0100 |
commit | 7773e717e611c2dc630d6f93d3cc9626cf18bf8f (patch) | |
tree | 1c9aea8a83575d0e1c5853ce54417c532aad79b4 | |
parent | 1d236f3fd5496355ce61adb68e0bf0efdd0ff366 (diff) |
[Alloy] only remove bounds if everything fails
-rw-r--r-- | web/cobrands/fixmystreet-uk-councils/alloy.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet-uk-councils/alloy.js b/web/cobrands/fixmystreet-uk-councils/alloy.js index c9fb11ab0..6995e9dd7 100644 --- a/web/cobrands/fixmystreet-uk-councils/alloy.js +++ b/web/cobrands/fixmystreet-uk-councils/alloy.js @@ -83,6 +83,7 @@ OpenLayers.Strategy.Alloy = OpenLayers.Class(OpenLayers.Strategy.FixMyStreet, { newRequest: function(max) { this.max = max; this.count = 0; + this.failcount = 0; this.layer.destroyFeatures(); }, merge: function(resp) { @@ -105,7 +106,10 @@ OpenLayers.Strategy.Alloy = OpenLayers.Class(OpenLayers.Strategy.FixMyStreet, { this.layer.addFeatures(features); } } else { - this.bounds = null; + this.failCount++; + if (this.failCount >= this.max) { + this.bounds = null; + } } // only fire loadend things if we've got all the tiles if (this.count == this.max) { |