aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-08-29 17:26:57 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-08-29 17:26:59 +0100
commit387d01923a601ba4ed5f5e50bb1519e16b8d4c05 (patch)
tree4dfb3a3c53864cc6c5bae287045e87baed764399
parent5e5358f0dd54bdc1a4676459dee216b4b0081d2d (diff)
[Bristol] Fix spot asset layer display.
Confusion over client/server side filtering meant Bristol was filtering client-side on an attribute it was not asking to be returned by the server.
-rw-r--r--web/cobrands/bristol/assets.js2
-rw-r--r--web/cobrands/fixmystreet/assets.js6
2 files changed, 6 insertions, 2 deletions
diff --git a/web/cobrands/bristol/assets.js b/web/cobrands/bristol/assets.js
index 1b32379dc..b886c1f2b 100644
--- a/web/cobrands/bristol/assets.js
+++ b/web/cobrands/bristol/assets.js
@@ -14,7 +14,7 @@ var options = {
min_resolution: 0.00001,
asset_id_field: 'COD_ASSET_ID',
asset_type: 'spot',
- propertyNames: [ 'COD_ASSET_ID', 'COD_USRN' ],
+ propertyNames: [ 'COD_ASSET_ID', 'COD_USRN', 'COD_ASSET_TYPE' ],
attributes: {
asset_id: 'COD_ASSET_ID',
usrn: 'COD_USRN'
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js
index c27d19211..c653fe908 100644
--- a/web/cobrands/fixmystreet/assets.js
+++ b/web/cobrands/fixmystreet/assets.js
@@ -522,6 +522,8 @@ fixmystreet.assets = {
layer_options.projection = new OpenLayers.Projection(fixmystreet.wmts_config.map_projection);
}
if (options.filter_key) {
+ // Add this filter to the layer, so it can potentially be used
+ // in the request (though only Bristol currently does this).
if (OpenLayers.Util.isArray(options.filter_value)) {
layer_options.filter = new OpenLayers.Filter.FeatureId({
type: OpenLayers.Filter.Function,
@@ -540,8 +542,10 @@ fixmystreet.assets = {
property: options.filter_key,
value: options.filter_value
});
- layer_options.strategies.push(new OpenLayers.Strategy.Filter({filter: layer_options.filter}));
}
+ // Add a strategy filter to the layer, to filter the incoming results
+ // after they are received. Bristol does not need this, but has to ask
+ // for the filter data in its response so it doesn't then disappear.
layer_options.strategies.push(new OpenLayers.Strategy.Filter({filter: layer_options.filter}));
}