aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2020-02-11 10:55:34 +0000
committerMatthew Somerville <matthew@mysociety.org>2020-02-17 15:09:12 +0000
commit0811a83332c599e5ff9d185a5e0c7140a5c7c3ae (patch)
tree25a11d02ff7dabaffac8fb6a707b380304a05922 /web
parent34ada5116e5adcc1887f5b6e5e12cf51d76ac09f (diff)
Allow road asset layers to specify an alternative class
If the options to either road or asset layer include a `class` attribute then use the Layer class there, otherwise the defaults.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/assets.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js
index ac967d523..bd8b97135 100644
--- a/web/cobrands/fixmystreet/assets.js
+++ b/web/cobrands/fixmystreet/assets.js
@@ -640,10 +640,10 @@ function construct_layer_options(options, protocol) {
}
function construct_layer_class(options) {
- var layer_class = options.class || OpenLayers.Layer.VectorAsset;
- if (options.usrn || options.road) {
- layer_class = OpenLayers.Layer.VectorNearest;
- }
+ var default_class = (options.usrn || options.road) ? OpenLayers.Layer.VectorNearest : OpenLayers.Layer.VectorAsset;
+
+ var layer_class = options.class || default_class;
+
return layer_class;
}