diff options
-rw-r--r-- | web/cobrands/tfl/assets.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/web/cobrands/tfl/assets.js b/web/cobrands/tfl/assets.js index 262039688..832f3c875 100644 --- a/web/cobrands/tfl/assets.js +++ b/web/cobrands/tfl/assets.js @@ -191,11 +191,24 @@ if (red_routes_layer) { }); } +// This is required so that the found/not found actions are fired on category +// select and pin move rather than just on asset select/not select. +OpenLayers.Layer.TfLVectorAsset = OpenLayers.Class(OpenLayers.Layer.VectorAsset, { + initialize: function(name, options) { + OpenLayers.Layer.VectorAsset.prototype.initialize.apply(this, arguments); + $(fixmystreet).on('maps:update_pin', this.checkSelected.bind(this)); + $(fixmystreet).on('report_new:category_change', this.checkSelected.bind(this)); + }, + + CLASS_NAME: 'OpenLayers.Layer.TfLVectorAsset' +}); + /* Point asset layers, bus stops and traffic lights. This comes after the red * route so its check for asset not clicked on happens after whether red route * clicked on or not */ var asset_defaults = $.extend(true, {}, defaults, { + class: OpenLayers.Layer.TfLVectorAsset, body: 'TfL', select_action: true, no_asset_msg_id: '#js-not-an-asset', |