diff options
author | Dave Arter <davea@mysociety.org> | 2018-02-09 14:38:52 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2018-02-13 12:39:50 +0000 |
commit | 1d61bce2befbc344d7da8da38e373836a6fb1b71 (patch) | |
tree | 5902c9a534029e5d6b8c7c871e6b446285651b68 | |
parent | a66db9d58a29ada7080837c6223fec78cdd444cc (diff) |
WFS asset layers can set their name attribute
-rw-r--r-- | web/cobrands/fixmystreet/assets.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js index 2cef581f2..d03481079 100644 --- a/web/cobrands/fixmystreet/assets.js +++ b/web/cobrands/fixmystreet/assets.js @@ -113,7 +113,7 @@ function check_zoom_message_visibility() { function layer_visibilitychanged() { check_zoom_message_visibility.call(this); - var layers = fixmystreet.map.getLayersByName('WFS'); + var layers = fixmystreet.map.getLayersBy('assets', true); var visible = 0; for (var i = 0; i<layers.length; i++) { if (layers[i].getVisibility()) { @@ -304,7 +304,8 @@ fixmystreet.add_assets = function(options) { visibility: false, maxResolution: options.max_resolution, minResolution: options.min_resolution, - styleMap: options.stylemap || get_asset_stylemap() + styleMap: options.stylemap || get_asset_stylemap(), + assets: true }; if (options.srsName !== undefined) { layer_options.projection = new OpenLayers.Projection(options.srsName); @@ -319,7 +320,7 @@ fixmystreet.add_assets = function(options) { value: options.filter_value }); } - asset_layer = new OpenLayers.Layer.Vector("WFS", layer_options); + asset_layer = new OpenLayers.Layer.Vector(options.name || "WFS", layer_options); // A non-interactive layer to display existing street light faults if (options.wfs_fault_feature) { @@ -331,7 +332,8 @@ fixmystreet.add_assets = function(options) { var lo = { strategies: [new OpenLayers.Strategy.BBOX()], protocol: fault_protocol, - styleMap: get_fault_stylemap() + styleMap: get_fault_stylemap(), + assets: true }; OpenLayers.Util.applyDefaults(lo, layer_options); asset_fault_layer = new OpenLayers.Layer.Vector("WFS", lo); |