aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2019-04-15 11:56:27 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2019-04-23 17:34:00 +0100
commitdd1be4283024377076e033efe82e10376070bc73 (patch)
tree820ab4433bd25966d94bd33de92613a961c1b106
parent45950f0a43486cb2aea3c463bdb9adc6db80704e (diff)
[Northamptonshire] only clear current layer on reload
Call newRequest directly rather than with an event to avoid resetting all the layers that have been used and hence removing all the features. Fixes mysociety/fixmystreet-commercial#1354
-rw-r--r--web/cobrands/fixmystreet-uk-councils/alloy.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/web/cobrands/fixmystreet-uk-councils/alloy.js b/web/cobrands/fixmystreet-uk-councils/alloy.js
index 1ceabef66..1ade3a1fa 100644
--- a/web/cobrands/fixmystreet-uk-councils/alloy.js
+++ b/web/cobrands/fixmystreet-uk-councils/alloy.js
@@ -11,7 +11,7 @@ OpenLayers.Protocol.Alloy = OpenLayers.Class(OpenLayers.Protocol.HTTP, {
var rresp;
var start = new Date();
var max = all_tiles.length;
- $(fixmystreet).trigger('alloy:start_request', [start, max]);
+ options.scope.newRequest(start, max);
for (var i = 0; i < max; i++) {
var resp = new OpenLayers.Protocol.Response({requestType: "read"});
resp.start = start;
@@ -69,9 +69,8 @@ OpenLayers.Strategy.Alloy = OpenLayers.Class(OpenLayers.Strategy.FixMyStreet, {
requestStart: 0,
initialize: function(name, options) {
OpenLayers.Strategy.FixMyStreet.prototype.initialize.apply(this, arguments);
- $(fixmystreet).on('alloy:start_request', this.newRequest.bind(this));
},
- newRequest: function(evt, start, max) {
+ newRequest: function(start, max) {
this.max = max;
this.requestStart = start;
this.count = 0;