diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-08-12 19:19:53 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-08-13 19:35:36 +0100 |
commit | fa9604aa0c6461753c0163d1791a61636570c679 (patch) | |
tree | 6a25cdc79c5685fca99998f3a5881f84274b1cf7 | |
parent | 502423c7a1ce0fc93657b08fd935aa380890d091 (diff) |
Do not set attribute fields on hidden layers.
This did not really matter before because you were either hiding an
asset layer (and thus its fields), or selecting a new layer/asset (and
so the last thing would be setting the attributes for the new asset. But
it was unnecessary, and now we're updating an inspector form and the
fields may apply to more than one layer.
-rw-r--r-- | web/cobrands/fixmystreet/assets.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/web/cobrands/fixmystreet/assets.js b/web/cobrands/fixmystreet/assets.js index ac4cb891c..367e2d33c 100644 --- a/web/cobrands/fixmystreet/assets.js +++ b/web/cobrands/fixmystreet/assets.js @@ -120,6 +120,9 @@ OpenLayers.Layer.VectorAsset = OpenLayers.Class(OpenLayers.Layer.Vector, { if (!fixmystreet.map) { return; } + if (!this.getVisibility()) { + return; + } var feature = fixmystreet.assets.selectedFeature(); if (feature) { this.setAttributeFields(feature); |