aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/cobrands/fixmystreet-uk-councils/alloy.js22
-rw-r--r--web/cobrands/northamptonshire/assets.js21
2 files changed, 23 insertions, 20 deletions
diff --git a/web/cobrands/fixmystreet-uk-councils/alloy.js b/web/cobrands/fixmystreet-uk-councils/alloy.js
index ace0062de..f11a3e7bf 100644
--- a/web/cobrands/fixmystreet-uk-councils/alloy.js
+++ b/web/cobrands/fixmystreet-uk-councils/alloy.js
@@ -133,4 +133,26 @@ fixmystreet.alloy_defaults = {
strategy_class: OpenLayers.Strategy.Alloy
};
+fixmystreet.alloy_add_layers = function(defaults, layers) {
+ $.each(layers, function(index, layer) {
+ if ( layer.categories ) {
+ var options = {
+ http_options: {
+ layerid: layer.layer,
+ layerVersion: layer.version,
+ },
+ asset_type: layer.asset_type || 'spot',
+ asset_category: layer.categories,
+ asset_item: layer.item_name || layer.layer_name.toLowerCase(),
+ };
+ if (layer.max_resolution) {
+ options.max_resolution = layer.max_resolution;
+ }
+ if (layer.snap_threshold || layer.snap_threshold === 0) {
+ options.snap_threshold = layer.snap_threshold;
+ }
+ fixmystreet.assets.add(northants_defaults, options);
+ }
+ });
+};
})();
diff --git a/web/cobrands/northamptonshire/assets.js b/web/cobrands/northamptonshire/assets.js
index 2b6cdeb69..377e1091c 100644
--- a/web/cobrands/northamptonshire/assets.js
+++ b/web/cobrands/northamptonshire/assets.js
@@ -439,26 +439,7 @@ var northants_defaults = $.extend(true, {}, fixmystreet.alloy_defaults, {
}
});
-$.each(layers, function(index, layer) {
- if ( layer.categories ) {
- var options = {
- http_options: {
- layerid: layer.layer,
- layerVersion: layer.version,
- },
- asset_type: layer.asset_type || 'spot',
- asset_category: layer.categories,
- asset_item: layer.item_name || layer.layer_name.toLowerCase(),
- };
- if (layer.max_resolution) {
- options.max_resolution = layer.max_resolution;
- }
- if (layer.snap_threshold || layer.snap_threshold === 0) {
- options.snap_threshold = layer.snap_threshold;
- }
- fixmystreet.assets.add(northants_defaults, options);
- }
-});
+fixmystreet.alloy_add_layers(northants_defaults, layers);
// NCC roads layers which prevent report submission unless we have selected
// an asset.